@communecter/cocolight-api-client 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cocolight-api-client.browser.js +2 -2
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/api/BaseEntity.js +51 -0
- package/src/api/EndpointApi.types.d.ts +10 -10
- package/src/api/Event.js +50 -17
- package/src/endpoints.module.js +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CocolightApiClient=t():e.CocolightApiClient=t()}(this,(()=>(()=>{var __webpack_modules__={117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2586),o=r(5765),i=r(4227),s=r(8660),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(l,s.default,"additionalProperties"));const p=(0,o.allSchemaProperties)(r);for(const e of p)l.definedProperties.add(e);l.opts.unevaluated&&p.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(p),l.props));const u=p.filter((e=>!(0,i.alwaysValidSchema)(l,r[e])));if(0===u.length)return;const d=t.name("valid");for(const r of u)m(r)?f(r):(t.if((0,o.propertyInData)(t,c,r,l.opts.ownProperties)),f(r),l.allErrors||t.else().var(d,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(d);function m(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},d)}}};t.default=a},208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(396),o=r(7887),i=r(8708),s=r(9029),a=r(4227);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c||(t.DataType=c={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:i}=e,a=function(e,t){return t?e.filter((e=>p.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=d(t,n,i.strictNumbers,c.Wrong);r.if(o,(()=>{a.length?function(e,t,r){const{gen:n,data:o,opts:i}=e,a=n.let("dataType",s._`typeof ${o}`),c=n.let("coerced",s._`undefined`);"array"===i.coerceTypes&&n.if(s._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,s._`${o}[0]`).assign(a,s._`typeof ${o}`).if(d(t,o,i.strictNumbers),(()=>n.assign(c,o))))),n.if(s._`${c} !== undefined`);for(const e of r)(p.has(e)||"array"===e&&"array"===i.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void n.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(c,s._`""`);case"number":return void n.elseIf(s._`${a} == "boolean" || ${o} === null
|
|
3
3
|
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(c,s._`+${o}`);case"integer":return void n.elseIf(s._`${a} === "boolean" || ${o} === null
|
|
4
4
|
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,s._`+${o}`);case"boolean":return void n.elseIf(s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf(s._`${o} === "true" || ${o} === 1`).assign(c,!0);case"null":return n.elseIf(s._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(c,null);case"array":n.elseIf(s._`${a} === "string" || ${a} === "number"
|
|
5
|
-
|| ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}n.else(),f(e),n.endIf(),n.if(s._`${c} !== undefined`,(()=>{n.assign(o,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,c)}))}(e,t,a):f(e)}))}return l};const p=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=c.Correct){const o=n===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return n===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function d(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,u(e,t,r,n));return o}t.checkDataType=u,t.checkDataTypes=d;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=f},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,l=c>>1,p=-7,u=r?o-1:0,d=r?-1:1,m=e[t+u];for(u+=d,i=m&(1<<-p)-1,m>>=-p,p+=a;p>0;i=256*i+e[t+u],u+=d,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=n;p>0;s=256*s+e[t+u],u+=d,p-=8);if(0===i)i=1-l;else{if(i===c)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),i-=l}return(m?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,l=8*i-o-1,p=(1<<l)-1,u=p>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,f=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=p?(a=0,s=p):s+u>=1?(a=(t*c-1)*Math.pow(2,o),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[r+m]=255&a,m+=f,a/=256,o-=8);for(s=s<<o|a,l+=o;l>0;e[r+m]=255&s,m+=f,s/=256,l-=8);e[r+m-f]|=128*h}},343:e=>{"use strict";const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function n(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function i(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const s={scheme:"http",domainHost:!0,parse:o,serialize:i},a={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(n(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},c={http:s,https:{scheme:"https",domainHost:s.domainHost,parse:o,serialize:i},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(r);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=c[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=c[o];i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,r){const n=e;return n.uuid=n.nss,n.nss=void 0,r.tolerant||n.uuid&&t.test(n.uuid)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};e.exports=c},363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromStream=t.fromBuffer=t.EndOfStreamError=t.fromFile=void 0;const n=r(1343),o=r(6452);var i=r(1456);Object.defineProperty(t,"fromFile",{enumerable:!0,get:function(){return i.fromFile}});var s=r(6452);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return s.EndOfStreamError}}),Object.defineProperty(t,"fromBuffer",{enumerable:!0,get:function(){return s.fromBuffer}}),t.fromStream=async function(e,t){if(t=t||{},e.path){const r=await n.stat(e.path);t.path=e.path,t.size=r.size}return o.fromStream(e,t)}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const 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:{}}}},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=r?o._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),o=r(4227),i=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:n,errSchemaPath:i}=l,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,n.strictTuples)}}(s),l.opts.unevaluated&&r.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,r.length,l.items));const p=i.name("valid"),u=i.const("len",n._`${a}.length`);r.forEach(((t,r)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(n._`${u} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},p))),e.ok(p))}))}t.validateTuple=a,t.default=s},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),o=r(9029),i=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:l,schemaCode:p,it:u}=e;if(!a&&!c)return;const d=t.let("valid"),m=l.items?(0,n.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,n.checkDataTypes)(m,a,u.opts.strictNumbers,n.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${r}[${i}]`),t.if(c,o._`continue`),m.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(d,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function h(n,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${n}--;`,(()=>t.for(o._`${a} = ${n}; ${a}--;`,(()=>t.if(o._`${c}(${r}[${n}], ${r}[${a}])`,(()=>{e.error(),t.assign(d,!1).break(l)}))))))}e.block$data(d,(function(){const n=t.let("i",o._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(d,!0),t.if(o._`${n} > 1`,(()=>(m.length>0&&!m.some((e=>"object"===e||"array"===e))?f:h)(n,i)))}),o._`${p} === false`),e.ok(d)}};t.default=a},793:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var o=n&&n.stringify||t;if("object"==typeof e&&null!==e){var i=r.length+1;if(1===i)return e;var s=new Array(i);s[0]=o(e);for(var a=1;a<i;a++)s[a]=o(r[a]);return s.join(" ")}if("string"!=typeof e)return e;var c=r.length;if(0===c)return e;for(var l="",p=0,u=-1,d=e&&e.length||0,m=0;m<d;){if(37===e.charCodeAt(m)&&m+1<d){switch(u=u>-1?u:0,e.charCodeAt(m+1)){case 100:case 102:if(p>=c)break;if(null==r[p])break;u<m&&(l+=e.slice(u,m)),l+=Number(r[p]),u=m+2,m++;break;case 105:if(p>=c)break;if(null==r[p])break;u<m&&(l+=e.slice(u,m)),l+=Math.floor(Number(r[p])),u=m+2,m++;break;case 79:case 111:case 106:if(p>=c)break;if(void 0===r[p])break;u<m&&(l+=e.slice(u,m));var f=typeof r[p];if("string"===f){l+="'"+r[p]+"'",u=m+2,m++;break}if("function"===f){l+=r[p].name||"<anonymous>",u=m+2,m++;break}l+=o(r[p]),u=m+2,m++;break;case 115:if(p>=c)break;u<m&&(l+=e.slice(u,m)),l+=String(r[p]),u=m+2,m++;break;case 37:u<m&&(l+=e.slice(u,m)),l+="%",u=m+2,m++,p--}++p}++m}return-1===u?e:(u<d&&(l+=e.slice(u)),l)}},1027:(e,t,r)=>{"use strict";r.d(t,{GN:()=>MemoryStorageStrategy,Ge:()=>LocalStorageStrategy,u3:()=>TokenStorageStrategy});class TokenStorageStrategy{getAccessToken(){throw new Error("getAccessToken() doit être implémenté")}setAccessToken(e){throw new Error("setAccessToken() doit être implémenté")}getRefreshToken(){throw new Error("getRefreshToken() doit être implémenté")}setRefreshToken(e){throw new Error("setRefreshToken() doit être implémenté")}clear(){throw new Error("clear() doit être implémenté")}}class MemoryStorageStrategy extends TokenStorageStrategy{constructor(){super(),this._accessToken=null,this._refreshToken=null}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e)}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e)}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}},1111:e=>{"use strict";const t=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!t.has(e&&e.code)},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${i} ${o}`)}};t.default=o},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:i}=e;void 0===r.then&&void 0===r.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),p=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(p,u("then",r),u("else",r))}else a?t.if(p,u("then")):t.if((0,n.not)(p),u("else"));function u(r,o){return()=>{const i=e.subschema({keyword:r},p);t.assign(l,p),e.mergeValidEvaluated(i,l),o?t.assign(o,n._`${r}`):e.setParams({ifClause:r})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default=i},1343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=t.writeFileSync=t.writeFile=t.read=t.open=t.close=t.stat=t.createReadStream=t.pathExists=void 0;const n=r(4428);t.pathExists=n.existsSync,t.createReadStream=n.createReadStream,t.stat=async function(e){return new Promise(((t,r)=>{n.stat(e,((e,n)=>{e?r(e):t(n)}))}))},t.close=async function(e){return new Promise(((t,r)=>{n.close(e,(e=>{e?r(e):t()}))}))},t.open=async function(e,t){return new Promise(((r,o)=>{n.open(e,t,((e,t)=>{e?o(e):r(t)}))}))},t.read=async function(e,t,r,o,i){return new Promise(((s,a)=>{n.read(e,t,r,o,i,((e,t,r)=>{e?a(e):s({bytesRead:t,buffer:r})}))}))},t.writeFile=async function(e,t){return new Promise(((r,o)=>{n.writeFile(e,t,(e=>{e?o(e):r()}))}))},t.writeFileSync=function(e,t){n.writeFileSync(e,t)},t.readFile=async function(e){return new Promise(((t,r)=>{n.readFile(e,((e,n)=>{e?r(e):t(n)}))}))}},1456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromFile=t.FileTokenizer=void 0;const n=r(8632),o=r(8705),i=r(1343);class FileTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await i.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new o.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await i.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new o.EndOfStreamError;return n.bytesRead}async close(){return i.close(this.fd)}}t.FileTokenizer=FileTokenizer,t.fromFile=async function(e){const t=await i.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await i.open(e,"r");return new FileTokenizer(r,{path:e,size:t.size})}},1510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;const n=r(5523),o=r(8122);var i=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.StreamReader=class StreamReader{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new n.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new n.EndOfStreamError;let o=r,i=0;for(;this.peekQueue.length>0&&o>0;){const r=this.peekQueue.pop();if(!r)throw new Error("peekData should be defined");const n=Math.min(r.length,o);e.set(r.subarray(0,n),t+i),i+=n,o-=n,n<r.length&&this.peekQueue.push(r.subarray(n))}for(;o>0&&!this.endOfStream;){const r=Math.min(o,1048576),n=await this.readFromStream(e,t+i,r);if(i+=n,n<r)break;o-=n}return i}async readFromStream(e,t,r){const n=this.s.read(r);if(n)return e.set(n,t),n.length;{const n={buffer:e,offset:t,length:r,deferred:new o.Deferred};return this.deferred=n.deferred,this.s.once("readable",(()=>{this.readDeferred(n)})),n.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof Name&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)i(r,t[n]),r.push(e[++n]);return new _Code(r)}t._Code=_Code,t.nil=new _Code(""),t._=r;const n=new _Code("+");function o(e,...t){const r=[a(e[0])];let o=0;for(;o<t.length;)r.push(n),i(r,t[o]),r.push(n,a(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){const r=s(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new _Code(r)}function i(e,t){var r;t instanceof _Code?e.push(...t._items):t instanceof Name?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:a(Array.isArray(r)?r.join(","):r))}function s(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof Name||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof Name?void 0:`"${e}${t.slice(1)}`}function a(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=i,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new _Code(a(e))},t.safeStringify=a,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new _Code(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new _Code(e.toString())}},1664:e=>{"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),o=r(3693),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];t.default=i},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),o=r(208),i=r(7887),s=r(208),a=r(7870),c=r(3673),l=r(4495),p=r(9029),u=r(2023),d=r(6939),m=r(4227),f=r(8708);function h({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,p._`${u.default.data}, ${u.default.valCxt}`,n.$async,(()=>{e.code(p._`"use strict"; ${y(r,o)}`),function(e,t){e.if(u.default.valCxt,(()=>{e.var(u.default.instancePath,p._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,p._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,p._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,p._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,p._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{e.var(u.default.instancePath,p._`""`),e.var(u.default.parentData,p._`undefined`),e.var(u.default.parentDataProperty,p._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,p._`{}`)}))}(e,o),e.code(i)})):e.func(t,p._`${u.default.data}, ${function(e){return p._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?p._`, ${u.default.dynamicAnchors}={}`:p.nil}}={}`}(o)}`,n.$async,(()=>e.code(y(r,o)).code(i)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?p._`/*# sourceURL=${r} */`:p.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function w(e){return"boolean"!=typeof e.schema}function _(e){(0,m.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,o.getSchemaTypes)(e.schema);E(e,r,!(0,o.coerceAndCheckDataType)(e,r),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(p._`${u.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=p.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(p._`${u.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function E(e,t,r,n){const{gen:o,schema:a,data:c,allErrors:l,opts:d,self:f}=e,{RULES:h}=f;function y(m){(0,i.shouldUseGroup)(a,m)&&(m.type?(o.if((0,s.checkDataType)(m.type,c,d.strictNumbers)),T(e,m),1===t.length&&t[0]===m.type&&r&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):T(e,m),l||o.if(p._`${u.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(a,h)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)S(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&A(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n}))&&A(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of h.rules)y(e);y(h.post)}))):o.block((()=>O(e,"$ref",h.all.$ref.definition)))}function T(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,i.shouldUseRule)(n,r)&&O(e,r.keyword,r.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function A(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,m.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){w(e)&&(_(e),g(e))?function(e){const{schema:t,opts:r,gen:n}=e;h(e,(()=>{r.$comment&&t.$comment&&b(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,m.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(u.default.vErrors,null),n.let(u.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",p._`${r}.evaluated`),t.if(p._`${e.evaluated}.dynamicProps`,(()=>t.assign(p._`${e.evaluated}.props`,p._`undefined`))),t.if(p._`${e.evaluated}.dynamicItems`,(()=>t.assign(p._`${e.evaluated}.items`,p._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(p._`${u.default.errors} === 0`,(()=>t.return(u.default.data)),(()=>t.throw(p._`new ${o}(${u.default.vErrors})`))):(t.assign(p._`${n}.errors`,u.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof p.Name&&e.assign(p._`${t}.props`,r),n instanceof p.Name&&e.assign(p._`${t}.items`,n)}(e),t.return(p._`${u.default.errors} === 0`))}(e)}))}(e):h(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class KeywordCxt{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(e,this.schema,r,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",x(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,r){this.failResult((0,p.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():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,p.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(p._`${t} !== undefined && (${(0,p.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_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(void 0===this.errsCount)throw new 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,r=p.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=p.nil,t=p.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,p.or)(p._`${n} === undefined`,t)),e!==p.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==p.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,p.or)(function(){if(r.length){if(!(t instanceof p.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return p._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return p.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return p._`!${r}(${t})`}return p.nil}())}subschema(e,t){const r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return function(e,t){w(e)&&(_(e),g(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&b(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",u.default.errors);v(e,i),n.var(t,p._`${i} === ${u.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=m.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=m.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,p.Name))),!0}}function O(e,t,r,n){const o=new KeywordCxt(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,c.funcKeywordCode)(o,r):"macro"in r?(0,c.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(o,r)}t.KeywordCxt=KeywordCxt;const P=/^\/(?:[^~]|~0|~1)*$/,$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return u.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=u.default.rootData}else{const s=$.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(i=r[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=p._`${i}${(0,p.getProperty)((0,m.unescapeJsonPointer)(e))}`,s=p._`${s} && ${i}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=x},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:s,it:a}=e;let c,l;const{minContains:p,maxContains:u}=i;a.opts.next?(c=void 0===p?1:p,l=u):c=1;const d=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,r)){let t=n._`${d} >= ${c}`;return void 0!==l&&(t=n._`${t} && ${d} <= ${l}`),void e.pass(t)}a.items=!0;const m=t.name("valid");function f(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===l?t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0).break())):(t.if(n._`${e} > ${l}`,(()=>t.assign(m,!1).break())),1===c?t.assign(m,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0))))}(r)))))}function h(r,n){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},r),n()}))}void 0===l&&1===c?h(m,(()=>t.if(m,(()=>t.break())))):0===c?(t.let(m,!0),void 0!==l&&t.if(n._`${s}.length > 0`,f)):(t.let(m,!1),f()),e.result(m,(()=>e.reset()))}};t.default=i},2808:e=>{for(var t=Math.floor(16777215*Math.random()),r=p.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,o=(()=>{try{return _Buffer}catch(e){try{return Buffer}catch(e){return null}}})(),i=function(e){return!(null==e||!e.constructor||"function"!=typeof e.constructor.isBuffer||!e.constructor.isBuffer(e))},s=[],a=0;a<256;a++)s[a]=(a<=15?"0":"")+a.toString(16);var c=new RegExp("^[0-9a-fA-F]{24}$"),l=[];for(a=0;a<10;)l[48+a]=a++;for(;a<16;)l[55+a]=l[87+a]=a++;function p(e){if(!(this instanceof p))return new p(e);if(e&&(e instanceof p||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null!=e&&"number"!=typeof e){var t=p.isValid(e);if(!t&&null!=e)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return p.createFromHexString(e);if(null==e||12!==e.length){if(null!=e&&"function"==typeof e.toHexString)return e;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=e}else this.id=this.generate(e)}e.exports=p,p.default=p,p.createFromTime=function(e){return new p((8===(t=(t=e=parseInt(e,10)%4294967295).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000");var t},p.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",r=0;r<24;)t+=String.fromCharCode(l[e.charCodeAt(r++)]<<4|l[e.charCodeAt(r++)]);return new p(t)},p.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&c.test(e):e instanceof p||(i(e)?p.isValid(e.toString("hex")):!("function"!=typeof e.toHexString||!o||!(e.id instanceof o||"string"==typeof e.id))&&(12===e.id.length||24===e.id.length&&c.test(e.id)))))},p.prototype={constructor:p,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=s[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof p?this.toString()===e.toString():"string"==typeof e&&p.isValid(e)&&12===e.length&&i(this.id)?e===this.id.toString("binary"):"string"==typeof e&&p.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&p.isValid(e)&&12===e.length?e===this.id:!(null==e||!(e instanceof p||e.toHexString))&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%4294967295;var o=r=(r+1)%16777215;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,t>>16&255,t>>8&255,255&t,n>>8&255,255&n,o>>16&255,o>>8&255,255&o)}};var u=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";p.prototype[u]=function(){return"ObjectID("+this+")"},p.prototype.toJSON=p.prototype.toHexString,p.prototype.toString=p.prototype.toHexString},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),o=r(4227),i=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const o=1===t?"property":"properties";return n.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>n._`{property: ${e},
|
|
5
|
+
|| ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}n.else(),f(e),n.endIf(),n.if(s._`${c} !== undefined`,(()=>{n.assign(o,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,c)}))}(e,t,a):f(e)}))}return l};const p=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=c.Correct){const o=n===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return n===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function d(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,u(e,t,r,n));return o}t.checkDataType=u,t.checkDataTypes=d;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=f},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,l=c>>1,p=-7,u=r?o-1:0,d=r?-1:1,m=e[t+u];for(u+=d,i=m&(1<<-p)-1,m>>=-p,p+=a;p>0;i=256*i+e[t+u],u+=d,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=n;p>0;s=256*s+e[t+u],u+=d,p-=8);if(0===i)i=1-l;else{if(i===c)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),i-=l}return(m?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,l=8*i-o-1,p=(1<<l)-1,u=p>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,f=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=p?(a=0,s=p):s+u>=1?(a=(t*c-1)*Math.pow(2,o),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[r+m]=255&a,m+=f,a/=256,o-=8);for(s=s<<o|a,l+=o;l>0;e[r+m]=255&s,m+=f,s/=256,l-=8);e[r+m-f]|=128*h}},343:e=>{"use strict";const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function n(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function i(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const s={scheme:"http",domainHost:!0,parse:o,serialize:i},a={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(n(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},c={http:s,https:{scheme:"https",domainHost:s.domainHost,parse:o,serialize:i},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(r);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=c[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=c[o];i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,r){const n=e;return n.uuid=n.nss,n.nss=void 0,r.tolerant||n.uuid&&t.test(n.uuid)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};e.exports=c},363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromStream=t.fromBuffer=t.EndOfStreamError=t.fromFile=void 0;const n=r(1343),o=r(6452);var i=r(1456);Object.defineProperty(t,"fromFile",{enumerable:!0,get:function(){return i.fromFile}});var s=r(6452);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return s.EndOfStreamError}}),Object.defineProperty(t,"fromBuffer",{enumerable:!0,get:function(){return s.fromBuffer}}),t.fromStream=async function(e,t){if(t=t||{},e.path){const r=await n.stat(e.path);t.path=e.path,t.size=r.size}return o.fromStream(e,t)}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const 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:{}}}},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=r?o._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),o=r(4227),i=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:n,errSchemaPath:i}=l,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,n.strictTuples)}}(s),l.opts.unevaluated&&r.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,r.length,l.items));const p=i.name("valid"),u=i.const("len",n._`${a}.length`);r.forEach(((t,r)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(n._`${u} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},p))),e.ok(p))}))}t.validateTuple=a,t.default=s},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),o=r(9029),i=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:l,schemaCode:p,it:u}=e;if(!a&&!c)return;const d=t.let("valid"),m=l.items?(0,n.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,n.checkDataTypes)(m,a,u.opts.strictNumbers,n.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${r}[${i}]`),t.if(c,o._`continue`),m.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(d,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function h(n,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${n}--;`,(()=>t.for(o._`${a} = ${n}; ${a}--;`,(()=>t.if(o._`${c}(${r}[${n}], ${r}[${a}])`,(()=>{e.error(),t.assign(d,!1).break(l)}))))))}e.block$data(d,(function(){const n=t.let("i",o._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(d,!0),t.if(o._`${n} > 1`,(()=>(m.length>0&&!m.some((e=>"object"===e||"array"===e))?f:h)(n,i)))}),o._`${p} === false`),e.ok(d)}};t.default=a},793:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var o=n&&n.stringify||t;if("object"==typeof e&&null!==e){var i=r.length+1;if(1===i)return e;var s=new Array(i);s[0]=o(e);for(var a=1;a<i;a++)s[a]=o(r[a]);return s.join(" ")}if("string"!=typeof e)return e;var c=r.length;if(0===c)return e;for(var l="",p=0,u=-1,d=e&&e.length||0,m=0;m<d;){if(37===e.charCodeAt(m)&&m+1<d){switch(u=u>-1?u:0,e.charCodeAt(m+1)){case 100:case 102:if(p>=c)break;if(null==r[p])break;u<m&&(l+=e.slice(u,m)),l+=Number(r[p]),u=m+2,m++;break;case 105:if(p>=c)break;if(null==r[p])break;u<m&&(l+=e.slice(u,m)),l+=Math.floor(Number(r[p])),u=m+2,m++;break;case 79:case 111:case 106:if(p>=c)break;if(void 0===r[p])break;u<m&&(l+=e.slice(u,m));var f=typeof r[p];if("string"===f){l+="'"+r[p]+"'",u=m+2,m++;break}if("function"===f){l+=r[p].name||"<anonymous>",u=m+2,m++;break}l+=o(r[p]),u=m+2,m++;break;case 115:if(p>=c)break;u<m&&(l+=e.slice(u,m)),l+=String(r[p]),u=m+2,m++;break;case 37:u<m&&(l+=e.slice(u,m)),l+="%",u=m+2,m++,p--}++p}++m}return-1===u?e:(u<d&&(l+=e.slice(u)),l)}},1027:(e,t,r)=>{"use strict";r.d(t,{GN:()=>MemoryStorageStrategy,Ge:()=>LocalStorageStrategy,u3:()=>TokenStorageStrategy});class TokenStorageStrategy{getAccessToken(){throw new Error("getAccessToken() doit être implémenté")}setAccessToken(e){throw new Error("setAccessToken() doit être implémenté")}getRefreshToken(){throw new Error("getRefreshToken() doit être implémenté")}setRefreshToken(e){throw new Error("setRefreshToken() doit être implémenté")}clear(){throw new Error("clear() doit être implémenté")}}class MemoryStorageStrategy extends TokenStorageStrategy{constructor(){super(),this._accessToken=null,this._refreshToken=null}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e)}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e)}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}},1111:e=>{"use strict";const t=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!t.has(e&&e.code)},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${i} ${o}`)}};t.default=o},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:i}=e;void 0===r.then&&void 0===r.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),p=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(p,u("then",r),u("else",r))}else a?t.if(p,u("then")):t.if((0,n.not)(p),u("else"));function u(r,o){return()=>{const i=e.subschema({keyword:r},p);t.assign(l,p),e.mergeValidEvaluated(i,l),o?t.assign(o,n._`${r}`):e.setParams({ifClause:r})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default=i},1343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=t.writeFileSync=t.writeFile=t.read=t.open=t.close=t.stat=t.createReadStream=t.pathExists=void 0;const n=r(4428);t.pathExists=n.existsSync,t.createReadStream=n.createReadStream,t.stat=async function(e){return new Promise(((t,r)=>{n.stat(e,((e,n)=>{e?r(e):t(n)}))}))},t.close=async function(e){return new Promise(((t,r)=>{n.close(e,(e=>{e?r(e):t()}))}))},t.open=async function(e,t){return new Promise(((r,o)=>{n.open(e,t,((e,t)=>{e?o(e):r(t)}))}))},t.read=async function(e,t,r,o,i){return new Promise(((s,a)=>{n.read(e,t,r,o,i,((e,t,r)=>{e?a(e):s({bytesRead:t,buffer:r})}))}))},t.writeFile=async function(e,t){return new Promise(((r,o)=>{n.writeFile(e,t,(e=>{e?o(e):r()}))}))},t.writeFileSync=function(e,t){n.writeFileSync(e,t)},t.readFile=async function(e){return new Promise(((t,r)=>{n.readFile(e,((e,n)=>{e?r(e):t(n)}))}))}},1456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromFile=t.FileTokenizer=void 0;const n=r(8632),o=r(8705),i=r(1343);class FileTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await i.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new o.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await i.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new o.EndOfStreamError;return n.bytesRead}async close(){return i.close(this.fd)}}t.FileTokenizer=FileTokenizer,t.fromFile=async function(e){const t=await i.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await i.open(e,"r");return new FileTokenizer(r,{path:e,size:t.size})}},1510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;const n=r(5523),o=r(8122);var i=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.StreamReader=class StreamReader{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new n.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new n.EndOfStreamError;let o=r,i=0;for(;this.peekQueue.length>0&&o>0;){const r=this.peekQueue.pop();if(!r)throw new Error("peekData should be defined");const n=Math.min(r.length,o);e.set(r.subarray(0,n),t+i),i+=n,o-=n,n<r.length&&this.peekQueue.push(r.subarray(n))}for(;o>0&&!this.endOfStream;){const r=Math.min(o,1048576),n=await this.readFromStream(e,t+i,r);if(i+=n,n<r)break;o-=n}return i}async readFromStream(e,t,r){const n=this.s.read(r);if(n)return e.set(n,t),n.length;{const n={buffer:e,offset:t,length:r,deferred:new o.Deferred};return this.deferred=n.deferred,this.s.once("readable",(()=>{this.readDeferred(n)})),n.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof Name&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)i(r,t[n]),r.push(e[++n]);return new _Code(r)}t._Code=_Code,t.nil=new _Code(""),t._=r;const n=new _Code("+");function o(e,...t){const r=[a(e[0])];let o=0;for(;o<t.length;)r.push(n),i(r,t[o]),r.push(n,a(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){const r=s(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new _Code(r)}function i(e,t){var r;t instanceof _Code?e.push(...t._items):t instanceof Name?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:a(Array.isArray(r)?r.join(","):r))}function s(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof Name||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof Name?void 0:`"${e}${t.slice(1)}`}function a(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=i,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new _Code(a(e))},t.safeStringify=a,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new _Code(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new _Code(e.toString())}},1664:e=>{"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),o=r(3693),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];t.default=i},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),o=r(208),i=r(7887),s=r(208),a=r(7870),c=r(3673),l=r(4495),p=r(9029),u=r(2023),d=r(6939),m=r(4227),f=r(8708);function h({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,p._`${u.default.data}, ${u.default.valCxt}`,n.$async,(()=>{e.code(p._`"use strict"; ${y(r,o)}`),function(e,t){e.if(u.default.valCxt,(()=>{e.var(u.default.instancePath,p._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,p._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,p._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,p._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,p._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{e.var(u.default.instancePath,p._`""`),e.var(u.default.parentData,p._`undefined`),e.var(u.default.parentDataProperty,p._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,p._`{}`)}))}(e,o),e.code(i)})):e.func(t,p._`${u.default.data}, ${function(e){return p._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?p._`, ${u.default.dynamicAnchors}={}`:p.nil}}={}`}(o)}`,n.$async,(()=>e.code(y(r,o)).code(i)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?p._`/*# sourceURL=${r} */`:p.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function w(e){return"boolean"!=typeof e.schema}function _(e){(0,m.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function b(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,o.getSchemaTypes)(e.schema);E(e,r,!(0,o.coerceAndCheckDataType)(e,r),t)}function v({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(p._`${u.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=p.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(p._`${u.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function E(e,t,r,n){const{gen:o,schema:a,data:c,allErrors:l,opts:d,self:f}=e,{RULES:h}=f;function y(m){(0,i.shouldUseGroup)(a,m)&&(m.type?(o.if((0,s.checkDataType)(m.type,c,d.strictNumbers)),T(e,m),1===t.length&&t[0]===m.type&&r&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):T(e,m),l||o.if(p._`${u.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(a,h)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)S(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&A(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n}))&&A(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of h.rules)y(e);y(h.post)}))):o.block((()=>O(e,"$ref",h.all.$ref.definition)))}function T(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,i.shouldUseRule)(n,r)&&O(e,r.keyword,r.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function A(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,m.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){w(e)&&(_(e),g(e))?function(e){const{schema:t,opts:r,gen:n}=e;h(e,(()=>{r.$comment&&t.$comment&&v(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,m.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(u.default.vErrors,null),n.let(u.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",p._`${r}.evaluated`),t.if(p._`${e.evaluated}.dynamicProps`,(()=>t.assign(p._`${e.evaluated}.props`,p._`undefined`))),t.if(p._`${e.evaluated}.dynamicItems`,(()=>t.assign(p._`${e.evaluated}.items`,p._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(p._`${u.default.errors} === 0`,(()=>t.return(u.default.data)),(()=>t.throw(p._`new ${o}(${u.default.vErrors})`))):(t.assign(p._`${n}.errors`,u.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof p.Name&&e.assign(p._`${t}.props`,r),n instanceof p.Name&&e.assign(p._`${t}.items`,n)}(e),t.return(p._`${u.default.errors} === 0`))}(e)}))}(e):h(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class KeywordCxt{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(e,this.schema,r,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",x(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,r){this.failResult((0,p.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():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,p.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(p._`${t} !== undefined && (${(0,p.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_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(void 0===this.errsCount)throw new 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,r=p.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=p.nil,t=p.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,p.or)(p._`${n} === undefined`,t)),e!==p.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==p.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,p.or)(function(){if(r.length){if(!(t instanceof p.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return p._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return p.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return p._`!${r}(${t})`}return p.nil}())}subschema(e,t){const r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return function(e,t){w(e)&&(_(e),g(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&v(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",u.default.errors);b(e,i),n.var(t,p._`${i} === ${u.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=m.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=m.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,p.Name))),!0}}function O(e,t,r,n){const o=new KeywordCxt(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,c.funcKeywordCode)(o,r):"macro"in r?(0,c.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(o,r)}t.KeywordCxt=KeywordCxt;const P=/^\/(?:[^~]|~0|~1)*$/,$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return u.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=u.default.rootData}else{const s=$.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(i=r[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=p._`${i}${(0,p.getProperty)((0,m.unescapeJsonPointer)(e))}`,s=p._`${s} && ${i}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=x},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:s,it:a}=e;let c,l;const{minContains:p,maxContains:u}=i;a.opts.next?(c=void 0===p?1:p,l=u):c=1;const d=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,r)){let t=n._`${d} >= ${c}`;return void 0!==l&&(t=n._`${t} && ${d} <= ${l}`),void e.pass(t)}a.items=!0;const m=t.name("valid");function f(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===l?t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0).break())):(t.if(n._`${e} > ${l}`,(()=>t.assign(m,!1).break())),1===c?t.assign(m,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0))))}(r)))))}function h(r,n){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},r),n()}))}void 0===l&&1===c?h(m,(()=>t.if(m,(()=>t.break())))):0===c?(t.let(m,!0),void 0!==l&&t.if(n._`${s}.length > 0`,f)):(t.let(m,!1),f()),e.result(m,(()=>e.reset()))}};t.default=i},2808:e=>{for(var t=Math.floor(16777215*Math.random()),r=p.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,o=(()=>{try{return _Buffer}catch(e){try{return Buffer}catch(e){return null}}})(),i=function(e){return!(null==e||!e.constructor||"function"!=typeof e.constructor.isBuffer||!e.constructor.isBuffer(e))},s=[],a=0;a<256;a++)s[a]=(a<=15?"0":"")+a.toString(16);var c=new RegExp("^[0-9a-fA-F]{24}$"),l=[];for(a=0;a<10;)l[48+a]=a++;for(;a<16;)l[55+a]=l[87+a]=a++;function p(e){if(!(this instanceof p))return new p(e);if(e&&(e instanceof p||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null!=e&&"number"!=typeof e){var t=p.isValid(e);if(!t&&null!=e)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return p.createFromHexString(e);if(null==e||12!==e.length){if(null!=e&&"function"==typeof e.toHexString)return e;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=e}else this.id=this.generate(e)}e.exports=p,p.default=p,p.createFromTime=function(e){return new p((8===(t=(t=e=parseInt(e,10)%4294967295).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000");var t},p.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",r=0;r<24;)t+=String.fromCharCode(l[e.charCodeAt(r++)]<<4|l[e.charCodeAt(r++)]);return new p(t)},p.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&c.test(e):e instanceof p||(i(e)?p.isValid(e.toString("hex")):!("function"!=typeof e.toHexString||!o||!(e.id instanceof o||"string"==typeof e.id))&&(12===e.id.length||24===e.id.length&&c.test(e.id)))))},p.prototype={constructor:p,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=s[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof p?this.toString()===e.toString():"string"==typeof e&&p.isValid(e)&&12===e.length&&i(this.id)?e===this.id.toString("binary"):"string"==typeof e&&p.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&p.isValid(e)&&12===e.length?e===this.id:!(null==e||!(e instanceof p||e.toHexString))&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%4294967295;var o=r=(r+1)%16777215;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,t>>16&255,t>>8&255,255&t,n>>8&255,255&n,o>>16&255,o>>8&255,255&o)}};var u=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";p.prototype[u]=function(){return"ObjectID("+this+")"},p.prototype.toJSON=p.prototype.toHexString,p.prototype.toString=p.prototype.toHexString},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),o=r(4227),i=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const o=1===t?"property":"properties";return n.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>n._`{property: ${e},
|
|
6
6
|
missingProperty: ${o},
|
|
7
7
|
depsCount: ${t},
|
|
8
|
-
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const p=(0,i.propertyInData)(r,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?r.if(p,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(r.if(n._`${p} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(r.if((0,i.propertyInData)(r,n,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),i=r(6653),s=r(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=Ajv,e.exports=t=Ajv,e.exports.Ajv=Ajv,Object.defineProperty(t,"__esModule",{value:!0}),t.default=Ajv;var l=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var p=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var u=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${c}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const n=r(8705),o=r(8632);class BufferTokenizer extends o.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),o=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&o<r.length)throw new n.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+o),r.offset),o}async close(){}}t.BufferTokenizer=BufferTokenizer},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class ValidationError extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=ValidationError},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,(()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,l=t.macro.call(a.self,i,s,a),p=c(r,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:p,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:l,keyword:p,schema:u,parentSchema:d,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,u,d,f):t.validate,y=c(l,p,h),g=l.let("valid");function w(r=(t.async?n._`await `:n.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!m||!1===t.schema);l.assign(g,n._`${r}${(0,i.callValidateCode)(e,y,s,a)}`,t.modifying)}function _(e){var r;l.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,(function(){if(!1===t.errors)w(),t.modifying&&a(e),_((()=>e.error()));else{const r=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>w(n._`await `)),(t=>l.assign(g,!1).if(n._`${t} instanceof ${f.ValidationError}`,(()=>l.assign(e,n._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=n._`${y}.errors`;return l.assign(e,null),w(n.nil),e}();t.modifying&&a(e),_((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),c=r(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:d,self:m}=o,{root:f}=c;if(("#"===r||"#/"===r)&&s===f.baseId)return function(){if(c===f)return u(e,l,c,c.$async);const r=t.scopeValue("root",{ref:f});return u(e,i._`${r}.validate`,f,f.$async)}();const h=a.resolveRef.call(m,f,s,r);if(void 0===h)throw new n.default(o.opts.uriResolver,s,r);return h instanceof a.SchemaEnv?function(t){const r=p(e,t);u(e,r,t,t.$async)}(h):function(n){const o=t.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(h)}};function p(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function u(e,t,r,n){const{gen:a,it:l}=e,{allErrors:p,schemaEnv:u,opts:d}=l,m=d.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function h(e){var t;if(!l.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(n&&!n.dynamicProps)void 0!==n.props&&(l.props=c.mergeEvaluated.props(a,n.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(n&&!n.dynamicItems)void 0!==n.items&&(l.items=c.mergeEvaluated.items(a,n.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}n?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,m)}`),h(t),p||a.assign(r,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),p||a.assign(r,!1)})),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,m),(()=>h(t)),(()=>f(t)))}t.getValidate=p,t.callRef=u,t.default=l},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),c=r(2586);class SchemaEnv{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){const t=u.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:p}=this.opts,d=new n.CodeGen(this.scope,{es5:a,lines:l,ownProperties:p});let m;e.$async&&(m=d.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const h={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(h),d.optimize(this.opts.code.optimize);const t=d.toString();y=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,y)(this,this.scope.get());if(this.scope.value(f,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=h;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function p(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return h.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new SchemaEnv({schema:t,schemaId:r,root:e,baseId:o})}return h.call(this,r,a)}}t.SchemaEnv=SchemaEnv,t.compileSchema=l,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=d.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new SchemaEnv({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=p.call(this,i):void 0},t.getCompilingSchema=u,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:c}=this.opts;return i=i||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3846:(e,t,r)=>{"use strict";const n=r(363),o=r(5707),i={fromFile:async function(e){const t=await n.fromFile(e);try{return await o.fromTokenizer(t)}finally{await t.close()}}};Object.assign(i,o),Object.defineProperty(i,"extensions",{get:()=>o.extensions}),Object.defineProperty(i,"mimeTypes",{get:()=>o.mimeTypes}),e.exports=i},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:l}=e,{opts:p}=l;if(!c&&0===r.length)return;const u=r.length>=p.loopRequired;if(l.allErrors?function(){if(u||c)e.block$data(o.nil,d);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(u||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(i,(0,n.propertyInData)(t,a,r,p.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),p.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function d(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,p.ownProperties),(()=>e.error()))}))}}};t.default=s},4018:(e,t)=>{"use strict";function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,s),time:r(c(!0),l),"date-time":r(d(!0),m),"iso-time":r(c(),p),"iso-date-time":r(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&y.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=_&&e>=w}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2===i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:o[i])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){const r=a.exec(t);if(!r)return!1;const n=+r[1],o=+r[2],i=+r[3],s=r[4],c="-"===r[5]?-1:1,l=+(r[6]||0),p=+(r[7]||0);if(l>23||p>59||e&&!s)return!1;if(n<=23&&o<=59&&i<60)return!0;const u=o-p*c,d=n-l*c-(u<0?1:0);return(23===d||-1===d)&&(59===u||-1===u)&&i<61}}function l(e,t){if(!e||!t)return;const r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();return r&&n?r-n:void 0}function p(e,t){if(!e||!t)return;const r=a.exec(e),n=a.exec(t);return r&&n?(e=r[1]+r[2]+r[3])>(t=n[1]+n[2]+n[3])?1:e<t?-1:0:void 0}const u=/t|\s/i;function d(e){const t=c(e);return function(e){const r=e.split(u);return 2===r.length&&i(r[0])&&t(r[1])}}function m(e,t){if(!e||!t)return;const r=new Date(e).valueOf(),n=new Date(t).valueOf();return r&&n?r-n:void 0}function f(e,t){if(!e||!t)return;const[r,n]=e.split(u),[o,i]=t.split(u),a=s(r,o);return void 0!==a?a||l(n,i):void 0}const h=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,w=-(2**31),_=2**31-1;function v(){return!0}const b=/[^\\]\\Z/},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),c=r(3835),l=r(9029),p=r(6939),u=r(208),d=r(4227),m=r(3837),f=r(5944),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,o,i,s,a,c,l,p,u,d,m,y,g,w,_,v,b,E,T,S,A,O,P;const $=e.strict,x=null===(t=e.code)||void 0===t?void 0:t.optimize,k=!0===x||void 0===x?1:x||0,j=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===c||c,strictTypes:null!==(p=null!==(l=e.strictTypes)&&void 0!==l?l:$)&&void 0!==p?p:"log",strictTuples:null!==(d=null!==(u=e.strictTuples)&&void 0!==u?u:$)&&void 0!==d?d:"log",strictRequired:null!==(y=null!==(m=e.strictRequired)&&void 0!==m?m:$)&&void 0!==y&&y,code:e.code?{...e.code,optimize:k,regExp:j}:{optimize:k,regExp:j},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(w=e.loopEnum)&&void 0!==w?w:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(b=e.inlineRefs)||void 0===b||b,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(A=e.validateFormats)||void 0===A||A,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class Ajv{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,w,e,"NOT SUPPORTED"),b.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),T.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=m;"id"===r&&(n={...m},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,p.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,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":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,p.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,d.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach((t=>k.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,p.normalizeId)(i||r);const l=p.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:l}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,p.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of y)delete e[t];return e}Ajv.ValidationError=i.default,Ajv.MissingRefError=s.default,t.default=Ajv;const P={log(){},warn(){},error(){}},$=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!$.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?j.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function j(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,C]}}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return c!==n.Name||l instanceof n.Name?l:o(i,l)}}function p(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&u(e,r,t),r}function u(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),u(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:p}),items:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=p,t.setEvaluated=u;const d={};var m;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===m.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},4266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const n=r(251);function o(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>o(e).getUint8(t),put:(e,t,r)=>(o(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>o(e).getUint16(t,!0),put:(e,t,r)=>(o(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>o(e).getUint16(t),put:(e,t,r)=>(o(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=o(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=o(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>o(e).getUint32(t,!0),put:(e,t,r)=>(o(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>o(e).getUint32(t),put:(e,t,r)=>(o(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>o(e).getInt8(t),put:(e,t,r)=>(o(e).setInt8(t,r),t+1)},t.INT16_BE={len:2,get:(e,t)=>o(e).getInt16(t),put:(e,t,r)=>(o(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>o(e).getInt16(t,!0),put:(e,t,r)=>(o(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const n=t.UINT24_LE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const n=t.UINT24_BE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>o(e).getInt32(t),put:(e,t,r)=>(o(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>o(e).getInt32(t,!0),put:(e,t,r)=>(o(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>o(e).getBigUint64(t,!0),put:(e,t,r)=>(o(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>o(e).getBigInt64(t,!0),put:(e,t,r)=>(o(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>o(e).getBigUint64(t),put:(e,t,r)=>(o(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>o(e).getBigInt64(t),put:(e,t,r)=>(o(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>o(e).getFloat32(t),put:(e,t,r)=>(o(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>o(e).getFloat32(t,!0),put:(e,t,r)=>(o(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>o(e).getFloat64(t),put:(e,t,r)=>(o(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>o(e).getFloat64(t,!0),put:(e,t,r)=>(o(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class IgnoreType{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class Uint8ArrayType{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class BufferType{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},t.StringType=class StringType{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class AnsiStringType{constructor(e){this.len=e}static decode(e,t,r){let n="";for(let o=t;o<r;++o)n+=AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(e[o]));return n}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(AnsiStringType.inRange(e,0,127))return e;const t=AnsiStringType.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return AnsiStringType.decode(e,t,t+this.len)}}t.AnsiStringType=AnsiStringType,AnsiStringType.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4428:()=>{},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;p(l.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function p(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(p(s instanceof n.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class MissingRefError extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=MissingRefError},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:p,schemaEnv:u,self:d}=c;l.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),c=r.let("fType"),p=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(p,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(p,s))),e.fail$data((0,n.or)(!1===l.strictSchema?n.nil:n._`${a} && !${p}`,function(){const e=u.$async?n._`(${s}.async ? await ${p}(${o}) : ${p}(${o}))`:n._`${p}(${o})`,r=n._`(typeof ${p} == "function" ? ${e} : ${p}.test(${o}))`;return n._`${p} && ${p} !== true && ${c} === ${t} && !${r}`}()))}():function(){const i=d.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${p}"`}d.logger.warn(e())}();if(!0===i)return;const[a,c,m]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):l.code.formats?n._`${l.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!u.$async)throw new Error("async format in sync schema");return n._`await ${m}(${o})`}return"function"==typeof c?n._`${m}(${o})`:n._`${m}.test(${o})`}())}())}};t.default=o},4834:(e,t,r)=>{"use strict";const{HEX:n}=r(4914),o=/^(?:(?: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){if(l(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[r]=t;return r?{host:c(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function s(e,t=!1){let r="",o=!0;for(const t of e){if(void 0===n[t])return;"0"!==t&&!0===o&&(o=!1),o||(r+=t)}return t&&0===r.length&&(r="0"),r}function a(e){if(l(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},n=[],o=[];let i=!1,a=!1,c=!1;function l(){if(o.length){if(!1===i){const e=s(o);if(void 0===e)return r.error=!0,!1;n.push(e)}o.length=0}return!0}for(let s=0;s<e.length;s++){const p=e[s];if("["!==p&&"]"!==p)if(":"!==p)if("%"===p){if(!l())break;i=!0}else o.push(p);else{if(!0===a&&(c=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}s-1>=0&&":"===e[s-1]&&(a=!0)}}return o.length&&(i?r.zone=o.join(""):c?n.push(o.join("")):n.push(s(o))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function c(e,t){let r="",n=!0;const o=e.length;for(let i=0;i<o;i++){const s=e[i];"0"===s&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(n=s===t,r+=s)}return r}function l(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}const p=/^\.\.?\//u,u=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);const n=i(r);if(n.isIPV4)r=n.host;else{const t=a(n.host);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(p))e=e.replace(p,"");else if(e.match(u))e=e.replace(u,"/");else if(e.match(d))e=e.replace(d,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(m);if(!r)throw new Error("Unexpected dot segment condition");{const n=r[0];e=e.slice(n.length),t.push(n)}}return t.join("")},normalizeIPv4:i,normalizeIPv6:a,stringArrayToHexStripped:s}},4874:(e,t,r)=>{"use strict";const n=r(793);e.exports=u;const o=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:w,wrapResponseSerializer:w,wrapErrorSerializer:w,req:g,res:g,err:h,errWithCause:h};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const a=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function p(e,t){const r={logger:t,parent:e[c]};t[c]=r}function u(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||o;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const h=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(h);"function"==typeof r&&g.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const w=e.level||"info",v=Object.create(r);v.log||(v.log=_),function(e,t,r){const n={};t.forEach((e=>{n[e]=r[e]?r[e]:o[e]||o[l[e]||"log"]||_})),e[a]=n}(v,g,r),p({},v),Object.defineProperty(v,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(v,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,b,v,"error"),d(this,b,v,"fatal"),d(this,b,v,"warn"),d(this,b,v,"info"),d(this,b,v,"debug"),d(this,b,v,"trace"),h.forEach((e=>{d(this,b,v,e)}))}});const b={transmit:t,serialize:i,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:g,timestamp:y(e),messageKey:e.messageKey||"msg",onChild:e.onChild||_};function E(r,o,s){if(!o)throw new Error("missing bindings for child Pino");s=s||{},i&&o.serializers&&(s.serializers=o.serializers);const a=s.serializers;if(i&&a){var c=Object.assign({},n,a),l=!0===e.browser.serialize?Object.keys(c):i;delete o.serializers,m([o],l,c,this._stdErrSerialize)}function u(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,c&&(this.serializers=c,this._serialize=l),t&&(this._logEvent=f([].concat(e._logEvent.bindings,o)))}u.prototype=this;const d=new u(this);return p(this,d),d.child=function(...e){return E.call(this,r,...e)},d.level=s.level||this.level,r.onChild(d),d}return v.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t))}}(e),v.level=w,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=_,v.serializers=n,v._serialize=i,v._stdErrSerialize=c,v.child=function(...e){return E.call(this,b,...e)},t&&(v._logEvent=f()),v}function d(e,t,r,i){if(Object.defineProperty(e,i,{value:s(e.level,r)>s(i,r)?_:r[a][i],writable:!0,enumerable:!0,configurable:!0}),e[i]===_){if(!t.transmit)return;const n=s(t.transmit.level||e.level,r);if(s(i,r)<n)return}e[i]=function(e,t,r,i){return c=e[a][i],function(){const a=t.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var u=0;u<l.length;u++)l[u]=arguments[u];var d=!1;if(t.serialize&&(m(l,this._serialize,this.serializers,this._stdErrSerialize),d=!0),t.asObject||t.formatters?c.call(p,function(e,t,r,o,i){const{level:s,log:a=e=>e}=i.formatters||{},c=r.slice();let l=c[0];const p={};if(o&&(p.time=o),s){const r=s(t,e.levels.values[t]);Object.assign(p,r)}else p.level=e.levels.values[t];let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==l&&"object"==typeof l){for(;u--&&"object"==typeof c[0];)Object.assign(p,c.shift());l=c.length?n(c.shift(),c):void 0}else"string"==typeof l&&(l=n(c.shift(),c));return void 0!==l&&(p[i.messageKey]=l),a(p)}(this,i,l,a,t)):c.apply(p,l),t.transmit){const n=t.transmit.level||e._level,o=s(n,r),c=s(i,r);if(c<o)return;!function(e,t,r,n=!1){const o=t.send,i=t.ts,s=t.methodLevel,a=t.methodValue,c=t.val,l=e._logEvent.bindings;n||m(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter((function(e){return-1===l.indexOf(e)})),e._logEvent.level.label=s,e._logEvent.level.value=a,o(s,e._logEvent,c),e._logEvent=f(l)}(this,{ts:a,methodLevel:i,methodValue:c,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,r)},l,d)}};var c}(e,t,r,i);const l=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[c];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==l.length&&(e[i]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,e[i]))}function m(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=u.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o])&&t)for(const n in e[o])t.indexOf(n)>-1&&n in r&&(e[o][n]=r[n](e[o][n]))}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?v:b}function g(){return{}}function w(e){return e}function _(){}function v(){return!1}function b(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers=i,u.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u},4914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:l}=e,{opts:p}=l,u=(0,n.allSchemaProperties)(r),d=u.filter((e=>(0,i.alwaysValidSchema)(l,r[e])));if(0===u.length||d.length===u.length&&(!l.opts.unevaluated||!0===l.props))return;const m=p.strictSchema&&!p.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:h}=l;function y(e){for(const t in m)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",a,(i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,(()=>{const n=d.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==h?t.assign(o._`${h}[${i}]`,!0):n||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of u)m&&y(e),l.allErrors?g(e):(t.var(f,!0),g(e),t.if(f))}()}};t.default=a},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const l=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${l} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=r.var("valid",n._`${l} <= ${t.length}`);r.if((0,n.not)(i),(()=>function(i){r.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||r.if((0,n.not)(i),(()=>r.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=EndOfStreamError},5707:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";const Token=__webpack_require__(4266),strtok3=__webpack_require__(6452),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__webpack_require__(6760),supported=__webpack_require__(1664),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,o]of t.entries())if(r.mask){if(o!==(r.mask[n]&e[n+r.offset]))return!1}else if(o!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const o=await e.readToken(uint32SyncSafeToken);return e.position+o>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(o),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const i={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(i.filename=await e.readToken(new Token.StringType(i.filenameLength,"utf-8")),await e.ignore(i.extraFieldLength),"META-INF/mozilla.rsa"===i.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(i.filename.endsWith(".rels")||i.filename.endsWith(".xml"))switch(i.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(i.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.filename.startsWith("3D/")&&i.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===i.filename&&i.compressedSize===i.uncompressedSize)switch(await e.readToken(new Token.StringType(i.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}if(0===i.compressedSize){let s=-1;for(;s<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),s=t.indexOf("504B0304",0,"hex"),await e.ignore(s>=0?s:t.length)}else await e.ignore(i.compressedSize)}}catch(a){if(!(a instanceof strtok3.EndOfStreamError))throw a}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const l=t.toString("binary",8,12).replace("\0"," ").trim();switch(l){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return l.startsWith("3g")?l.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const p=10485760,u=Buffer.alloc(Math.min(p,e.fileInfo.size));return await e.readBuffer(u,{mayBeLess:!0}),u.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function d(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const o=Buffer.alloc(n+1);return await e.readBuffer(o),o}async function m(){const e=await d(),t=await d();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function f(t,r){for(;r>0;){const t=await m();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await m();switch(await f(0,h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n("solid "))return{ext:"stl",mime:"model/stl"};if(n("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(n("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function y(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const g=await y();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function w(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const _=await w();let v=_.size-24;if(_check(_.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const b=Buffer.alloc(16);if(v-=await e.readBuffer(b),_check(b,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(b,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(v)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),n("BEGIN:")){if(n("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(n("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(n("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){const E=t.readUInt32LE(12);if(E>12&&t.length>=E+16)try{const T=t.slice(16,E+16).toString();if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,(()=>{})):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)}))})),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function l(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(c(e,t,r))):i}function p(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(l(r,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map((o=>(0,n.and)(l(e,t,o,r.ownProperties),n._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${c(e,t,r)}`:i},t.noPropertyInData=l,t.allSchemaProperties=p,t.schemaProperties=function(e,t){return p(t).filter((r=>!(0,o.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,p,u){const d=u?n._`${e}, ${t}, ${o}${s}`:t,m=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&m.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=n._`${d}, ${r.object(...m)}`;return p!==n.nil?n._`${l}.call(${p}, ${f})`:n._`${l}(${f})`};const u=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?u:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6022:e=>{!function(){"use strict";var t=[,function(e,t){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.lengthOf=t.keysOf=t.isObject=t.isInfOrNaN=t.isFunction=t.isArguments=t.hasOwn=t.handleError=t.convertMapToObject=t.checkError=void 0,t.isFunction=function(e){return"function"==typeof e},t.isObject=function(e){return"object"===n(e)},t.keysOf=function(e){return Object.keys(e)},t.lengthOf=function(e){return Object.keys(e).length};var o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};t.hasOwn=o,t.convertMapToObject=function(e){return Array.from(e).reduce((function(e,t){var n,o,i=(o=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return e[s]=a,e}),{})},t.isArguments=function(e){return null!=e&&o(e,"callee")},t.isInfOrNaN=function(e){return Number.isNaN(e)||e===1/0||e===-1/0};var i={maxStack:function(e){return new RegExp("Maximum call stack size exceeded","g").test(e)}};t.checkError=i,t.handleError=function(e){return function(){try{return e.apply(this,arguments)}catch(e){if(i.maxStack(e.message))throw new Error("Converting circular structure to JSON");throw e}}}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0;for(var r=Object.create(null),n=function(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)},o=0;o<64;o++)r[n(o)]=o;var i=function(e){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer){for(var t=[],r=0;r<e;r++)t.push(0);return t.$Uint8ArrayPolyfill=!0,t}return new Uint8Array(new ArrayBuffer(e))},s={encode:function(e){if("string"==typeof e){var t=e;e=i(t.length);for(var r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");e[r]=o}}for(var s=[],a=null,c=null,l=null,p=null,u=0;u<e.length;u++)switch(u%3){case 0:a=e[u]>>2&63,c=(3&e[u])<<4;break;case 1:c|=e[u]>>4&15,l=(15&e[u])<<2;break;case 2:l|=e[u]>>6&3,p=63&e[u],s.push(n(a)),s.push(n(c)),s.push(n(l)),s.push(n(p)),a=null,c=null,l=null,p=null}return null!=a&&(s.push(n(a)),s.push(n(c)),null==l?s.push("="):s.push(n(l)),null==p&&s.push("=")),s.join("")},decode:function(e){var t=Math.floor(3*e.length/4);"="==e.charAt(e.length-1)&&(t--,"="==e.charAt(e.length-2)&&t--);for(var n,o=i(t),s=null,a=null,c=null,l=0,p=0;p<e.length;p++){var u="="===(n=e.charAt(p))?-1:r[n];switch(p%4){case 0:if(u<0)throw new Error("invalid base64 string");s=u<<2;break;case 1:if(u<0)throw new Error("invalid base64 string");s|=u>>4,o[l++]=s,a=(15&u)<<4;break;case 2:u>=0&&(a|=u>>2,o[l++]=a,c=(3&u)<<6);break;case 3:u>=0&&(o[l++]=c|u)}}return o},newBinary:i};t.Base64=s},function(e){e.exports={_noYieldsAllowed:function(e){return e()}}},function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function e(t,o,i,s,a){var c=o[t];switch(r(c)){case"string":return n(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var l,p=s+i,u=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var d=c.length,m=0;m<d;m+=1)u[m]=e(m,c,i,p,a)||"null";return l=0===u.length?"[]":p?"[\n"+p+u.join(",\n"+p)+"\n"+s+"]":"["+u.join(",")+"]"}var f=Object.keys(c);return a&&(f=f.sort()),f.forEach((function(t){(l=e(t,c,i,p,a))&&u.push(n(t)+(p?": ":":")+l)})),l=0===u.length?"{}":p?"{\n"+p+u.join(",\n"+p)+"\n"+s+"}":"{"+u.join(",")+"}"}};t.default=function(e,t){var r=Object.assign({indent:"",canonical:!1},t);if(!0===r.indent)r.indent=" ";else if("number"==typeof r.indent){for(var n="",i=0;i<r.indent;i++)n+=" ";r.indent=n}return o("",{"":e},r.indent,"",r.canonical)},e.exports=t.default}],r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}var o={};!function(){var e=o,t=n(2).Base64,r=n(3);Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=void 0;var i=n(1),s={};e.EJSON=s;var a=new Map;s.addType=function(e,t){if(a.has(e))throw new Error("Type ".concat(e," already present"));a.set(e,t)};var c=[{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$date")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof Date},toJSONValue:function(e){return{$date:e.getTime()}},fromJSONValue:function(e){return new Date(e.$date)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$regexp")&&(0,i.hasOwn)(e,"$flags")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof RegExp},toJSONValue:function(e){return{$regexp:e.source,$flags:e.flags}},fromJSONValue:function(e){return new RegExp(e.$regexp,e.$flags.slice(0,50).replace(/[^gimuy]/g,"").replace(/(.)(?=.*\1)/g,""))}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$InfNaN")&&1===(0,i.lengthOf)(e)},matchObject:i.isInfOrNaN,toJSONValue:function(e){return{$InfNaN:Number.isNaN(e)?0:e===1/0?1:-1}},fromJSONValue:function(e){return e.$InfNaN/0}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$binary")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return"undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&(0,i.hasOwn)(e,"$Uint8ArrayPolyfill")},toJSONValue:function(e){return{$binary:t.encode(e)}},fromJSONValue:function(e){return t.decode(e.$binary)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$escape")&&1===(0,i.lengthOf)(e)},matchObject:function(e){var t=!1;if(e){var r=(0,i.lengthOf)(e);1!==r&&2!==r||(t=c.some((function(t){return t.matchJSONValue(e)})))}return t},toJSONValue:function(e){var t={};return(0,i.keysOf)(e).forEach((function(r){t[r]=s.toJSONValue(e[r])})),{$escape:t}},fromJSONValue:function(e){var t={};return(0,i.keysOf)(e.$escape).forEach((function(r){t[r]=s.fromJSONValue(e.$escape[r])})),t}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$type")&&(0,i.hasOwn)(e,"$value")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return s._isCustomType(e)},toJSONValue:function(e){var t=r._noYieldsAllowed((function(){return e.toJSONValue()}));return{$type:e.typeName(),$value:t}},fromJSONValue:function(e){var t=e.$type;if(!a.has(t))throw new Error("Custom EJSON type ".concat(t," is not defined"));var n=a.get(t);return r._noYieldsAllowed((function(){return n(e.$value)}))}}];s._isCustomType=function(e){return e&&(0,i.isFunction)(e.toJSONValue)&&(0,i.isFunction)(e.typeName)&&a.has(e.typeName())},s._getTypes=function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?a:(0,i.convertMapToObject)(a)},s._getConverters=function(){return c};var l=function(e){for(var t=0;t<c.length;t++){var r=c[t];if(r.matchObject(e))return r.toJSONValue(e)}},p=function e(t){if(null===t)return null;var r=l(t);return void 0!==r?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)||void 0===n||(0,i.isInfOrNaN)(n)){var o=l(n);o?t[r]=o:e(n)}})),t):t};s._adjustTypesToJSONValue=p,s.toJSONValue=function(e){var t=l(e);if(void 0!==t)return t;var r=e;return(0,i.isObject)(e)&&(r=s.clone(e),p(r)),r};var u=function(e){if((0,i.isObject)(e)&&null!==e){var t=(0,i.keysOf)(e);if(t.length<=2&&t.every((function(e){return"string"==typeof e&&"$"===e.substr(0,1)})))for(var r=0;r<c.length;r++){var n=c[r];if(n.matchJSONValue(e))return n.fromJSONValue(e)}}return e},d=function e(t){if(null===t)return null;var r=u(t);return r!==t?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)){var o=u(n);if(n!==o)return void(t[r]=o);e(n)}})),t):t};s._adjustTypesFromJSONValue=d,s.fromJSONValue=function(e){var t=u(e);return t===e&&(0,i.isObject)(e)&&(t=s.clone(e),d(t)),t},s.stringify=(0,i.handleError)((function(e,t){var r=s.toJSONValue(e);return t&&(t.canonical||t.indent)?n(4)(r,t):JSON.stringify(r)})),s.parse=function(e){if("string"!=typeof e)throw new Error("EJSON.parse argument should be a string");return s.fromJSONValue(JSON.parse(e))},s.isBinary=function(e){return!!("undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&e.$Uint8ArrayPolyfill)},s.equals=function(e,t,r){var n,o=!(!r||!r.keyOrderSensitive);if(e===t)return!0;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(!e||!t)return!1;if(!(0,i.isObject)(e)||!(0,i.isObject)(t))return!1;if(e instanceof Date&&t instanceof Date)return e.valueOf()===t.valueOf();if(s.isBinary(e)&&s.isBinary(t)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if((0,i.isFunction)(e.equals))return e.equals(t,r);if((0,i.isFunction)(t.equals))return t.equals(e,r);var a,c=Array.isArray(e),l=Array.isArray(t);if(c!==l)return!1;if(c&&l){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!s.equals(e[n],t[n],r))return!1;return!0}switch(s._isCustomType(e)+s._isCustomType(t)){case 1:return!1;case 2:return s.equals(s.toJSONValue(e),s.toJSONValue(t))}var p=(0,i.keysOf)(e),u=(0,i.keysOf)(t);return o?(n=0,a=p.every((function(o){return!(n>=u.length||o!==u[n]||!s.equals(e[o],t[u[n]],r)||(n++,0))}))):(n=0,a=p.every((function(o){return!!(0,i.hasOwn)(t,o)&&!!s.equals(e[o],t[o],r)&&(n++,!0)}))),a&&n===u.length},s.clone=function(e){var t;if(!(0,i.isObject)(e))return e;if(null===e)return null;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return e;if(s.isBinary(e)){t=s.newBinary(e.length);for(var r=0;r<e.length;r++)t[r]=e[r];return t}return Array.isArray(e)?e.map(s.clone):(0,i.isArguments)(e)?Array.from(e).map(s.clone):(0,i.isFunction)(e.clone)?e.clone():s._isCustomType(e)?s.fromJSONValue(s.clone(s.toJSONValue(e)),!0):(t={},(0,i.keysOf)(e).forEach((function(r){t[r]=s.clone(e[r])})),t)},s.newBinary=t.newBinary}(),e.exports=o.EJSON}()},6066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const n=r(8632),o=r(8705);class ReadStreamTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new o.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new o.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const o=new Uint8Array(r.length+t);return n=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),e.set(o.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof o.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new o.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const o=e-n,i=await this.readBuffer(r,{length:Math.min(t,o)});if(i<0)return i;n+=i}return n}}t.ReadStreamTokenizer=ReadStreamTokenizer},6092:(e,t,r)=>{"use strict";r.d(t,{Ek:()=>MultiServerMemoryStorageStrategy,SJ:()=>MultiServerTokenStorageStrategy,YP:()=>MultiServerLocalStorageStrategy});var n=r(1027);class MultiServerTokenStorageStrategy extends n.u3{constructor(){super(),this._currentBaseURL=null}use(e){if(!e)throw new Error("baseURL est requis");this._currentBaseURL=e.replace(/\/+$/,"")}_ensureContext(){if(!this._currentBaseURL)throw new Error("baseURL non défini. Appelez use(baseURL)")}getServers(){throw new Error("getServers() doit être implémenté")}exportAll(){throw new Error("exportAll() doit être implémenté")}}class MultiServerMemoryStorageStrategy extends MultiServerTokenStorageStrategy{constructor(){super(),this._storage=new Map}getAccessToken(){return this._ensureContext(),this._storage.get(this._currentBaseURL)?.accessToken||null}setAccessToken(e){this._ensureContext();const t=this._storage.get(this._currentBaseURL)||{};this._storage.set(this._currentBaseURL,{...t,accessToken:e})}getRefreshToken(){return this._ensureContext(),this._storage.get(this._currentBaseURL)?.refreshToken||null}setRefreshToken(e){this._ensureContext();const t=this._storage.get(this._currentBaseURL)||{};this._storage.set(this._currentBaseURL,{...t,refreshToken:e})}clear(){this._ensureContext(),this._storage.delete(this._currentBaseURL)}getServers(){return[...this._storage.keys()]}exportAll(){return Object.fromEntries(this._storage.entries())}}class MultiServerLocalStorageStrategy extends MultiServerTokenStorageStrategy{constructor(e="cocolight"){super(),this.prefix=e}_key(e){return`${this.prefix}_tokens_${e}`}_getData(){this._ensureContext();const e=localStorage.getItem(this._key(this._currentBaseURL));return e?JSON.parse(e):{}}_setData(e){localStorage.setItem(this._key(this._currentBaseURL),JSON.stringify(e))}getAccessToken(){return this._getData().accessToken||null}setAccessToken(e){const t=this._getData();t.accessToken=e,this._setData(t)}getRefreshToken(){return this._getData().refreshToken||null}setRefreshToken(e){const t=this._getData();t.refreshToken=e,this._setData(t)}clear(){localStorage.removeItem(this._key(this._currentBaseURL))}getServers(){return Object.keys(localStorage).filter((e=>e.startsWith(`${this.prefix}_tokens_`))).map((e=>e.replace(`${this.prefix}_tokens_`,"")))}exportAll(){const e={};for(const t of this.getServers()){const r=localStorage.getItem(this._key(t));r&&(e[t]=JSON.parse(r))}return e}}},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),c=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,c=t.let("valid",!1),l=t.let("passing",null),p=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(p,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},p),i>0&&t.if(n._`${p} && ${c}`).assign(c,!1).assign(l,n._`[${l}, ${i}]`).else(),t.if(p,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),c=r(3025),l=r(9713),p=r(8660),u=r(117),d=r(5333),m=r(7923),f=r(6505),h=r(6163),y=r(5844),g=r(1239),w=r(4426);t.default=function(e=!1){const t=[m.default,f.default,h.default,y.default,g.default,w.default,l.default,p.default,c.default,u.default,d.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const n=r(6066),o=r(3492);var i=r(8705);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new n.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new o.BufferTokenizer(e,t)}},6461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3282),o=r(9029),i=o.operators,s={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},a={message:({keyword:e,schemaCode:t})=>o.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>o._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:i,keyword:a,it:c}=e,{opts:l,self:p}=c;if(!l.validateFormats)return;const u=new n.KeywordCxt(c,p.RULES.all.format.definition,"format");function d(e){return o._`${e}.compare(${r}, ${i}) ${s[a].fail} 0`}u.$data?function(){const r=t.scopeValue("formats",{ref:p.formats,code:l.code.formats}),n=t.const("fmt",o._`${r}[${u.schemaCode}]`);e.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,d(n)))}():function(){const r=u.schema,n=p.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const i=t.scopeValue("formats",{key:r,ref:n,code:l.code.formats?o._`${l.code.formats}${(0,o.getProperty)(r)}`:void 0});e.fail$data(d(i))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:c,parentSchema:l,it:p}=e,{oneOf:u}=l;if(!p.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=c.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const m=t.let("valid",!1),f=t.const("tag",n._`${r}${(0,n.getProperty)(d)}`);function h(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${f} == "string"`,(()=>function(){const r=function(){var e;const t={},r=o(l);let n=!0;for(let t=0;t<u.length;t++){let l=u[t];if((null==l?void 0:l.$ref)&&!(0,a.schemaHasRulesButRef)(l,p.self.RULES)){const e=l.$ref;if(l=i.resolveRef.call(p.self,p.schemaEnv.root,p.baseId,e),l instanceof i.SchemaEnv&&(l=l.schema),void 0===l)throw new s.default(p.opts.uriResolver,p.baseId,e)}const m=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[d];if("object"!=typeof m)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||o(l)),c(m,t)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(d)}function c(e,t){if(e.const)m(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const r of e.enum)m(r,t)}}function m(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${f} === ${e}`),t.assign(m,h(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:f,tagName:d}),t.endIf()}()),(()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:f,tagName:d}))),e.ok(m)}};t.default=c},6760:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=l(e))),t===1/0))return 1/0}return t}function p(e,t="",r){!1!==r&&(t=m(t));const n=e.parse(t);return u(e,n)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=p,t._getFullPath=u;const d=/#\/?$/;function m(e){return e?e.replace(d,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,r){return r=m(r),e.resolve(t,r)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=m(e[r]||t),a={"":s},c=p(n,s,!1),l={},u=new Set;return i(e,{allKeys:!0},((e,t,n,o)=>{if(void 0===o)return;const i=c+t;let s=a[o];function p(t){const r=this.opts.uriResolver.resolve;if(t=m(s?r(s,t):t),u.has(t))throw h(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(e,n.schema,t):t!==m(i)&&("#"===t[0]?(d(e,l[t],t),l[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);p.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=p.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),l;function d(e,t,r){if(void 0!==t&&!o(e,t))throw h(r)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,s,l;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=s.length,l=p,console&&console.warn&&console.warn(l)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):f(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,p=f(c,l);for(r=0;r<l;++r)n(p[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},i.prototype.listenerCount=m,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7031:(e,t,r)=>{"use strict";r.d(t,{LD:()=>OfflineQueueStorageStrategy,QM:()=>MemoryOfflineStorage,Rc:()=>LocalStorageOfflineStorage});class OfflineQueueStorageStrategy{async loadQueue(){throw new Error("loadQueue() doit être implémenté")}async saveQueue(e){throw new Error("saveQueue(queue) doit être implémenté")}}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{constructor(){super(),this._queue=[]}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return e?JSON.parse(e):[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),c=r(4003),l=r(1163),p=r(617),u=r(7935),d=r(8643),m=[n.default,o.default,i.default,s.default,a.default,c.default,l.default,p.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];t.default=m},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,o,i,s,a,c,l,p,u){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var d in n(i,s,a,c,l,p,u),i){var m=i[d];if(Array.isArray(m)){if(d in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,n,o,m[f],s+"/"+d+"/"+f,a,s,d,i,f)}else if(d in t.propsKeywords){if(m&&"object"==typeof m)for(var h in m)r(e,n,o,m[h],s+"/"+d+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,d,i,h)}else(d in t.keywords||e.allKeys&&!(d in t.skipKeywords))&&r(e,n,o,m,s+"/"+d,a,s,d,i)}o(i,s,a,c,l,p,u)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,l=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${l} ${c} ${s}`)}};t.default=s},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const i=n._`\n`;t.ValueScope=class ValueScope extends Scope{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,i={},s){let a=n.nil;for(const c in e){const l=e[c];if(!l)continue;const p=i[c]=i[c]||new Map;l.forEach((e=>{if(p.has(e))return;p.set(e,o.Started);let i=r(e);if(i){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;a=n._`${a}${r} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(e)))throw new ValueError(e);a=n._`${a}${i}${this.opts._n}`}p.set(e,o.Completed)}))}return a}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const l=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let p=n._`${l} === undefined`;"empty"===c.useDefaults&&(p=n._`${p} || ${l} === null || ${l} === ""`),i.if(p,n._`${l} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>i(e,r,t.default)))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},8122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class Deferred{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4018),o=r(6461),i=r(9029),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,n.fullFormats,s),e;const[r,i]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return l(e,t.formats||n.formatNames,r,i),t.keywords&&(0,o.default)(e),e};function l(e,t,r,n){var o,s;null!==(o=(s=e.opts.code).formats)&&void 0!==o||(s.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,normalizeIPv4:o,removeDotSegments:i,recomposeAuthority:s,normalizeComponentEncoding:a}=r(4834),c=r(343);function l(e,t,r,n){const o={};return n||(e=m(p(e,r),r),t=m(p(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function p(e,t){const r={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:""},n=Object.assign({},t),o=[],a=c[(n.scheme||r.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&o.push(r.scheme,":");const l=s(r);if(void 0!==l&&("suffix"!==n.reference&&o.push("//"),o.push(l),r.path&&"/"!==r.path.charAt(0)&&o.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}const u=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(e,t){const r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=-1!==e.indexOf("%");let a=!1;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);const l=e.match(d);if(l){if(i.scheme=l[1],i.userinfo=l[3],i.host=l[4],i.port=parseInt(l[5],10),i.path=l[6]||"",i.query=l[7],i.fragment=l[8],isNaN(i.port)&&(i.port=l[5]),i.host){const e=o(i.host);if(!1===e.isIPV4){const t=n(e.host);i.host=t.host.toLowerCase(),a=t.isIPV6}else i.host=e.host,a=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");const e=c[(r.scheme||i.scheme||"").toLowerCase()];if(!(r.unicodeSupport||e&&e.unicodeSupport)&&i.host&&(r.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||u[t])return!0;return!1}(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}(!e||e&&!e.skipNormalize)&&(s&&void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),s&&void 0!==i.host&&(i.host=unescape(i.host)),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),e&&e.parse&&e.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}const f={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=p(m(e,t),t):"object"==typeof e&&(e=m(p(e,t),t)),e},resolve:function(e,t,r){const n=Object.assign({scheme:"null"},r);return p(l(m(e,n),m(t,n),n,!0),{...n,skipEscape:!0})},resolveComponents:l,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=p(a(m(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=p(a(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=p(a(m(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=p(a(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:p,parse:m};e.exports=f,e.exports.default=f,e.exports.fastUri=f},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const n=r(8705);t.AbstractTokenizer=class AbstractTokenizer{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const p=a.length>=l.opts.loopEnum;let u;const d=()=>null!=u?u:u=(0,o.useFunc)(t,i.default);let m;if(p||s)m=t.let("valid"),e.block$data(m,(function(){t.assign(m,!1),t.forOf("v",c,(e=>t.if(n._`${d()}(${r}, ${e})`,(()=>t.assign(m,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);m=(0,n.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${d()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o))))}e.pass(m)}};t.default=s},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:l,it:p}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=p;if(p.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(p,r))return;const m=(0,n.allSchemaProperties)(a.properties),f=(0,n.allSchemaProperties)(a.patternProperties);function h(e){t.code(o._`delete ${c}[${e}]`)}function y(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)h(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(u||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(p,r)){const r=t.name("valid");"failing"===d.removeAdditional?(g(n,r,!1),t.if((0,o.not)(r),(()=>{e.reset(),h(n)}))):(g(n,r),u||t.if((0,o.not)(r),(()=>t.break())))}}}function g(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",c,(r=>{m.length||f.length?t.if(function(r){let i;if(m.length>8){const e=(0,s.schemaRefOrVal)(p,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=m.length?(0,o.or)(...m.map((e=>o._`${r} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,o.not)(i)}(r),(()=>y(r))):y(r)})),e.ok(o._`${l} === ${i.default.errors}`)}};t.default=a},8705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var n=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});var o=r(1510);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return o.StreamReader}})},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,n._`[${r}]`)),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){const{it:c}=e,{gen:p,compositeRule:u,allErrors:d}=c,m=l(e,r,o);(null!=i?i:u||d)?s(p,m):a(c,n._`[${m}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:c,compositeRule:p,allErrors:u}=o;s(c,l(e,r,n)),p||u||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,n._`${i.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,o))}))};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[p(s,r),u(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:l,it:p}=e,{opts:u,propertyName:d,topSchemaRef:m,schemaPath:f}=p;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),u.messages&&o.push([c.message,"function"==typeof r?r(e):r]),u.verbose&&o.push([c.schema,l],[c.parentSchema,n._`${m}${f}`],[i.default.data,a]),d&&o.push([c.propertyName,d])}(e,t,a),o.object(...a)}(e,t,r)}function p({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[c.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=l(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=l(this.rhs,e,t),this}get names(){return c(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Throw extends Node{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=l(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(p(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>a(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}return t?!1===e?t instanceof If?t:t.nodes:this.nodes.length?this:new If(u(e),t instanceof If?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=l(this.condition,e,t),this}get names(){const e=super.names;return c(e,this.condition),this.else&&a(e,this.else.names),e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=l(this.iteration,e,t),this}get names(){return a(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=c(super.names,this.from);return c(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=l(this.iterable,e,t),this}get names(){return a(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&a(e,this.catch.names),this.finally&&a(e,this.finally.names),e}}class Catch extends BlockNode{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}function a(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function c(e,t){return t instanceof n._CodeOrName?a(e,t.names):e}function l(e,t,r){return e instanceof n.Name?i(e):(o=e)instanceof n._Code&&o._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function p(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function u(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${h(e)}`}Finally.kind="finally",t.CodeGen=class CodeGen{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}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,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new Def(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new AnyCode(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new If(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new ForRange(i,s,t,r),(()=>n(s)))}forOf(e,t,r,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(s,n._`${e}[${t}]`),r(s)}))}return this._for(new ForIter("of",i,s,t),(()=>r(s)))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new ForIter("in",i,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new Catch(e),t(e)}return r&&(this._currNode=n.finally=new Finally,this.code(r)),this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new Func(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Func)}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){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=u;const d=f(t.operators.AND);t.and=function(...e){return e.reduce(d)};const m=f(t.operators.OR);function f(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${h(t)} ${e} ${h(r)}`}function h(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(m)}},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var o=2&t&&e;"object"==typeof o&&!~leafPrototypes.indexOf(o);o=getProto(o))Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>e+".cocolight-api-client.browser.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="CocolightApiClient:",__webpack_require__.l=(e,t,r,n)=>{if(inProgress[e])inProgress[e].push(t);else{var o,i;if(void 0!==r)for(var s=document.getElementsByTagName("script"),a=0;a<s.length;a++){var c=s[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==dataWebpackPrefix+r){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,__webpack_require__.nc&&o.setAttribute("nonce",__webpack_require__.nc),o.setAttribute("data-webpack",dataWebpackPrefix+r),o.src=e),inProgress[e]=[t];var l=(t,r)=>{o.onerror=o.onload=null,clearTimeout(p);var n=inProgress[e];if(delete inProgress[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(r))),t)return t(r)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,r)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(i,(r=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,a]=r,c=0;if(i.some((t=>0!==e[t]))){for(n in s)__webpack_require__.o(s,n)&&(__webpack_require__.m[n]=s[n]);a&&a(__webpack_require__)}for(t&&t(r);c<i.length;c++)o=i[c],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunkCocolightApiClient=this.webpackChunkCocolightApiClient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>gr});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{ApiAuthenticationError:()=>ApiAuthenticationError,ApiClientError:()=>ApiClientError,ApiError:()=>ApiError,ApiResponseError:()=>ApiResponseError,ApiValidationError:()=>ApiValidationError,CircuitBreakerError:()=>CircuitBreakerError});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{batch:()=>h,computed:()=>b,effect:()=>f,getSignals:()=>T,isReactive:()=>v,isSignal:()=>g,reactive:()=>_,subscribeTo:()=>S,watch:()=>E});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{hasBrowserEnv:()=>Ge,hasStandardBrowserEnv:()=>Je,hasStandardBrowserWebWorkerEnv:()=>He,navigator:()=>Ke,origin:()=>Ze});const n=new Map;function o(e,t){n.set(e,t)}function i(e,t){const r=n.get(e),o={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project"),Event:n.get("Event"),Poi:n.get("Poi"),Badge:n.get("Badge"),News:n.get("News")};return o[e]=r,t.remove.forEach((e=>delete o[e])),{entityClass:r,deps:o}}class ApiError extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.details=r}}class ApiClientError extends ApiError{constructor(e,t,r){super(e,t,r),this.name="ApiClientError"}}class ApiValidationError extends Error{constructor(e,t,r,n=null){super(e),this.name="ApiValidationError",this.status=t,this.messages=r,this.details=n}}class CircuitBreakerError extends ApiError{constructor(e){super(e,503),this.name="CircuitBreakerError"}}class ApiResponseError extends Error{constructor(e,t,r,n=null){super(e),this.name="ApiResponseError",this.status=t,this.responseData=r,this.details=n}}class ApiAuthenticationError extends ApiError{constructor(e,t,r){super(e,t,r),this.name="ApiAuthenticationError"}}var s=__webpack_require__(2808),a=__webpack_require__(6022),c=__webpack_require__(3846);const l=[],p=new WeakMap,u=new WeakMap;let d=0;const m=new Set;function f(e){const t=()=>{try{l.push(t),e()}finally{l.pop()}};return t(),t}function h(e){d++;try{e()}finally{if(d--,0===d){const e=Array.from(m);m.clear();for(const t of e)t()}}}function y(e){let t=e;const r=new Set;return{get value(){const e=l[l.length-1];return e&&r.add(e),t},set value(e){t!==e&&(t=e,d>0?r.forEach((e=>m.add(e))):r.forEach((e=>e())))},subscribe:e=>(r.add(e),()=>r.delete(e)),__isSignal:!0}}function g(e){return e&&!0===e.__isSignal}function w(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,r){if("string"==typeof r&&!isNaN(r)){const n=e[r];return v(n)?n:_(n,t.concat(r))}return Reflect.get(e,r)},set(e,r,n){const o=_(n,t.concat(r));return e[r]=o,!0}})}(e,t);if(e.__isReactive)return e;const r=new Map,n=new Proxy(e,{get(e,n,o){if("__raw"===n)return e;if("__isReactive"===n)return!0;if(!r.has(n)){const o=y(w(e[n],t.concat(n)));r.set(n,o)}return r.get(n).value},set(e,n,o){const i=w(o,t.concat(n));if(!r.has(n)){const e=y(i);r.set(n,e)}return r.get(n).value=i,e[n]=function(e){return g(e)?e.value:e}(i),!0},deleteProperty:(e,t)=>(r.delete(t),Reflect.deleteProperty(e,t))});return u.set(n,r),n}function _(e){return"object"!=typeof e||null===e||e.__isReactive?e:w(e)}function v(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function b(e){if(p.has(e))return p.get(e);const t=y();return f((()=>t.value=e())),p.set(e,t),t}function E(e,t){let r;f((()=>{const n=e();n!==r&&(t(n,r),r=n)}))}function T(e){return v(e)?u.get(e):null}function S(e,t,r){const n=T(e);if(!n||!n.has(t))return()=>{};const o=n.get(t);return o?.subscribe?.((()=>r(o.value)))??(()=>{})}const{fromBuffer:A}=c,O=class BaseEntity{_draftData={};_initialDraftData={};_serverData=null;_calledFromSave=!1;_syncReactiveDraft=!1;static entityTag="BaseEntity";constructor(e,t={},r={},n={}){if(this.__entityTag=n.entityTag||this.getEntityTag(this.constructor.entityTag)||"BaseEntity",this.deps=r,"ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e?.apiClient)throw new ApiError("Parent invalide ou ApiClient manquant.");this.apiClient=e.apiClient,this.parent=e,"User"===this.getEntityTag(e?.__entityTag)?this.userContext=e:e?.userContext&&(this.userContext=e.userContext)}if("function"==typeof r.EndpointApi)this.endpointApi=new r.EndpointApi(this.apiClient);else{if("object"!=typeof r.EndpointApi)throw new ApiError("deps.EndpointApi doit être une classe ou une instance valide.");this.endpointApi=r.EndpointApi}this._serverData=_({});const{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this.constructor.SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=s,this._draftData=o,this.data=i}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return this.isConnected&&this.userId===this.userContext?.id}getEntityType(){return this.constructor.entityType}hasChanges(){return this._serialize(this._toRawDeep(this._draftData))!==this._serialize(this._initialDraftData)}async refresh(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.");return this.get()}async save(){if(!this.isConnected)throw new ApiError("Non connecté.");this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await this.userContext.refresh(),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}static fromServerData(e,t,r){const n=new this(t,{},r);return n._setData(e),n}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.info?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`),v(this._serverData)?Object.assign(this._serverData,e):this._serverData=_({...e});const r=this._draftData?this._toRawDeep(this._draftData):{},n={...e,...this.defaultFields,...r},{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:n,serverData:this._serverData,previousDraft:this._draftData,constant:this.constructor.SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(o)):this._initialDraftData||(this._initialDraftData=s),v(this._draftData)?this._updateDraftPreservingUserChanges(o):this._draftData=_(o),this.data||(this.data=i)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(e)){const r=this._draftData?.[t],n=this._initialDraftData?.[t];void 0!==r&&void 0!==n&&this._serialize(this._toRawDeep(r))!==this._serialize(n)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(g(e))return this._toRawDeep(e.value);if(Array.isArray(e))return e.map((e=>this._toRawDeep(e)));if("object"==typeof e&&null!==e){const t={};for(const r of Object.keys(e))t[r]=this._toRawDeep(e[r]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(a.stringify(this._removeUnserializables(e)))}catch(e){return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON",e),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map((e=>this._removeUnserializables(e,t)));const r={};for(const n of Object.keys(e)){const o=e[n];if("function"!=typeof o&&"symbol"!=typeof o&&void 0!==o)try{r[n]=this._removeUnserializables(o,t)}catch(e){r[n]=null}}return r}static _revive(e){return a.fromJSONValue(e)}static fromJSON(e,t,r){const{serverData:n}=e;return this.fromServerData(this._revive(n),t,r)}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.");return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour faire cette action.");return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(!this.isMe)throw new ApiAuthenticationError("Vous devez être vous-même pour faire cette action.");return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:r="any"}){if(!e)throw new ApiValidationError("Le fichier est requis.");const n="undefined"==typeof window&&"undefined"!=typeof process;let o="",i=e;if("undefined"!=typeof File&&e instanceof File){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.")}else if("undefined"!=typeof Blob&&e instanceof Blob){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");const r=o.split("/")[1]||"bin",n=`${Date.now()}.${r}`;i=new File([e],n,{type:o})}else if(n&&Buffer.isBuffer(e)){const n=await A(e);if(o=n?.mime,!n||!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");if("image"===r){const t=n.ext,r=`${Date.now()}.${t}`;i=await this._createReadStreamFromBuffer(e,r,o)}}else{if(!n||!e?.readable||"function"!=typeof e._read)throw new ApiValidationError("Type de fichier non reconnu.");{const r=[],n=await this._passThrough(),s=await this._passThrough(),a=4100;let c=0;e.on("data",(e=>{c<a&&(r.push(e),c+=e.length)})),e.pipe(n).pipe(s),await new Promise((e=>setTimeout(e,10)));const l=Buffer.concat(r),p=await A(l);if(o=p?.mime,!p||!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");s.path=`${Date.now()}.${p.ext}`,s.mimeType=o,i=s}}return i}async _createReadStreamFromBuffer(e,t="file.bin",r="application/octet-stream"){const n=await this._bufferToReadable(e);return n.path=t,n.mimeType=r,n}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await __webpack_require__.e(931).then(__webpack_require__.bind(__webpack_require__,7931));return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await __webpack_require__.e(931).then(__webpack_require__.bind(__webpack_require__,7931));return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const r={...e};for(const e of t)delete r[e];return r}_pickProps(e,t,r={}){if(!e||"object"!=typeof e)return{};const n={};for(const o of t)if(o in e){const t=e[o];"function"==typeof r[o]?n[o]=r[o](t,e):n[o]=t}return n}_hasAtLeastOne(e,t=[]){return t.some((t=>t in e&&null!=e[t]))}_createFilteredProxy(e){return new Proxy(e,{get:(e,t,r)=>"string"!=typeof t||isNaN(t)?"length"===t?e.filter((e=>!e._isDeleted)).length:"function"==typeof e[t]?(...r)=>e.filter((e=>!e._isDeleted))[t](...r):Reflect.get(e,t,r):e.filter((e=>!e._isDeleted))[t]})}_newId(){return(new s).toString()}_createDraftProxy(e,t={},r={},n=[],o={},i={}){return new Proxy({},{get:(e,n)=>{if("string"==typeof n||"symbol"==typeof n){if(n in r){const e=r[n],t=o[n];return"function"==typeof t?t(e):e}if(t&&"object"==typeof t&&n in t){const e=t[n],r=o[n];return"function"==typeof r?r(e):e}}},set:(t,o,s)=>{if(!n.includes(o)){const t=`[DraftProxy] Le champ "${o}" n'est pas autorisé.`;if(i.throwOnError)throw new ApiValidationError(t,400,null,{field:o,value:s,allowedFields:n});return e._logger.warn(t),!1}const a=r[o];return a&&"object"==typeof a&&!0===a.__isSignal?a.value=s:r[o]=s,!0},deleteProperty:(e,t)=>!!n.includes(t)&&(delete r[t],!0),has:(e,n)=>n in r||n in t,ownKeys:()=>[...new Set([...Object.keys(t||{}),...Object.keys(r||{})])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}_extractWritableFields(e={},t={},r={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&r.visited.has(e.$id))return[];e.$id&&r.visited.add(e.$id),r.defs=e.$defs||e.definitions||r.defs;const n=[];if(e.$ref){const o=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),i=r.defs?.[o];i&&n.push(...this._extractWritableFields(i,t,r))}if(e.allOf&&e.allOf.forEach((e=>n.push(...this._extractWritableFields(e,t,r)))),e.if&&e.then){const o=e.if?.properties;let i=!0;if(o)for(const e in o){const r=o[e]?.const;if(t[e]!==r){i=!1;break}}i&&e.then?n.push(...this._extractWritableFields(e.then,t,r)):!i&&e.else&&n.push(...this._extractWritableFields(e.else,t,r))}return e.properties&&n.push(...Object.entries(e.properties).filter((([e,t])=>!0!==t.readOnly&&void 0===t.const)).map((([e])=>e))),[...new Set(n)]}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:r=null,constant:n,apiClient:o,transforms:i={},throwOnError:s=!0,removeFields:a=[]}){const c=Array.isArray(n)?n:[n],l={allOf:[],$defs:{}};for(const e of c){const t=o.getRequestSchema(e);if(!t)throw new ApiError(`Unable to find schema for ${e}.`);if(t.$defs)for(const[r,n]of Object.entries(t.$defs))l.$defs[r]?o._logger.warn(`Duplicate $defs key '${r}' from schema '${e}'`):l.$defs[r]=n;l.allOf.push(t)}let p=this._extractWritableFields(l,e);e.id&&-1===p.indexOf("id")&&p.push("id"),e.slug&&-1===p.indexOf("slug")&&p.push("slug"),p=p.filter((e=>!a.includes(e)));const u=Object.fromEntries(p.map((t=>{const r=e[t];return[t,"function"==typeof i[t]?i[t](r,e):r]})).filter((([e,t])=>void 0!==t))),d=structuredClone?structuredClone(u):JSON.parse(JSON.stringify(u)),m=v(r)?Object.assign(r,u):_(u),f=v(t)?t:t&&"object"==typeof t?_(t):t;return{draft:m,proxy:this._createDraftProxy(o,f,m,p,i,{throwOnError:s}),initial:d}}_extractChangedFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=c[e];JSON.stringify(t)!==JSON.stringify(n)&&(a[e]=t)}return Object.keys(a).length>0?a:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t?.contextId||t?.contextType!==e)throw new ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){throw t instanceof ApiResponseError?t?.responseData?.contextType!==e?t:new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData):t}return this.id}async _getPublicProfile(){return await this._resolveId(this.getEntityType()),this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:this.getEntityType()}})}_getEntityMeta(e){const t=this.constructor,r=this.__entityTag,n={EndpointApi:this.deps.EndpointApi,User:"User"===r?t:this.deps.User,Organization:"Organization"===r?t:this.deps.Organization,Project:"Project"===r?t:this.deps.Project,Event:"Event"===r?t:this.deps.Event,Poi:"Poi"===r?t:this.deps.Poi,Badge:"Badge"===r?t:this.deps.Badge,News:"News"===r?t:this.deps.News};return{citoyens:{entityClass:n.User,deps:n},organizations:{entityClass:n.Organization,deps:n},projects:{entityClass:n.Project,deps:n},events:{entityClass:n.Event,deps:{...n,Badge:void 0}},poi:{entityClass:n.Poi,deps:{...n,Badge:void 0,News:void 0}},news:{entityClass:n.News,deps:{...n}},badges:{entityClass:n.Badge,deps:{EndpointApi:n.EndpointApi,User:n.User,Organization:n.Organization,Project:n.Project}}}[e]||null}_linkEntity(e,t){const r=this._getEntityMeta(e);return r?r.entityClass.fromServerData(t,this,r.deps):t}async _linkEntityById(e,t,r={}){const n=this._getEntityMeta(e);if(!n)return null;const o=new n.entityClass(this,{id:t},n.deps);return r?.skipGet||await o.get(),o}_linkEntities(e){return e.flatMap((e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[])))}async linkEntitiesFromServerData(e,t={},r={}){const n=r.key||e,o="function"==typeof r.mapFn?r.mapFn:null,i=e=>!0===e||"true"===e,s=e=>!1===e||"false"===e,a=this.serverData?.[n],c=[];if(a&&"object"==typeof a&&Object.keys(a).length>0)for(const r of Object.keys(a)){const n=a[r],l=Object.entries(t).every((([e,t])=>{const r=n[e];if("function"==typeof t)try{return t(r)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof r&&t.test(r):"string"==typeof t&&"string"==typeof r?r.toLowerCase().includes(t.toLowerCase()):i(t)?i(r):s(t)?s(r):"string"!=typeof r||"string"!=typeof t||isNaN(Date.parse(r))||isNaN(Date.parse(t))?r===t:new Date(r).getTime()===new Date(t).getTime()}));if(l)try{const t=await this._linkEntityById(e,r);t&&(t.meta=n,c.push(o?o(t):t))}catch(t){this._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${r}) :`,t)}}return c}_entityInstanceData(e,t){const r=this._getEntityMeta(e),n=this.__entityTag,o=this.constructor;return new r.entityClass(this,t,{[n]:o,...r.deps})}async entity(e,t={}){try{const r=this._entityInstanceData(e,t),n={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"]}[e];return n&&this._hasAtLeastOne(t,n)&&await r.get(),r}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new ApiError("Le slug est requis.");try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t?.contextId&&t?.contextType)return await this.entity(t.contextType,{id:t.contextId});throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}_buildLinkFilters(e,{linkType:t,isAdmin:r,isAdminPending:n,isInviting:o,toBeValidated:i=!1,roles:s=[]}={}){if("string"!=typeof e)throw new TypeError("id doit être une chaîne.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("isInviting doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(s))throw new TypeError("roles doit être un tableau de chaînes.");const a=`links.${t}.${e}`,c={[`${a}`]:{$exists:!0}};return"boolean"==typeof i&&(c[`${a}.toBeValidated`]={$exists:i}),"boolean"==typeof o&&(c[`${a}.isInviting`]={$exists:o}),!0===r&&(c[`${a}.isAdmin`]={$exists:!0}),!0===n&&(c[`${a}.isAdminPending`]={$exists:!0}),s.length>0&&(c[`${a}.roles`]={$in:s}),c}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof ApiError)throw new ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.callIsMe((()=>this.endpointApi.connect(t)));return await this.userContext.refresh(),r}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async _submitLinkRequestAdmin(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const e=this._getLinkFromConnectedUser();if(!e){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"admin"},t=await this.callIsMe((()=>this.endpointApi.connect(e)));return await this.userContext.refresh(),t}if(e.isInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new ApiError("Vous êtes déjà en attente de validation pour devenir admin.");if(e.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async _acceptLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this._getLinkFromConnectedUser().isInviting){const e={parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.callIsMe((()=>this.endpointApi.linkValidate(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous n'avez pas d'invitation à valider.")}async _leaveLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.");const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.callIsMe((()=>this.endpointApi.disconnect(t)));return await this.userContext.refresh(),r}async get(){return this.apiClient.safeCall((async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}))}async updateSettings(e={}){return e.idEntity=this.id,e.typeEntity=this.getEntityType(),this.callIsConnected((()=>this.endpointApi.updateSettings(e)))}async updateDescription(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockDescription(e)))}async updateInfo(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockInfo(e)))}async updateSocial(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockSocial(e)))}async updateLocality(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockLocality(e)))}async updateSlug({slug:e}){try{await this.endpointApi.check({type:this.getEntityType(),id:this.id,slug:e})}catch(e){if(e instanceof ApiResponseError)throw new ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.data);throw e}return this.callIsConnected((()=>this.endpointApi.updateBlockSlug({typeElement:this.getEntityType(),id:this.id,slug:e})))}async updateImageProfil({profil_avatar:e}){e=await this._validateImage(e);const t={pathParams:{folder:this.getEntityType(),ownerId:this.id},profil_avatar:e};return this.callIsConnected((()=>this.endpointApi.profilImage(t)))}async organization(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.");return this.entity("organizations",e)}async project(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un projet.");return this.entity("projects",e)}async poi(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un POI.");return this.entity("poi",e)}async event(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un événement.");return this.entity("events",e)}async badge(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un badge.");return this.entity("badges",e)}async news(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.");return this.entity("news",e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e))())}).next()}async getProjects(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getProjectsAdmin(e))):()=>this.endpointApi.getProjectsNoAdmin(e))())}).next()}async getPois(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getPoisAdmin(e))):()=>this.endpointApi.getPoisNoAdmin(e))())}).next()}async getSubscribers(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){e.pathParams={type:this.getEntityType(),id:this.id};const t=await this.endpointApi.getNews(e);if(!Array.isArray(t))throw new ApiResponseError("Erreur lors de la récupération des actualités.",500,t);const r=this._linkEntities(t);return this._createFilteredProxy(r)}async requestToJoin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async acceptInvitation(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour suivre cette entité.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id},t=await this.callIsMe((()=>this.endpointApi.follow(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous êtes déjà abonné à cette entité.")}async unfollow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour vous désabonner.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.callIsMe((()=>this.endpointApi.disconnect(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous n'êtes pas abonné à cette entité.")}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new ApiError(`Vous devez être connecté pour ${e}`);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:r}=e;return!t&&!r}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`)}_isLinked(e){return!!this.userContext?.serverData?.links?.[e]?.[this.id]}isAuthor(){if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new ApiError("Aucune donnée serveur disponible.");return this.userId&&this.serverData?.creator===this.userId}isAdmin(){this._checkAccess("vérifier l'administrateur."),this._assertEntityType("organizations","projects","events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)&&!0===e?.isAdmin&&!e?.isAdminPending}isAuthorOrAdmin(){return this._checkAccess("vérifier l'auteur ou l'administrateur."),this.isAuthor()||this.isAdmin()}isMember(){this._checkAccess("vérifier le membre."),this._assertEntityType("organizations");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isContributor(){this._checkAccess("vérifier le contributeur."),this._assertEntityType("projects");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isAttendee(){this._checkAccess("vérifier si vous êtes un participant."),this._assertEntityType("events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){return this._checkAccess("vérifier si il vous suit."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("followers")}isFollowing(){return this._checkAccess("vérifier si vous le suivez."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("follows")}async getCostumJson(){if(!this.serverData.slug)throw new ApiError("slug de l'entité non défini");const e={pathParams:{slug:this.serverData.slug}};return this.endpointApi.getCostumJson(e)}_generateRanges(e,t,r={}){const n={};for(const o of e){const e=r[o]||{indexMax:0};n[o]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return n}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce(((e,t)=>e+("number"==typeof t?t:0)),0),e}_getDefaultFromEndpoint(e,t){const r=this.apiClient._endpoints.find((t=>t.constant===e));if(r?.request?.properties?.[t])return r.request.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t}){const r=this,n={cursor:void 0,count:0,index:0,history:[],sizes:[]},o=e=>e?.indexStep&&e.indexStep>0;async function i(s=!1){let a={...e};n.cursor&&(s||0!==n.history.length)||(n.count=0,n.index=0,n.history=[],n.sizes=[],a.countType=a.searchType,!a?.searchBy&&o(a)?(a.ranges=r._generateRanges(a.searchType,a.indexStep),a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep):"ALL"===a?.searchBy&&o(a)&&(a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep),n.cursor={...a});const c=n.cursor;if(s&&(n.history.push({...c}),!c.searchBy&&o(c)?(c.ranges=r._generateRanges(c.searchType,c.indexStep,c.ranges),c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep):"ALL"===c.searchBy&&o(c)&&(c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep),n.cursor={...c}),a={...n.cursor},!(s||a?.searchType&&Array.isArray(a.searchType)&&0!==a.searchType.length))throw new Error("searchType non défini");const l=await t(a);if(!Array.isArray(l.results))throw new Error("Les résultats doivent être un tableau");n.count+=l.results.length,n.sizes.push(l.results.length),s&&n.index++;const p=r._normalizeCount(l.count),u=r._linkEntities(l.results),d=o(a)&&n.count<p.total,m=n.history.length>0;return{count:p,results:u,pageIndex:n.index,pageNumber:n.index+1,hasNext:d,hasPrev:m,next:d?()=>i(!0):void 0,prev:m?async()=>{const e=n.history.pop(),t=n.sizes.pop()??0;return n.count-=t,n.index=Math.max(0,n.index-1),n.cursor={...e},i(!1)}:void 0}}return{next:()=>i(!1)}}_withCostumContext(e){return async t=>{const r={...t,costumSlug:this.serverData.slug,contextId:this.serverData.id,contextType:this.getEntityType(),sourceKey:[...t.sourceKey||[],this.serverData.slug]};return e(r)}}async searchCostum(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.globalAutocompleteCostum(e)))}).next()}async costumEventRequestActors(e={}){e={pathParams:{id:this.id,type:this.getEntityType()},...e};const t=this._withCostumContext((e=>this.endpointApi.costumEventRequestActors(e)));return await t(e)}async costumEventRequestSubevents(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestSubevents(e)))(e)}async costumEventRequestDates(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestDates(e)))(e)}async costumEventRequestElementEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestElementEvent(e)))(e)}async costumEventRequestCategories(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestCategories(e)))(e)}async costumEventRequestEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestEvent(e)))(e)}async costumEventRequestLinkTlToEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestLinkTlToEvent(e)))(e)}async costumEventRequestLoadContextTag(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestLoadContextTag(e)))(e)}};class Badge extends O{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];transforms={};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Badge.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Badge.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`)}async getSubscribers(){throw new ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`)}}const P=class EndpointApi{constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.");return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.");return this.call(e,t)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deletePoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_POI",e)}async deleteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}};class Event extends O{static entityType="events";static entityTag="Event";static SCHEMA_CONSTANTS=["ADD_EVENT"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=["typeElement"];transforms={};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Event.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Event.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addEvent(e={}){return this.isMe||e.organizer||(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addEvent(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class News extends O{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=[];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map((e=>({...e,count:parseInt(e.count)}))):[],mediaImg:e=>{const t=e?.images?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:void 0},mediaFile:e=>{const t=e?.files?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:void 0}};async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.");const e=await this.callIsConnected((()=>this.endpointApi.getNewsById({ids:[this.id]})));if(e&&Array.isArray(e)&&1===e.length){const t=e[0];return this._setData(t),this.serverData}throw new ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`)}async _add(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),e.parentId=this.parent.id,e.parentType=this.parent.getEntityType();for(const[t,r]of News.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}}async _update(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),e.parentId=this.parent.id,e.parentType=this.parent.getEntityType(),e.idNews=this.id;let t=!1;const r=await this.callIsConnected((()=>this.endpointApi.updateNews(e)));return r?.object&&(this._serverData={...r.object}),t=!0,!0}async addNews(e={}){return this.callIsConnected((()=>this.endpointApi.addNews(e)))}async updateNews(e={}){return this.callIsConnected((()=>this.endpointApi.updateNews(e)))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.");const r=await this.entity("citoyens",{id:t,slug:e}),n=r.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find((e=>e.id===n.id)))return this._draftData.mentions=this._draftData.mentions.map((e=>(e.id===n.id&&(e.count+=1),e))),this._draftData.mentions;const o={id:n.id,slug:n.slug,type:r.getEntityType(),name:n.name,value:n.name,count:1};return this._draftData.mentions.push(o),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){e=await this._validateImage(e);const t={pathParams:{folder:this.parent.getEntityType(),ownerId:this.parent.id},newsImage:e},r=await this.callIsConnected((()=>this.endpointApi.addImageNews(t)));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(r.id)):this._draftData.mediaImg={countImages:1,images:[r.id]},r}async addFile(e){e=await this._validateFile(e);const t={pathParams:{folder:this.parent.getEntityType(),ownerId:this.parent.id},newsFile:e},r=await this.callIsConnected((()=>this.endpointApi.addFileNews(t)));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(r)):this._draftData.mediaFile={countFiles:1,files:[r]},r}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une news.");const e={pathParams:{id:this.id}};await this.callIsConnected((()=>this.endpointApi.deleteNews(e))),this._draftData={},this._serverData=null,this._draftData.id=null,this._isDeleted=!0}}class Organization extends O{static entityType="organizations";static entityTag="Organization";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Organization.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Organization.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addOrganization(e={}){return this.callIsConnected((()=>this.endpointApi.addOrganization(e)))}async getOrganizations(){throw new ApiError("getOrganizations n'existe pas dans Organization")}async getProjects(e={}){return super.getProjects(e)}async getEvents(){throw new ApiError("getEvents pas encore implémenté dans Organization")}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isAdminPending:o,isInviting:i,roles:s=[]}=t;return this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"memberOf",toBeValidated:r,isAdmin:n,isAdminPending:o,isInviting:i,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"memberOf",toBeValidated:!1,isAdmin:n,isInviting:i,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getMembersAdmin(e))):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e={}){return super.searchCostum(e)}}class Poi extends O{static entityType="poi";static entityTag="Poi";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Poi.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAuthor())throw new ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Poi.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addPoi(e={}){return this.isMe||(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addPoi(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends O{static entityType="projects";static entityTag="Project";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal,parent:e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{type:t?.type??null,name:t?.name??null}]))):null};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Project.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Project.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addProject(e={}){return this.isMe||(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addProject(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(e={}){return super.getProjects(e)}async getEvents(){throw new ApiError(`getEvents pas encore implémenté dans ${this.constructor.name}`)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getContributorsAdmin(e))):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class User extends O{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};constructor(e,t={},r={}){if(!r.EndpointApi)throw new ApiError("EndpointApi class must be injected to avoid circular dependency.");if(!t?.id&&!t?.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.");if(!r.Organization)throw new ApiError("Organization class must be injected.");if(!r.Project)throw new ApiError("Project class must be injected.");if(!r.Event)throw new ApiError("Event class must be injected.");if(!r.Poi)throw new ApiError("Poi class must be injected.");if(!r.Badge)throw new ApiError("Badge class must be injected.");if(!r.News)throw new ApiError("News class must be injected.");super(e,t,r)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}async get(){return this.apiClient.safeCall((async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e),e}{const e=await this._getPublicProfile();return this._setData(e),e}}))}async changePassword(e={}){return this.callIsMe((()=>this.endpointApi.changePassword(e)))}async delete(e={}){return this.callIsMe((()=>this.endpointApi.deleteAccount(e)))}async save(){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.");await super.save()}async _add(){throw new ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.")}async _update(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of User.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}static fromServerData(e,t,r){const n=new User(t.apiClient,e,r);return("object"==typeof e||Object.keys(e).length>0)&&n._setData(e),n}async updateSettings(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.");await super.updateSettings(e),await this.refresh()}async updateDescription(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.");return super.updateDescription(e)}async updateInfo(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.");return super.updateInfo(e)}async updateSocial(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.");return super.updateSocial(e)}async updateLocality(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.");return super.updateLocality(e)}async updateSlug({slug:e}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.");return super.updateSlug({slug:e})}async updateImageProfil({profil_avatar:e}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.");return super.updateImageProfil({profil_avatar:e})}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getProjects(e={}){return super.getProjects(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,this.isMe||(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getSubscriptionsAdmin(e))):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async user(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur");if(!e.id&&!e.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.");const t=new User(this,e,this.deps);return await t.get(),t}async organization(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.");return super.organization(e)}async project(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.");return super.project(e)}async news(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.");return super.news(e)}async poi(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.");return super.poi(e)}async event(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.");return super.event(e)}async badge(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.");return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour envoyer une demande d'amis.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.connect(t);return await this.userContext.refresh(),r}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async acceptFriendRequest(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour accepter une demande d'amitié.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await this.userContext.refresh(),t}throw new ApiError("Vous n'avez pas d'invitation à valider.")}async removeFriend(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour supprimer un ami.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.");const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.disconnect(t);return await this.userContext.refresh(),r}requestToJoin(){throw new ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.")}requestToJoinAdmin(){throw new ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.")}acceptInvitation(){throw new ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.")}leave(){throw new ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.")}async follow(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour suivre un utilisateur.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await this.userContext.refresh(),t}throw new ApiError("Vous êtes déjà abonné à cet utilisateur.")}async unfollow(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await this.userContext.refresh(),t}throw new ApiError("Vous n'êtes pas abonné à cet utilisateur.")}isFriend(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous êtes ami.");this._assertEntityType("citoyens");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si il vous suit.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous le suivez.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);return this._assertEntityType("citoyens"),this._isLinked("follows")}}Object.assign(User.prototype,{});var $=__webpack_require__(7007);const x=(e,t)=>1===t?e:`${e}s`,k=e=>{if(""===e)return"$";const t=e.substring(1).split(/\//).map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~").replace(/\./g,"\\."))).map((e=>/^\d+$/.exec(e)?`[${e}]`:`.${e}`)).join("");return"$"+t},j=e=>{switch(e[0]){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}},I=(e,t="and")=>0===e.length?"nothing":1===e.length?e[0]:2===e.length?`${e[0]} ${t} ${e[1]}`:`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`,C={"date-time":"date and time",time:"time",date:"date",email:"email address",hostname:"hostname",ipv4:"IPv4 address",ipv6:"IPv6 address",uri:"URI","uri-reference":"URI Reference","uri-template":"URI-template","json-pointer":"JSON Pointer","relative-json-pointer":"relative JSON Pointer",regex:"regular expression"},N={fieldLabels:"title",includeOriginalError:!1,includeData:!1};class AjvError extends Error{constructor(e,t={}){super(),this.options={},this.redundant=!1,this.options={...N,...t},this.pointer=e.instancePath,this.path=k(e.instancePath);const r=(({data:e,keyword:t,message:r,params:n,parentSchema:o,schemaPath:i,instancePath:s},{fieldLabels:a})=>{const c=(({instancePath:e,parentSchema:t},{fieldLabels:r})=>{switch(r){case"js":return""===e?"the root value":`the value at ${k(e).replace(/^\$/,"")}`;case"jsonPath":return`the value at ${k(e)}`;case"jsonPointer":case"instancePath":return""===e?"the root value":`the value at ${e}`;case"title":return(null==t?void 0:t.title)?t.title:""===e?"the root value":`the value at ${e}`;default:throw new Error(`invalid fieldLabels value: ${r}`)}})({instancePath:s,parentSchema:o},{fieldLabels:a});if(null==o?void 0:o.errorMessage)return`${c} ${o.errorMessage}`;switch(t){case"enum":{const e=n.allowedValues.map(JSON.stringify);return`${c} must be one of: ${I(e,"or")}`}case"type":{const t=Array.isArray(n.type)?n.type:n.type.split(","),r=I(t,"or"),o=(e=>{const t=typeof e;switch(t){case"object":return null===e?"null":Array.isArray(e)?"an array":"an object";case"undefined":return"undefined";default:return`${j(t)} ${t}`}})(e);return`${c} must be ${j(r)} ${r} but it was ${o}`}case"minLength":{const t=n.limit,r=x("character",t),o=e.length;return`${c} must be ${t} ${r} or more but it was ${o} ${x("character",o)}`}case"maxLength":{const t=n.limit,r=x("character",t),o=e.length;return`${c} must be ${t} ${r} or fewer but it was ${o} ${x("character",o)}`}case"pattern":{if(i.endsWith("propertyNames/pattern"))return null;const e=null==o?void 0:o.patternLabel;return e?`${c} must be ${e} but it was not`:`${c} is an invalid string`}case"format":return`${c} must be a valid ${C[n.format]||n.format} string but it was not`;case"multipleOf":return`${c} must be a multiple of ${n.multipleOf}`;case"minimum":return`${c} must be equal to or greater than ${n.limit}`;case"exclusiveMinimum":return`${c} must be greater than ${n.limit}`;case"maximum":return`${c} must be equal to or less than ${n.limit}`;case"exclusiveMaximum":return`${c} must be less than ${n.limit}`;case"additionalProperties":{const e=Object.keys(null==o?void 0:o.properties).join(", ");return`${c} has an unexpected property, ${n.additionalProperty}, which is not in the list of allowed properties (${e})`}case"required":return`${c} is missing the required field '${n.missingProperty}'`;case"propertyNames":return`${c} has an invalid property name ${JSON.stringify(n.propertyName)}`;case"minProperties":return`${c} must have ${n.limit} or more properties but it has ${Object.keys(e).length}`;case"maxProperties":return`${c} must have ${n.limit} or fewer properties but it has ${Object.keys(e).length}`;case"dependencies":{const e=n.property;return`${c} must have property ${n.missingProperty} when ${e} is present`}case"minItems":return`${c} must have ${n.limit} or more items but it has ${e.length}`;case"maxItems":return`${c} must have ${n.limit} or fewer items but it has ${e.length}`;case"uniqueItems":{const{i:e,j:t}=n;return`${c} must be unique but elements ${t} and ${e} are the same`}default:return`${c} ${r}`}})(e,this.options);var n;null!==r?(this.message=`${n=r,"string"!=typeof n||0===n.length?n:n.charAt(0).toUpperCase()+n.slice(1)}.`,this.options.includeOriginalError&&(this.original=e),this.options.includeData&&(this.data=e.data)):this.redundant=!0}toJSON(){const e={path:this.path,pointer:this.pointer,message:this.message};return this.options.includeOriginalError&&(e.original=this.original),this.options.includeData&&(e.data=this.data),e}}class AggregateAjvError extends Error{constructor(e,t={}){super(),this.name="AggregateAjvError",this.errors=(null!=e?e:[]).map((e=>new AjvError(e,t))).filter((e=>!e.redundant)),this.message=this.errors.map((e=>e.message)).join(" ")}toJSON(){return this.errors.map((e=>e.toJSON()))}*[Symbol.iterator](){for(const e of this.errors)yield e}}var R=__webpack_require__(3282),D=__webpack_require__(8182);function L(e,t){return function(){return e.apply(t,arguments)}}const{toString:M}=Object.prototype,{getPrototypeOf:z}=Object,{iterator:q,toStringTag:B}=Symbol,U=(F=Object.create(null),e=>{const t=M.call(e);return F[t]||(F[t]=t.slice(8,-1).toLowerCase())});var F;const V=e=>(e=e.toLowerCase(),t=>U(t)===e),G=e=>t=>typeof t===e,{isArray:K}=Array,J=G("undefined"),H=V("ArrayBuffer"),Z=G("string"),W=G("function"),Q=G("number"),Y=e=>null!==e&&"object"==typeof e,X=e=>{if("object"!==U(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||B in e||q in e)},ee=V("Date"),te=V("File"),re=V("Blob"),ne=V("FileList"),oe=V("URLSearchParams"),[ie,se,ae,ce]=["ReadableStream","Request","Response","Headers"].map(V);function le(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),K(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(n=0;n<i;n++)s=o[n],t.call(null,e[s],s,e)}}function pe(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,de=e=>!J(e)&&e!==ue,me=(fe="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>fe&&e instanceof fe);var fe;const he=V("HTMLFormElement"),ye=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ge=V("RegExp"),we=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};le(r,((r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},_e=V("AsyncFunction"),ve=(be="function"==typeof setImmediate,Ee=W(ue.postMessage),be?setImmediate:Ee?(Te=`axios@${Math.random()}`,Se=[],ue.addEventListener("message",(({source:e,data:t})=>{e===ue&&t===Te&&Se.length&&Se.shift()()}),!1),e=>{Se.push(e),ue.postMessage(Te,"*")}):e=>setTimeout(e));var be,Ee,Te,Se;const Ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ue):"undefined"!=typeof process&&process.nextTick||ve,Oe={isArray:K,isArrayBuffer:H,isBuffer:function(e){return null!==e&&!J(e)&&null!==e.constructor&&!J(e.constructor)&&W(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||W(e.append)&&("formdata"===(t=U(e))||"object"===t&&W(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&H(e.buffer),t},isString:Z,isNumber:Q,isBoolean:e=>!0===e||!1===e,isObject:Y,isPlainObject:X,isReadableStream:ie,isRequest:se,isResponse:ae,isHeaders:ce,isUndefined:J,isDate:ee,isFile:te,isBlob:re,isRegExp:ge,isFunction:W,isStream:e=>Y(e)&&W(e.pipe),isURLSearchParams:oe,isTypedArray:me,isFileList:ne,forEach:le,merge:function e(){const{caseless:t}=de(this)&&this||{},r={},n=(n,o)=>{const i=t&&pe(r,o)||o;X(r[i])&&X(n)?r[i]=e(r[i],n):X(n)?r[i]=e({},n):K(n)?r[i]=n.slice():r[i]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&le(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(le(t,((t,n)=>{r&&W(t)?e[n]=L(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==r&&z(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:U,kindOfTest:V,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!Q(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[q]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:he,hasOwnProperty:ye,hasOwnProp:ye,reduceDescriptors:we,freezeMethods:e=>{we(e,((t,r)=>{if(W(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];W(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return K(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:pe,global:ue,isContextDefined:de,isSpecCompliantForm:function(e){return!!(e&&W(e.append)&&"FormData"===e[B]&&e[q])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=K(e)?[]:{};return le(e,((e,t)=>{const i=r(e,n+1);!J(i)&&(o[t]=i)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:_e,isThenable:e=>e&&(Y(e)||W(e))&&W(e.then)&&W(e.catch),setImmediate:ve,asap:Ae,isIterable:e=>null!=e&&W(e[q])};function Pe(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Oe.inherits(Pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Oe.toJSONObject(this.config),code:this.code,status:this.status}}});const $e=Pe.prototype,xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{xe[e]={value:e}})),Object.defineProperties(Pe,xe),Object.defineProperty($e,"isAxiosError",{value:!0}),Pe.from=(e,t,r,n,o,i)=>{const s=Object.create($e);return Oe.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Pe.call(s,e.message,t,r,n,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const ke=Pe;function je(e){return Oe.isPlainObject(e)||Oe.isArray(e)}function Ie(e){return Oe.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,r){return e?e.concat(t).map((function(e,t){return e=Ie(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ne=Oe.toFlatObject(Oe,{},null,(function(e){return/^is[A-Z]/.test(e)})),Re=function(e,t,r){if(!Oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Oe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Oe.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Oe.isSpecCompliantForm(t);if(!Oe.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Oe.isDate(e))return e.toISOString();if(!a&&Oe.isBlob(e))throw new ke("Blob is not supported. Use a Buffer instead.");return Oe.isArrayBuffer(e)||Oe.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(Oe.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Oe.isArray(e)&&function(e){return Oe.isArray(e)&&!e.some(je)}(e)||(Oe.isFileList(e)||Oe.endsWith(r,"[]"))&&(a=Oe.toArray(e)))return r=Ie(r),a.forEach((function(e,n){!Oe.isUndefined(e)&&null!==e&&t.append(!0===s?Ce([r],n,i):null===s?r:r+"[]",c(e))})),!1;return!!je(e)||(t.append(Ce(o,r,i),c(e)),!1)}const p=[],u=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:je});if(!Oe.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Oe.isUndefined(r)){if(-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));p.push(r),Oe.forEach(r,(function(r,i){!0===(!(Oe.isUndefined(r)||null===r)&&o.call(t,r,Oe.isString(i)?i.trim():i,n,u))&&e(r,n?n.concat(i):[i])})),p.pop()}}(e),t};function De(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Le(e,t){this._pairs=[],e&&Re(e,this,t)}const Me=Le.prototype;Me.append=function(e,t){this._pairs.push([e,t])},Me.toString=function(e){const t=e?function(t){return e.call(this,t,De)}:De;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ze=Le;function qe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,r){if(!t)return e;const n=r&&r.encode||qe;Oe.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Oe.isURLSearchParams(t)?t.toString():new ze(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ue=class InterceptorManager{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Oe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ve={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ge="undefined"!=typeof window&&"undefined"!=typeof document,Ke="object"==typeof navigator&&navigator||void 0,Je=Ge&&(!Ke||["ReactNative","NativeScript","NS"].indexOf(Ke.product)<0),He="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ze=Ge&&window.location.href||"http://localhost",We={...r,...Ve},Qe=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&Oe.isArray(n)?n.length:i,a?(Oe.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s):(n[i]&&Oe.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&Oe.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!s)}if(Oe.isFormData(e)&&Oe.isFunction(e.entries)){const r={};return Oe.forEachEntry(e,((e,n)=>{t(function(e){return Oe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},Ye={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Oe.isObject(e);if(o&&Oe.isHTMLForm(e)&&(e=new FormData(e)),Oe.isFormData(e))return n?JSON.stringify(Qe(e)):e;if(Oe.isArrayBuffer(e)||Oe.isBuffer(e)||Oe.isStream(e)||Oe.isFile(e)||Oe.isBlob(e)||Oe.isReadableStream(e))return e;if(Oe.isArrayBufferView(e))return e.buffer;if(Oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Re(e,new We.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return We.isNode&&Oe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Re(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(Oe.isString(e))try{return(0,JSON.parse)(e),Oe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ye.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Oe.isResponse(e)||Oe.isReadableStream(e))return e;if(e&&Oe.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw ke.from(e,ke.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Oe.forEach(["delete","get","head","post","put","patch"],(e=>{Ye.headers[e]={}}));const Xe=Ye,et=Oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tt=Symbol("internals");function rt(e){return e&&String(e).trim().toLowerCase()}function nt(e){return!1===e||null==e?e:Oe.isArray(e)?e.map(nt):String(e)}function ot(e,t,r,n,o){return Oe.isFunction(n)?n.call(this,t,r):(o&&(t=r),Oe.isString(t)?Oe.isString(n)?-1!==t.indexOf(n):Oe.isRegExp(n)?n.test(t):void 0:void 0)}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=rt(t);if(!o)throw new Error("header name must be a non-empty string");const i=Oe.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=nt(e))}const i=(e,t)=>Oe.forEach(e,((e,r)=>o(e,r,t)));if(Oe.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Oe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&et[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Oe.isObject(e)&&Oe.isIterable(e)){let r,n,o={};for(const t of e){if(!Oe.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Oe.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=rt(e)){const r=Oe.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Oe.isFunction(t))return t.call(this,e,r);if(Oe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=rt(e)){const r=Oe.findKey(this,e);return!(!r||void 0===this[r]||t&&!ot(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=rt(e)){const o=Oe.findKey(r,e);!o||t&&!ot(0,r[o],o,t)||(delete r[o],n=!0)}}return Oe.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ot(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Oe.forEach(this,((n,o)=>{const i=Oe.findKey(r,o);if(i)return t[i]=nt(n),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete t[o],t[s]=nt(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Oe.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Oe.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[tt]=this[tt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=rt(e);t[n]||(function(e,t){const r=Oe.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Oe.isArray(e)?e.forEach(n):n(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Oe.reduceDescriptors(AxiosHeaders.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Oe.freezeMethods(AxiosHeaders);const it=AxiosHeaders;function st(e,t){const r=this||Xe,n=t||r,o=it.from(n.headers);let i=n.data;return Oe.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function at(e){return!(!e||!e.__CANCEL__)}function ct(e,t,r){ke.call(this,null==e?"canceled":e,ke.ERR_CANCELED,t,r),this.name="CanceledError"}Oe.inherits(ct,ke,{__CANCEL__:!0});const lt=ct;function pt(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new ke("Request failed with status code "+r.status,[ke.ERR_BAD_REQUEST,ke.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const ut=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[s];o||(o=c),r[i]=a,n[i]=c;let p=s,u=0;for(;p!==i;)u+=r[p++],p%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(r=e,n||(n=setTimeout((()=>{n=null,s(r)}),i-a)))},()=>r&&s(r)]}((r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,c=o(a);n=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),r)},dt=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},mt=e=>(...t)=>Oe.asap((()=>e(...t))),ft=We.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,We.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(We.origin),We.navigator&&/(msie|trident)/i.test(We.navigator.userAgent)):()=>!0,ht=We.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];Oe.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Oe.isString(n)&&s.push("path="+n),Oe.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function yt(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const gt=e=>e instanceof it?{...e}:e;function wt(e,t){t=t||{};const r={};function n(e,t,r,n){return Oe.isPlainObject(e)&&Oe.isPlainObject(t)?Oe.merge.call({caseless:n},e,t):Oe.isPlainObject(t)?Oe.merge({},t):Oe.isArray(t)?t.slice():t}function o(e,t,r,o){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Oe.isUndefined(t))return n(void 0,t)}function s(e,t){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>o(gt(e),gt(t),0,!0)};return Oe.forEach(Object.keys(Object.assign({},e,t)),(function(n){const i=c[n]||o,s=i(e[n],t[n],n);Oe.isUndefined(s)&&i!==a||(r[n]=s)})),r}const _t=e=>{const t=wt({},e);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=it.from(a),t.url=Be(yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Oe.isFormData(n))if(We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(r=a.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(We.hasStandardBrowserEnv&&(o&&Oe.isFunction(o)&&(o=o(t)),o||!1!==o&&ft(t.url))){const e=i&&s&&ht.read(s);e&&a.set(i,e)}return t},vt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=_t(e);let o=n.data;const i=it.from(n.headers).normalize();let s,a,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=n;function f(){l&&l(),p&&p(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function y(){if(!h)return;const n=it.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());pt((function(e){t(e),f()}),(function(e){r(e),f()}),{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(r(new ke("Request aborted",ke.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new ke("Network Error",ke.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Fe;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new ke(t,o.clarifyTimeoutError?ke.ETIMEDOUT:ke.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&Oe.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),Oe.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),u&&"json"!==u&&(h.responseType=n.responseType),m&&([c,p]=ut(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([a,l]=ut(d),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new lt(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===We.protocols.indexOf(g)?r(new ke("Unsupported protocol "+g+":",ke.ERR_BAD_REQUEST,e)):h.send(o||null)}))},bt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ke?t:new lt(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new ke(`timeout ${t} of ms exceeded`,ke.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=n;return a.unsubscribe=()=>Oe.asap(s),a}},Et=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Tt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Et(r,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let i=n.byteLength;if(r){let e=s+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},St="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,At=St&&"function"==typeof ReadableStream,Ot=St&&("function"==typeof TextEncoder?(Pt=new TextEncoder,e=>Pt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Pt;const $t=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},xt=At&&$t((()=>{let e=!1;const t=new Request(We.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),kt=At&&$t((()=>Oe.isReadableStream(new Response("").body))),jt={stream:kt&&(e=>e.body)};var It;St&&(It=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!jt[e]&&(jt[e]=Oe.isFunction(It[e])?t=>t[e]():(t,r)=>{throw new ke(`Response type '${e}' is not supported`,ke.ERR_NOT_SUPPORT,r)})})));const Ct={http:null,xhr:vt,fetch:St&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:p,withCredentials:u="same-origin",fetchOptions:d}=_t(e);l=l?(l+"").toLowerCase():"text";let m,f=bt([o,i&&i.toAbortSignal()],s);const h=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let y;try{if(c&&xt&&"get"!==r&&"head"!==r&&0!==(y=await(async(e,t)=>{const r=Oe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Oe.isBlob(e))return e.size;if(Oe.isSpecCompliantForm(e)){const t=new Request(We.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Oe.isArrayBufferView(e)||Oe.isArrayBuffer(e)?e.byteLength:(Oe.isURLSearchParams(e)&&(e+=""),Oe.isString(e)?(await Ot(e)).byteLength:void 0)})(t):r})(p,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});if(Oe.isFormData(n)&&(e=r.headers.get("content-type"))&&p.setContentType(e),r.body){const[e,t]=dt(y,ut(mt(c)));n=Tt(r.body,65536,e,t)}}Oe.isString(u)||(u=u?"include":"omit");const o="credentials"in Request.prototype;m=new Request(t,{...d,signal:f,method:r.toUpperCase(),headers:p.normalize().toJSON(),body:n,duplex:"half",credentials:o?u:void 0});let i=await fetch(m);const s=kt&&("stream"===l||"response"===l);if(kt&&(a||s&&h)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Oe.toFiniteNumber(i.headers.get("content-length")),[r,n]=a&&dt(t,ut(mt(a),!0))||[];i=new Response(Tt(i.body,65536,r,(()=>{n&&n(),h&&h()})),e)}l=l||"text";let g=await jt[Oe.findKey(jt,l)||"text"](i,e);return!s&&h&&h(),await new Promise(((t,r)=>{pt(t,r,{data:g,headers:it.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:m})}))}catch(t){if(h&&h(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ke("Network Error",ke.ERR_NETWORK,e,m),{cause:t.cause||t});throw ke.from(t,t&&t.code,e,m)}})};Oe.forEach(Ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Nt=e=>`- ${e}`,Rt=e=>Oe.isFunction(e)||null===e||!1===e,Dt=e=>{e=Oe.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i<t;i++){let t;if(r=e[i],n=r,!Rt(r)&&(n=Ct[(t=String(r)).toLowerCase()],void 0===n))throw new ke(`Unknown adapter '${t}'`);if(n)break;o[t||"#"+i]=n}if(!n){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let r=t?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new ke("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new lt(null,e)}function Mt(e){return Lt(e),e.headers=it.from(e.headers),e.data=st.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Dt(e.adapter||Xe.adapter)(e).then((function(t){return Lt(e),t.data=st.call(e,e.transformResponse,t),t.headers=it.from(t.headers),t}),(function(t){return at(t)||(Lt(e),t&&t.response&&(t.response.data=st.call(e,e.transformResponse,t.response),t.response.headers=it.from(t.response.headers))),Promise.reject(t)}))}const zt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{zt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const qt={};zt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.9.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new ke(n(o," has been removed"+(t?" in "+t:"")),ke.ERR_DEPRECATED);return t&&!qt[o]&&(qt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},zt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Bt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new ke("options must be an object",ke.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const t=e[i],r=void 0===t||s(t,i,e);if(!0!==r)throw new ke("option "+i+" must be "+r,ke.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new ke("Unknown option "+i,ke.ERR_BAD_OPTION)}},validators:zt},Ut=Bt.validators;class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new Ue,response:new Ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=wt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Bt.assertOptions(r,{silentJSONParsing:Ut.transitional(Ut.boolean),forcedJSONParsing:Ut.transitional(Ut.boolean),clarifyTimeoutError:Ut.transitional(Ut.boolean)},!1),null!=n&&(Oe.isFunction(n)?t.paramsSerializer={serialize:n}:Bt.assertOptions(n,{encode:Ut.function,serialize:Ut.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Bt.assertOptions(t,{baseUrl:Ut.spelling("baseURL"),withXsrfToken:Ut.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Oe.merge(o.common,o[t.method]);o&&Oe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=it.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let p,u=0;if(!a){const e=[Mt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(u=0;u<p;){const e=s[u++],t=s[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Mt.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Be(yt((e=wt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Oe.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(wt(r||{},{method:e,url:t,data:(r||{}).data}))}})),Oe.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(wt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Axios.prototype[e]=t(),Axios.prototype[e+"Form"]=t(!0)}));const Ft=Axios;class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new lt(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken((function(t){e=t})),cancel:e}}}const Vt=CancelToken,Gt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gt).forEach((([e,t])=>{Gt[t]=e}));const Kt=Gt,Jt=function e(t){const r=new Ft(t),n=L(Ft.prototype.request,r);return Oe.extend(n,Ft.prototype,r,{allOwnKeys:!0}),Oe.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(wt(t,r))},n}(Xe);Jt.Axios=Ft,Jt.CanceledError=lt,Jt.CancelToken=Vt,Jt.isCancel=at,Jt.VERSION="1.9.0",Jt.toFormData=Re,Jt.AxiosError=ke,Jt.Cancel=Jt.CanceledError,Jt.all=function(e){return Promise.all(e)},Jt.spread=function(e){return function(t){return e.apply(null,t)}},Jt.isAxiosError=function(e){return Oe.isObject(e)&&!0===e.isAxiosError},Jt.mergeConfig=wt,Jt.AxiosHeaders=it,Jt.formToJSON=e=>Qe(Oe.isHTMLForm(e)?new FormData(e):e),Jt.getAdapter=Dt,Jt.HttpStatusCode=Kt,Jt.default=Jt;const Ht=Jt;var Zt=__webpack_require__(1111);const Wt="axios-retry";function Qt(e){return!e.response&&!!e.code&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&Zt(e)}const Yt=["get","head","options"],Xt=Yt.concat(["put","delete"]);function er(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}function tr(e){return!!e.config?.method&&er(e)&&-1!==Xt.indexOf(e.config.method)}function rr(e){return Qt(e)||tr(e)}function nr(e=void 0){const t=e?.response?.headers["retry-after"];if(!t)return 0;let r=1e3*(Number(t)||0);return 0===r&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}const or={retries:3,retryCondition:rr,retryDelay:function(e=0,t=void 0){return Math.max(0,nr(t))},shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function ir(e,t,r=!1){const n=function(e,t){return{...or,...t,...e[Wt]}}(e,t||{});return n.retryCount=n.retryCount||0,n.lastRequestTime&&!r||(n.lastRequestTime=Date.now()),e[Wt]=n,n}const sr=(e,t)=>{const r=e.interceptors.request.use((e=>(ir(e,t,!0),e[Wt]?.validateResponse&&(e.validateStatus=()=>!1),e))),n=e.interceptors.response.use(null,(async r=>{const{config:n}=r;if(!n)return Promise.reject(r);const o=ir(n,t);return r.response&&o.validateResponse?.(r.response)?r.response:await async function(e,t){const{retries:r,retryCondition:n}=e,o=(e.retryCount||0)<r&&n(t);if("object"==typeof o)try{return!1!==await o}catch(e){return!1}return o}(o,r)?async function(e,t,r,n){t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:s}=t,a=o(t.retryCount,r);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,n),!i&&n.timeout&&t.lastRequestTime){const e=Date.now()-t.lastRequestTime,o=n.timeout-e-a;if(o<=0)return Promise.reject(r);n.timeout=o}return n.transformRequest=[e=>e],await s(t.retryCount,r,n),n.signal?.aborted?Promise.resolve(e(n)):new Promise((t=>{const r=()=>{clearTimeout(o),t(e(n))},o=setTimeout((()=>{t(e(n)),n.signal?.removeEventListener&&n.signal.removeEventListener("abort",r)}),a);n.signal?.addEventListener&&n.signal.addEventListener("abort",r,{once:!0})}))}(e,o,r,n):(await async function(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}(o,r),Promise.reject(r))}));return{requestInterceptorId:r,responseInterceptorId:n}};sr.isNetworkError=Qt,sr.isSafeRequestError=function(e){return!!e.config?.method&&er(e)&&-1!==Yt.indexOf(e.config.method)},sr.isIdempotentRequestError=tr,sr.isNetworkOrIdempotentRequestError=rr,sr.exponentialDelay=function(e=0,t=void 0,r=100){const n=2**e*r,o=Math.max(n,nr(t));return o+.2*o*Math.random()},sr.linearDelay=function(e=100){return(t=0,r=void 0)=>{const n=t*e;return Math.max(n,nr(r))}},sr.isRetryableError=er;const ar=sr;class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";var cr=__webpack_require__(4874);const lr={_looksLikeObjectID:e=>24===e.length&&/^[0-9a-f]*$/.test(e),ObjectID:class ObjectID{constructor(e){if(e){if(e=e.toLowerCase(),!lr._looksLikeObjectID(e))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}}equals(e){return e instanceof lr.ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new lr.ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str.substr(0,8),16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}},pr=lr,ur={common1:{type:"string"},common2:{format:"email",type:"string"},common3:{type:"boolean"},common4:{format:"uri",type:"string"},common5:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common6:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common7:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},common8:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common9:{reason:{default:"",type:"string"}},common10:{default:"",type:"string"},common11:{pattern:"^[a-f0-9]{24}$",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common14:{value:{type:"boolean"}},common15:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common16:{},common17:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common18:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},common19:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},common20:{properties:{typeElement:{const:"citoyens"}}},common21:{typeElement:{const:"citoyens"}},common22:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}},common23:{not:{type:"null"}},common24:{type:"null"},common25:{default:"citoyens",enum:["citoyens","projects","organizations","poi"],type:"string"},common26:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common27:{items:{type:"string"},type:"array"},common28:{enum:[""],type:"string"},common29:{properties:{name:{not:{type:"null"}}},required:["name"]},common30:{name:{not:{type:"null"}}},common31:{properties:{url:{not:{type:"null"}}},required:["url"]},common32:{url:{not:{type:"null"}}},common33:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common34:{tags:{not:{type:"null"}}},common35:{properties:{email:{not:{type:"null"}}},required:["email"]},common36:{email:{not:{type:"null"}}},common37:{format:"date",type:"string"},common38:{const:"info",default:"info",type:"string"},common39:{$ref:"#/$defs/sharedFields/email"},common40:{$ref:"#/$defs/sharedFields/name"},common41:{$ref:"#/$defs/sharedFields/tags"},common42:{default:"citoyens",enum:["citoyens"],type:"string"},common43:{$ref:"#/$defs/sharedFields/url"},common44:{const:"projects"},common45:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common46:{name:{type:"string"},type:{type:"string"}},common47:{const:"organizations"},common48:{properties:{type:{not:{type:"null"}}},required:["type"]},common49:{type:{not:{type:"null"}}},common50:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common51:{enum:["poi"],type:"string"},common52:{$ref:"#/$defs/socialField"},common53:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common54:{id:{pattern:"^[a-f0-9]{24}$"}},common55:{pattern:"^[a-f0-9]{24}$"},common56:{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},common57:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},common58:{const:"PostalAddress",type:"string"},common59:{minLength:0,type:"string"},common60:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common61:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},common62:{const:"GeoCoordinates",type:"string"},common63:{type:["string","number"]},common64:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common65:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},common66:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},common67:{type:"number"},common68:{const:!0,default:!0,type:"boolean"},common69:{const:"Point",type:"string"},common70:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common71:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common72:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"},common73:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common74:{properties:{type:{const:"citoyens"}}},common75:{type:{const:"citoyens"}},common76:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},common77:{ownerId:{pattern:"^[a-f0-9]{24}$"}},common78:{properties:{folder:{const:"citoyens"}}},common79:{folder:{const:"citoyens"}},common80:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common81:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common82:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common83:{parentId:{pattern:"^[a-f0-9]{24}$"}},common84:{properties:{parentType:{const:"citoyens"}}},common85:{parentType:{const:"citoyens"}},common86:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common87:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common88:{default:!0,type:"boolean"},common89:{default:0,type:"integer"},common90:{required:["text"]},common91:{required:["mediaImg"]},common92:{required:["mediaFile"]},common93:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common94:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},common95:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common96:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},common97:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common98:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common99:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common100:{minimum:1,type:"integer"},common101:{default:"public",enum:["public","private","restricted"],type:"string"},common102:{const:"news",default:"news",type:"string"},common103:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common104:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},common105:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common106:{default:!1,type:"boolean"},common107:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common108:{childId:{pattern:"^[a-f0-9]{24}$"}},common109:{properties:{childType:{const:"citoyens"}}},common110:{childType:{const:"citoyens"}},common111:{const:"share",default:"share",type:"string"},common112:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common113:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common114:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"news",enum:["news"],type:"string"}},required:["type","id"],type:"object"},common115:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"news",enum:["news"],type:"string"}},common116:{default:"news",enum:["news"],type:"string"},common117:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common118:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common119:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common120:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],type:"string"},common121:{const:!1,default:!1,type:"boolean"},common122:{const:"",default:"",type:"string"},common123:{default:0,type:"number"},common124:{default:30,type:"number"},common125:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common126:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},common127:{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"},common128:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},common129:{enum:["cities","level1"],type:"string"},common130:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common131:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},common132:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common133:{indexMax:{type:"number"},indexMin:{type:"number"}},common134:{enum:["ALL"],type:"string"},common135:{default:0,minimum:0,type:"integer"},common136:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common137:{enum:["projects"],type:"string"},common138:{$exists:!0},common139:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common140:{$exists:{const:!0}},common141:{const:!0},common142:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common143:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},common144:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common145:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common146:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},common147:{$exists:!1},common148:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common149:{$exists:{const:!1}},common150:{const:!1},common151:{default:30,type:"integer"},common152:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common153:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common154:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common155:{$exists:{default:!1,type:"boolean"}},common156:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common157:{$in:{items:{type:"string"},minItems:1,type:"array"}},common158:{items:{type:"string"},minItems:1,type:"array"},common159:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common160:{enum:["citoyens"],type:"string"},common161:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common162:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},common163:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common164:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common165:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common166:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common167:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common168:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common169:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common170:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common171:{enum:["badges"],type:"string"},common172:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common173:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common174:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common175:{$exists:{const:!0,type:"boolean"}},common176:{const:!0,type:"boolean"},common177:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common178:{$exists:{const:!1,type:"boolean"}},common179:{const:!1,type:"boolean"},common180:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common181:{indexMax:30,indexMin:0},common182:{properties:{parentType:{const:"organizations"}}},common183:{parentType:{const:"organizations"}},common184:{properties:{parentType:{const:"projects"}}},common185:{parentType:{const:"projects"}},common186:{properties:{parentType:{const:"events"}}},common187:{parentType:{const:"events"}},common188:{const:"events"},common189:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common190:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common191:{enum:["citoyens","organizations","projects","events"],type:"string"},common192:{const:"citoyens",default:"citoyens",type:"string"},common193:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common194:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common195:{isOpenData:!0,isOpenEdition:!0},common196:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},common197:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common198:{"@userId":{type:"citoyens"}},common199:{type:"citoyens"},common200:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},common201:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},common202:{const:"poi",default:"poi",type:"string"},common203:{const:"events",default:"events",type:"string"},common204:{format:"date-time",type:"string"},common205:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},common206:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common207:{type:"integer"},common208:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common209:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},common210:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},common211:{const:"badges",default:"badges",type:"string"},common212:{const:"badge",default:"badge",type:"string"},common213:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common214:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},common215:{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"},common216:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},common217:{default:"",enum:["","admin"],type:"string"},common218:{enum:["projects","organizations"],type:"string"},common219:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},type:"array"},common220:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},common221:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common222:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},common223:{default:"events",type:"string"},common224:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common225:{properties:{id:{type:"string"}},required:["id"],type:"object"},common226:{id:{type:"string"}},common227:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common228:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}}},dr=[{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:ur.common1,email:ur.common2,isInvitation:ur.common3,mode:ur.common1,name:ur.common1,pendingUserId:ur.common1,pwd:ur.common1,username:ur.common1},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:ur.common2,password:ur.common1},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:ur.common1},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:ur.common2,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:ur.common4},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:ur.common1,newPassword2:ur.common1,oldPassword:ur.common1,scope:{default:"",type:["string"]},userId:ur.common5},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:ur.common6,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:ur.common8},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:ur.common11}},if:{properties:{typeEntity:ur.common12}},then:{properties:{idEntity:ur.common5}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:ur.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:ur.common12}},then:ur.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","private","feedback"]},typeEntity:{not:ur.common12}}},then:ur.common13}],properties:{idEntity:ur.common1,type:ur.common1,typeEntity:ur.common15,value:ur.common16},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[ur.common17,{anyOf:[{properties:{description:ur.common23},required:["description"]},{properties:{shortDescription:ur.common23},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:ur.common10,description:ur.common1,id:ur.common1,scope:{default:"",type:["string","null"]},shortDescription:ur.common1,typeElement:ur.common25},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:ur.common2,name:ur.common1,tags:ur.common26,url:ur.common4}},allOf:[{if:ur.common20,then:{additionalProperties:!1,anyOf:[ur.common29,{properties:{birthDate:ur.common23},required:["birthDate"]},{properties:{fixe:ur.common23},required:["fixe"]},{properties:{mobile:ur.common23},required:["mobile"]},ur.common31,ur.common33,ur.common35],properties:{birthDate:ur.common37,block:ur.common38,email:ur.common39,fixe:ur.common1,id:ur.common5,mobile:ur.common1,name:ur.common40,scope:ur.common10,tags:ur.common41,typeElement:ur.common42,url:ur.common43}}},{if:{properties:{typeElement:ur.common44}},then:{additionalProperties:!1,anyOf:[ur.common29,ur.common31,ur.common33,ur.common35,{properties:{avancement:ur.common23},required:["avancement"]},{properties:{parent:ur.common23},required:["parent"]}],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:ur.common38,email:ur.common39,id:ur.common1,name:ur.common40,parent:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":ur.common45},type:"object"},scope:ur.common10,tags:ur.common41,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:ur.common43}}},{if:{properties:{typeElement:ur.common47}},then:{additionalProperties:!1,anyOf:[ur.common29,ur.common31,ur.common33,ur.common35,ur.common48],properties:{block:ur.common38,email:ur.common39,id:ur.common1,name:ur.common40,scope:ur.common10,tags:ur.common41,type:{enum:["NGO","Cooperative","LocalBusiness","GovernmentOrganizationautre"],type:"string"},typeElement:{enum:["organizations"],type:"string"},url:ur.common43}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[ur.common29,ur.common31,ur.common33,ur.common35,ur.common48,{properties:{urls:ur.common23},required:["urls"]}],properties:{block:ur.common38,email:ur.common39,id:ur.common1,name:ur.common40,scope:ur.common10,tags:ur.common41,type:ur.common50,typeElement:ur.common51,url:ur.common43,urls:ur.common27}}}],properties:{block:ur.common38,id:ur.common1,scope:ur.common10,typeElement:ur.common25},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[ur.common28,ur.common4]}},allOf:[ur.common17,{anyOf:[{properties:{gitlab:ur.common23},required:["gitlab"]},{properties:{github:ur.common23},required:["github"]},{properties:{twitter:ur.common23},required:["twitter"]},{properties:{facebook:ur.common23},required:["facebook"]},{properties:{instagram:ur.common23},required:["instagram"]},{properties:{diaspora:ur.common23},required:["diaspora"]},{properties:{mastodon:ur.common23},required:["mastodon"]},{properties:{telegram:ur.common23},required:["telegram"]},{properties:{signal:ur.common23},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:ur.common52,facebook:ur.common52,github:ur.common52,gitlab:ur.common52,id:ur.common1,instagram:ur.common52,mastodon:ur.common52,scope:ur.common10,signal:ur.common52,telegram:ur.common52,twitter:ur.common52,typeElement:ur.common15},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:ur.common53,if:ur.common20,properties:{address:ur.common56,block:{const:"localities",default:"localities",type:"string"},geo:ur.common60,geoPosition:ur.common64,id:ur.common1,scope:ur.common10,typeElement:ur.common25},required:["block","typeElement","id","address"],then:ur.common70,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:ur.common53,if:ur.common20,properties:{block:ur.common38,id:ur.common1,scope:ur.common10,slug:ur.common73,typeElement:ur.common25},required:["block","typeElement","id","slug"],then:ur.common70,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:ur.common53,if:ur.common74,properties:{block:ur.common38,id:ur.common1,slug:ur.common73,type:ur.common15},required:["block","type","id","slug"],then:ur.common70,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:{additionalProperties:!1,else:ur.common76,if:ur.common78,properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:ur.common1},required:["folder","ownerId"],then:ur.common80,type:"object"},request:{additionalProperties:!1,properties:{profil_avatar:ur.common16},required:["profil_avatar"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:ur.common53,if:ur.common74,properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges"],type:"string"}},required:["type","id"],then:ur.common70,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:ur.common82,if:ur.common84,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:ur.common1},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:ur.common1,parentType:ur.common15},required:["parentId","parentType","listInvite"],then:ur.common86,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:ur.common53,if:ur.common74,properties:{id:ur.common1,isLive:ur.common88,type:ur.common15},required:["isLive","type","id"],then:ur.common70,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:ur.common89,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:ur.common10},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:{items:ur.common11,type:"array"}},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[ur.common90,ur.common91,ur.common92],else:ur.common82,if:ur.common84,properties:{json:ur.common68,markdownActive:ur.common88,mediaFile:ur.common93,mediaImg:ur.common95,mentions:ur.common97,parentId:ur.common1,parentType:ur.common15,scope:ur.common101,tags:ur.common26,text:ur.common1,type:ur.common102},required:["scope","markdownActive","parentId","parentType","type","json"],then:ur.common86,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:ur.common103,request:{additionalProperties:!1,properties:{newsImage:ur.common16},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}}/input/newsFile/docType/file",pathParams:ur.common103,request:{additionalProperties:!1,properties:{newsFile:ur.common16},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:ur.common105,request:{additionalProperties:!1,properties:{isLive:ur.common106},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[ur.common90,ur.common91,ur.common92],else:ur.common82,if:ur.common84,properties:{idNews:ur.common11,markdownActive:ur.common88,mediaFile:ur.common93,mediaImg:ur.common95,mentions:ur.common97,parentId:ur.common1,parentType:ur.common15,scope:ur.common101,tags:ur.common26,text:ur.common1,type:ur.common102},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:ur.common86,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:ur.common107,if:ur.common109,properties:{childId:ur.common11,childType:ur.common15,comment:ur.common1,connectType:ur.common111,parentId:ur.common11,parentType:ur.common102},required:["parentId","parentType","childId","childType","connectType"],then:ur.common112,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:ur.common114},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:ur.common10,contextId:ur.common11,contextType:ur.common116,mentions:ur.common117,parentCommentId:ur.common11,path:ur.common10,text:ur.common1},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:ur.common105},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:ur.common11,params:{properties:{mentions:ur.common117,text:ur.common1},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:ur.common1},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:ur.common114},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:ur.common120,type:"array"},fediverse:ur.common121,filters:ur.common122,indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common125,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchTags:ur.common27,searchType:{items:ur.common120,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:{minimum:0,type:"integer"},locality:ur.common122,name:ur.common1,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:ur.common106,scopeValue:ur.common1,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:ur.common135,name:ur.common1,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common136,fediverse:ur.common121,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":ur.common138,"parent.@userId":ur.common138},"links.contributors.@userId":ur.common138},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139},type:"object"}},required:["$or"],type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common136},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:ur.common142,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common136,fediverse:ur.common121,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":ur.common138,"parent.@{pathParams.id}":ur.common138},"links.contributors.@{pathParams.id}":ur.common138},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139},type:"object"}},required:["$or"],type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common136},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common144,fediverse:ur.common121,filters:{additionalProperties:!1,default:{"parent.@userId":ur.common138},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common144},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:ur.common142,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common144,fediverse:ur.common121,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":ur.common138},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common144},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common145,fediverse:ur.common121,filters:{additionalProperties:!1,default:{"links.members.@userId":ur.common138,"links.members.@userId.isInviting":ur.common147,"links.members.@userId.toBeValidated":ur.common147},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common148,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common148},type:"object"},indexMax:ur.common67,indexMin:ur.common135,indexStep:ur.common151,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common145},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,else:ur.common53,if:ur.common74,properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:ur.common70,type:"object"},request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common145,fediverse:ur.common121,filters:{additionalProperties:!1,default:{"links.members.@{pathParams.id}":ur.common138,"links.members.@{pathParams.id}.isInviting":ur.common147,"links.members.@{pathParams.id}.toBeValidated":ur.common147},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common148,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common148},type:"object"},indexMax:ur.common67,indexMin:ur.common135,indexStep:ur.common151,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common145},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common152,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common154,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":ur.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common148},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common152},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:ur.common105,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common152,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":ur.common138,"links.memberOf.@{pathParams.id}.isInviting":ur.common147,"links.memberOf.@{pathParams.id}.toBeValidated":ur.common147},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":ur.common139,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common154,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":ur.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common154},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common152},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:ur.common6,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common159,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":ur.common138,"links.friends.@{pathParams.id}.isInviting":ur.common147,"links.friends.@{pathParams.id}.toBeValidated":ur.common147},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common154,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common154},type:"object"},indexMin:ur.common135,indexStep:ur.common151,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,searchType:ur.common159},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common161,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[ur.common163],default:{"links.followers.@userId":ur.common138,"links.followers.@{userId}.isInviting":ur.common147,"links.followers.@{userId}.toBeValidated":ur.common147},patternProperties:ur.common166,type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common161},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:ur.common6,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common161,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[ur.common163],default:{"links.followers.@{pathParams.id}":ur.common138,"links.followers.@{pathParams.id}.isInviting":ur.common147,"links.followers.@{pathParams.id}.toBeValidated":ur.common147},patternProperties:ur.common166,type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common161},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common159,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[ur.common167],default:{"links.follows.@userId":ur.common138,"links.follows.@{userId}.isInviting":ur.common147,"links.follows.@{userId}.toBeValidated":ur.common147},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common148,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common148},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common159},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:ur.common53,if:ur.common74,then:ur.common70}],properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"}},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common159,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[ur.common167],default:{"links.follows.@{pathParams.id}":ur.common138},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139},type:"object"},indexMin:ur.common135,indexStep:ur.common151,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,searchType:ur.common159},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common152,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common154,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":ur.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common148},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common152},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:ur.common105,request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common152,fediverse:ur.common121,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":ur.common138,"links.projects.@{pathParams.id}.isInviting":ur.common147,"links.projects.@{pathParams.id}.toBeValidated":ur.common147},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":ur.common139,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common154,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":ur.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common154},type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common152},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common170,fediverse:ur.common121,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common139},type:"object"},isParcours:ur.common3,"preferences.private":ur.common121},required:["preferences.private"],type:"object"},indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:ur.common130,searchBy:ur.common134,searchType:ur.common170},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common68,countType:ur.common172,fediverse:ur.common121,fields:ur.common170,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common174}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common174,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":ur.common177,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":ur.common177}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:ur.common180},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:ur.common180,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":ur.common176}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":ur.common174}}],type:"object"},indexMin:ur.common135,indexStep:ur.common151,initType:ur.common122,locality:ur.common122,name:ur.common1,notSourceKey:ur.common68,ranges:{additionalProperties:!1,default:{Cooperative:ur.common181,GovernmentOrganization:ur.common181,Group:ur.common181,LocalBusiness:ur.common181,NGO:ur.common181,citoyens:ur.common181,projects:ur.common181},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":ur.common132},type:"object"},searchType:ur.common172},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:ur.common84,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:ur.common182,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:ur.common184,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:ur.common186,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:ur.common189,childType:ur.common190,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:ur.common11,parentType:ur.common191},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:ur.common84,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:ur.common182,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:ur.common184,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:ur.common186,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:ur.common189,childType:ur.common190,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:ur.common11,parentType:ur.common191},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:ur.common6},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:ur.common67},type:"object"},request:{additionalProperties:!1,properties:{collection:ur.common192,id:ur.common193,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:ur.common122},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:ur.common176,collection:ur.common192,id:ur.common193,path:{const:"preferences.search",default:"preferences.search",type:"string"},value:{additionalProperties:!1,properties:{description:ur.common1,locality:{patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:ur.common46,required:["name","type"]}},type:"object"},name:ur.common1,tags:ur.common27,url:ur.common1},required:["url","name"],type:"object"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common56,collection:{const:"organizations",default:"organizations",type:"string"},email:ur.common2,geo:ur.common60,geoPosition:ur.common64,id:ur.common11,key:{const:"organization",default:"organization",type:"string"},name:{minLength:3,type:"string"},preferences:ur.common194,role:{enum:["admin","member"],type:"string"},scope:ur.common122,shortDescription:ur.common1,tags:ur.common27,type:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},url:ur.common4},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common56,collection:{const:"projects",default:"projects",type:"string"},geo:ur.common60,geoPosition:ur.common64,id:ur.common11,key:{const:"project",default:"project",type:"string"},name:ur.common1,parent:ur.common197,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:ur.common88,isOpenData:ur.common106,isOpenEdition:ur.common106},required:["isOpenData","isOpenEdition"],type:"object"},public:ur.common88,scope:ur.common122,shortDescription:ur.common1,tags:ur.common27,url:ur.common4},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common56,collection:ur.common202,description:ur.common1,geo:ur.common60,geoPosition:ur.common64,id:ur.common11,key:ur.common202,name:ur.common1,parent:ur.common197,scope:ur.common122,tags:ur.common27,type:ur.common50,urls:ur.common27},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:ur.common150}},properties:{address:ur.common56,collection:ur.common203,email:ur.common2,endDate:ur.common204,geo:ur.common60,geoPosition:ur.common64,id:ur.common11,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[{const:"",type:"string"},{additionalProperties:!1,properties:{dayOfWeek:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},hours:{default:[],items:{additionalProperties:!1,properties:{closes:ur.common205,opens:ur.common205},required:["opens","closes"],type:"object"},type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:ur.common197,parent:{additionalProperties:!1,patternProperties:ur.common200,type:"object"},preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:ur.common106,isOpenEdition:ur.common106},required:["isOpenData","isOpenEdition"],type:"object"},public:ur.common88,recurrency:ur.common106,scope:ur.common122,shortDescription:{format:"textarea",type:"string"},startDate:ur.common204,tags:ur.common27,timeZone:ur.common1,type:ur.common206,url:ur.common4},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/poi/id/{id}",pathParams:ur.common105,request:ur.common8},{auth:"bearer",constant:"DELETE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/events/id/{id}/",pathParams:ur.common105,request:ur.common8},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:ur.common11,type:ur.common1},required:["type","id"],type:"object"},request:ur.common8},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:ur.common11},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:ur.common16,qqfilename:ur.common1,qqtotalfilesize:ur.common207,qquuid:ur.common11},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:ur.common5,childType:ur.common42,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:ur.common11,parentType:ur.common191},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:ur.common1,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:ur.common208,request:{additionalProperties:!1,properties:{indexMin:ur.common89},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:ur.common208,request:{additionalProperties:!1,properties:{refreshTimestamp:ur.common207},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:ur.common68},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:ur.common105},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[ur.common16],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:ur.common1},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:ur.common1,name:ur.common1,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:ur.common4},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:ur.common11},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:ur.common105},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:ur.common211,criteria:{additionalProperties:!1,properties:{narrative:ur.common1},required:["narrative"],type:"object"},description:ur.common1,id:ur.common11,isParcours:ur.common106,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:ur.common1,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:ur.common212,name:ur.common1,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:ur.common1,type:ur.common211},required:["type"],type:"object"}},type:"object"},preferences:ur.common194,public:ur.common88,scope:ur.common122,tags:ur.common27},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":ur.common45},type:"object"},badgeId:ur.common11,collection:ur.common211,evidences:{items:{additionalProperties:!1,properties:{narative:ur.common1,url:ur.common4},required:["narative"],type:"object"},type:"array"},key:ur.common212,narative:ur.common1,scope:ur.common122},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!1,properties:{count:ur.common106,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:ur.common204,fediverse:ur.common106,indexMin:ur.common89,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:ur.common1,searchType:{const:["events"],default:["events"],items:ur.common1,type:"array"},startDate:ur.common67,startDateUTC:ur.common204,type:ur.common206},required:["searchType","indexMin","indexStep","startDate","startDateUTC","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:ur.common107,if:ur.common109,properties:{childId:ur.common11,childType:ur.common15,comment:ur.common1,connectType:ur.common111,parentId:ur.common11,parentType:ur.common203},required:["parentId","childId","childType","connectType","parentType"],then:ur.common112,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:ur.common82,if:ur.common84,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:ur.common213,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:ur.common2,isAdmin:ur.common217,msg:ur.common1,name:ur.common1,roles:ur.common27},required:["name","email"],type:"object"}},type:"object"},organizations:ur.common213,projects:ur.common213},type:"object"},parentId:ur.common1,parentType:ur.common15},required:["parentId","parentType","listInvite"],then:ur.common86,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:ur.common189,childType:ur.common190,parentId:ur.common11,parentType:ur.common191},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:ur.common1}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,count:ur.common68,countType:ur.common219,fediverse:ur.common106,filters:ur.common122,indexMax:ur.common67,indexMin:ur.common123,indexStep:ur.common124,initType:ur.common122,locality:ur.common125,mapUsed:ur.common106,name:ur.common1,options:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:ur.common1},type:"object"}},type:"object"},ranges:ur.common130,searchBy:ur.common134,searchTags:ur.common27,searchType:ur.common219,sourceKey:ur.common27},required:["name","searchType","countType","indexMin","indexStep","initType","count","filters","fediverse","mapUsed","costumSlug","sourceKey","costumEditMode"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:ur.common221,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,parent_only:ur.common3,sourceKey:ur.common27,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:ur.common221,request:{additionalProperties:!1,allOf:[{if:{properties:{date:ur.common1},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,date:{oneOf:[ur.common1,{properties:{between:{properties:{end:ur.common37,start:ur.common37},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:ur.common3,regions:ur.common224,sourceKey:ur.common27,tags:ur.common27,timezone:ur.common1,type:ur.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:ur.common221,request:ur.common227},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:ur.common221,request:ur.common227},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:ur.common221,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,regions:ur.common224,sourceKey:ur.common27,tags:ur.common27,type:ur.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:ur.common221,request:ur.common227},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:ur.common221,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,event:ur.common1,sourceKey:ur.common27,tl:ur.common1},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:ur.common221,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common218,costumEditMode:ur.common106,costumSlug:ur.common1,event:ur.common11,search:ur.common1,sourceKey:ur.common27},type:"object"}}];var mr=__webpack_require__(6092),fr=__webpack_require__(1027);a.addType("oid",(e=>new pr.ObjectID(e)));class ApiClient extends $.EventEmitter{constructor({baseURL:e,accessToken:t,refreshToken:r,refreshUrl:n="/api/cocolight/refreshtoken",endpoints:o=dr,timeout:i=3e4,debug:s=!1,maxRetries:a=0,circuitBreakerThreshold:c=5,circuitBreakerResetTime:l=6e4,fromJSONValue:p=!0,tokenStorageStrategy:u=null}={}){if(super(),!e)throw new ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this.__entityTag="ApiClient",this._baseURL=e,this._refreshUrl=n,this._endpoints=o,this._debug=s;let d=null;if(this._offlineClientManager=null,this._fromJSONValue=p,Object.defineProperty(this,"userId",{get:()=>d,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{d=e,this._logger.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new R({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),D(this._ajv),this._ajv.addFormat("textarea",!0),this._ajv.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate}),this._logger=cr({transport:{target:"pino-pretty",options:{colorize:!0}},level:s?"debug":"info"}),this._client=Ht.create({baseURL:e,timeout:i}),a>0&&(ar(this._client,{retries:a,retryDelay:ar.exponentialDelay,retryCondition:e=>ar.isNetworkError(e)||ar.isRetryableError(e),onRetry:(e,t,r)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${r?.url}`),this.emit("retryAttempt",{retryCount:e,url:r?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${a} max`)),this._breakerThreshold=c,this._breakerResetTime=l,this._breakerErrorCount=0,this._breakerOpen=!1,this._lastBreakerOpenTime=null,this._accessToken=null,this._refreshToken=null,u instanceof mr.SJ&&u.use(this._baseURL),this._tokenStorage=u||new fr.GN,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");r&&this.setRefreshToken(r),t&&this.setToken(t);const m=this._tokenStorage.getAccessToken();m&&this.setToken(m);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use((e=>e),(async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{if(this._logger.info("[ApiClient] Tentative de refresh du token..."),await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){throw this.resetSession(),new ApiClientError("Erreur lors du rafraîchissement du token.",401,e)}}throw e}))}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e),this._client.defaults.headers.common.Authorization="Bearer "+e;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=function(e,t){if("string"!=typeof e)throw new InvalidTokenError("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new InvalidTokenError(`Invalid token specified: missing part #${r+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(n)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=Ht.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token||(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),0))}catch(e){return this.emit("refreshFailed",{error:e.message}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${e.message}`),!1}}_checkCircuitBreaker(){return!this._breakerOpen||Date.now()-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const r={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const r=this._getValueByPath(t,e);return null!=r?r:void 0}},n=/@(?:\{([^}]+)\}|([\w.]+))/g,o=e=>"string"!=typeof e?e:e.replace(n,((t,n,o)=>{if(n){if(n.startsWith("pathParams.")){const e=n.substring(11),t=r.pathParams(e);return null!=t?t:`@{${n}}`}{const e=r[n];if("function"==typeof e){const t=e();return null!=t?t:`@{${n}}`}return`@{${n}}`}}if(o){if(o.startsWith("pathParams.")){const e=o.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],n=e[2],i=r.pathParams(t);return null!=i?i+n:`@${o}`}return`@${o}`}{const e=r[o];if("function"==typeof e){const t=e();return null!=t?t:`@${o}`}return`@${o}`}}return e})),i=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(i);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[r,n]of Object.entries(e))t[o(r)]=i(n);return t}return"string"==typeof e?o(e):e};return i(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map((e=>this._cleanSchemaLeftoverAlias(e)));if(e&&"object"==typeof e){const r={};for(const n of Object.keys(e)){const o=e[n];if(!t.test(n)){if("default"===n){if("string"==typeof o&&t.test(o))continue;if(o&&"object"==typeof o){const e=this._cleanSchemaLeftoverAlias(o);Object.keys(e).length>0&&(r[n]=e);continue}}"string"==typeof o&&t.test(o)||(r[n]=this._cleanSchemaLeftoverAlias(o))}}return r}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${e.message}`),e}}async callEndpoint(e,t={},r=!0,n=!0){const o=this._endpoints.find((t=>t.constant===e));if(!o)throw new ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:i,method:s,contentType:a,auth:c,pathParams:l,request:p,responses:u}=o,d=(s||"GET").toLowerCase(),m=a||"application/json",f={"Content-Type":m};if(this._accessToken)"bearer"===c?f.Authorization=`Bearer ${this._accessToken}`:c&&"none"!==c||f.Authorization||(f.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===c)throw new ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let h,y=i,g={};if(l){let r=l;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(l));const n=t.pathParams||{},o=this._ajv.compile(r);if(!o(n)){const t=this._ajvErrorHuman(o.errors);throw this.emit("validationError",{stage:"pathParams",errors:o.errors}),new ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,o.errors)}g=this._resolveSpecialValuesInPlace(n),y=y.replace(/\{(\w+)\}/g,((e,t)=>{const r=g[t];if(void 0!==r)return encodeURIComponent(r);throw new ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)}))}if(p){let r=p;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(p));const n={...t};delete n.pathParams;const o=ApiClient.stripNullsInPlace(n),i=this._ajv.compile(r);if(!i(o)){const t=i.errors?this._ajvErrorHuman(i.errors):[];throw this.emit("validationError",{stage:"request",errors:i.errors}),new ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,i.errors)}t=this._resolveSpecialValuesInPlace(o,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t}),{data:null,offline:!0};throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t}),{data:null,breaker:!0};throw new CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===m||"multipart/form-data"===m?h=t:"application/x-www-form-urlencoded"===m&&(h=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${y}, method=${d}`);try{const e=await this._client.request({url:y,method:d,headers:f,["get"===d?"params":"data"]:h});if(n){const t=e.status.toString(),r=u?.[t];if(r){const n=this._ajv.compile(r);if(!n(e.data)){const e=this._ajvErrorHuman(n.errors);throw this.emit("validationError",{stage:"response",errors:n.errors}),new ApiValidationError("Response validation failed.",t,e,n.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof r?e.data=r(e.data):!0===r&&(e.data=this._transformData(e.data)),Array.isArray(o.postActions)&&o.postActions.forEach((t=>{const r=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(r);break;case"setRefreshToken":this.setRefreshToken(r);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,r),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,r));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}})),e}catch(t){throw this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${t.message}`),t instanceof ApiValidationError?t:new ApiClientError(`Erreur lors de l'appel de l'API : ${t.message}`,t.response?t.response.status:500,t.response?t.response.data:null)}}_ajvErrorHuman(e){try{return new AggregateAjvError(e).errors.map((({message:e})=>e))}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map((({message:e})=>e))}}checkAndThrowApiResponseError(e){const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(t)return t.split(".").reduce(((e,t)=>e&&e[t]),e)}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,r={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:n=!1,indexes:o=!1,metaTokens:i=!0}=r,s=[];function a(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function c(e){return e.endsWith("[]")?e.slice(0,-2):e}function l(e,t,r=!1){return e?e.concat(t).map(((e,t)=>(e=c(e),!r&&t?`[${e}]`:e))).join(r?".":""):t}function p(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(r,u=[]){null==r||s.includes(r)||(s.push(r),Object.entries(r).forEach((([r,s])=>{void 0!==s&&function(e,r,s){if(e&&"object"==typeof e){if(r.endsWith("{}"))return r=i?r:r.slice(0,-2),t.append(l(s,r,n),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(a)||r.endsWith("[]"))return r=c(r),e.forEach(((e,i)=>{if(null!=e){const a=o?l(s.concat(r),i,n):`${l(s,r,n)}[]`;t.append(a,p(e))}})),!1}return!!a(e)||(t.append(l(s,r,n),p(e)),!1)}(s,r.trim(),u)&&e(s,u.concat(c(r)))})),s.pop())}(e),t}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map((t=>this._normalizeJsonData({id:t,...e.results[t]})));else if(Array.isArray(e.results))e.results=e.results.map((e=>this._normalizeJsonData(e)));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map((t=>this._normalizeJsonData({id:t,...e.news[t]})));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map((t=>this._normalizeJsonData({id:t,...e.notif[t]})));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]}))),...Object.keys(e.organizations).map((t=>this._normalizeJsonData({id:t,...e.organizations[t]})))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]})));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map((t=>this._normalizeJsonData({id:t,...e.cities[t]})));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map((e=>this._normalizeJsonData(e)));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every((e=>/^[0-9a-fA-F]{24}$/.test(e)));e=t?Object.keys(e).map((t=>({id:t,...this._normalizeJsonData(e[t])}))):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach((t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))})),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter((e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens))),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map((t=>this._normalizeJsonData({id:t,...e.replies[t]})))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,this._fromJSONValue?a.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){return e&&"object"==typeof e&&"number"==typeof e.sec?{$date:1e3*e.sec}:"number"==typeof e?{$date:1e3*e}:e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn"];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map((e=>this._normalizeRecursively(e)));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach((r=>{let n=this._normalizeRecursively(e[r]);this._dateFields.includes(r)&&(n=this._normalizeDate(n)),this._imageFields.includes(r)&&(n=this._normalizeImage(n)),"content"===r&&n&&"object"==typeof n&&n.image&&(n.image=this._normalizeImage(n.image)),t[r]=n})),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const r=new Date(t.startDate)<new Date(t.endDate);return r||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),r};getRequestSchema(e){const t=this._endpoints.find((t=>t.constant===e));return t?.request||null}getPathSchema(e){return this._endpoints.find((t=>t.constant===e))?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const r of t)"function"==typeof e[r]&&this.on(r,e[r])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const r of t.postActions)"emitEvent"===r.type&&r.event&&e.add(r.event);return Array.from(e)}}class UserApi{constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e),this.loggedUser=null}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall((async()=>{const r=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,r.data.user,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News}),this.loggedUser}))}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new ApiError("User not connected",401);return this.client._logger.info("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:P,Organization,Project,Event,Poi,Badge,News}),this.loggedUser}async register({name:e,username:t,email:r,pwd:n}={}){return this.client.safeCall((async()=>{const o=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:r,pwd:n});if(!1===o?.data?.result)throw new ApiResponseError(o.data.msg,o.status,o.data);return o.data}))}async recoverPassword(e){return this.client.safeCall((async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!1===t?.data?.result)throw new ApiResponseError(t.data.msg,t.status,t.data);return t.data}))}}o("User",User),o("Organization",Organization),o("Project",Project),o("Event",Event),o("Poi",Poi),o("Badge",Badge),o("EndpointApi",P),o("UserApi",UserApi),o("News",News);class Api{static async userLogin(e,t,r){const n=Api.userApi(r);return await Api.userApiLogin(n,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,r){try{if(!e)throw new ApiError("userApi is not defined");if(!e.client)throw new ApiError("userApi.client is not defined");if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!r)throw new ApiError("email and password are required");const n=await e.login(t,r);return new Api(n,e.client)}}catch(e){if(e instanceof ApiClientError&&e?.details?.error)throw new ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new ApiAuthenticationError("Accès refusé : utilisateur non authentifié.");return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News});return await t.get(),t}return new User(this._client,e,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:P,User,Project,Event,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:P,User,Organization,Event,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:P,User,Organization,Project,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async entitySlug(e){if(e)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t?.contextId&&t?.contextType){const e=function(e,t=null,r={}){const o={citoyens:{entityTag:"User",meta:e=>i(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>i(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>i(e,{remove:[]})},events:{entityTag:"Event",meta:e=>i(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>i(e,{remove:["Badge","News"]})},news:{entityTag:"News",meta:e=>i(e,{remove:[]})},badges:{entityTag:"Badge",meta:e=>function(e){const t=n.get(e),r={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project")};return r[e]=t,{entityClass:t,deps:r}}(e)}}[e];if(!o)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:s,meta:a}=o,{entityClass:c,deps:l}=a(s);return new c(t,r,l)}(t?.contextType,this._client,{id:t?.contextId});return await e.get(),e}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new P(this._client)}logout(){this.loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}var hr=__webpack_require__(7031);class OfflineClientManager{constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const r=await async function(e="auto"){if("memory"===e)return new hr.QM;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new hr.Rc;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await __webpack_require__.e(394).then(__webpack_require__.bind(__webpack_require__,394));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new hr.Rc;{const{FileOfflineStorage:e}=await __webpack_require__.e(394).then(__webpack_require__.bind(__webpack_require__,394));return new e}}}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(r),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const r=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,r),r}async replayAction(e){const t=await this.getClient(e.meta);try{const r=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),r}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",(()=>this.setOfflineMode(!1))),window.addEventListener("offline",(()=>this.setOfflineMode(!0)))),this._pingInterval=setInterval((async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch(e){this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}}),e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:r={}}){const n=this._client.getToken()||this._client.getRefreshToken(),o=this._client._endpoints.find((t=>t.constant===e));if("required"===(o?.authPolicy||("none"===o?.auth?"none":"required"))&&!n)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const i={constant:e,data:t,options:r,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(i),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find((e=>e.constant===t.constant)),r=e?.authPolicy||("none"===e?.auth?"none":"required"),n=t.meta.accessToken||t.meta.refreshToken;if("required"!==r||n)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const yr=OfflineClientManager,gr={ApiClient,Api,error:e,reactive:t,...t,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new fr.GN;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new fr.Ge;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await __webpack_require__.e(405).then(__webpack_require__.bind(__webpack_require__,8405));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new fr.Ge;{const{FileStorageStrategy:e}=await __webpack_require__.e(405).then(__webpack_require__.bind(__webpack_require__,8405));return new e}}},TokenStorageStrategy:fr.u3,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new mr.Ek;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new mr.YP;throw new Error("localStorage n’est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("Le stockage fichier n’est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(123).then(__webpack_require__.bind(__webpack_require__,6123));return new e}if("undefined"!=typeof window&&window.localStorage)return new mr.YP;{const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(123).then(__webpack_require__.bind(__webpack_require__,6123));return new e}},MultiServerTokenStorageStrategy:mr.SJ},helper:{fromEntityJSON:function(e,t=null){if(!e?.__entityTag)return null;if(!e.serverData?.collection)return e;const r=function(e,t){const r=n.get(t),o=t,i={EndpointApi:n.get("EndpointApi"),User:"User"===o?r:n.get("User"),Organization:"Organization"===o?r:n.get("Organization"),Project:"Project"===o?r:n.get("Project"),Event:"Event"===o?r:n.get("Event"),Poi:"Poi"===o?r:n.get("Poi"),Badge:"Badge"===o?r:n.get("Badge"),News:"News"===o?r:n.get("News")};return{citoyens:{entityClass:i.User,deps:i},organizations:{entityClass:i.Organization,deps:i},projects:{entityClass:i.Project,deps:i},events:{entityClass:i.Event,deps:{...i,Badge:void 0}},poi:{entityClass:i.Poi,deps:{...i,Badge:void 0,News:void 0}},news:{entityClass:i.News,deps:{...i}},badges:{entityClass:i.Badge,deps:{EndpointApi:i.EndpointApi,User:i.User,Organization:i.Organization,Project:i.Project}}}[e]||null}(e.serverData.collection,e.__entityTag);if(!r)return e;if(!r?.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return r.entityClass.fromJSON(e,t,r.deps)}},OfflineClientManager:yr}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));
|
|
8
|
+
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const p=(0,i.propertyInData)(r,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?r.if(p,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(r.if(n._`${p} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(r.if((0,i.propertyInData)(r,n,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),i=r(6653),s=r(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=Ajv,e.exports=t=Ajv,e.exports.Ajv=Ajv,Object.defineProperty(t,"__esModule",{value:!0}),t.default=Ajv;var l=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var p=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var u=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${c}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const n=r(8705),o=r(8632);class BufferTokenizer extends o.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),o=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&o<r.length)throw new n.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+o),r.offset),o}async close(){}}t.BufferTokenizer=BufferTokenizer},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class ValidationError extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=ValidationError},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,(()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,l=t.macro.call(a.self,i,s,a),p=c(r,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:p,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:l,keyword:p,schema:u,parentSchema:d,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,u,d,f):t.validate,y=c(l,p,h),g=l.let("valid");function w(r=(t.async?n._`await `:n.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!m||!1===t.schema);l.assign(g,n._`${r}${(0,i.callValidateCode)(e,y,s,a)}`,t.modifying)}function _(e){var r;l.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,(function(){if(!1===t.errors)w(),t.modifying&&a(e),_((()=>e.error()));else{const r=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>w(n._`await `)),(t=>l.assign(g,!1).if(n._`${t} instanceof ${f.ValidationError}`,(()=>l.assign(e,n._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=n._`${y}.errors`;return l.assign(e,null),w(n.nil),e}();t.modifying&&a(e),_((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),c=r(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:d,self:m}=o,{root:f}=c;if(("#"===r||"#/"===r)&&s===f.baseId)return function(){if(c===f)return u(e,l,c,c.$async);const r=t.scopeValue("root",{ref:f});return u(e,i._`${r}.validate`,f,f.$async)}();const h=a.resolveRef.call(m,f,s,r);if(void 0===h)throw new n.default(o.opts.uriResolver,s,r);return h instanceof a.SchemaEnv?function(t){const r=p(e,t);u(e,r,t,t.$async)}(h):function(n){const o=t.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(h)}};function p(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function u(e,t,r,n){const{gen:a,it:l}=e,{allErrors:p,schemaEnv:u,opts:d}=l,m=d.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function h(e){var t;if(!l.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(n&&!n.dynamicProps)void 0!==n.props&&(l.props=c.mergeEvaluated.props(a,n.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(n&&!n.dynamicItems)void 0!==n.items&&(l.items=c.mergeEvaluated.items(a,n.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}n?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,m)}`),h(t),p||a.assign(r,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),p||a.assign(r,!1)})),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,m),(()=>h(t)),(()=>f(t)))}t.getValidate=p,t.callRef=u,t.default=l},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),c=r(2586);class SchemaEnv{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){const t=u.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:p}=this.opts,d=new n.CodeGen(this.scope,{es5:a,lines:l,ownProperties:p});let m;e.$async&&(m=d.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const h={gen:d,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(h),d.optimize(this.opts.code.optimize);const t=d.toString();y=`${d.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,y)(this,this.scope.get());if(this.scope.value(f,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=h;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function p(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return h.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new SchemaEnv({schema:t,schemaId:r,root:e,baseId:o})}return h.call(this,r,a)}}t.SchemaEnv=SchemaEnv,t.compileSchema=l,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=d.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new SchemaEnv({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=p.call(this,i):void 0},t.getCompilingSchema=u,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:c}=this.opts;return i=i||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3846:(e,t,r)=>{"use strict";const n=r(363),o=r(5707),i={fromFile:async function(e){const t=await n.fromFile(e);try{return await o.fromTokenizer(t)}finally{await t.close()}}};Object.assign(i,o),Object.defineProperty(i,"extensions",{get:()=>o.extensions}),Object.defineProperty(i,"mimeTypes",{get:()=>o.mimeTypes}),e.exports=i},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:l}=e,{opts:p}=l;if(!c&&0===r.length)return;const u=r.length>=p.loopRequired;if(l.allErrors?function(){if(u||c)e.block$data(o.nil,d);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(u||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(i,(0,n.propertyInData)(t,a,r,p.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),p.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function d(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,p.ownProperties),(()=>e.error()))}))}}};t.default=s},4018:(e,t)=>{"use strict";function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,s),time:r(c(!0),l),"date-time":r(d(!0),m),"iso-time":r(c(),p),"iso-date-time":r(d(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&y.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(v.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=_&&e>=w}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),"iso-date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2===i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:o[i])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){const r=a.exec(t);if(!r)return!1;const n=+r[1],o=+r[2],i=+r[3],s=r[4],c="-"===r[5]?-1:1,l=+(r[6]||0),p=+(r[7]||0);if(l>23||p>59||e&&!s)return!1;if(n<=23&&o<=59&&i<60)return!0;const u=o-p*c,d=n-l*c-(u<0?1:0);return(23===d||-1===d)&&(59===u||-1===u)&&i<61}}function l(e,t){if(!e||!t)return;const r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();return r&&n?r-n:void 0}function p(e,t){if(!e||!t)return;const r=a.exec(e),n=a.exec(t);return r&&n?(e=r[1]+r[2]+r[3])>(t=n[1]+n[2]+n[3])?1:e<t?-1:0:void 0}const u=/t|\s/i;function d(e){const t=c(e);return function(e){const r=e.split(u);return 2===r.length&&i(r[0])&&t(r[1])}}function m(e,t){if(!e||!t)return;const r=new Date(e).valueOf(),n=new Date(t).valueOf();return r&&n?r-n:void 0}function f(e,t){if(!e||!t)return;const[r,n]=e.split(u),[o,i]=t.split(u),a=s(r,o);return void 0!==a?a||l(n,i):void 0}const h=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,w=-(2**31),_=2**31-1;function b(){return!0}const v=/[^\\]\\Z/},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),c=r(3835),l=r(9029),p=r(6939),u=r(208),d=r(4227),m=r(3837),f=r(5944),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(e){var t,r,n,o,i,s,a,c,l,p,u,d,m,y,g,w,_,b,v,E,T,S,A,O,P;const $=e.strict,x=null===(t=e.code)||void 0===t?void 0:t.optimize,k=!0===x||void 0===x?1:x||0,j=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===c||c,strictTypes:null!==(p=null!==(l=e.strictTypes)&&void 0!==l?l:$)&&void 0!==p?p:"log",strictTuples:null!==(d=null!==(u=e.strictTuples)&&void 0!==u?u:$)&&void 0!==d?d:"log",strictRequired:null!==(y=null!==(m=e.strictRequired)&&void 0!==m?m:$)&&void 0!==y&&y,code:e.code?{...e.code,optimize:k,regExp:j}:{optimize:k,regExp:j},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(w=e.loopEnum)&&void 0!==w?w:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(b=e.messages)||void 0===b||b,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(A=e.validateFormats)||void 0===A||A,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class Ajv{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),v.call(this,w,e,"NOT SUPPORTED"),v.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),T.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=m;"id"===r&&(n={...m},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,p.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,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":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,p.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,d.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach((t=>k.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,p.normalizeId)(i||r);const l=p.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:l}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function v(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,p.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of y)delete e[t];return e}Ajv.ValidationError=i.default,Ajv.MissingRefError=s.default,t.default=Ajv;const P={log(){},warn(){},error(){}},$=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!$.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?j.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function j(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,C]}}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return c!==n.Name||l instanceof n.Name?l:o(i,l)}}function p(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&u(e,r,t),r}function u(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),u(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:p}),items:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=p,t.setEvaluated=u;const d={};var m;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:d[t.code]||(d[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===m.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},4266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const n=r(251);function o(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>o(e).getUint8(t),put:(e,t,r)=>(o(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>o(e).getUint16(t,!0),put:(e,t,r)=>(o(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>o(e).getUint16(t),put:(e,t,r)=>(o(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=o(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=o(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>o(e).getUint32(t,!0),put:(e,t,r)=>(o(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>o(e).getUint32(t),put:(e,t,r)=>(o(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>o(e).getInt8(t),put:(e,t,r)=>(o(e).setInt8(t,r),t+1)},t.INT16_BE={len:2,get:(e,t)=>o(e).getInt16(t),put:(e,t,r)=>(o(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>o(e).getInt16(t,!0),put:(e,t,r)=>(o(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const n=t.UINT24_LE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const n=t.UINT24_BE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>o(e).getInt32(t),put:(e,t,r)=>(o(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>o(e).getInt32(t,!0),put:(e,t,r)=>(o(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>o(e).getBigUint64(t,!0),put:(e,t,r)=>(o(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>o(e).getBigInt64(t,!0),put:(e,t,r)=>(o(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>o(e).getBigUint64(t),put:(e,t,r)=>(o(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>o(e).getBigInt64(t),put:(e,t,r)=>(o(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>o(e).getFloat32(t),put:(e,t,r)=>(o(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>o(e).getFloat32(t,!0),put:(e,t,r)=>(o(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>o(e).getFloat64(t),put:(e,t,r)=>(o(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>o(e).getFloat64(t,!0),put:(e,t,r)=>(o(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class IgnoreType{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class Uint8ArrayType{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class BufferType{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},t.StringType=class StringType{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class AnsiStringType{constructor(e){this.len=e}static decode(e,t,r){let n="";for(let o=t;o<r;++o)n+=AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(e[o]));return n}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(AnsiStringType.inRange(e,0,127))return e;const t=AnsiStringType.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return AnsiStringType.decode(e,t,t+this.len)}}t.AnsiStringType=AnsiStringType,AnsiStringType.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4428:()=>{},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;p(l.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function p(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(p(s instanceof n.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class MissingRefError extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=MissingRefError},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:p,schemaEnv:u,self:d}=c;l.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),c=r.let("fType"),p=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(p,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(p,s))),e.fail$data((0,n.or)(!1===l.strictSchema?n.nil:n._`${a} && !${p}`,function(){const e=u.$async?n._`(${s}.async ? await ${p}(${o}) : ${p}(${o}))`:n._`${p}(${o})`,r=n._`(typeof ${p} == "function" ? ${e} : ${p}.test(${o}))`;return n._`${p} && ${p} !== true && ${c} === ${t} && !${r}`}()))}():function(){const i=d.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${p}"`}d.logger.warn(e())}();if(!0===i)return;const[a,c,m]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):l.code.formats?n._`${l.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!u.$async)throw new Error("async format in sync schema");return n._`await ${m}(${o})`}return"function"==typeof c?n._`${m}(${o})`:n._`${m}.test(${o})`}())}())}};t.default=o},4834:(e,t,r)=>{"use strict";const{HEX:n}=r(4914),o=/^(?:(?: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){if(l(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[r]=t;return r?{host:c(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function s(e,t=!1){let r="",o=!0;for(const t of e){if(void 0===n[t])return;"0"!==t&&!0===o&&(o=!1),o||(r+=t)}return t&&0===r.length&&(r="0"),r}function a(e){if(l(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},n=[],o=[];let i=!1,a=!1,c=!1;function l(){if(o.length){if(!1===i){const e=s(o);if(void 0===e)return r.error=!0,!1;n.push(e)}o.length=0}return!0}for(let s=0;s<e.length;s++){const p=e[s];if("["!==p&&"]"!==p)if(":"!==p)if("%"===p){if(!l())break;i=!0}else o.push(p);else{if(!0===a&&(c=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}s-1>=0&&":"===e[s-1]&&(a=!0)}}return o.length&&(i?r.zone=o.join(""):c?n.push(o.join("")):n.push(s(o))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function c(e,t){let r="",n=!0;const o=e.length;for(let i=0;i<o;i++){const s=e[i];"0"===s&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(n=s===t,r+=s)}return r}function l(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}const p=/^\.\.?\//u,u=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);const n=i(r);if(n.isIPV4)r=n.host;else{const t=a(n.host);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(p))e=e.replace(p,"");else if(e.match(u))e=e.replace(u,"/");else if(e.match(d))e=e.replace(d,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(m);if(!r)throw new Error("Unexpected dot segment condition");{const n=r[0];e=e.slice(n.length),t.push(n)}}return t.join("")},normalizeIPv4:i,normalizeIPv6:a,stringArrayToHexStripped:s}},4874:(e,t,r)=>{"use strict";const n=r(793);e.exports=u;const o=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:w,wrapResponseSerializer:w,wrapErrorSerializer:w,req:g,res:g,err:h,errWithCause:h};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const a=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function p(e,t){const r={logger:t,parent:e[c]};t[c]=r}function u(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||o;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const h=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(h);"function"==typeof r&&g.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const w=e.level||"info",b=Object.create(r);b.log||(b.log=_),function(e,t,r){const n={};t.forEach((e=>{n[e]=r[e]?r[e]:o[e]||o[l[e]||"log"]||_})),e[a]=n}(b,g,r),p({},b),Object.defineProperty(b,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,v,b,"error"),d(this,v,b,"fatal"),d(this,v,b,"warn"),d(this,v,b,"info"),d(this,v,b,"debug"),d(this,v,b,"trace"),h.forEach((e=>{d(this,v,b,e)}))}});const v={transmit:t,serialize:i,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:g,timestamp:y(e),messageKey:e.messageKey||"msg",onChild:e.onChild||_};function E(r,o,s){if(!o)throw new Error("missing bindings for child Pino");s=s||{},i&&o.serializers&&(s.serializers=o.serializers);const a=s.serializers;if(i&&a){var c=Object.assign({},n,a),l=!0===e.browser.serialize?Object.keys(c):i;delete o.serializers,m([o],l,c,this._stdErrSerialize)}function u(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,c&&(this.serializers=c,this._serialize=l),t&&(this._logEvent=f([].concat(e._logEvent.bindings,o)))}u.prototype=this;const d=new u(this);return p(this,d),d.child=function(...e){return E.call(this,r,...e)},d.level=s.level||this.level,r.onChild(d),d}return b.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t))}}(e),b.level=w,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=_,b.serializers=n,b._serialize=i,b._stdErrSerialize=c,b.child=function(...e){return E.call(this,v,...e)},t&&(b._logEvent=f()),b}function d(e,t,r,i){if(Object.defineProperty(e,i,{value:s(e.level,r)>s(i,r)?_:r[a][i],writable:!0,enumerable:!0,configurable:!0}),e[i]===_){if(!t.transmit)return;const n=s(t.transmit.level||e.level,r);if(s(i,r)<n)return}e[i]=function(e,t,r,i){return c=e[a][i],function(){const a=t.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var u=0;u<l.length;u++)l[u]=arguments[u];var d=!1;if(t.serialize&&(m(l,this._serialize,this.serializers,this._stdErrSerialize),d=!0),t.asObject||t.formatters?c.call(p,function(e,t,r,o,i){const{level:s,log:a=e=>e}=i.formatters||{},c=r.slice();let l=c[0];const p={};if(o&&(p.time=o),s){const r=s(t,e.levels.values[t]);Object.assign(p,r)}else p.level=e.levels.values[t];let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==l&&"object"==typeof l){for(;u--&&"object"==typeof c[0];)Object.assign(p,c.shift());l=c.length?n(c.shift(),c):void 0}else"string"==typeof l&&(l=n(c.shift(),c));return void 0!==l&&(p[i.messageKey]=l),a(p)}(this,i,l,a,t)):c.apply(p,l),t.transmit){const n=t.transmit.level||e._level,o=s(n,r),c=s(i,r);if(c<o)return;!function(e,t,r,n=!1){const o=t.send,i=t.ts,s=t.methodLevel,a=t.methodValue,c=t.val,l=e._logEvent.bindings;n||m(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter((function(e){return-1===l.indexOf(e)})),e._logEvent.level.label=s,e._logEvent.level.value=a,o(s,e._logEvent,c),e._logEvent=f(l)}(this,{ts:a,methodLevel:i,methodValue:c,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,r)},l,d)}};var c}(e,t,r,i);const l=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[c];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==l.length&&(e[i]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,e[i]))}function m(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=u.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o])&&t)for(const n in e[o])t.indexOf(n)>-1&&n in r&&(e[o][n]=r[n](e[o][n]))}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?b:v}function g(){return{}}function w(e){return e}function _(){}function b(){return!1}function v(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers=i,u.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:v,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u},4914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:l}=e,{opts:p}=l,u=(0,n.allSchemaProperties)(r),d=u.filter((e=>(0,i.alwaysValidSchema)(l,r[e])));if(0===u.length||d.length===u.length&&(!l.opts.unevaluated||!0===l.props))return;const m=p.strictSchema&&!p.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:h}=l;function y(e){for(const t in m)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",a,(i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,(()=>{const n=d.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==h?t.assign(o._`${h}[${i}]`,!0):n||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of u)m&&y(e),l.allErrors?g(e):(t.var(f,!0),g(e),t.if(f))}()}};t.default=a},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const l=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${l} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=r.var("valid",n._`${l} <= ${t.length}`);r.if((0,n.not)(i),(()=>function(i){r.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||r.if((0,n.not)(i),(()=>r.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=EndOfStreamError},5707:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";const Token=__webpack_require__(4266),strtok3=__webpack_require__(6452),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__webpack_require__(6760),supported=__webpack_require__(1664),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,o]of t.entries())if(r.mask){if(o!==(r.mask[n]&e[n+r.offset]))return!1}else if(o!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const o=await e.readToken(uint32SyncSafeToken);return e.position+o>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(o),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const i={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(i.filename=await e.readToken(new Token.StringType(i.filenameLength,"utf-8")),await e.ignore(i.extraFieldLength),"META-INF/mozilla.rsa"===i.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(i.filename.endsWith(".rels")||i.filename.endsWith(".xml"))switch(i.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(i.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.filename.startsWith("3D/")&&i.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===i.filename&&i.compressedSize===i.uncompressedSize)switch(await e.readToken(new Token.StringType(i.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}if(0===i.compressedSize){let s=-1;for(;s<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),s=t.indexOf("504B0304",0,"hex"),await e.ignore(s>=0?s:t.length)}else await e.ignore(i.compressedSize)}}catch(a){if(!(a instanceof strtok3.EndOfStreamError))throw a}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const l=t.toString("binary",8,12).replace("\0"," ").trim();switch(l){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return l.startsWith("3g")?l.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const p=10485760,u=Buffer.alloc(Math.min(p,e.fileInfo.size));return await e.readBuffer(u,{mayBeLess:!0}),u.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function d(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const o=Buffer.alloc(n+1);return await e.readBuffer(o),o}async function m(){const e=await d(),t=await d();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function f(t,r){for(;r>0;){const t=await m();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await m();switch(await f(0,h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n("solid "))return{ext:"stl",mime:"model/stl"};if(n("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(n("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function y(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const g=await y();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function w(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const _=await w();let b=_.size-24;if(_check(_.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const v=Buffer.alloc(16);if(b-=await e.readBuffer(v),_check(v,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(v,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),n("BEGIN:")){if(n("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(n("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(n("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){const E=t.readUInt32LE(12);if(E>12&&t.length>=E+16)try{const T=t.slice(16,E+16).toString();if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,(()=>{})):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)}))})),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function l(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(c(e,t,r))):i}function p(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(l(r,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map((o=>(0,n.and)(l(e,t,o,r.ownProperties),n._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${c(e,t,r)}`:i},t.noPropertyInData=l,t.allSchemaProperties=p,t.schemaProperties=function(e,t){return p(t).filter((r=>!(0,o.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,p,u){const d=u?n._`${e}, ${t}, ${o}${s}`:t,m=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&m.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=n._`${d}, ${r.object(...m)}`;return p!==n.nil?n._`${l}.call(${p}, ${f})`:n._`${l}(${f})`};const u=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?u:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6022:e=>{!function(){"use strict";var t=[,function(e,t){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.lengthOf=t.keysOf=t.isObject=t.isInfOrNaN=t.isFunction=t.isArguments=t.hasOwn=t.handleError=t.convertMapToObject=t.checkError=void 0,t.isFunction=function(e){return"function"==typeof e},t.isObject=function(e){return"object"===n(e)},t.keysOf=function(e){return Object.keys(e)},t.lengthOf=function(e){return Object.keys(e).length};var o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};t.hasOwn=o,t.convertMapToObject=function(e){return Array.from(e).reduce((function(e,t){var n,o,i=(o=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return e[s]=a,e}),{})},t.isArguments=function(e){return null!=e&&o(e,"callee")},t.isInfOrNaN=function(e){return Number.isNaN(e)||e===1/0||e===-1/0};var i={maxStack:function(e){return new RegExp("Maximum call stack size exceeded","g").test(e)}};t.checkError=i,t.handleError=function(e){return function(){try{return e.apply(this,arguments)}catch(e){if(i.maxStack(e.message))throw new Error("Converting circular structure to JSON");throw e}}}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0;for(var r=Object.create(null),n=function(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)},o=0;o<64;o++)r[n(o)]=o;var i=function(e){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer){for(var t=[],r=0;r<e;r++)t.push(0);return t.$Uint8ArrayPolyfill=!0,t}return new Uint8Array(new ArrayBuffer(e))},s={encode:function(e){if("string"==typeof e){var t=e;e=i(t.length);for(var r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");e[r]=o}}for(var s=[],a=null,c=null,l=null,p=null,u=0;u<e.length;u++)switch(u%3){case 0:a=e[u]>>2&63,c=(3&e[u])<<4;break;case 1:c|=e[u]>>4&15,l=(15&e[u])<<2;break;case 2:l|=e[u]>>6&3,p=63&e[u],s.push(n(a)),s.push(n(c)),s.push(n(l)),s.push(n(p)),a=null,c=null,l=null,p=null}return null!=a&&(s.push(n(a)),s.push(n(c)),null==l?s.push("="):s.push(n(l)),null==p&&s.push("=")),s.join("")},decode:function(e){var t=Math.floor(3*e.length/4);"="==e.charAt(e.length-1)&&(t--,"="==e.charAt(e.length-2)&&t--);for(var n,o=i(t),s=null,a=null,c=null,l=0,p=0;p<e.length;p++){var u="="===(n=e.charAt(p))?-1:r[n];switch(p%4){case 0:if(u<0)throw new Error("invalid base64 string");s=u<<2;break;case 1:if(u<0)throw new Error("invalid base64 string");s|=u>>4,o[l++]=s,a=(15&u)<<4;break;case 2:u>=0&&(a|=u>>2,o[l++]=a,c=(3&u)<<6);break;case 3:u>=0&&(o[l++]=c|u)}}return o},newBinary:i};t.Base64=s},function(e){e.exports={_noYieldsAllowed:function(e){return e()}}},function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function e(t,o,i,s,a){var c=o[t];switch(r(c)){case"string":return n(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var l,p=s+i,u=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var d=c.length,m=0;m<d;m+=1)u[m]=e(m,c,i,p,a)||"null";return l=0===u.length?"[]":p?"[\n"+p+u.join(",\n"+p)+"\n"+s+"]":"["+u.join(",")+"]"}var f=Object.keys(c);return a&&(f=f.sort()),f.forEach((function(t){(l=e(t,c,i,p,a))&&u.push(n(t)+(p?": ":":")+l)})),l=0===u.length?"{}":p?"{\n"+p+u.join(",\n"+p)+"\n"+s+"}":"{"+u.join(",")+"}"}};t.default=function(e,t){var r=Object.assign({indent:"",canonical:!1},t);if(!0===r.indent)r.indent=" ";else if("number"==typeof r.indent){for(var n="",i=0;i<r.indent;i++)n+=" ";r.indent=n}return o("",{"":e},r.indent,"",r.canonical)},e.exports=t.default}],r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}var o={};!function(){var e=o,t=n(2).Base64,r=n(3);Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=void 0;var i=n(1),s={};e.EJSON=s;var a=new Map;s.addType=function(e,t){if(a.has(e))throw new Error("Type ".concat(e," already present"));a.set(e,t)};var c=[{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$date")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof Date},toJSONValue:function(e){return{$date:e.getTime()}},fromJSONValue:function(e){return new Date(e.$date)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$regexp")&&(0,i.hasOwn)(e,"$flags")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof RegExp},toJSONValue:function(e){return{$regexp:e.source,$flags:e.flags}},fromJSONValue:function(e){return new RegExp(e.$regexp,e.$flags.slice(0,50).replace(/[^gimuy]/g,"").replace(/(.)(?=.*\1)/g,""))}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$InfNaN")&&1===(0,i.lengthOf)(e)},matchObject:i.isInfOrNaN,toJSONValue:function(e){return{$InfNaN:Number.isNaN(e)?0:e===1/0?1:-1}},fromJSONValue:function(e){return e.$InfNaN/0}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$binary")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return"undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&(0,i.hasOwn)(e,"$Uint8ArrayPolyfill")},toJSONValue:function(e){return{$binary:t.encode(e)}},fromJSONValue:function(e){return t.decode(e.$binary)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$escape")&&1===(0,i.lengthOf)(e)},matchObject:function(e){var t=!1;if(e){var r=(0,i.lengthOf)(e);1!==r&&2!==r||(t=c.some((function(t){return t.matchJSONValue(e)})))}return t},toJSONValue:function(e){var t={};return(0,i.keysOf)(e).forEach((function(r){t[r]=s.toJSONValue(e[r])})),{$escape:t}},fromJSONValue:function(e){var t={};return(0,i.keysOf)(e.$escape).forEach((function(r){t[r]=s.fromJSONValue(e.$escape[r])})),t}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$type")&&(0,i.hasOwn)(e,"$value")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return s._isCustomType(e)},toJSONValue:function(e){var t=r._noYieldsAllowed((function(){return e.toJSONValue()}));return{$type:e.typeName(),$value:t}},fromJSONValue:function(e){var t=e.$type;if(!a.has(t))throw new Error("Custom EJSON type ".concat(t," is not defined"));var n=a.get(t);return r._noYieldsAllowed((function(){return n(e.$value)}))}}];s._isCustomType=function(e){return e&&(0,i.isFunction)(e.toJSONValue)&&(0,i.isFunction)(e.typeName)&&a.has(e.typeName())},s._getTypes=function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?a:(0,i.convertMapToObject)(a)},s._getConverters=function(){return c};var l=function(e){for(var t=0;t<c.length;t++){var r=c[t];if(r.matchObject(e))return r.toJSONValue(e)}},p=function e(t){if(null===t)return null;var r=l(t);return void 0!==r?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)||void 0===n||(0,i.isInfOrNaN)(n)){var o=l(n);o?t[r]=o:e(n)}})),t):t};s._adjustTypesToJSONValue=p,s.toJSONValue=function(e){var t=l(e);if(void 0!==t)return t;var r=e;return(0,i.isObject)(e)&&(r=s.clone(e),p(r)),r};var u=function(e){if((0,i.isObject)(e)&&null!==e){var t=(0,i.keysOf)(e);if(t.length<=2&&t.every((function(e){return"string"==typeof e&&"$"===e.substr(0,1)})))for(var r=0;r<c.length;r++){var n=c[r];if(n.matchJSONValue(e))return n.fromJSONValue(e)}}return e},d=function e(t){if(null===t)return null;var r=u(t);return r!==t?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)){var o=u(n);if(n!==o)return void(t[r]=o);e(n)}})),t):t};s._adjustTypesFromJSONValue=d,s.fromJSONValue=function(e){var t=u(e);return t===e&&(0,i.isObject)(e)&&(t=s.clone(e),d(t)),t},s.stringify=(0,i.handleError)((function(e,t){var r=s.toJSONValue(e);return t&&(t.canonical||t.indent)?n(4)(r,t):JSON.stringify(r)})),s.parse=function(e){if("string"!=typeof e)throw new Error("EJSON.parse argument should be a string");return s.fromJSONValue(JSON.parse(e))},s.isBinary=function(e){return!!("undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&e.$Uint8ArrayPolyfill)},s.equals=function(e,t,r){var n,o=!(!r||!r.keyOrderSensitive);if(e===t)return!0;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(!e||!t)return!1;if(!(0,i.isObject)(e)||!(0,i.isObject)(t))return!1;if(e instanceof Date&&t instanceof Date)return e.valueOf()===t.valueOf();if(s.isBinary(e)&&s.isBinary(t)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if((0,i.isFunction)(e.equals))return e.equals(t,r);if((0,i.isFunction)(t.equals))return t.equals(e,r);var a,c=Array.isArray(e),l=Array.isArray(t);if(c!==l)return!1;if(c&&l){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!s.equals(e[n],t[n],r))return!1;return!0}switch(s._isCustomType(e)+s._isCustomType(t)){case 1:return!1;case 2:return s.equals(s.toJSONValue(e),s.toJSONValue(t))}var p=(0,i.keysOf)(e),u=(0,i.keysOf)(t);return o?(n=0,a=p.every((function(o){return!(n>=u.length||o!==u[n]||!s.equals(e[o],t[u[n]],r)||(n++,0))}))):(n=0,a=p.every((function(o){return!!(0,i.hasOwn)(t,o)&&!!s.equals(e[o],t[o],r)&&(n++,!0)}))),a&&n===u.length},s.clone=function(e){var t;if(!(0,i.isObject)(e))return e;if(null===e)return null;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return e;if(s.isBinary(e)){t=s.newBinary(e.length);for(var r=0;r<e.length;r++)t[r]=e[r];return t}return Array.isArray(e)?e.map(s.clone):(0,i.isArguments)(e)?Array.from(e).map(s.clone):(0,i.isFunction)(e.clone)?e.clone():s._isCustomType(e)?s.fromJSONValue(s.clone(s.toJSONValue(e)),!0):(t={},(0,i.keysOf)(e).forEach((function(r){t[r]=s.clone(e[r])})),t)},s.newBinary=t.newBinary}(),e.exports=o.EJSON}()},6066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const n=r(8632),o=r(8705);class ReadStreamTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new o.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new o.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const o=new Uint8Array(r.length+t);return n=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),e.set(o.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof o.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new o.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const o=e-n,i=await this.readBuffer(r,{length:Math.min(t,o)});if(i<0)return i;n+=i}return n}}t.ReadStreamTokenizer=ReadStreamTokenizer},6092:(e,t,r)=>{"use strict";r.d(t,{Ek:()=>MultiServerMemoryStorageStrategy,SJ:()=>MultiServerTokenStorageStrategy,YP:()=>MultiServerLocalStorageStrategy});var n=r(1027);class MultiServerTokenStorageStrategy extends n.u3{constructor(){super(),this._currentBaseURL=null}use(e){if(!e)throw new Error("baseURL est requis");this._currentBaseURL=e.replace(/\/+$/,"")}_ensureContext(){if(!this._currentBaseURL)throw new Error("baseURL non défini. Appelez use(baseURL)")}getServers(){throw new Error("getServers() doit être implémenté")}exportAll(){throw new Error("exportAll() doit être implémenté")}}class MultiServerMemoryStorageStrategy extends MultiServerTokenStorageStrategy{constructor(){super(),this._storage=new Map}getAccessToken(){return this._ensureContext(),this._storage.get(this._currentBaseURL)?.accessToken||null}setAccessToken(e){this._ensureContext();const t=this._storage.get(this._currentBaseURL)||{};this._storage.set(this._currentBaseURL,{...t,accessToken:e})}getRefreshToken(){return this._ensureContext(),this._storage.get(this._currentBaseURL)?.refreshToken||null}setRefreshToken(e){this._ensureContext();const t=this._storage.get(this._currentBaseURL)||{};this._storage.set(this._currentBaseURL,{...t,refreshToken:e})}clear(){this._ensureContext(),this._storage.delete(this._currentBaseURL)}getServers(){return[...this._storage.keys()]}exportAll(){return Object.fromEntries(this._storage.entries())}}class MultiServerLocalStorageStrategy extends MultiServerTokenStorageStrategy{constructor(e="cocolight"){super(),this.prefix=e}_key(e){return`${this.prefix}_tokens_${e}`}_getData(){this._ensureContext();const e=localStorage.getItem(this._key(this._currentBaseURL));return e?JSON.parse(e):{}}_setData(e){localStorage.setItem(this._key(this._currentBaseURL),JSON.stringify(e))}getAccessToken(){return this._getData().accessToken||null}setAccessToken(e){const t=this._getData();t.accessToken=e,this._setData(t)}getRefreshToken(){return this._getData().refreshToken||null}setRefreshToken(e){const t=this._getData();t.refreshToken=e,this._setData(t)}clear(){localStorage.removeItem(this._key(this._currentBaseURL))}getServers(){return Object.keys(localStorage).filter((e=>e.startsWith(`${this.prefix}_tokens_`))).map((e=>e.replace(`${this.prefix}_tokens_`,"")))}exportAll(){const e={};for(const t of this.getServers()){const r=localStorage.getItem(this._key(t));r&&(e[t]=JSON.parse(r))}return e}}},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),c=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,c=t.let("valid",!1),l=t.let("passing",null),p=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(p,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},p),i>0&&t.if(n._`${p} && ${c}`).assign(c,!1).assign(l,n._`[${l}, ${i}]`).else(),t.if(p,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),c=r(3025),l=r(9713),p=r(8660),u=r(117),d=r(5333),m=r(7923),f=r(6505),h=r(6163),y=r(5844),g=r(1239),w=r(4426);t.default=function(e=!1){const t=[m.default,f.default,h.default,y.default,g.default,w.default,l.default,p.default,c.default,u.default,d.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const n=r(6066),o=r(3492);var i=r(8705);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new n.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new o.BufferTokenizer(e,t)}},6461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3282),o=r(9029),i=o.operators,s={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},a={message:({keyword:e,schemaCode:t})=>o.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>o._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:i,keyword:a,it:c}=e,{opts:l,self:p}=c;if(!l.validateFormats)return;const u=new n.KeywordCxt(c,p.RULES.all.format.definition,"format");function d(e){return o._`${e}.compare(${r}, ${i}) ${s[a].fail} 0`}u.$data?function(){const r=t.scopeValue("formats",{ref:p.formats,code:l.code.formats}),n=t.const("fmt",o._`${r}[${u.schemaCode}]`);e.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,d(n)))}():function(){const r=u.schema,n=p.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const i=t.scopeValue("formats",{key:r,ref:n,code:l.code.formats?o._`${l.code.formats}${(0,o.getProperty)(r)}`:void 0});e.fail$data(d(i))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:c,parentSchema:l,it:p}=e,{oneOf:u}=l;if(!p.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=c.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const m=t.let("valid",!1),f=t.const("tag",n._`${r}${(0,n.getProperty)(d)}`);function h(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${f} == "string"`,(()=>function(){const r=function(){var e;const t={},r=o(l);let n=!0;for(let t=0;t<u.length;t++){let l=u[t];if((null==l?void 0:l.$ref)&&!(0,a.schemaHasRulesButRef)(l,p.self.RULES)){const e=l.$ref;if(l=i.resolveRef.call(p.self,p.schemaEnv.root,p.baseId,e),l instanceof i.SchemaEnv&&(l=l.schema),void 0===l)throw new s.default(p.opts.uriResolver,p.baseId,e)}const m=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[d];if("object"!=typeof m)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||o(l)),c(m,t)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(d)}function c(e,t){if(e.const)m(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const r of e.enum)m(r,t)}}function m(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${f} === ${e}`),t.assign(m,h(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:f,tagName:d}),t.endIf()}()),(()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:f,tagName:d}))),e.ok(m)}};t.default=c},6760:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=l(e))),t===1/0))return 1/0}return t}function p(e,t="",r){!1!==r&&(t=m(t));const n=e.parse(t);return u(e,n)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=p,t._getFullPath=u;const d=/#\/?$/;function m(e){return e?e.replace(d,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,r){return r=m(r),e.resolve(t,r)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=m(e[r]||t),a={"":s},c=p(n,s,!1),l={},u=new Set;return i(e,{allKeys:!0},((e,t,n,o)=>{if(void 0===o)return;const i=c+t;let s=a[o];function p(t){const r=this.opts.uriResolver.resolve;if(t=m(s?r(s,t):t),u.has(t))throw h(t);u.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(e,n.schema,t):t!==m(i)&&("#"===t[0]?(d(e,l[t],t),l[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);p.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=p.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),l;function d(e,t,r){if(void 0!==t&&!o(e,t))throw h(r)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,s,l;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=s.length,l=p,console&&console.warn&&console.warn(l)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):f(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,p=f(c,l);for(r=0;r<l;++r)n(p[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},i.prototype.listenerCount=m,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7031:(e,t,r)=>{"use strict";r.d(t,{LD:()=>OfflineQueueStorageStrategy,QM:()=>MemoryOfflineStorage,Rc:()=>LocalStorageOfflineStorage});class OfflineQueueStorageStrategy{async loadQueue(){throw new Error("loadQueue() doit être implémenté")}async saveQueue(e){throw new Error("saveQueue(queue) doit être implémenté")}}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{constructor(){super(),this._queue=[]}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return e?JSON.parse(e):[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),c=r(4003),l=r(1163),p=r(617),u=r(7935),d=r(8643),m=[n.default,o.default,i.default,s.default,a.default,c.default,l.default,p.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];t.default=m},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,o,i,s,a,c,l,p,u){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var d in n(i,s,a,c,l,p,u),i){var m=i[d];if(Array.isArray(m)){if(d in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,n,o,m[f],s+"/"+d+"/"+f,a,s,d,i,f)}else if(d in t.propsKeywords){if(m&&"object"==typeof m)for(var h in m)r(e,n,o,m[h],s+"/"+d+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,d,i,h)}else(d in t.keywords||e.allKeys&&!(d in t.skipKeywords))&&r(e,n,o,m,s+"/"+d,a,s,d,i)}o(i,s,a,c,l,p,u)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,l=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${l} ${c} ${s}`)}};t.default=s},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const i=n._`\n`;t.ValueScope=class ValueScope extends Scope{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,i={},s){let a=n.nil;for(const c in e){const l=e[c];if(!l)continue;const p=i[c]=i[c]||new Map;l.forEach((e=>{if(p.has(e))return;p.set(e,o.Started);let i=r(e);if(i){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;a=n._`${a}${r} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(e)))throw new ValueError(e);a=n._`${a}${i}${this.opts._n}`}p.set(e,o.Completed)}))}return a}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const l=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let p=n._`${l} === undefined`;"empty"===c.useDefaults&&(p=n._`${p} || ${l} === null || ${l} === ""`),i.if(p,n._`${l} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>i(e,r,t.default)))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},8122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class Deferred{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4018),o=r(6461),i=r(9029),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,n.fullFormats,s),e;const[r,i]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return l(e,t.formats||n.formatNames,r,i),t.keywords&&(0,o.default)(e),e};function l(e,t,r,n){var o,s;null!==(o=(s=e.opts.code).formats)&&void 0!==o||(s.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,normalizeIPv4:o,removeDotSegments:i,recomposeAuthority:s,normalizeComponentEncoding:a}=r(4834),c=r(343);function l(e,t,r,n){const o={};return n||(e=m(p(e,r),r),t=m(p(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function p(e,t){const r={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:""},n=Object.assign({},t),o=[],a=c[(n.scheme||r.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&o.push(r.scheme,":");const l=s(r);if(void 0!==l&&("suffix"!==n.reference&&o.push("//"),o.push(l),r.path&&"/"!==r.path.charAt(0)&&o.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}const u=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(e,t){const r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=-1!==e.indexOf("%");let a=!1;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);const l=e.match(d);if(l){if(i.scheme=l[1],i.userinfo=l[3],i.host=l[4],i.port=parseInt(l[5],10),i.path=l[6]||"",i.query=l[7],i.fragment=l[8],isNaN(i.port)&&(i.port=l[5]),i.host){const e=o(i.host);if(!1===e.isIPV4){const t=n(e.host);i.host=t.host.toLowerCase(),a=t.isIPV6}else i.host=e.host,a=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");const e=c[(r.scheme||i.scheme||"").toLowerCase()];if(!(r.unicodeSupport||e&&e.unicodeSupport)&&i.host&&(r.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||u[t])return!0;return!1}(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}(!e||e&&!e.skipNormalize)&&(s&&void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),s&&void 0!==i.host&&(i.host=unescape(i.host)),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),e&&e.parse&&e.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}const f={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=p(m(e,t),t):"object"==typeof e&&(e=m(p(e,t),t)),e},resolve:function(e,t,r){const n=Object.assign({scheme:"null"},r);return p(l(m(e,n),m(t,n),n,!0),{...n,skipEscape:!0})},resolveComponents:l,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=p(a(m(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=p(a(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=p(a(m(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=p(a(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:p,parse:m};e.exports=f,e.exports.default=f,e.exports.fastUri=f},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const n=r(8705);t.AbstractTokenizer=class AbstractTokenizer{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const p=a.length>=l.opts.loopEnum;let u;const d=()=>null!=u?u:u=(0,o.useFunc)(t,i.default);let m;if(p||s)m=t.let("valid"),e.block$data(m,(function(){t.assign(m,!1),t.forOf("v",c,(e=>t.if(n._`${d()}(${r}, ${e})`,(()=>t.assign(m,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);m=(0,n.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${d()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o))))}e.pass(m)}};t.default=s},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:l,it:p}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=p;if(p.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(p,r))return;const m=(0,n.allSchemaProperties)(a.properties),f=(0,n.allSchemaProperties)(a.patternProperties);function h(e){t.code(o._`delete ${c}[${e}]`)}function y(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===r)h(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(u||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(p,r)){const r=t.name("valid");"failing"===d.removeAdditional?(g(n,r,!1),t.if((0,o.not)(r),(()=>{e.reset(),h(n)}))):(g(n,r),u||t.if((0,o.not)(r),(()=>t.break())))}}}function g(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",c,(r=>{m.length||f.length?t.if(function(r){let i;if(m.length>8){const e=(0,s.schemaRefOrVal)(p,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=m.length?(0,o.or)(...m.map((e=>o._`${r} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,o.not)(i)}(r),(()=>y(r))):y(r)})),e.ok(o._`${l} === ${i.default.errors}`)}};t.default=a},8705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var n=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});var o=r(1510);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return o.StreamReader}})},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,n._`[${r}]`)),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){const{it:c}=e,{gen:p,compositeRule:u,allErrors:d}=c,m=l(e,r,o);(null!=i?i:u||d)?s(p,m):a(c,n._`[${m}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:c,compositeRule:p,allErrors:u}=o;s(c,l(e,r,n)),p||u||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,n._`${i.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,o))}))};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[p(s,r),u(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:l,it:p}=e,{opts:u,propertyName:d,topSchemaRef:m,schemaPath:f}=p;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),u.messages&&o.push([c.message,"function"==typeof r?r(e):r]),u.verbose&&o.push([c.schema,l],[c.parentSchema,n._`${m}${f}`],[i.default.data,a]),d&&o.push([c.propertyName,d])}(e,t,a),o.object(...a)}(e,t,r)}function p({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[c.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=l(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=l(this.rhs,e,t),this}get names(){return c(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Throw extends Node{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=l(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(p(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>a(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}return t?!1===e?t instanceof If?t:t.nodes:this.nodes.length?this:new If(u(e),t instanceof If?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=l(this.condition,e,t),this}get names(){const e=super.names;return c(e,this.condition),this.else&&a(e,this.else.names),e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=l(this.iteration,e,t),this}get names(){return a(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=c(super.names,this.from);return c(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=l(this.iterable,e,t),this}get names(){return a(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&a(e,this.catch.names),this.finally&&a(e,this.finally.names),e}}class Catch extends BlockNode{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}function a(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function c(e,t){return t instanceof n._CodeOrName?a(e,t.names):e}function l(e,t,r){return e instanceof n.Name?i(e):(o=e)instanceof n._Code&&o._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function p(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function u(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${h(e)}`}Finally.kind="finally",t.CodeGen=class CodeGen{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}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,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new Def(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new AnyCode(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new If(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new ForRange(i,s,t,r),(()=>n(s)))}forOf(e,t,r,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(s,n._`${e}[${t}]`),r(s)}))}return this._for(new ForIter("of",i,s,t),(()=>r(s)))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new ForIter("in",i,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new Catch(e),t(e)}return r&&(this._currNode=n.finally=new Finally,this.code(r)),this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new Func(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Func)}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){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=u;const d=f(t.operators.AND);t.and=function(...e){return e.reduce(d)};const m=f(t.operators.OR);function f(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${h(t)} ${e} ${h(r)}`}function h(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(m)}},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var o=2&t&&e;"object"==typeof o&&!~leafPrototypes.indexOf(o);o=getProto(o))Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>e+".cocolight-api-client.browser.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="CocolightApiClient:",__webpack_require__.l=(e,t,r,n)=>{if(inProgress[e])inProgress[e].push(t);else{var o,i;if(void 0!==r)for(var s=document.getElementsByTagName("script"),a=0;a<s.length;a++){var c=s[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==dataWebpackPrefix+r){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,__webpack_require__.nc&&o.setAttribute("nonce",__webpack_require__.nc),o.setAttribute("data-webpack",dataWebpackPrefix+r),o.src=e),inProgress[e]=[t];var l=(t,r)=>{o.onerror=o.onload=null,clearTimeout(p);var n=inProgress[e];if(delete inProgress[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(r))),t)return t(r)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,r)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(i,(r=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,a]=r,c=0;if(i.some((t=>0!==e[t]))){for(n in s)__webpack_require__.o(s,n)&&(__webpack_require__.m[n]=s[n]);a&&a(__webpack_require__)}for(t&&t(r);c<i.length;c++)o=i[c],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunkCocolightApiClient=this.webpackChunkCocolightApiClient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>gr});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{ApiAuthenticationError:()=>ApiAuthenticationError,ApiClientError:()=>ApiClientError,ApiError:()=>ApiError,ApiResponseError:()=>ApiResponseError,ApiValidationError:()=>ApiValidationError,CircuitBreakerError:()=>CircuitBreakerError});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{batch:()=>h,computed:()=>v,effect:()=>f,getSignals:()=>T,isReactive:()=>b,isSignal:()=>g,reactive:()=>_,subscribeTo:()=>S,watch:()=>E});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{hasBrowserEnv:()=>Ge,hasStandardBrowserEnv:()=>Je,hasStandardBrowserWebWorkerEnv:()=>He,navigator:()=>Ke,origin:()=>Ze});const n=new Map;function o(e,t){n.set(e,t)}function i(e,t){const r=n.get(e),o={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project"),Event:n.get("Event"),Poi:n.get("Poi"),Badge:n.get("Badge"),News:n.get("News")};return o[e]=r,t.remove.forEach((e=>delete o[e])),{entityClass:r,deps:o}}class ApiError extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.details=r}}class ApiClientError extends ApiError{constructor(e,t,r){super(e,t,r),this.name="ApiClientError"}}class ApiValidationError extends Error{constructor(e,t,r,n=null){super(e),this.name="ApiValidationError",this.status=t,this.messages=r,this.details=n}}class CircuitBreakerError extends ApiError{constructor(e){super(e,503),this.name="CircuitBreakerError"}}class ApiResponseError extends Error{constructor(e,t,r,n=null){super(e),this.name="ApiResponseError",this.status=t,this.responseData=r,this.details=n}}class ApiAuthenticationError extends ApiError{constructor(e,t,r){super(e,t,r),this.name="ApiAuthenticationError"}}var s=__webpack_require__(2808),a=__webpack_require__(6022),c=__webpack_require__(3846);const l=[],p=new WeakMap,u=new WeakMap;let d=0;const m=new Set;function f(e){const t=()=>{try{l.push(t),e()}finally{l.pop()}};return t(),t}function h(e){d++;try{e()}finally{if(d--,0===d){const e=Array.from(m);m.clear();for(const t of e)t()}}}function y(e){let t=e;const r=new Set;return{get value(){const e=l[l.length-1];return e&&r.add(e),t},set value(e){t!==e&&(t=e,d>0?r.forEach((e=>m.add(e))):r.forEach((e=>e())))},subscribe:e=>(r.add(e),()=>r.delete(e)),__isSignal:!0}}function g(e){return e&&!0===e.__isSignal}function w(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,r){if("string"==typeof r&&!isNaN(r)){const n=e[r];return b(n)?n:_(n,t.concat(r))}return Reflect.get(e,r)},set(e,r,n){const o=_(n,t.concat(r));return e[r]=o,!0}})}(e,t);if(e.__isReactive)return e;const r=new Map,n=new Proxy(e,{get(e,n,o){if("__raw"===n)return e;if("__isReactive"===n)return!0;if(!r.has(n)){const o=y(w(e[n],t.concat(n)));r.set(n,o)}return r.get(n).value},set(e,n,o){const i=w(o,t.concat(n));if(!r.has(n)){const e=y(i);r.set(n,e)}return r.get(n).value=i,e[n]=function(e){return g(e)?e.value:e}(i),!0},deleteProperty:(e,t)=>(r.delete(t),Reflect.deleteProperty(e,t))});return u.set(n,r),n}function _(e){return"object"!=typeof e||null===e||e.__isReactive?e:w(e)}function b(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function v(e){if(p.has(e))return p.get(e);const t=y();return f((()=>t.value=e())),p.set(e,t),t}function E(e,t){let r;f((()=>{const n=e();n!==r&&(t(n,r),r=n)}))}function T(e){return b(e)?u.get(e):null}function S(e,t,r){const n=T(e);if(!n||!n.has(t))return()=>{};const o=n.get(t);return o?.subscribe?.((()=>r(o.value)))??(()=>{})}const{fromBuffer:A}=c,O=class BaseEntity{_draftData={};_initialDraftData={};_serverData=null;_calledFromSave=!1;_syncReactiveDraft=!1;static entityTag="BaseEntity";constructor(e,t={},r={},n={}){if(this.__entityTag=n.entityTag||this.getEntityTag(this.constructor.entityTag)||"BaseEntity",this.deps=r,"ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e?.apiClient)throw new ApiError("Parent invalide ou ApiClient manquant.");this.apiClient=e.apiClient,this.parent=e,"User"===this.getEntityTag(e?.__entityTag)?this.userContext=e:e?.userContext&&(this.userContext=e.userContext)}if("function"==typeof r.EndpointApi)this.endpointApi=new r.EndpointApi(this.apiClient);else{if("object"!=typeof r.EndpointApi)throw new ApiError("deps.EndpointApi doit être une classe ou une instance valide.");this.endpointApi=r.EndpointApi}this._serverData=_({});const{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this.constructor.SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=s,this._draftData=o,this.data=i}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return this.isConnected&&this.userId===this.userContext?.id}getEntityType(){return this.constructor.entityType}hasChanges(){return this._serialize(this._toRawDeep(this._draftData))!==this._serialize(this._initialDraftData)}async refresh(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.");return this.get()}async save(){if(!this.isConnected)throw new ApiError("Non connecté.");this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await this.userContext.refresh(),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}static fromServerData(e,t,r){const n=new this(t,{},r);return n._setData(e),n}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.info?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`),b(this._serverData)?Object.assign(this._serverData,e):this._serverData=_({...e});const r=this._draftData?this._toRawDeep(this._draftData):{},n={...e,...this.defaultFields,...r},{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:n,serverData:this._serverData,previousDraft:this._draftData,constant:this.constructor.SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(o)):this._initialDraftData||(this._initialDraftData=s),b(this._draftData)?this._updateDraftPreservingUserChanges(o):this._draftData=_(o),this.data||(this.data=i)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(e)){const r=this._draftData?.[t],n=this._initialDraftData?.[t];void 0!==r&&void 0!==n&&this._serialize(this._toRawDeep(r))!==this._serialize(n)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(g(e))return this._toRawDeep(e.value);if(Array.isArray(e))return e.map((e=>this._toRawDeep(e)));if("object"==typeof e&&null!==e){const t={};for(const r of Object.keys(e))t[r]=this._toRawDeep(e[r]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(a.stringify(this._removeUnserializables(e)))}catch(e){return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON",e),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map((e=>this._removeUnserializables(e,t)));const r={};for(const n of Object.keys(e)){const o=e[n];if("function"!=typeof o&&"symbol"!=typeof o&&void 0!==o)try{r[n]=this._removeUnserializables(o,t)}catch(e){r[n]=null}}return r}static _revive(e){return a.fromJSONValue(e)}static fromJSON(e,t,r){const{serverData:n}=e;return this.fromServerData(this._revive(n),t,r)}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.");return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour faire cette action.");return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(!this.isMe)throw new ApiAuthenticationError("Vous devez être vous-même pour faire cette action.");return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:r="any"}){if(!e)throw new ApiValidationError("Le fichier est requis.");const n="undefined"==typeof window&&"undefined"!=typeof process;let o="",i=e;if("undefined"!=typeof File&&e instanceof File){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.")}else if("undefined"!=typeof Blob&&e instanceof Blob){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");const r=o.split("/")[1]||"bin",n=`${Date.now()}.${r}`;i=new File([e],n,{type:o})}else if(n&&Buffer.isBuffer(e)){const n=await A(e);if(o=n?.mime,!n||!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");if("image"===r){const t=n.ext,r=`${Date.now()}.${t}`;i=await this._createReadStreamFromBuffer(e,r,o)}}else{if(!n||!e?.readable||"function"!=typeof e._read)throw new ApiValidationError("Type de fichier non reconnu.");{const r=[],n=await this._passThrough(),s=await this._passThrough(),a=4100;let c=0;e.on("data",(e=>{c<a&&(r.push(e),c+=e.length)})),e.pipe(n).pipe(s),await new Promise((e=>setTimeout(e,10)));const l=Buffer.concat(r),p=await A(l);if(o=p?.mime,!p||!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.");s.path=`${Date.now()}.${p.ext}`,s.mimeType=o,i=s}}return i}async _createReadStreamFromBuffer(e,t="file.bin",r="application/octet-stream"){const n=await this._bufferToReadable(e);return n.path=t,n.mimeType=r,n}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await __webpack_require__.e(931).then(__webpack_require__.bind(__webpack_require__,7931));return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await __webpack_require__.e(931).then(__webpack_require__.bind(__webpack_require__,7931));return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const r={...e};for(const e of t)delete r[e];return r}_pickProps(e,t,r={}){if(!e||"object"!=typeof e)return{};const n={};for(const o of t)if(o in e){const t=e[o];"function"==typeof r[o]?n[o]=r[o](t,e):n[o]=t}return n}_hasAtLeastOne(e,t=[]){return t.some((t=>t in e&&null!=e[t]))}_createFilteredProxy(e){return new Proxy(e,{get:(e,t,r)=>"string"!=typeof t||isNaN(t)?"length"===t?e.filter((e=>!e._isDeleted)).length:"function"==typeof e[t]?(...r)=>e.filter((e=>!e._isDeleted))[t](...r):Reflect.get(e,t,r):e.filter((e=>!e._isDeleted))[t]})}_newId(){return(new s).toString()}_createDraftProxy(e,t={},r={},n=[],o={},i={}){return new Proxy({},{get:(e,n)=>{if("string"==typeof n||"symbol"==typeof n){if(n in r){const e=r[n],t=o[n];return"function"==typeof t?t(e):e}if(t&&"object"==typeof t&&n in t){const e=t[n],r=o[n];return"function"==typeof r?r(e):e}}},set:(t,o,s)=>{if(!n.includes(o)){const t=`[DraftProxy] Le champ "${o}" n'est pas autorisé.`;if(i.throwOnError)throw new ApiValidationError(t,400,null,{field:o,value:s,allowedFields:n});return e._logger.warn(t),!1}const a=r[o];return a&&"object"==typeof a&&!0===a.__isSignal?a.value=s:r[o]=s,!0},deleteProperty:(e,t)=>!!n.includes(t)&&(delete r[t],!0),has:(e,n)=>n in r||n in t,ownKeys:()=>[...new Set([...Object.keys(t||{}),...Object.keys(r||{})])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}_extractWritableFields(e={},t={},r={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&r.visited.has(e.$id))return[];e.$id&&r.visited.add(e.$id),r.defs=e.$defs||e.definitions||r.defs;const n=[];if(e.$ref){const o=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),i=r.defs?.[o];i&&n.push(...this._extractWritableFields(i,t,r))}if(e.allOf&&e.allOf.forEach((e=>n.push(...this._extractWritableFields(e,t,r)))),e.if&&e.then){const o=e.if?.properties;let i=!0;if(o)for(const e in o){const r=o[e]?.const;if(t[e]!==r){i=!1;break}}i&&e.then?n.push(...this._extractWritableFields(e.then,t,r)):!i&&e.else&&n.push(...this._extractWritableFields(e.else,t,r))}return e.properties&&n.push(...Object.entries(e.properties).filter((([e,t])=>!0!==t.readOnly&&void 0===t.const)).map((([e])=>e))),[...new Set(n)]}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:r=null,constant:n,apiClient:o,transforms:i={},throwOnError:s=!0,removeFields:a=[]}){const c=Array.isArray(n)?n:[n],l={allOf:[],$defs:{}};for(const e of c){const t=o.getRequestSchema(e);if(!t)throw new ApiError(`Unable to find schema for ${e}.`);if(t.$defs)for(const[r,n]of Object.entries(t.$defs))l.$defs[r]?o._logger.warn(`Duplicate $defs key '${r}' from schema '${e}'`):l.$defs[r]=n;l.allOf.push(t)}let p=this._extractWritableFields(l,e);e.id&&-1===p.indexOf("id")&&p.push("id"),e.slug&&-1===p.indexOf("slug")&&p.push("slug"),p=p.filter((e=>!a.includes(e)));const u=Object.fromEntries(p.map((t=>{const r=e[t];return[t,"function"==typeof i[t]?i[t](r,e):r]})).filter((([e,t])=>void 0!==t))),d=structuredClone?structuredClone(u):JSON.parse(JSON.stringify(u)),m=b(r)?Object.assign(r,u):_(u),f=b(t)?t:t&&"object"==typeof t?_(t):t;return{draft:m,proxy:this._createDraftProxy(o,f,m,p,i,{throwOnError:s}),initial:d}}_extractChangedFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=c[e];JSON.stringify(t)!==JSON.stringify(n)&&(a[e]=t)}return Object.keys(a).length>0?a:null}_extractAllValidFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c={},l=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=l[e];JSON.stringify(t)!==JSON.stringify(n)&&(a[e]=t),c[e]=t}return Object.keys(a).length>0?c:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t?.contextId||t?.contextType!==e)throw new ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){throw t instanceof ApiResponseError?t?.responseData?.contextType!==e?t:new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData):t}return this.id}async _getPublicProfile(){return await this._resolveId(this.getEntityType()),this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:this.getEntityType()}})}_getEntityMeta(e){const t=this.constructor,r=this.__entityTag,n={EndpointApi:this.deps.EndpointApi,User:"User"===r?t:this.deps.User,Organization:"Organization"===r?t:this.deps.Organization,Project:"Project"===r?t:this.deps.Project,Event:"Event"===r?t:this.deps.Event,Poi:"Poi"===r?t:this.deps.Poi,Badge:"Badge"===r?t:this.deps.Badge,News:"News"===r?t:this.deps.News};return{citoyens:{entityClass:n.User,deps:n},organizations:{entityClass:n.Organization,deps:n},projects:{entityClass:n.Project,deps:n},events:{entityClass:n.Event,deps:{...n,Badge:void 0}},poi:{entityClass:n.Poi,deps:{...n,Badge:void 0,News:void 0}},news:{entityClass:n.News,deps:{...n}},badges:{entityClass:n.Badge,deps:{EndpointApi:n.EndpointApi,User:n.User,Organization:n.Organization,Project:n.Project}}}[e]||null}_linkEntity(e,t){const r=this._getEntityMeta(e);return r?r.entityClass.fromServerData(t,this,r.deps):t}async _linkEntityById(e,t,r={}){const n=this._getEntityMeta(e);if(!n)return null;const o=new n.entityClass(this,{id:t},n.deps);return r?.skipGet||await o.get(),o}_linkEntities(e){return e.flatMap((e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[])))}async linkEntitiesFromServerData(e,t={},r={}){const n=r.key||e,o="function"==typeof r.mapFn?r.mapFn:null,i=e=>!0===e||"true"===e,s=e=>!1===e||"false"===e,a=this.serverData?.[n],c=[];if(a&&"object"==typeof a&&Object.keys(a).length>0)for(const r of Object.keys(a)){const n=a[r],l=Object.entries(t).every((([e,t])=>{const r=n[e];if("function"==typeof t)try{return t(r)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof r&&t.test(r):"string"==typeof t&&"string"==typeof r?r.toLowerCase().includes(t.toLowerCase()):i(t)?i(r):s(t)?s(r):"string"!=typeof r||"string"!=typeof t||isNaN(Date.parse(r))||isNaN(Date.parse(t))?r===t:new Date(r).getTime()===new Date(t).getTime()}));if(l)try{const t=await this._linkEntityById(e,r);t&&(t.meta=n,c.push(o?o(t):t))}catch(t){this._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${r}) :`,t)}}return c}_entityInstanceData(e,t){const r=this._getEntityMeta(e),n=this.__entityTag,o=this.constructor;return new r.entityClass(this,t,{[n]:o,...r.deps})}async entity(e,t={}){try{const r=this._entityInstanceData(e,t),n={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"]}[e];return n&&this._hasAtLeastOne(t,n)&&await r.get(),r}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new ApiError("Le slug est requis.");try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t?.contextId&&t?.contextType)return await this.entity(t.contextType,{id:t.contextId});throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}_buildLinkFilters(e,{linkType:t,isAdmin:r,isAdminPending:n,isInviting:o,toBeValidated:i=!1,roles:s=[]}={}){if("string"!=typeof e)throw new TypeError("id doit être une chaîne.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("isInviting doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(s))throw new TypeError("roles doit être un tableau de chaînes.");const a=`links.${t}.${e}`,c={[`${a}`]:{$exists:!0}};return"boolean"==typeof i&&(c[`${a}.toBeValidated`]={$exists:i}),"boolean"==typeof o&&(c[`${a}.isInviting`]={$exists:o}),!0===r&&(c[`${a}.isAdmin`]={$exists:!0}),!0===n&&(c[`${a}.isAdminPending`]={$exists:!0}),s.length>0&&(c[`${a}.roles`]={$in:s}),c}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof ApiError)throw new ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.callIsMe((()=>this.endpointApi.connect(t)));return await this.userContext.refresh(),r}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async _submitLinkRequestAdmin(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const e=this._getLinkFromConnectedUser();if(!e){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"admin"},t=await this.callIsMe((()=>this.endpointApi.connect(e)));return await this.userContext.refresh(),t}if(e.isInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new ApiError("Vous êtes déjà en attente de validation pour devenir admin.");if(e.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async _acceptLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this._getLinkFromConnectedUser().isInviting){const e={parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.callIsMe((()=>this.endpointApi.linkValidate(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous n'avez pas d'invitation à valider.")}async _leaveLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.");const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.callIsMe((()=>this.endpointApi.disconnect(t)));return await this.userContext.refresh(),r}async get(){return this.apiClient.safeCall((async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}))}async updateSettings(e={}){return e.idEntity=this.id,e.typeEntity=this.getEntityType(),this.callIsConnected((()=>this.endpointApi.updateSettings(e)))}async updateDescription(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockDescription(e)))}async updateInfo(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockInfo(e)))}async updateSocial(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockSocial(e)))}async updateLocality(e={}){return e.typeElement=this.getEntityType(),e.id=this.id,this.callIsConnected((()=>this.endpointApi.updateBlockLocality(e)))}async updateSlug({slug:e}){try{await this.endpointApi.check({type:this.getEntityType(),id:this.id,slug:e})}catch(e){if(e instanceof ApiResponseError)throw new ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.data);throw e}return this.callIsConnected((()=>this.endpointApi.updateBlockSlug({typeElement:this.getEntityType(),id:this.id,slug:e})))}async updateImageProfil({profil_avatar:e}){e=await this._validateImage(e);const t={pathParams:{folder:this.getEntityType(),ownerId:this.id},profil_avatar:e};return this.callIsConnected((()=>this.endpointApi.profilImage(t)))}async organization(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.");return this.entity("organizations",e)}async project(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un projet.");return this.entity("projects",e)}async poi(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un POI.");return this.entity("poi",e)}async event(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un événement.");return this.entity("events",e)}async badge(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un badge.");return this.entity("badges",e)}async news(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.");return this.entity("news",e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e))())}).next()}async getProjects(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getProjectsAdmin(e))):()=>this.endpointApi.getProjectsNoAdmin(e))())}).next()}async getPois(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getPoisAdmin(e))):()=>this.endpointApi.getPoisNoAdmin(e))())}).next()}async getSubscribers(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){e.pathParams={type:this.getEntityType(),id:this.id};const t=await this.endpointApi.getNews(e);if(!Array.isArray(t))throw new ApiResponseError("Erreur lors de la récupération des actualités.",500,t);const r=this._linkEntities(t);return this._createFilteredProxy(r)}async requestToJoin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async acceptInvitation(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.");return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour suivre cette entité.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id},t=await this.callIsMe((()=>this.endpointApi.follow(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous êtes déjà abonné à cette entité.")}async unfollow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour vous désabonner.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.callIsMe((()=>this.endpointApi.disconnect(e)));return await this.userContext.refresh(),t}throw new ApiError("Vous n'êtes pas abonné à cette entité.")}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new ApiError(`Vous devez être connecté pour ${e}`);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:r}=e;return!t&&!r}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`)}_isLinked(e){return!!this.userContext?.serverData?.links?.[e]?.[this.id]}isAuthor(){if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new ApiError("Aucune donnée serveur disponible.");return this.userId&&this.serverData?.creator===this.userId}isAdmin(){this._checkAccess("vérifier l'administrateur."),this._assertEntityType("organizations","projects","events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)&&!0===e?.isAdmin&&!e?.isAdminPending}isAuthorOrAdmin(){return this._checkAccess("vérifier l'auteur ou l'administrateur."),this.isAuthor()||this.isAdmin()}isMember(){this._checkAccess("vérifier le membre."),this._assertEntityType("organizations");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isContributor(){this._checkAccess("vérifier le contributeur."),this._assertEntityType("projects");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isAttendee(){this._checkAccess("vérifier si vous êtes un participant."),this._assertEntityType("events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){return this._checkAccess("vérifier si il vous suit."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("followers")}isFollowing(){return this._checkAccess("vérifier si vous le suivez."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("follows")}async getCostumJson(){if(!this.serverData.slug)throw new ApiError("slug de l'entité non défini");const e={pathParams:{slug:this.serverData.slug}};return this.endpointApi.getCostumJson(e)}_generateRanges(e,t,r={}){const n={};for(const o of e){const e=r[o]||{indexMax:0};n[o]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return n}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce(((e,t)=>e+("number"==typeof t?t:0)),0),e}_getDefaultFromEndpoint(e,t){const r=this.apiClient._endpoints.find((t=>t.constant===e));if(r?.request?.properties?.[t])return r.request.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t}){const r=this,n={cursor:void 0,count:0,index:0,history:[],sizes:[]},o=e=>e?.indexStep&&e.indexStep>0;async function i(s=!1){let a={...e};n.cursor&&(s||0!==n.history.length)||(n.count=0,n.index=0,n.history=[],n.sizes=[],a.countType=a.searchType,!a?.searchBy&&o(a)?(a.ranges=r._generateRanges(a.searchType,a.indexStep),a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep):"ALL"===a?.searchBy&&o(a)&&(a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep),n.cursor={...a});const c=n.cursor;if(s&&(n.history.push({...c}),!c.searchBy&&o(c)?(c.ranges=r._generateRanges(c.searchType,c.indexStep,c.ranges),c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep):"ALL"===c.searchBy&&o(c)&&(c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep),n.cursor={...c}),a={...n.cursor},!(s||a?.searchType&&Array.isArray(a.searchType)&&0!==a.searchType.length))throw new Error("searchType non défini");const l=await t(a);if(!Array.isArray(l.results))throw new Error("Les résultats doivent être un tableau");n.count+=l.results.length,n.sizes.push(l.results.length),s&&n.index++;const p=r._normalizeCount(l.count),u=r._linkEntities(l.results),d=o(a)&&n.count<p.total,m=n.history.length>0;return{count:p,results:u,pageIndex:n.index,pageNumber:n.index+1,hasNext:d,hasPrev:m,next:d?()=>i(!0):void 0,prev:m?async()=>{const e=n.history.pop(),t=n.sizes.pop()??0;return n.count-=t,n.index=Math.max(0,n.index-1),n.cursor={...e},i(!1)}:void 0}}return{next:()=>i(!1)}}_withCostumContext(e){return async t=>{const r={...t,costumSlug:this.serverData.slug,contextId:this.serverData.id,contextType:this.getEntityType(),sourceKey:[...t.sourceKey||[],this.serverData.slug]};return e(r)}}async searchCostum(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.globalAutocompleteCostum(e)))}).next()}async costumEventRequestActors(e={}){e={pathParams:{id:this.id,type:this.getEntityType()},...e};const t=this._withCostumContext((e=>this.endpointApi.costumEventRequestActors(e)));return await t(e)}async costumEventRequestSubevents(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestSubevents(e)))(e)}async costumEventRequestDates(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestDates(e)))(e)}async costumEventRequestElementEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestElementEvent(e)))(e)}async costumEventRequestCategories(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestCategories(e)))(e)}async costumEventRequestEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestEvent(e)))(e)}async costumEventRequestLinkTlToEvent(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestLinkTlToEvent(e)))(e)}async costumEventRequestLoadContextTag(e={}){return e={pathParams:{id:this.id,type:this.getEntityType()},...e},this._withCostumContext((e=>this.endpointApi.costumEventRequestLoadContextTag(e)))(e)}};class Badge extends O{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];transforms={};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Badge.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Badge.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`)}async getSubscribers(){throw new ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`)}}const P=class EndpointApi{constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.");return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.");return this.call(e,t)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deletePoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_POI",e)}async deleteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}};class Event extends O{static entityType="events";static entityTag="Event";static SCHEMA_CONSTANTS=["ADD_EVENT","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{type:t?.type??null,name:t?.name??null}]))):null,organizer:e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{type:t?.type??null,name:t?.name??null}]))):null};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Event.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");let t=!1;const r=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_EVENT",{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);r&&Object.keys(r).length>0&&(await this.addEvent(r),t=!0),e.id&&delete e.id;for(const[r,n]of Event.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addEvent(e={}){return this.isMe||e.organizer||(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addEvent(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class News extends O{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=[];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map((e=>({...e,count:parseInt(e.count)}))):[],mediaImg:e=>{const t=e?.images?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:void 0},mediaFile:e=>{const t=e?.files?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:void 0}};async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.");const e=await this.callIsConnected((()=>this.endpointApi.getNewsById({ids:[this.id]})));if(e&&Array.isArray(e)&&1===e.length){const t=e[0];return this._setData(t),this.serverData}throw new ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`)}async _add(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),e.parentId=this.parent.id,e.parentType=this.parent.getEntityType();for(const[t,r]of News.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}}async _update(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),e.parentId=this.parent.id,e.parentType=this.parent.getEntityType(),e.idNews=this.id;let t=!1;const r=await this.callIsConnected((()=>this.endpointApi.updateNews(e)));return r?.object&&(this._serverData={...r.object}),t=!0,!0}async addNews(e={}){return this.callIsConnected((()=>this.endpointApi.addNews(e)))}async updateNews(e={}){return this.callIsConnected((()=>this.endpointApi.updateNews(e)))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.");const r=await this.entity("citoyens",{id:t,slug:e}),n=r.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find((e=>e.id===n.id)))return this._draftData.mentions=this._draftData.mentions.map((e=>(e.id===n.id&&(e.count+=1),e))),this._draftData.mentions;const o={id:n.id,slug:n.slug,type:r.getEntityType(),name:n.name,value:n.name,count:1};return this._draftData.mentions.push(o),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){e=await this._validateImage(e);const t={pathParams:{folder:this.parent.getEntityType(),ownerId:this.parent.id},newsImage:e},r=await this.callIsConnected((()=>this.endpointApi.addImageNews(t)));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(r.id)):this._draftData.mediaImg={countImages:1,images:[r.id]},r}async addFile(e){e=await this._validateFile(e);const t={pathParams:{folder:this.parent.getEntityType(),ownerId:this.parent.id},newsFile:e},r=await this.callIsConnected((()=>this.endpointApi.addFileNews(t)));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(r)):this._draftData.mediaFile={countFiles:1,files:[r]},r}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une news.");const e={pathParams:{id:this.id}};await this.callIsConnected((()=>this.endpointApi.deleteNews(e))),this._draftData={},this._serverData=null,this._draftData.id=null,this._isDeleted=!0}}class Organization extends O{static entityType="organizations";static entityTag="Organization";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Organization.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Organization.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addOrganization(e={}){return this.callIsConnected((()=>this.endpointApi.addOrganization(e)))}async getOrganizations(){throw new ApiError("getOrganizations n'existe pas dans Organization")}async getProjects(e={}){return super.getProjects(e)}async getEvents(){throw new ApiError("getEvents pas encore implémenté dans Organization")}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isAdminPending:o,isInviting:i,roles:s=[]}=t;return this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"memberOf",toBeValidated:r,isAdmin:n,isAdminPending:o,isInviting:i,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"memberOf",toBeValidated:!1,isAdmin:n,isInviting:i,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getMembersAdmin(e))):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e={}){return super.searchCostum(e)}}class Poi extends O{static entityType="poi";static entityTag="Poi";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Poi.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAuthor())throw new ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Poi.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addPoi(e={}){return this.isMe||(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addPoi(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans${this.constructor.name}`)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends O{static entityType="projects";static entityTag="Project";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal,parent:e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{type:t?.type??null,name:t?.name??null}]))):null};async _add(e){if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save");e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Project.ADD_BLOCKS){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}}async _update(e){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of Project.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}async addProject(e={}){return this.isMe||(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addProject(e)))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`)}async getProjects(e={}){return super.getProjects(e)}async getEvents(){throw new ApiError(`getEvents pas encore implémenté dans ${this.constructor.name}`)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getContributorsAdmin(e))):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class User extends O{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};constructor(e,t={},r={}){if(!r.EndpointApi)throw new ApiError("EndpointApi class must be injected to avoid circular dependency.");if(!t?.id&&!t?.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.");if(!r.Organization)throw new ApiError("Organization class must be injected.");if(!r.Project)throw new ApiError("Project class must be injected.");if(!r.Event)throw new ApiError("Event class must be injected.");if(!r.Poi)throw new ApiError("Poi class must be injected.");if(!r.Badge)throw new ApiError("Badge class must be injected.");if(!r.News)throw new ApiError("News class must be injected.");super(e,t,r)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}async get(){return this.apiClient.safeCall((async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e),e}{const e=await this._getPublicProfile();return this._setData(e),e}}))}async changePassword(e={}){return this.callIsMe((()=>this.endpointApi.changePassword(e)))}async delete(e={}){return this.callIsMe((()=>this.endpointApi.deleteAccount(e)))}async save(){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.");await super.save()}async _add(){throw new ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.")}async _update(e){if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id;let t=!1;for(const[r,n]of User.UPDATE_BLOCKS){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t}static fromServerData(e,t,r){const n=new User(t.apiClient,e,r);return("object"==typeof e||Object.keys(e).length>0)&&n._setData(e),n}async updateSettings(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.");await super.updateSettings(e),await this.refresh()}async updateDescription(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.");return super.updateDescription(e)}async updateInfo(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.");return super.updateInfo(e)}async updateSocial(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.");return super.updateSocial(e)}async updateLocality(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.");return super.updateLocality(e)}async updateSlug({slug:e}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.");return super.updateSlug({slug:e})}async updateImageProfil({profil_avatar:e}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.");return super.updateImageProfil({profil_avatar:e})}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getProjects(e={}){return super.getProjects(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,this.isMe||(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getSubscriptionsAdmin(e))):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async user(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur");if(!e.id&&!e.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.");const t=new User(this,e,this.deps);return await t.get(),t}async organization(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.");return super.organization(e)}async project(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.");return super.project(e)}async news(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.");return super.news(e)}async poi(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.");return super.poi(e)}async event(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.");return super.event(e)}async badge(e={}){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.");return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour envoyer une demande d'amis.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.connect(t);return await this.userContext.refresh(),r}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.");throw new ApiError("Vous êtes déjà connecté à cette entité.")}async acceptFriendRequest(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour accepter une demande d'amitié.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await this.userContext.refresh(),t}throw new ApiError("Vous n'avez pas d'invitation à valider.")}async removeFriend(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour supprimer un ami.");if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.");const t={parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.disconnect(t);return await this.userContext.refresh(),r}requestToJoin(){throw new ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.")}requestToJoinAdmin(){throw new ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.")}acceptInvitation(){throw new ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.")}leave(){throw new ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.")}async follow(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour suivre un utilisateur.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await this.userContext.refresh(),t}throw new ApiError("Vous êtes déjà abonné à cet utilisateur.")}async unfollow(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await this.userContext.refresh(),t}throw new ApiError("Vous n'êtes pas abonné à cet utilisateur.")}isFriend(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous êtes ami.");this._assertEntityType("citoyens");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si il vous suit.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(){if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous le suivez.");if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`);return this._assertEntityType("citoyens"),this._isLinked("follows")}}Object.assign(User.prototype,{});var $=__webpack_require__(7007);const x=(e,t)=>1===t?e:`${e}s`,k=e=>{if(""===e)return"$";const t=e.substring(1).split(/\//).map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~").replace(/\./g,"\\."))).map((e=>/^\d+$/.exec(e)?`[${e}]`:`.${e}`)).join("");return"$"+t},j=e=>{switch(e[0]){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}},I=(e,t="and")=>0===e.length?"nothing":1===e.length?e[0]:2===e.length?`${e[0]} ${t} ${e[1]}`:`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`,C={"date-time":"date and time",time:"time",date:"date",email:"email address",hostname:"hostname",ipv4:"IPv4 address",ipv6:"IPv6 address",uri:"URI","uri-reference":"URI Reference","uri-template":"URI-template","json-pointer":"JSON Pointer","relative-json-pointer":"relative JSON Pointer",regex:"regular expression"},N={fieldLabels:"title",includeOriginalError:!1,includeData:!1};class AjvError extends Error{constructor(e,t={}){super(),this.options={},this.redundant=!1,this.options={...N,...t},this.pointer=e.instancePath,this.path=k(e.instancePath);const r=(({data:e,keyword:t,message:r,params:n,parentSchema:o,schemaPath:i,instancePath:s},{fieldLabels:a})=>{const c=(({instancePath:e,parentSchema:t},{fieldLabels:r})=>{switch(r){case"js":return""===e?"the root value":`the value at ${k(e).replace(/^\$/,"")}`;case"jsonPath":return`the value at ${k(e)}`;case"jsonPointer":case"instancePath":return""===e?"the root value":`the value at ${e}`;case"title":return(null==t?void 0:t.title)?t.title:""===e?"the root value":`the value at ${e}`;default:throw new Error(`invalid fieldLabels value: ${r}`)}})({instancePath:s,parentSchema:o},{fieldLabels:a});if(null==o?void 0:o.errorMessage)return`${c} ${o.errorMessage}`;switch(t){case"enum":{const e=n.allowedValues.map(JSON.stringify);return`${c} must be one of: ${I(e,"or")}`}case"type":{const t=Array.isArray(n.type)?n.type:n.type.split(","),r=I(t,"or"),o=(e=>{const t=typeof e;switch(t){case"object":return null===e?"null":Array.isArray(e)?"an array":"an object";case"undefined":return"undefined";default:return`${j(t)} ${t}`}})(e);return`${c} must be ${j(r)} ${r} but it was ${o}`}case"minLength":{const t=n.limit,r=x("character",t),o=e.length;return`${c} must be ${t} ${r} or more but it was ${o} ${x("character",o)}`}case"maxLength":{const t=n.limit,r=x("character",t),o=e.length;return`${c} must be ${t} ${r} or fewer but it was ${o} ${x("character",o)}`}case"pattern":{if(i.endsWith("propertyNames/pattern"))return null;const e=null==o?void 0:o.patternLabel;return e?`${c} must be ${e} but it was not`:`${c} is an invalid string`}case"format":return`${c} must be a valid ${C[n.format]||n.format} string but it was not`;case"multipleOf":return`${c} must be a multiple of ${n.multipleOf}`;case"minimum":return`${c} must be equal to or greater than ${n.limit}`;case"exclusiveMinimum":return`${c} must be greater than ${n.limit}`;case"maximum":return`${c} must be equal to or less than ${n.limit}`;case"exclusiveMaximum":return`${c} must be less than ${n.limit}`;case"additionalProperties":{const e=Object.keys(null==o?void 0:o.properties).join(", ");return`${c} has an unexpected property, ${n.additionalProperty}, which is not in the list of allowed properties (${e})`}case"required":return`${c} is missing the required field '${n.missingProperty}'`;case"propertyNames":return`${c} has an invalid property name ${JSON.stringify(n.propertyName)}`;case"minProperties":return`${c} must have ${n.limit} or more properties but it has ${Object.keys(e).length}`;case"maxProperties":return`${c} must have ${n.limit} or fewer properties but it has ${Object.keys(e).length}`;case"dependencies":{const e=n.property;return`${c} must have property ${n.missingProperty} when ${e} is present`}case"minItems":return`${c} must have ${n.limit} or more items but it has ${e.length}`;case"maxItems":return`${c} must have ${n.limit} or fewer items but it has ${e.length}`;case"uniqueItems":{const{i:e,j:t}=n;return`${c} must be unique but elements ${t} and ${e} are the same`}default:return`${c} ${r}`}})(e,this.options);var n;null!==r?(this.message=`${n=r,"string"!=typeof n||0===n.length?n:n.charAt(0).toUpperCase()+n.slice(1)}.`,this.options.includeOriginalError&&(this.original=e),this.options.includeData&&(this.data=e.data)):this.redundant=!0}toJSON(){const e={path:this.path,pointer:this.pointer,message:this.message};return this.options.includeOriginalError&&(e.original=this.original),this.options.includeData&&(e.data=this.data),e}}class AggregateAjvError extends Error{constructor(e,t={}){super(),this.name="AggregateAjvError",this.errors=(null!=e?e:[]).map((e=>new AjvError(e,t))).filter((e=>!e.redundant)),this.message=this.errors.map((e=>e.message)).join(" ")}toJSON(){return this.errors.map((e=>e.toJSON()))}*[Symbol.iterator](){for(const e of this.errors)yield e}}var R=__webpack_require__(3282),D=__webpack_require__(8182);function L(e,t){return function(){return e.apply(t,arguments)}}const{toString:M}=Object.prototype,{getPrototypeOf:z}=Object,{iterator:q,toStringTag:B}=Symbol,U=(F=Object.create(null),e=>{const t=M.call(e);return F[t]||(F[t]=t.slice(8,-1).toLowerCase())});var F;const V=e=>(e=e.toLowerCase(),t=>U(t)===e),G=e=>t=>typeof t===e,{isArray:K}=Array,J=G("undefined"),H=V("ArrayBuffer"),Z=G("string"),W=G("function"),Q=G("number"),Y=e=>null!==e&&"object"==typeof e,X=e=>{if("object"!==U(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||B in e||q in e)},ee=V("Date"),te=V("File"),re=V("Blob"),ne=V("FileList"),oe=V("URLSearchParams"),[ie,se,ae,ce]=["ReadableStream","Request","Response","Headers"].map(V);function le(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),K(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(n=0;n<i;n++)s=o[n],t.call(null,e[s],s,e)}}function pe(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,de=e=>!J(e)&&e!==ue,me=(fe="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>fe&&e instanceof fe);var fe;const he=V("HTMLFormElement"),ye=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ge=V("RegExp"),we=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};le(r,((r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},_e=V("AsyncFunction"),be=(ve="function"==typeof setImmediate,Ee=W(ue.postMessage),ve?setImmediate:Ee?(Te=`axios@${Math.random()}`,Se=[],ue.addEventListener("message",(({source:e,data:t})=>{e===ue&&t===Te&&Se.length&&Se.shift()()}),!1),e=>{Se.push(e),ue.postMessage(Te,"*")}):e=>setTimeout(e));var ve,Ee,Te,Se;const Ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ue):"undefined"!=typeof process&&process.nextTick||be,Oe={isArray:K,isArrayBuffer:H,isBuffer:function(e){return null!==e&&!J(e)&&null!==e.constructor&&!J(e.constructor)&&W(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||W(e.append)&&("formdata"===(t=U(e))||"object"===t&&W(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&H(e.buffer),t},isString:Z,isNumber:Q,isBoolean:e=>!0===e||!1===e,isObject:Y,isPlainObject:X,isReadableStream:ie,isRequest:se,isResponse:ae,isHeaders:ce,isUndefined:J,isDate:ee,isFile:te,isBlob:re,isRegExp:ge,isFunction:W,isStream:e=>Y(e)&&W(e.pipe),isURLSearchParams:oe,isTypedArray:me,isFileList:ne,forEach:le,merge:function e(){const{caseless:t}=de(this)&&this||{},r={},n=(n,o)=>{const i=t&&pe(r,o)||o;X(r[i])&&X(n)?r[i]=e(r[i],n):X(n)?r[i]=e({},n):K(n)?r[i]=n.slice():r[i]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&le(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(le(t,((t,n)=>{r&&W(t)?e[n]=L(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==r&&z(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:U,kindOfTest:V,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!Q(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[q]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:he,hasOwnProperty:ye,hasOwnProp:ye,reduceDescriptors:we,freezeMethods:e=>{we(e,((t,r)=>{if(W(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];W(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return K(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:pe,global:ue,isContextDefined:de,isSpecCompliantForm:function(e){return!!(e&&W(e.append)&&"FormData"===e[B]&&e[q])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=K(e)?[]:{};return le(e,((e,t)=>{const i=r(e,n+1);!J(i)&&(o[t]=i)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:_e,isThenable:e=>e&&(Y(e)||W(e))&&W(e.then)&&W(e.catch),setImmediate:be,asap:Ae,isIterable:e=>null!=e&&W(e[q])};function Pe(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Oe.inherits(Pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Oe.toJSONObject(this.config),code:this.code,status:this.status}}});const $e=Pe.prototype,xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{xe[e]={value:e}})),Object.defineProperties(Pe,xe),Object.defineProperty($e,"isAxiosError",{value:!0}),Pe.from=(e,t,r,n,o,i)=>{const s=Object.create($e);return Oe.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Pe.call(s,e.message,t,r,n,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const ke=Pe;function je(e){return Oe.isPlainObject(e)||Oe.isArray(e)}function Ie(e){return Oe.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,r){return e?e.concat(t).map((function(e,t){return e=Ie(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ne=Oe.toFlatObject(Oe,{},null,(function(e){return/^is[A-Z]/.test(e)})),Re=function(e,t,r){if(!Oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Oe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Oe.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Oe.isSpecCompliantForm(t);if(!Oe.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Oe.isDate(e))return e.toISOString();if(!a&&Oe.isBlob(e))throw new ke("Blob is not supported. Use a Buffer instead.");return Oe.isArrayBuffer(e)||Oe.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(Oe.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Oe.isArray(e)&&function(e){return Oe.isArray(e)&&!e.some(je)}(e)||(Oe.isFileList(e)||Oe.endsWith(r,"[]"))&&(a=Oe.toArray(e)))return r=Ie(r),a.forEach((function(e,n){!Oe.isUndefined(e)&&null!==e&&t.append(!0===s?Ce([r],n,i):null===s?r:r+"[]",c(e))})),!1;return!!je(e)||(t.append(Ce(o,r,i),c(e)),!1)}const p=[],u=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:je});if(!Oe.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Oe.isUndefined(r)){if(-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));p.push(r),Oe.forEach(r,(function(r,i){!0===(!(Oe.isUndefined(r)||null===r)&&o.call(t,r,Oe.isString(i)?i.trim():i,n,u))&&e(r,n?n.concat(i):[i])})),p.pop()}}(e),t};function De(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Le(e,t){this._pairs=[],e&&Re(e,this,t)}const Me=Le.prototype;Me.append=function(e,t){this._pairs.push([e,t])},Me.toString=function(e){const t=e?function(t){return e.call(this,t,De)}:De;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ze=Le;function qe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,r){if(!t)return e;const n=r&&r.encode||qe;Oe.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Oe.isURLSearchParams(t)?t.toString():new ze(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ue=class InterceptorManager{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Oe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ve={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ge="undefined"!=typeof window&&"undefined"!=typeof document,Ke="object"==typeof navigator&&navigator||void 0,Je=Ge&&(!Ke||["ReactNative","NativeScript","NS"].indexOf(Ke.product)<0),He="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ze=Ge&&window.location.href||"http://localhost",We={...r,...Ve},Qe=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&Oe.isArray(n)?n.length:i,a?(Oe.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s):(n[i]&&Oe.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&Oe.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!s)}if(Oe.isFormData(e)&&Oe.isFunction(e.entries)){const r={};return Oe.forEachEntry(e,((e,n)=>{t(function(e){return Oe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},Ye={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Oe.isObject(e);if(o&&Oe.isHTMLForm(e)&&(e=new FormData(e)),Oe.isFormData(e))return n?JSON.stringify(Qe(e)):e;if(Oe.isArrayBuffer(e)||Oe.isBuffer(e)||Oe.isStream(e)||Oe.isFile(e)||Oe.isBlob(e)||Oe.isReadableStream(e))return e;if(Oe.isArrayBufferView(e))return e.buffer;if(Oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Re(e,new We.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return We.isNode&&Oe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Re(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(Oe.isString(e))try{return(0,JSON.parse)(e),Oe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ye.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Oe.isResponse(e)||Oe.isReadableStream(e))return e;if(e&&Oe.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw ke.from(e,ke.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Oe.forEach(["delete","get","head","post","put","patch"],(e=>{Ye.headers[e]={}}));const Xe=Ye,et=Oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tt=Symbol("internals");function rt(e){return e&&String(e).trim().toLowerCase()}function nt(e){return!1===e||null==e?e:Oe.isArray(e)?e.map(nt):String(e)}function ot(e,t,r,n,o){return Oe.isFunction(n)?n.call(this,t,r):(o&&(t=r),Oe.isString(t)?Oe.isString(n)?-1!==t.indexOf(n):Oe.isRegExp(n)?n.test(t):void 0:void 0)}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=rt(t);if(!o)throw new Error("header name must be a non-empty string");const i=Oe.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=nt(e))}const i=(e,t)=>Oe.forEach(e,((e,r)=>o(e,r,t)));if(Oe.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Oe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&et[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Oe.isObject(e)&&Oe.isIterable(e)){let r,n,o={};for(const t of e){if(!Oe.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Oe.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=rt(e)){const r=Oe.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Oe.isFunction(t))return t.call(this,e,r);if(Oe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=rt(e)){const r=Oe.findKey(this,e);return!(!r||void 0===this[r]||t&&!ot(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=rt(e)){const o=Oe.findKey(r,e);!o||t&&!ot(0,r[o],o,t)||(delete r[o],n=!0)}}return Oe.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ot(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Oe.forEach(this,((n,o)=>{const i=Oe.findKey(r,o);if(i)return t[i]=nt(n),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete t[o],t[s]=nt(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Oe.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Oe.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[tt]=this[tt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=rt(e);t[n]||(function(e,t){const r=Oe.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Oe.isArray(e)?e.forEach(n):n(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Oe.reduceDescriptors(AxiosHeaders.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Oe.freezeMethods(AxiosHeaders);const it=AxiosHeaders;function st(e,t){const r=this||Xe,n=t||r,o=it.from(n.headers);let i=n.data;return Oe.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function at(e){return!(!e||!e.__CANCEL__)}function ct(e,t,r){ke.call(this,null==e?"canceled":e,ke.ERR_CANCELED,t,r),this.name="CanceledError"}Oe.inherits(ct,ke,{__CANCEL__:!0});const lt=ct;function pt(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new ke("Request failed with status code "+r.status,[ke.ERR_BAD_REQUEST,ke.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const ut=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[s];o||(o=c),r[i]=a,n[i]=c;let p=s,u=0;for(;p!==i;)u+=r[p++],p%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(r=e,n||(n=setTimeout((()=>{n=null,s(r)}),i-a)))},()=>r&&s(r)]}((r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,c=o(a);n=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),r)},dt=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},mt=e=>(...t)=>Oe.asap((()=>e(...t))),ft=We.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,We.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(We.origin),We.navigator&&/(msie|trident)/i.test(We.navigator.userAgent)):()=>!0,ht=We.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];Oe.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Oe.isString(n)&&s.push("path="+n),Oe.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function yt(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const gt=e=>e instanceof it?{...e}:e;function wt(e,t){t=t||{};const r={};function n(e,t,r,n){return Oe.isPlainObject(e)&&Oe.isPlainObject(t)?Oe.merge.call({caseless:n},e,t):Oe.isPlainObject(t)?Oe.merge({},t):Oe.isArray(t)?t.slice():t}function o(e,t,r,o){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Oe.isUndefined(t))return n(void 0,t)}function s(e,t){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>o(gt(e),gt(t),0,!0)};return Oe.forEach(Object.keys(Object.assign({},e,t)),(function(n){const i=c[n]||o,s=i(e[n],t[n],n);Oe.isUndefined(s)&&i!==a||(r[n]=s)})),r}const _t=e=>{const t=wt({},e);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=it.from(a),t.url=Be(yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Oe.isFormData(n))if(We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(r=a.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(We.hasStandardBrowserEnv&&(o&&Oe.isFunction(o)&&(o=o(t)),o||!1!==o&&ft(t.url))){const e=i&&s&&ht.read(s);e&&a.set(i,e)}return t},bt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=_t(e);let o=n.data;const i=it.from(n.headers).normalize();let s,a,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=n;function f(){l&&l(),p&&p(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function y(){if(!h)return;const n=it.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());pt((function(e){t(e),f()}),(function(e){r(e),f()}),{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(r(new ke("Request aborted",ke.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new ke("Network Error",ke.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Fe;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new ke(t,o.clarifyTimeoutError?ke.ETIMEDOUT:ke.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&Oe.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),Oe.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),u&&"json"!==u&&(h.responseType=n.responseType),m&&([c,p]=ut(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([a,l]=ut(d),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new lt(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===We.protocols.indexOf(g)?r(new ke("Unsupported protocol "+g+":",ke.ERR_BAD_REQUEST,e)):h.send(o||null)}))},vt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ke?t:new lt(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new ke(`timeout ${t} of ms exceeded`,ke.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=n;return a.unsubscribe=()=>Oe.asap(s),a}},Et=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Tt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Et(r,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let i=n.byteLength;if(r){let e=s+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},St="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,At=St&&"function"==typeof ReadableStream,Ot=St&&("function"==typeof TextEncoder?(Pt=new TextEncoder,e=>Pt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Pt;const $t=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},xt=At&&$t((()=>{let e=!1;const t=new Request(We.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),kt=At&&$t((()=>Oe.isReadableStream(new Response("").body))),jt={stream:kt&&(e=>e.body)};var It;St&&(It=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!jt[e]&&(jt[e]=Oe.isFunction(It[e])?t=>t[e]():(t,r)=>{throw new ke(`Response type '${e}' is not supported`,ke.ERR_NOT_SUPPORT,r)})})));const Ct={http:null,xhr:bt,fetch:St&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:p,withCredentials:u="same-origin",fetchOptions:d}=_t(e);l=l?(l+"").toLowerCase():"text";let m,f=vt([o,i&&i.toAbortSignal()],s);const h=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let y;try{if(c&&xt&&"get"!==r&&"head"!==r&&0!==(y=await(async(e,t)=>{const r=Oe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Oe.isBlob(e))return e.size;if(Oe.isSpecCompliantForm(e)){const t=new Request(We.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Oe.isArrayBufferView(e)||Oe.isArrayBuffer(e)?e.byteLength:(Oe.isURLSearchParams(e)&&(e+=""),Oe.isString(e)?(await Ot(e)).byteLength:void 0)})(t):r})(p,n))){let e,r=new Request(t,{method:"POST",body:n,duplex:"half"});if(Oe.isFormData(n)&&(e=r.headers.get("content-type"))&&p.setContentType(e),r.body){const[e,t]=dt(y,ut(mt(c)));n=Tt(r.body,65536,e,t)}}Oe.isString(u)||(u=u?"include":"omit");const o="credentials"in Request.prototype;m=new Request(t,{...d,signal:f,method:r.toUpperCase(),headers:p.normalize().toJSON(),body:n,duplex:"half",credentials:o?u:void 0});let i=await fetch(m);const s=kt&&("stream"===l||"response"===l);if(kt&&(a||s&&h)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Oe.toFiniteNumber(i.headers.get("content-length")),[r,n]=a&&dt(t,ut(mt(a),!0))||[];i=new Response(Tt(i.body,65536,r,(()=>{n&&n(),h&&h()})),e)}l=l||"text";let g=await jt[Oe.findKey(jt,l)||"text"](i,e);return!s&&h&&h(),await new Promise(((t,r)=>{pt(t,r,{data:g,headers:it.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:m})}))}catch(t){if(h&&h(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ke("Network Error",ke.ERR_NETWORK,e,m),{cause:t.cause||t});throw ke.from(t,t&&t.code,e,m)}})};Oe.forEach(Ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Nt=e=>`- ${e}`,Rt=e=>Oe.isFunction(e)||null===e||!1===e,Dt=e=>{e=Oe.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i<t;i++){let t;if(r=e[i],n=r,!Rt(r)&&(n=Ct[(t=String(r)).toLowerCase()],void 0===n))throw new ke(`Unknown adapter '${t}'`);if(n)break;o[t||"#"+i]=n}if(!n){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let r=t?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new ke("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new lt(null,e)}function Mt(e){return Lt(e),e.headers=it.from(e.headers),e.data=st.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Dt(e.adapter||Xe.adapter)(e).then((function(t){return Lt(e),t.data=st.call(e,e.transformResponse,t),t.headers=it.from(t.headers),t}),(function(t){return at(t)||(Lt(e),t&&t.response&&(t.response.data=st.call(e,e.transformResponse,t.response),t.response.headers=it.from(t.response.headers))),Promise.reject(t)}))}const zt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{zt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const qt={};zt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.9.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new ke(n(o," has been removed"+(t?" in "+t:"")),ke.ERR_DEPRECATED);return t&&!qt[o]&&(qt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},zt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Bt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new ke("options must be an object",ke.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const t=e[i],r=void 0===t||s(t,i,e);if(!0!==r)throw new ke("option "+i+" must be "+r,ke.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new ke("Unknown option "+i,ke.ERR_BAD_OPTION)}},validators:zt},Ut=Bt.validators;class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new Ue,response:new Ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=wt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Bt.assertOptions(r,{silentJSONParsing:Ut.transitional(Ut.boolean),forcedJSONParsing:Ut.transitional(Ut.boolean),clarifyTimeoutError:Ut.transitional(Ut.boolean)},!1),null!=n&&(Oe.isFunction(n)?t.paramsSerializer={serialize:n}:Bt.assertOptions(n,{encode:Ut.function,serialize:Ut.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Bt.assertOptions(t,{baseUrl:Ut.spelling("baseURL"),withXsrfToken:Ut.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Oe.merge(o.common,o[t.method]);o&&Oe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=it.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let p,u=0;if(!a){const e=[Mt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(u=0;u<p;){const e=s[u++],t=s[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Mt.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Be(yt((e=wt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Oe.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(wt(r||{},{method:e,url:t,data:(r||{}).data}))}})),Oe.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(wt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Axios.prototype[e]=t(),Axios.prototype[e+"Form"]=t(!0)}));const Ft=Axios;class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new lt(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken((function(t){e=t})),cancel:e}}}const Vt=CancelToken,Gt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gt).forEach((([e,t])=>{Gt[t]=e}));const Kt=Gt,Jt=function e(t){const r=new Ft(t),n=L(Ft.prototype.request,r);return Oe.extend(n,Ft.prototype,r,{allOwnKeys:!0}),Oe.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(wt(t,r))},n}(Xe);Jt.Axios=Ft,Jt.CanceledError=lt,Jt.CancelToken=Vt,Jt.isCancel=at,Jt.VERSION="1.9.0",Jt.toFormData=Re,Jt.AxiosError=ke,Jt.Cancel=Jt.CanceledError,Jt.all=function(e){return Promise.all(e)},Jt.spread=function(e){return function(t){return e.apply(null,t)}},Jt.isAxiosError=function(e){return Oe.isObject(e)&&!0===e.isAxiosError},Jt.mergeConfig=wt,Jt.AxiosHeaders=it,Jt.formToJSON=e=>Qe(Oe.isHTMLForm(e)?new FormData(e):e),Jt.getAdapter=Dt,Jt.HttpStatusCode=Kt,Jt.default=Jt;const Ht=Jt;var Zt=__webpack_require__(1111);const Wt="axios-retry";function Qt(e){return!e.response&&!!e.code&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&Zt(e)}const Yt=["get","head","options"],Xt=Yt.concat(["put","delete"]);function er(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}function tr(e){return!!e.config?.method&&er(e)&&-1!==Xt.indexOf(e.config.method)}function rr(e){return Qt(e)||tr(e)}function nr(e=void 0){const t=e?.response?.headers["retry-after"];if(!t)return 0;let r=1e3*(Number(t)||0);return 0===r&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}const or={retries:3,retryCondition:rr,retryDelay:function(e=0,t=void 0){return Math.max(0,nr(t))},shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function ir(e,t,r=!1){const n=function(e,t){return{...or,...t,...e[Wt]}}(e,t||{});return n.retryCount=n.retryCount||0,n.lastRequestTime&&!r||(n.lastRequestTime=Date.now()),e[Wt]=n,n}const sr=(e,t)=>{const r=e.interceptors.request.use((e=>(ir(e,t,!0),e[Wt]?.validateResponse&&(e.validateStatus=()=>!1),e))),n=e.interceptors.response.use(null,(async r=>{const{config:n}=r;if(!n)return Promise.reject(r);const o=ir(n,t);return r.response&&o.validateResponse?.(r.response)?r.response:await async function(e,t){const{retries:r,retryCondition:n}=e,o=(e.retryCount||0)<r&&n(t);if("object"==typeof o)try{return!1!==await o}catch(e){return!1}return o}(o,r)?async function(e,t,r,n){t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:s}=t,a=o(t.retryCount,r);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,n),!i&&n.timeout&&t.lastRequestTime){const e=Date.now()-t.lastRequestTime,o=n.timeout-e-a;if(o<=0)return Promise.reject(r);n.timeout=o}return n.transformRequest=[e=>e],await s(t.retryCount,r,n),n.signal?.aborted?Promise.resolve(e(n)):new Promise((t=>{const r=()=>{clearTimeout(o),t(e(n))},o=setTimeout((()=>{t(e(n)),n.signal?.removeEventListener&&n.signal.removeEventListener("abort",r)}),a);n.signal?.addEventListener&&n.signal.addEventListener("abort",r,{once:!0})}))}(e,o,r,n):(await async function(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}(o,r),Promise.reject(r))}));return{requestInterceptorId:r,responseInterceptorId:n}};sr.isNetworkError=Qt,sr.isSafeRequestError=function(e){return!!e.config?.method&&er(e)&&-1!==Yt.indexOf(e.config.method)},sr.isIdempotentRequestError=tr,sr.isNetworkOrIdempotentRequestError=rr,sr.exponentialDelay=function(e=0,t=void 0,r=100){const n=2**e*r,o=Math.max(n,nr(t));return o+.2*o*Math.random()},sr.linearDelay=function(e=100){return(t=0,r=void 0)=>{const n=t*e;return Math.max(n,nr(r))}},sr.isRetryableError=er;const ar=sr;class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";var cr=__webpack_require__(4874);const lr={_looksLikeObjectID:e=>24===e.length&&/^[0-9a-f]*$/.test(e),ObjectID:class ObjectID{constructor(e){if(e){if(e=e.toLowerCase(),!lr._looksLikeObjectID(e))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}}equals(e){return e instanceof lr.ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new lr.ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str.substr(0,8),16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}},pr=lr,ur={common1:{type:"string"},common2:{format:"email",type:"string"},common3:{type:"boolean"},common4:{format:"uri",type:"string"},common5:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common6:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common7:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},common8:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common9:{reason:{default:"",type:"string"}},common10:{default:"",type:"string"},common11:{pattern:"^[a-f0-9]{24}$",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common14:{value:{type:"boolean"}},common15:{enum:["isOpenData","isOpenEdition","private","feedback"]},common16:{const:"organizations"},common17:{const:"projects"},common18:{const:"events"},common19:{default:"citoyens",enum:["citoyens","projects","organizations","events"],type:"string"},common20:{},common21:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common22:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},common23:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},common24:{properties:{typeElement:{const:"citoyens"}}},common25:{typeElement:{const:"citoyens"}},common26:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}},common27:{not:{type:"null"}},common28:{type:"null"},common29:{default:"citoyens",enum:["citoyens","projects","organizations","poi","events"],type:"string"},common30:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common31:{items:{type:"string"},type:"array"},common32:{enum:[""],type:"string"},common33:{properties:{name:{not:{type:"null"}}},required:["name"]},common34:{name:{not:{type:"null"}}},common35:{properties:{url:{not:{type:"null"}}},required:["url"]},common36:{url:{not:{type:"null"}}},common37:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common38:{tags:{not:{type:"null"}}},common39:{properties:{email:{not:{type:"null"}}},required:["email"]},common40:{email:{not:{type:"null"}}},common41:{format:"date",type:"string"},common42:{const:"info",default:"info",type:"string"},common43:{$ref:"#/$defs/sharedFields/email"},common44:{$ref:"#/$defs/sharedFields/name"},common45:{$ref:"#/$defs/sharedFields/tags"},common46:{default:"citoyens",enum:["citoyens"],type:"string"},common47:{$ref:"#/$defs/sharedFields/url"},common48:{properties:{avancement:{not:{type:"null"}}},required:["avancement"]},common49:{avancement:{not:{type:"null"}}},common50:{properties:{parent:{not:{type:"null"}}},required:["parent"]},common51:{parent:{not:{type:"null"}}},common52:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},type:"object"},common53:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},common54:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common55:{name:{type:"string"},type:{type:"string"}},common56:{properties:{type:{not:{type:"null"}}},required:["type"]},common57:{type:{not:{type:"null"}}},common58:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common59:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},common60:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},common61:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common62:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common63:{enum:["poi"],type:"string"},common64:{$ref:"#/$defs/socialField"},common65:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common66:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common67:{id:{pattern:"^[a-f0-9]{24}$"}},common68:{pattern:"^[a-f0-9]{24}$"},common69:{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},common70:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},common71:{const:"PostalAddress",type:"string"},common72:{minLength:0,type:"string"},common73:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common74:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},common75:{const:"GeoCoordinates",type:"string"},common76:{type:["string","number"]},common77:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common78:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},common79:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},common80:{type:"number"},common81:{const:!0,default:!0,type:"boolean"},common82:{const:"Point",type:"string"},common83:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common84:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common85:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"},common86:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common87:{properties:{type:{const:"citoyens"}}},common88:{type:{const:"citoyens"}},common89:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},common90:{ownerId:{pattern:"^[a-f0-9]{24}$"}},common91:{properties:{folder:{const:"citoyens"}}},common92:{folder:{const:"citoyens"}},common93:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common94:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common95:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common96:{parentId:{pattern:"^[a-f0-9]{24}$"}},common97:{properties:{parentType:{const:"citoyens"}}},common98:{parentType:{const:"citoyens"}},common99:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common100:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common101:{default:!0,type:"boolean"},common102:{default:0,type:"integer"},common103:{required:["text"]},common104:{required:["mediaImg"]},common105:{required:["mediaFile"]},common106:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common107:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},common108:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common109:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},common110:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common111:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common112:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common113:{minimum:1,type:"integer"},common114:{default:"public",enum:["public","private","restricted"],type:"string"},common115:{const:"news",default:"news",type:"string"},common116:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common117:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},common118:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common119:{default:!1,type:"boolean"},common120:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common121:{childId:{pattern:"^[a-f0-9]{24}$"}},common122:{properties:{childType:{const:"citoyens"}}},common123:{childType:{const:"citoyens"}},common124:{const:"share",default:"share",type:"string"},common125:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common126:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common127:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"news",enum:["news"],type:"string"}},required:["type","id"],type:"object"},common128:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"news",enum:["news"],type:"string"}},common129:{default:"news",enum:["news"],type:"string"},common130:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common131:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common132:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common133:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],type:"string"},common134:{const:!1,default:!1,type:"boolean"},common135:{const:"",default:"",type:"string"},common136:{default:0,type:"number"},common137:{default:30,type:"number"},common138:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common139:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},common140:{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"},common141:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},common142:{enum:["cities","level1"],type:"string"},common143:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common144:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},common145:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common146:{indexMax:{type:"number"},indexMin:{type:"number"}},common147:{enum:["ALL"],type:"string"},common148:{default:0,minimum:0,type:"integer"},common149:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common150:{enum:["projects"],type:"string"},common151:{$exists:!0},common152:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common153:{$exists:{const:!0}},common154:{const:!0},common155:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common156:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},common157:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common158:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common159:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},common160:{$exists:!1},common161:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common162:{$exists:{const:!1}},common163:{const:!1},common164:{default:30,type:"integer"},common165:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common166:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common167:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common168:{$exists:{default:!1,type:"boolean"}},common169:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common170:{$in:{items:{type:"string"},minItems:1,type:"array"}},common171:{items:{type:"string"},minItems:1,type:"array"},common172:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common173:{enum:["citoyens"],type:"string"},common174:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common175:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},common176:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common177:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common178:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common179:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common180:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common181:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common182:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common183:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common184:{enum:["badges"],type:"string"},common185:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common186:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common187:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common188:{$exists:{const:!0,type:"boolean"}},common189:{const:!0,type:"boolean"},common190:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common191:{$exists:{const:!1,type:"boolean"}},common192:{const:!1,type:"boolean"},common193:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common194:{indexMax:30,indexMin:0},common195:{properties:{parentType:{const:"organizations"}}},common196:{parentType:{const:"organizations"}},common197:{properties:{parentType:{const:"projects"}}},common198:{parentType:{const:"projects"}},common199:{properties:{parentType:{const:"events"}}},common200:{parentType:{const:"events"}},common201:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common202:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common203:{enum:["citoyens","organizations","projects","events"],type:"string"},common204:{const:"citoyens",default:"citoyens",type:"string"},common205:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common206:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common207:{isOpenData:!0,isOpenEdition:!0},common208:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},common209:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common210:{"@userId":{type:"citoyens"}},common211:{type:"citoyens"},common212:{const:"poi",default:"poi",type:"string"},common213:{const:"events",default:"events",type:"string"},common214:{format:"date-time",type:"string"},common215:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},common216:{type:"integer"},common217:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common218:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},common219:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},common220:{const:"badges",default:"badges",type:"string"},common221:{const:"badge",default:"badge",type:"string"},common222:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common223:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},common224:{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"},common225:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},common226:{default:"",enum:["","admin"],type:"string"},common227:{enum:["projects","organizations"],type:"string"},common228:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},type:"array"},common229:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},common230:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common231:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},common232:{default:"events",type:"string"},common233:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common234:{properties:{id:{type:"string"}},required:["id"],type:"object"},common235:{id:{type:"string"}},common236:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common237:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}}},dr=[{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:ur.common1,email:ur.common2,isInvitation:ur.common3,mode:ur.common1,name:ur.common1,pendingUserId:ur.common1,pwd:ur.common1,username:ur.common1},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:ur.common2,password:ur.common1},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:ur.common1},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:ur.common2,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:ur.common4},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:ur.common1,newPassword2:ur.common1,oldPassword:ur.common1,scope:{default:"",type:["string"]},userId:ur.common5},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:ur.common6,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:ur.common8},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:ur.common11}},if:{properties:{typeEntity:ur.common12}},then:{properties:{idEntity:ur.common5}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:ur.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:ur.common12}},then:ur.common13},{if:{properties:{type:ur.common15,typeEntity:ur.common16}},then:ur.common13},{if:{properties:{type:ur.common15,typeEntity:ur.common17}},then:ur.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","public"]},typeEntity:ur.common18}},then:ur.common13}],properties:{idEntity:ur.common1,type:ur.common1,typeEntity:ur.common19,value:ur.common20},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[ur.common21,{anyOf:[{properties:{description:ur.common27},required:["description"]},{properties:{shortDescription:ur.common27},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:ur.common10,description:ur.common1,id:ur.common1,scope:{default:"",type:["string","null"]},shortDescription:ur.common1,typeElement:ur.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:ur.common2,name:ur.common1,tags:ur.common30,url:ur.common4}},allOf:[{if:ur.common24,then:{additionalProperties:!1,anyOf:[ur.common33,{properties:{birthDate:ur.common27},required:["birthDate"]},{properties:{fixe:ur.common27},required:["fixe"]},{properties:{mobile:ur.common27},required:["mobile"]},ur.common35,ur.common37,ur.common39],properties:{birthDate:ur.common41,block:ur.common42,email:ur.common43,fixe:ur.common1,id:ur.common5,mobile:ur.common1,name:ur.common44,scope:ur.common10,tags:ur.common45,typeElement:ur.common46,url:ur.common47}}},{if:{properties:{typeElement:ur.common17}},then:{additionalProperties:!1,anyOf:[ur.common33,ur.common35,ur.common37,ur.common39,ur.common48,ur.common50],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:ur.common42,email:ur.common43,id:ur.common1,name:ur.common44,parent:ur.common52,scope:ur.common10,tags:ur.common45,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:ur.common47}}},{if:{properties:{typeElement:ur.common18}},then:{additionalProperties:!1,anyOf:[ur.common33,ur.common35,ur.common37,ur.common39,ur.common48,ur.common56,{properties:{organizer:ur.common27},required:["organizer"]},ur.common50],properties:{block:ur.common42,email:ur.common43,id:ur.common1,name:ur.common44,organizer:ur.common58,parent:ur.common52,scope:ur.common10,tags:ur.common45,type:ur.common61,typeElement:{default:"citoyens",enum:["events"],type:"string"},url:ur.common47}}},{if:{properties:{typeElement:ur.common16}},then:{additionalProperties:!1,anyOf:[ur.common33,ur.common35,ur.common37,ur.common39,ur.common56],properties:{block:ur.common42,email:ur.common43,id:ur.common1,name:ur.common44,scope:ur.common10,tags:ur.common45,type:{enum:["NGO","Cooperative","LocalBusiness","GovernmentOrganizationautre"],type:"string"},typeElement:{enum:["organizations"],type:"string"},url:ur.common47}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[ur.common33,ur.common35,ur.common37,ur.common39,ur.common56,{properties:{urls:ur.common27},required:["urls"]}],properties:{block:ur.common42,email:ur.common43,id:ur.common1,name:ur.common44,scope:ur.common10,tags:ur.common45,type:ur.common62,typeElement:ur.common63,url:ur.common47,urls:ur.common31}}}],properties:{block:ur.common42,id:ur.common1,scope:ur.common10,typeElement:ur.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[ur.common32,ur.common4]}},allOf:[ur.common21,{anyOf:[{properties:{gitlab:ur.common27},required:["gitlab"]},{properties:{github:ur.common27},required:["github"]},{properties:{twitter:ur.common27},required:["twitter"]},{properties:{facebook:ur.common27},required:["facebook"]},{properties:{instagram:ur.common27},required:["instagram"]},{properties:{diaspora:ur.common27},required:["diaspora"]},{properties:{mastodon:ur.common27},required:["mastodon"]},{properties:{telegram:ur.common27},required:["telegram"]},{properties:{signal:ur.common27},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:ur.common64,facebook:ur.common64,github:ur.common64,gitlab:ur.common64,id:ur.common1,instagram:ur.common64,mastodon:ur.common64,scope:ur.common10,signal:ur.common64,telegram:ur.common64,twitter:ur.common64,typeElement:ur.common65},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:ur.common66,if:ur.common24,properties:{address:ur.common69,block:{const:"localities",default:"localities",type:"string"},geo:ur.common73,geoPosition:ur.common77,id:ur.common1,scope:ur.common10,typeElement:ur.common29},required:["block","typeElement","id","address"],then:ur.common83,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:ur.common66,if:ur.common24,properties:{block:ur.common42,id:ur.common1,scope:ur.common10,slug:ur.common86,typeElement:ur.common29},required:["block","typeElement","id","slug"],then:ur.common83,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:ur.common66,if:ur.common87,properties:{block:ur.common42,id:ur.common1,slug:ur.common86,type:ur.common19},required:["block","type","id","slug"],then:ur.common83,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:{additionalProperties:!1,else:ur.common89,if:ur.common91,properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:ur.common1},required:["folder","ownerId"],then:ur.common93,type:"object"},request:{additionalProperties:!1,properties:{profil_avatar:ur.common20},required:["profil_avatar"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:ur.common66,if:ur.common87,properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges"],type:"string"}},required:["type","id"],then:ur.common83,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:ur.common95,if:ur.common97,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:ur.common1},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:ur.common1,parentType:ur.common65},required:["parentId","parentType","listInvite"],then:ur.common99,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:ur.common66,if:ur.common87,properties:{id:ur.common1,isLive:ur.common101,type:ur.common65},required:["isLive","type","id"],then:ur.common83,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:ur.common102,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:ur.common10},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:{items:ur.common11,type:"array"}},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[ur.common103,ur.common104,ur.common105],else:ur.common95,if:ur.common97,properties:{json:ur.common81,markdownActive:ur.common101,mediaFile:ur.common106,mediaImg:ur.common108,mentions:ur.common110,parentId:ur.common1,parentType:ur.common65,scope:ur.common114,tags:ur.common30,text:ur.common1,type:ur.common115},required:["scope","markdownActive","parentId","parentType","type","json"],then:ur.common99,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:ur.common116,request:{additionalProperties:!1,properties:{newsImage:ur.common20},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}}/input/newsFile/docType/file",pathParams:ur.common116,request:{additionalProperties:!1,properties:{newsFile:ur.common20},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:ur.common118,request:{additionalProperties:!1,properties:{isLive:ur.common119},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[ur.common103,ur.common104,ur.common105],else:ur.common95,if:ur.common97,properties:{idNews:ur.common11,markdownActive:ur.common101,mediaFile:ur.common106,mediaImg:ur.common108,mentions:ur.common110,parentId:ur.common1,parentType:ur.common65,scope:ur.common114,tags:ur.common30,text:ur.common1,type:ur.common115},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:ur.common99,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:ur.common120,if:ur.common122,properties:{childId:ur.common11,childType:ur.common65,comment:ur.common1,connectType:ur.common124,parentId:ur.common11,parentType:ur.common115},required:["parentId","parentType","childId","childType","connectType"],then:ur.common125,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:ur.common127},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:ur.common10,contextId:ur.common11,contextType:ur.common129,mentions:ur.common130,parentCommentId:ur.common11,path:ur.common10,text:ur.common1},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:ur.common118},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:ur.common11,params:{properties:{mentions:ur.common130,text:ur.common1},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:ur.common1},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:ur.common127},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:ur.common133,type:"array"},fediverse:ur.common134,filters:ur.common135,indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common138,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchTags:ur.common31,searchType:{items:ur.common133,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:{minimum:0,type:"integer"},locality:ur.common135,name:ur.common1,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:ur.common119,scopeValue:ur.common1,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:ur.common148,name:ur.common1,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common149,fediverse:ur.common134,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":ur.common151,"parent.@userId":ur.common151},"links.contributors.@userId":ur.common151},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152},type:"object"}},required:["$or"],type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common149},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:ur.common155,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common149,fediverse:ur.common134,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":ur.common151,"parent.@{pathParams.id}":ur.common151},"links.contributors.@{pathParams.id}":ur.common151},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152},type:"object"}},required:["$or"],type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common149},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common157,fediverse:ur.common134,filters:{additionalProperties:!1,default:{"parent.@userId":ur.common151},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common157},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:ur.common155,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common157,fediverse:ur.common134,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":ur.common151},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common157},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common158,fediverse:ur.common134,filters:{additionalProperties:!1,default:{"links.members.@userId":ur.common151,"links.members.@userId.isInviting":ur.common160,"links.members.@userId.toBeValidated":ur.common160},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common161,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common161},type:"object"},indexMax:ur.common80,indexMin:ur.common148,indexStep:ur.common164,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common158},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,else:ur.common66,if:ur.common87,properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:ur.common83,type:"object"},request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common158,fediverse:ur.common134,filters:{additionalProperties:!1,default:{"links.members.@{pathParams.id}":ur.common151,"links.members.@{pathParams.id}.isInviting":ur.common160,"links.members.@{pathParams.id}.toBeValidated":ur.common160},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common161,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common161},type:"object"},indexMax:ur.common80,indexMin:ur.common148,indexStep:ur.common164,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common158},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common165,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common167,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":ur.common169,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common161},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common165},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:ur.common118,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common165,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":ur.common151,"links.memberOf.@{pathParams.id}.isInviting":ur.common160,"links.memberOf.@{pathParams.id}.toBeValidated":ur.common160},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":ur.common152,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common167,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":ur.common169,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common167},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common165},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:ur.common6,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common172,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":ur.common151,"links.friends.@{pathParams.id}.isInviting":ur.common160,"links.friends.@{pathParams.id}.toBeValidated":ur.common160},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common167,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common167},type:"object"},indexMin:ur.common148,indexStep:ur.common164,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,searchType:ur.common172},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common174,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[ur.common176],default:{"links.followers.@userId":ur.common151,"links.followers.@{userId}.isInviting":ur.common160,"links.followers.@{userId}.toBeValidated":ur.common160},patternProperties:ur.common179,type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common174},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:ur.common6,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common174,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[ur.common176],default:{"links.followers.@{pathParams.id}":ur.common151,"links.followers.@{pathParams.id}.isInviting":ur.common160,"links.followers.@{pathParams.id}.toBeValidated":ur.common160},patternProperties:ur.common179,type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common174},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common172,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[ur.common180],default:{"links.follows.@userId":ur.common151,"links.follows.@{userId}.isInviting":ur.common160,"links.follows.@{userId}.toBeValidated":ur.common160},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common161,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common161},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common172},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:ur.common66,if:ur.common87,then:ur.common83}],properties:{id:ur.common1,type:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"}},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common172,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[ur.common180],default:{"links.follows.@{pathParams.id}":ur.common151},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152},type:"object"},indexMin:ur.common148,indexStep:ur.common164,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,searchType:ur.common172},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common165,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":ur.common167,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":ur.common169,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":ur.common161},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common165},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:ur.common118,request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common165,fediverse:ur.common134,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":ur.common151,"links.projects.@{pathParams.id}.isInviting":ur.common160,"links.projects.@{pathParams.id}.toBeValidated":ur.common160},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":ur.common152,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":ur.common167,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":ur.common169,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":ur.common167},type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common165},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common183,fediverse:ur.common134,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common152},type:"object"},isParcours:ur.common3,"preferences.private":ur.common134},required:["preferences.private"],type:"object"},indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:ur.common143,searchBy:ur.common147,searchType:ur.common183},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:ur.common81,countType:ur.common185,fediverse:ur.common134,fields:ur.common183,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common187}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":ur.common187,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":ur.common190,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":ur.common190}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:ur.common193},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:ur.common193,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":ur.common189}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":ur.common187}}],type:"object"},indexMin:ur.common148,indexStep:ur.common164,initType:ur.common135,locality:ur.common135,name:ur.common1,notSourceKey:ur.common81,ranges:{additionalProperties:!1,default:{Cooperative:ur.common194,GovernmentOrganization:ur.common194,Group:ur.common194,LocalBusiness:ur.common194,NGO:ur.common194,citoyens:ur.common194,projects:ur.common194},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":ur.common145},type:"object"},searchType:ur.common185},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:ur.common97,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:ur.common195,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:ur.common197,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:ur.common199,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:ur.common201,childType:ur.common202,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:ur.common11,parentType:ur.common203},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:ur.common97,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:ur.common195,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:ur.common197,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:ur.common199,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:ur.common201,childType:ur.common202,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:ur.common11,parentType:ur.common203},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:ur.common6},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:ur.common80},type:"object"},request:{additionalProperties:!1,properties:{collection:ur.common204,id:ur.common205,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:ur.common135},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:ur.common189,collection:ur.common204,id:ur.common205,path:{const:"preferences.search",default:"preferences.search",type:"string"},value:{additionalProperties:!1,properties:{description:ur.common1,locality:{patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:ur.common55,required:["name","type"]}},type:"object"},name:ur.common1,tags:ur.common31,url:ur.common1},required:["url","name"],type:"object"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common69,collection:{const:"organizations",default:"organizations",type:"string"},email:ur.common2,geo:ur.common73,geoPosition:ur.common77,id:ur.common11,key:{const:"organization",default:"organization",type:"string"},name:{minLength:3,type:"string"},preferences:ur.common206,role:{enum:["admin","member"],type:"string"},scope:ur.common135,shortDescription:ur.common1,tags:ur.common31,type:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},url:ur.common4},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common69,collection:{const:"projects",default:"projects",type:"string"},geo:ur.common73,geoPosition:ur.common77,id:ur.common11,key:{const:"project",default:"project",type:"string"},name:ur.common1,parent:ur.common209,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:ur.common101,isOpenData:ur.common119,isOpenEdition:ur.common119},required:["isOpenData","isOpenEdition"],type:"object"},public:ur.common101,scope:ur.common135,shortDescription:ur.common1,tags:ur.common31,url:ur.common4},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:ur.common69,collection:ur.common212,description:ur.common1,geo:ur.common73,geoPosition:ur.common77,id:ur.common11,key:ur.common212,name:ur.common1,parent:ur.common209,scope:ur.common135,tags:ur.common31,type:ur.common62,urls:ur.common31},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:ur.common163}},properties:{address:ur.common69,collection:ur.common213,email:ur.common2,endDate:ur.common214,geo:ur.common73,geoPosition:ur.common77,id:ur.common11,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[{const:"",type:"string"},{additionalProperties:!1,properties:{dayOfWeek:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},hours:{default:[],items:{additionalProperties:!1,properties:{closes:ur.common215,opens:ur.common215},required:["opens","closes"],type:"object"},type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:ur.common209,parent:ur.common58,preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:ur.common119,isOpenEdition:ur.common119},required:["isOpenData","isOpenEdition"],type:"object"},public:ur.common101,recurrency:ur.common119,scope:ur.common135,shortDescription:{format:"textarea",type:"string"},startDate:ur.common214,tags:ur.common31,timeZone:ur.common1,type:ur.common61,url:ur.common4},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/poi/id/{id}",pathParams:ur.common118,request:ur.common8},{auth:"bearer",constant:"DELETE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/events/id/{id}/",pathParams:ur.common118,request:ur.common8},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:ur.common11,type:ur.common1},required:["type","id"],type:"object"},request:ur.common8},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:ur.common11},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:ur.common20,qqfilename:ur.common1,qqtotalfilesize:ur.common216,qquuid:ur.common11},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:ur.common5,childType:ur.common46,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:ur.common11,parentType:ur.common203},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:ur.common1,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:ur.common217,request:{additionalProperties:!1,properties:{indexMin:ur.common102},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:ur.common217,request:{additionalProperties:!1,properties:{refreshTimestamp:ur.common216},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:ur.common81},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:ur.common118},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[ur.common20],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:ur.common1},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:ur.common1,name:ur.common1,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:ur.common4},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:ur.common11},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:ur.common118},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:ur.common220,criteria:{additionalProperties:!1,properties:{narrative:ur.common1},required:["narrative"],type:"object"},description:ur.common1,id:ur.common11,isParcours:ur.common119,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:ur.common1,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:ur.common221,name:ur.common1,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:ur.common1,type:ur.common220},required:["type"],type:"object"}},type:"object"},preferences:ur.common206,public:ur.common101,scope:ur.common135,tags:ur.common31},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":ur.common54},type:"object"},badgeId:ur.common11,collection:ur.common220,evidences:{items:{additionalProperties:!1,properties:{narative:ur.common1,url:ur.common4},required:["narative"],type:"object"},type:"array"},key:ur.common221,narative:ur.common1,scope:ur.common135},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!1,properties:{count:ur.common119,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:ur.common214,fediverse:ur.common119,indexMin:ur.common102,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:ur.common1,searchType:{const:["events"],default:["events"],items:ur.common1,type:"array"},startDate:ur.common80,startDateUTC:ur.common214,type:ur.common61},required:["searchType","indexMin","indexStep","startDate","startDateUTC","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:ur.common120,if:ur.common122,properties:{childId:ur.common11,childType:ur.common65,comment:ur.common1,connectType:ur.common124,parentId:ur.common11,parentType:ur.common213},required:["parentId","childId","childType","connectType","parentType"],then:ur.common125,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:ur.common95,if:ur.common97,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:ur.common222,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:ur.common2,isAdmin:ur.common226,msg:ur.common1,name:ur.common1,roles:ur.common31},required:["name","email"],type:"object"}},type:"object"},organizations:ur.common222,projects:ur.common222},type:"object"},parentId:ur.common1,parentType:ur.common65},required:["parentId","parentType","listInvite"],then:ur.common99,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:ur.common201,childType:ur.common202,parentId:ur.common11,parentType:ur.common203},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:ur.common1}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,count:ur.common81,countType:ur.common228,fediverse:ur.common119,filters:ur.common135,indexMax:ur.common80,indexMin:ur.common136,indexStep:ur.common137,initType:ur.common135,locality:ur.common138,mapUsed:ur.common119,name:ur.common1,options:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:ur.common1},type:"object"}},type:"object"},ranges:ur.common143,searchBy:ur.common147,searchTags:ur.common31,searchType:ur.common228,sourceKey:ur.common31},required:["name","searchType","countType","indexMin","indexStep","initType","count","filters","fediverse","mapUsed","costumSlug","sourceKey","costumEditMode"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:ur.common230,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,parent_only:ur.common3,sourceKey:ur.common31,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:ur.common230,request:{additionalProperties:!1,allOf:[{if:{properties:{date:ur.common1},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,date:{oneOf:[ur.common1,{properties:{between:{properties:{end:ur.common41,start:ur.common41},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:ur.common3,regions:ur.common233,sourceKey:ur.common31,tags:ur.common31,timezone:ur.common1,type:ur.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:ur.common230,request:ur.common236},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:ur.common230,request:ur.common236},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:ur.common230,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,regions:ur.common233,sourceKey:ur.common31,tags:ur.common31,type:ur.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:ur.common230,request:ur.common236},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:ur.common230,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,event:ur.common1,sourceKey:ur.common31,tl:ur.common1},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:ur.common230,request:{additionalProperties:!1,properties:{contextId:ur.common11,contextType:ur.common227,costumEditMode:ur.common119,costumSlug:ur.common1,event:ur.common11,search:ur.common1,sourceKey:ur.common31},type:"object"}}];var mr=__webpack_require__(6092),fr=__webpack_require__(1027);a.addType("oid",(e=>new pr.ObjectID(e)));class ApiClient extends $.EventEmitter{constructor({baseURL:e,accessToken:t,refreshToken:r,refreshUrl:n="/api/cocolight/refreshtoken",endpoints:o=dr,timeout:i=3e4,debug:s=!1,maxRetries:a=0,circuitBreakerThreshold:c=5,circuitBreakerResetTime:l=6e4,fromJSONValue:p=!0,tokenStorageStrategy:u=null}={}){if(super(),!e)throw new ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this.__entityTag="ApiClient",this._baseURL=e,this._refreshUrl=n,this._endpoints=o,this._debug=s;let d=null;if(this._offlineClientManager=null,this._fromJSONValue=p,Object.defineProperty(this,"userId",{get:()=>d,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{d=e,this._logger.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new R({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),D(this._ajv),this._ajv.addFormat("textarea",!0),this._ajv.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate}),this._logger=cr({transport:{target:"pino-pretty",options:{colorize:!0}},level:s?"debug":"info"}),this._client=Ht.create({baseURL:e,timeout:i}),a>0&&(ar(this._client,{retries:a,retryDelay:ar.exponentialDelay,retryCondition:e=>ar.isNetworkError(e)||ar.isRetryableError(e),onRetry:(e,t,r)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${r?.url}`),this.emit("retryAttempt",{retryCount:e,url:r?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${a} max`)),this._breakerThreshold=c,this._breakerResetTime=l,this._breakerErrorCount=0,this._breakerOpen=!1,this._lastBreakerOpenTime=null,this._accessToken=null,this._refreshToken=null,u instanceof mr.SJ&&u.use(this._baseURL),this._tokenStorage=u||new fr.GN,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");r&&this.setRefreshToken(r),t&&this.setToken(t);const m=this._tokenStorage.getAccessToken();m&&this.setToken(m);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use((e=>e),(async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{if(this._logger.info("[ApiClient] Tentative de refresh du token..."),await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){throw this.resetSession(),new ApiClientError("Erreur lors du rafraîchissement du token.",401,e)}}throw e}))}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e),this._client.defaults.headers.common.Authorization="Bearer "+e;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=function(e,t){if("string"!=typeof e)throw new InvalidTokenError("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new InvalidTokenError(`Invalid token specified: missing part #${r+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(n)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=Ht.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token||(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),0))}catch(e){return this.emit("refreshFailed",{error:e.message}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${e.message}`),!1}}_checkCircuitBreaker(){return!this._breakerOpen||Date.now()-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const r={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const r=this._getValueByPath(t,e);return null!=r?r:void 0}},n=/@(?:\{([^}]+)\}|([\w.]+))/g,o=e=>"string"!=typeof e?e:e.replace(n,((t,n,o)=>{if(n){if(n.startsWith("pathParams.")){const e=n.substring(11),t=r.pathParams(e);return null!=t?t:`@{${n}}`}{const e=r[n];if("function"==typeof e){const t=e();return null!=t?t:`@{${n}}`}return`@{${n}}`}}if(o){if(o.startsWith("pathParams.")){const e=o.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],n=e[2],i=r.pathParams(t);return null!=i?i+n:`@${o}`}return`@${o}`}{const e=r[o];if("function"==typeof e){const t=e();return null!=t?t:`@${o}`}return`@${o}`}}return e})),i=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(i);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[r,n]of Object.entries(e))t[o(r)]=i(n);return t}return"string"==typeof e?o(e):e};return i(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map((e=>this._cleanSchemaLeftoverAlias(e)));if(e&&"object"==typeof e){const r={};for(const n of Object.keys(e)){const o=e[n];if(!t.test(n)){if("default"===n){if("string"==typeof o&&t.test(o))continue;if(o&&"object"==typeof o){const e=this._cleanSchemaLeftoverAlias(o);Object.keys(e).length>0&&(r[n]=e);continue}}"string"==typeof o&&t.test(o)||(r[n]=this._cleanSchemaLeftoverAlias(o))}}return r}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${e.message}`),e}}async callEndpoint(e,t={},r=!0,n=!0){const o=this._endpoints.find((t=>t.constant===e));if(!o)throw new ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:i,method:s,contentType:a,auth:c,pathParams:l,request:p,responses:u}=o,d=(s||"GET").toLowerCase(),m=a||"application/json",f={"Content-Type":m};if(this._accessToken)"bearer"===c?f.Authorization=`Bearer ${this._accessToken}`:c&&"none"!==c||f.Authorization||(f.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===c)throw new ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let h,y=i,g={};if(l){let r=l;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(l));const n=t.pathParams||{},o=this._ajv.compile(r);if(!o(n)){const t=this._ajvErrorHuman(o.errors);throw this.emit("validationError",{stage:"pathParams",errors:o.errors}),new ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,o.errors)}g=this._resolveSpecialValuesInPlace(n),y=y.replace(/\{(\w+)\}/g,((e,t)=>{const r=g[t];if(void 0!==r)return encodeURIComponent(r);throw new ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)}))}if(p){let r=p;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(p));const n={...t};delete n.pathParams;const o=ApiClient.stripNullsInPlace(n),i=this._ajv.compile(r);if(!i(o)){const t=i.errors?this._ajvErrorHuman(i.errors):[];throw this.emit("validationError",{stage:"request",errors:i.errors}),new ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,i.errors)}t=this._resolveSpecialValuesInPlace(o,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t}),{data:null,offline:!0};throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t}),{data:null,breaker:!0};throw new CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===m||"multipart/form-data"===m?h=t:"application/x-www-form-urlencoded"===m&&(h=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${y}, method=${d}`);try{const e=await this._client.request({url:y,method:d,headers:f,["get"===d?"params":"data"]:h});if(n){const t=e.status.toString(),r=u?.[t];if(r){const n=this._ajv.compile(r);if(!n(e.data)){const e=this._ajvErrorHuman(n.errors);throw this.emit("validationError",{stage:"response",errors:n.errors}),new ApiValidationError("Response validation failed.",t,e,n.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof r?e.data=r(e.data):!0===r&&(e.data=this._transformData(e.data)),Array.isArray(o.postActions)&&o.postActions.forEach((t=>{const r=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(r);break;case"setRefreshToken":this.setRefreshToken(r);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,r),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,r));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}})),e}catch(t){throw this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${t.message}`),t instanceof ApiValidationError?t:new ApiClientError(`Erreur lors de l'appel de l'API : ${t.message}`,t.response?t.response.status:500,t.response?t.response.data:null)}}_ajvErrorHuman(e){try{return new AggregateAjvError(e).errors.map((({message:e})=>e))}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map((({message:e})=>e))}}checkAndThrowApiResponseError(e){const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(t)return t.split(".").reduce(((e,t)=>e&&e[t]),e)}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,r={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:n=!1,indexes:o=!1,metaTokens:i=!0}=r,s=[];function a(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function c(e){return e.endsWith("[]")?e.slice(0,-2):e}function l(e,t,r=!1){return e?e.concat(t).map(((e,t)=>(e=c(e),!r&&t?`[${e}]`:e))).join(r?".":""):t}function p(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(r,u=[]){null==r||s.includes(r)||(s.push(r),Object.entries(r).forEach((([r,s])=>{void 0!==s&&function(e,r,s){if(e&&"object"==typeof e){if(r.endsWith("{}"))return r=i?r:r.slice(0,-2),t.append(l(s,r,n),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(a)||r.endsWith("[]"))return r=c(r),e.forEach(((e,i)=>{if(null!=e){const a=o?l(s.concat(r),i,n):`${l(s,r,n)}[]`;t.append(a,p(e))}})),!1}return!!a(e)||(t.append(l(s,r,n),p(e)),!1)}(s,r.trim(),u)&&e(s,u.concat(c(r)))})),s.pop())}(e),t}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map((t=>this._normalizeJsonData({id:t,...e.results[t]})));else if(Array.isArray(e.results))e.results=e.results.map((e=>this._normalizeJsonData(e)));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map((t=>this._normalizeJsonData({id:t,...e.news[t]})));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map((t=>this._normalizeJsonData({id:t,...e.notif[t]})));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]}))),...Object.keys(e.organizations).map((t=>this._normalizeJsonData({id:t,...e.organizations[t]})))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]})));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map((t=>this._normalizeJsonData({id:t,...e.cities[t]})));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map((e=>this._normalizeJsonData(e)));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every((e=>/^[0-9a-fA-F]{24}$/.test(e)));e=t?Object.keys(e).map((t=>({id:t,...this._normalizeJsonData(e[t])}))):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach((t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))})),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter((e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens))),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map((t=>this._normalizeJsonData({id:t,...e.replies[t]})))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,this._fromJSONValue?a.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){return e&&"object"==typeof e&&"number"==typeof e.sec?{$date:1e3*e.sec}:"number"==typeof e?{$date:1e3*e}:e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn"];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map((e=>this._normalizeRecursively(e)));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach((r=>{let n=this._normalizeRecursively(e[r]);this._dateFields.includes(r)&&(n=this._normalizeDate(n)),this._imageFields.includes(r)&&(n=this._normalizeImage(n)),"content"===r&&n&&"object"==typeof n&&n.image&&(n.image=this._normalizeImage(n.image)),t[r]=n})),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const r=new Date(t.startDate)<new Date(t.endDate);return r||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),r};getRequestSchema(e){const t=this._endpoints.find((t=>t.constant===e));return t?.request||null}getPathSchema(e){return this._endpoints.find((t=>t.constant===e))?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const r of t)"function"==typeof e[r]&&this.on(r,e[r])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const r of t.postActions)"emitEvent"===r.type&&r.event&&e.add(r.event);return Array.from(e)}}class UserApi{constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e),this.loggedUser=null}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall((async()=>{const r=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,r.data.user,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News}),this.loggedUser}))}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new ApiError("User not connected",401);return this.client._logger.info("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:P,Organization,Project,Event,Poi,Badge,News}),this.loggedUser}async register({name:e,username:t,email:r,pwd:n}={}){return this.client.safeCall((async()=>{const o=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:r,pwd:n});if(!1===o?.data?.result)throw new ApiResponseError(o.data.msg,o.status,o.data);return o.data}))}async recoverPassword(e){return this.client.safeCall((async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!1===t?.data?.result)throw new ApiResponseError(t.data.msg,t.status,t.data);return t.data}))}}o("User",User),o("Organization",Organization),o("Project",Project),o("Event",Event),o("Poi",Poi),o("Badge",Badge),o("EndpointApi",P),o("UserApi",UserApi),o("News",News);class Api{static async userLogin(e,t,r){const n=Api.userApi(r);return await Api.userApiLogin(n,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,r){try{if(!e)throw new ApiError("userApi is not defined");if(!e.client)throw new ApiError("userApi.client is not defined");if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!r)throw new ApiError("email and password are required");const n=await e.login(t,r);return new Api(n,e.client)}}catch(e){if(e instanceof ApiClientError&&e?.details?.error)throw new ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new ApiAuthenticationError("Accès refusé : utilisateur non authentifié.");return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News});return await t.get(),t}return new User(this._client,e,{EndpointApi:P,Organization,Project,Event,Poi,Badge,News})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:P,User,Project,Event,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:P,User,Organization,Event,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:P,User,Organization,Project,Poi,Badge,News});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async entitySlug(e){if(e)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t?.contextId&&t?.contextType){const e=function(e,t=null,r={}){const o={citoyens:{entityTag:"User",meta:e=>i(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>i(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>i(e,{remove:[]})},events:{entityTag:"Event",meta:e=>i(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>i(e,{remove:["Badge","News"]})},news:{entityTag:"News",meta:e=>i(e,{remove:[]})},badges:{entityTag:"Badge",meta:e=>function(e){const t=n.get(e),r={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project")};return r[e]=t,{entityClass:t,deps:r}}(e)}}[e];if(!o)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:s,meta:a}=o,{entityClass:c,deps:l}=a(s);return new c(t,r,l)}(t?.contextType,this._client,{id:t?.contextId});return await e.get(),e}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new P(this._client)}logout(){this.loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}var hr=__webpack_require__(7031);class OfflineClientManager{constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const r=await async function(e="auto"){if("memory"===e)return new hr.QM;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new hr.Rc;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await __webpack_require__.e(394).then(__webpack_require__.bind(__webpack_require__,394));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new hr.Rc;{const{FileOfflineStorage:e}=await __webpack_require__.e(394).then(__webpack_require__.bind(__webpack_require__,394));return new e}}}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(r),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const r=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,r),r}async replayAction(e){const t=await this.getClient(e.meta);try{const r=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),r}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",(()=>this.setOfflineMode(!1))),window.addEventListener("offline",(()=>this.setOfflineMode(!0)))),this._pingInterval=setInterval((async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch(e){this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}}),e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:r={}}){const n=this._client.getToken()||this._client.getRefreshToken(),o=this._client._endpoints.find((t=>t.constant===e));if("required"===(o?.authPolicy||("none"===o?.auth?"none":"required"))&&!n)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const i={constant:e,data:t,options:r,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(i),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find((e=>e.constant===t.constant)),r=e?.authPolicy||("none"===e?.auth?"none":"required"),n=t.meta.accessToken||t.meta.refreshToken;if("required"!==r||n)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const yr=OfflineClientManager,gr={ApiClient,Api,error:e,reactive:t,...t,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new fr.GN;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new fr.Ge;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await __webpack_require__.e(405).then(__webpack_require__.bind(__webpack_require__,8405));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new fr.Ge;{const{FileStorageStrategy:e}=await __webpack_require__.e(405).then(__webpack_require__.bind(__webpack_require__,8405));return new e}}},TokenStorageStrategy:fr.u3,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new mr.Ek;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new mr.YP;throw new Error("localStorage n’est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("Le stockage fichier n’est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(123).then(__webpack_require__.bind(__webpack_require__,6123));return new e}if("undefined"!=typeof window&&window.localStorage)return new mr.YP;{const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(123).then(__webpack_require__.bind(__webpack_require__,6123));return new e}},MultiServerTokenStorageStrategy:mr.SJ},helper:{fromEntityJSON:function(e,t=null){if(!e?.__entityTag)return null;if(!e.serverData?.collection)return e;const r=function(e,t){const r=n.get(t),o=t,i={EndpointApi:n.get("EndpointApi"),User:"User"===o?r:n.get("User"),Organization:"Organization"===o?r:n.get("Organization"),Project:"Project"===o?r:n.get("Project"),Event:"Event"===o?r:n.get("Event"),Poi:"Poi"===o?r:n.get("Poi"),Badge:"Badge"===o?r:n.get("Badge"),News:"News"===o?r:n.get("News")};return{citoyens:{entityClass:i.User,deps:i},organizations:{entityClass:i.Organization,deps:i},projects:{entityClass:i.Project,deps:i},events:{entityClass:i.Event,deps:{...i,Badge:void 0}},poi:{entityClass:i.Poi,deps:{...i,Badge:void 0,News:void 0}},news:{entityClass:i.News,deps:{...i}},badges:{entityClass:i.Badge,deps:{EndpointApi:i.EndpointApi,User:i.User,Organization:i.Organization,Project:i.Project}}}[e]||null}(e.serverData.collection,e.__entityTag);if(!r)return e;if(!r?.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return r.entityClass.fromJSON(e,t,r.deps)}},OfflineClientManager:yr}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));
|