@sovity.de/edc-client 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- (function(s,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(s=typeof globalThis<"u"?globalThis:s||self,P(s["sovity-edc-client"]={}))})(this,function(s){"use strict";var $a=Object.defineProperty;var Va=(s,P,L)=>P in s?$a(s,P,{enumerable:!0,configurable:!0,writable:!0,value:L}):s[P]=L;var E=(s,P,L)=>(Va(s,typeof P!="symbol"?P+"":P,L),L);const P="https://my-connector/api/management".replace(/\/+$/,"");class L{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:P}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||De}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const Qe=new L,Ae=class Ae{constructor(t=Qe){E(this,"middleware");E(this,"fetchApi",async(t,r)=>{let n={url:t,init:r};for(const a of this.middleware)a.pre&&(n=await a.pre({fetch:this.fetchApi,...n})||n);let i;try{i=await(this.configuration.fetchApi||fetch)(n.url,n.init)}catch(a){for(const o of this.middleware)o.onError&&(i=await o.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:a,response:i?i.clone():void 0})||i);if(i===void 0)throw a instanceof Error?new We(a,"The request failed and the interceptors did not return an alternative response"):a}for(const a of this.middleware)a.post&&(i=await a.post({fetch:this.fetchApi,url:n.url,init:n.init,response:i.clone()})||i);return i});this.configuration=t,this.middleware=t.middleware}withMiddleware(...t){const r=this.clone();return r.middleware=r.middleware.concat(...t),r}withPreMiddleware(...t){const r=t.map(n=>({pre:n}));return this.withMiddleware(...r)}withPostMiddleware(...t){const r=t.map(n=>({post:n}));return this.withMiddleware(...r)}isJsonMime(t){return t?Ae.jsonRegex.test(t):!1}async request(t,r){const{url:n,init:i}=await this.createFetchParams(t,r),a=await this.fetchApi(n,i);if(a&&a.status>=200&&a.status<300)return a;throw new Ke(a,"Response returned an error code")}async createFetchParams(t,r){let n=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(n+="?"+this.configuration.queryParamsStringify(t.query));const i=Object.assign({},this.configuration.headers,t.headers);Object.keys(i).forEach(l=>i[l]===void 0?delete i[l]:{});const a=typeof r=="function"?r:async()=>r,o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},c={...o,...await a({init:o,context:t})},m={...c,body:un(c.body)||c.body instanceof URLSearchParams||dn(c.body)?c.body:JSON.stringify(c.body)};return{url:n,init:m}}clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}};E(Ae,"jsonRegex",new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"));let Q=Ae;function dn(e){return typeof Blob<"u"&&e instanceof Blob}function un(e){return typeof FormData<"u"&&e instanceof FormData}class Ke extends Error{constructor(r,n){super(n);E(this,"name","ResponseError");this.response=r}}class We extends Error{constructor(r,n){super(n);E(this,"name","FetchError");this.cause=r}}class R extends Error{constructor(r,n){super(n);E(this,"name","RequiredError");this.field=r}}const ln={csv:",",ssv:" ",tsv:" ",pipes:"|"};function d(e,t){const r=e[t];return r!=null}function De(e,t=""){return Object.keys(e).map(r=>Ye(r,e[r],t)).filter(r=>r.length>0).join("&")}function Ye(e,t,r=""){const n=r+(r.length?`[${e}]`:e);if(t instanceof Array){const i=t.map(a=>encodeURIComponent(String(a))).join(`&${encodeURIComponent(n)}=`);return`${encodeURIComponent(n)}=${i}`}if(t instanceof Set){const i=Array.from(t);return Ye(e,i,r)}return t instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?De(t,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`}function fn(e,t){return Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n])}),{})}function pn(e){for(const t of e)if(t.contentType==="multipart/form-data")return!0;return!1}class O{constructor(t,r=n=>n){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class Xe{constructor(t){this.raw=t}async value(){}}class mn{constructor(t){this.raw=t}async value(){return await this.raw.blob()}}class je{constructor(t){this.raw=t}async value(){return await this.raw.text()}}function gn(e){let t=!0;return t=t&&"assetId"in e,t=t&&"connectorEndpoint"in e,t=t&&"participantId"in e,t=t&&"title"in e,t=t&&"creatorOrganizationName"in e,t=t&&"isOwnConnector"in e,t}function j(e){return et(e)}function et(e,t){return e==null?e:{assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,descriptionShortText:d(e,"descriptionShortText")?e.descriptionShortText:void 0,isOwnConnector:e.isOwnConnector,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,httpDatasourceHintsProxyMethod:d(e,"httpDatasourceHintsProxyMethod")?e.httpDatasourceHintsProxyMethod:void 0,httpDatasourceHintsProxyPath:d(e,"httpDatasourceHintsProxyPath")?e.httpDatasourceHintsProxyPath:void 0,httpDatasourceHintsProxyQueryParams:d(e,"httpDatasourceHintsProxyQueryParams")?e.httpDatasourceHintsProxyQueryParams:void 0,httpDatasourceHintsProxyBody:d(e,"httpDatasourceHintsProxyBody")?e.httpDatasourceHintsProxyBody:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,assetJsonLd:d(e,"assetJsonLd")?e.assetJsonLd:void 0,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function me(e){if(e!==void 0)return e===null?null:{assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,language:e.language,description:e.description,descriptionShortText:e.descriptionShortText,isOwnConnector:e.isOwnConnector,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,httpDatasourceHintsProxyMethod:e.httpDatasourceHintsProxyMethod,httpDatasourceHintsProxyPath:e.httpDatasourceHintsProxyPath,httpDatasourceHintsProxyQueryParams:e.httpDatasourceHintsProxyQueryParams,httpDatasourceHintsProxyBody:e.httpDatasourceHintsProxyBody,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),assetJsonLd:e.assetJsonLd,customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function hn(e){let t=!0;return t=t&&"assets"in e,t}function tt(e){return rt(e)}function rt(e,t){return e==null?e:{assets:e.assets.map(j)}}function yn(e){if(e!==void 0)return e===null?null:{assets:e.assets.map(me)}}const Sn={Value:"VALUE",ValueList:"VALUE_LIST"};function nt(e){return it(e)}function it(e,t){return e}function vn(e){return e}function Tn(e){return!0}function at(e){return st(e)}function st(e,t){return e==null?e:{type:d(e,"type")?nt(e.type):void 0,value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function ot(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const Cn={Like:"LIKE",Eq:"EQ",In:"IN"};function ct(e){return dt(e)}function dt(e,t){return e}function On(e){return e}function _n(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function ut(e){return lt(e)}function lt(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:ct(e.operator),operandRight:at(e.operandRight)}}function ft(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:ot(e.operandRight)}}function wn(e){let t=!0;return t=t&&"connectorEndpoint"in e,t}function Nn(e){return pt(e)}function pt(e,t){return e==null?e:{connectorEndpoint:e.connectorEndpoint,limit:d(e,"limit")?e.limit:void 0,offset:d(e,"offset")?e.offset:void 0,filterExpressions:d(e,"filterExpressions")?e.filterExpressions.map(ut):void 0}}function mt(e){if(e!==void 0)return e===null?null:{connectorEndpoint:e.connectorEndpoint,limit:e.limit,offset:e.offset,filterExpressions:e.filterExpressions===void 0?void 0:e.filterExpressions.map(ft)}}function Pn(e){let t=!0;return t=t&&"numActiveConsumingContractAgreements"in e,t}function gt(e){return ht(e)}function ht(e,t){return e==null?e:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:d(e,"maxActiveConsumingContractAgreements")?e.maxActiveConsumingContractAgreements:void 0}}function In(e){if(e!==void 0)return e===null?null:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:e.maxActiveConsumingContractAgreements}}const An={Consuming:"CONSUMING",Providing:"PROVIDING"};function Je(e){return yt(e)}function yt(e,t){return e}function Dn(e){return e}const Jn={Running:"RUNNING",Ok:"OK",Error:"ERROR"};function St(e){return vt(e)}function vt(e,t){return e}function bn(e){return e}function Rn(e){let t=!0;return t=t&&"name"in e,t=t&&"code"in e,t=t&&"simplifiedState"in e,t}function be(e){return Tt(e)}function Tt(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:St(e.simplifiedState)}}function Re(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function kn(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t}function Ct(e){return Ot(e)}function Ot(e,t){return e==null?e:{transferProcessId:e.transferProcessId,lastUpdatedDate:new Date(e.lastUpdatedDate),state:be(e.state),errorMessage:d(e,"errorMessage")?e.errorMessage:void 0}}function _t(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Re(e.state),errorMessage:e.errorMessage}}const Un={Eq:"EQ",Neq:"NEQ",Gt:"GT",Geq:"GEQ",Lt:"LT",Leq:"LEQ",In:"IN",HasPart:"HAS_PART",IsA:"IS_A",IsAllOf:"IS_ALL_OF",IsAnyOf:"IS_ANY_OF",IsNoneOf:"IS_NONE_OF"};function wt(e){return Nt(e)}function Nt(e,t){return e}function Fn(e){return e}const En={String:"STRING",StringList:"STRING_LIST",Json:"JSON"};function Pt(e){return It(e)}function It(e,t){return e}function Ln(e){return e}function qn(e){let t=!0;return t=t&&"type"in e,t}function At(e){return Dt(e)}function Dt(e,t){return e==null?e:{type:Pt(e.type),value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function Jt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}function Mn(e){let t=!0;return t=t&&"left"in e,t=t&&"operator"in e,t=t&&"right"in e,t}function ke(e){return bt(e)}function bt(e,t){return e==null?e:{left:e.left,operator:wt(e.operator),right:At(e.right)}}function Ue(e){if(e!==void 0)return e===null?null:{left:e.left,operator:e.operator,right:Jt(e.right)}}function xn(e){let t=!0;return t=t&&"policyJsonLd"in e,t=t&&"errors"in e,t}function ge(e){return Rt(e)}function Rt(e,t){return e==null?e:{policyJsonLd:e.policyJsonLd,constraints:d(e,"constraints")?e.constraints.map(ke):void 0,errors:e.errors}}function he(e){if(e!==void 0)return e===null?null:{policyJsonLd:e.policyJsonLd,constraints:e.constraints===void 0?void 0:e.constraints.map(Ue),errors:e.errors}}function Zn(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"contractNegotiationId"in e,t=t&&"direction"in e,t=t&&"counterPartyAddress"in e,t=t&&"counterPartyId"in e,t=t&&"contractSigningDate"in e,t=t&&"asset"in e,t=t&&"contractPolicy"in e,t=t&&"transferProcesses"in e,t}function kt(e){return Ut(e)}function Ut(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,contractNegotiationId:e.contractNegotiationId,direction:Je(e.direction),counterPartyAddress:e.counterPartyAddress,counterPartyId:e.counterPartyId,contractSigningDate:new Date(e.contractSigningDate),asset:j(e.asset),contractPolicy:ge(e.contractPolicy),transferProcesses:e.transferProcesses.map(Ct)}}function Ft(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,contractNegotiationId:e.contractNegotiationId,direction:e.direction,counterPartyAddress:e.counterPartyAddress,counterPartyId:e.counterPartyId,contractSigningDate:e.contractSigningDate.toISOString(),asset:me(e.asset),contractPolicy:he(e.contractPolicy),transferProcesses:e.transferProcesses.map(_t)}}function $n(e){let t=!0;return t=t&&"contractAgreements"in e,t}function Et(e){return Lt(e)}function Lt(e,t){return e==null?e:{contractAgreements:e.contractAgreements.map(kt)}}function Vn(e){if(e!==void 0)return e===null?null:{contractAgreements:e.contractAgreements.map(Ft)}}const Hn={Value:"VALUE",ValueList:"VALUE_LIST"};function qt(e){return Mt(e)}function Mt(e,t){return e}function zn(e){return e}function Bn(e){return!0}function xt(e){return Zt(e)}function Zt(e,t){return e==null?e:{type:d(e,"type")?qt(e.type):void 0,value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function $t(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const Gn={Eq:"EQ",In:"IN",Like:"LIKE"};function Vt(e){return Ht(e)}function Ht(e,t){return e}function Qn(e){return e}function Kn(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function Fe(e){return zt(e)}function zt(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:Vt(e.operator),operandRight:xt(e.operandRight)}}function Ee(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:$t(e.operandRight)}}function Wn(e){let t=!0;return t=t&&"contractDefinitionId"in e,t=t&&"accessPolicyId"in e,t=t&&"contractPolicyId"in e,t=t&&"assetSelector"in e,t}function Bt(e){return Gt(e)}function Gt(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Fe)}}function Qt(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Ee)}}function Yn(e){let t=!0;return t=t&&"contractDefinitions"in e,t}function Kt(e){return Wt(e)}function Wt(e,t){return e==null?e:{contractDefinitions:e.contractDefinitions.map(Bt)}}function Xn(e){if(e!==void 0)return e===null?null:{contractDefinitions:e.contractDefinitions.map(Qt)}}function jn(e){let t=!0;return t=t&&"contractDefinitionId"in e,t=t&&"contractPolicyId"in e,t=t&&"accessPolicyId"in e,t=t&&"assetSelector"in e,t}function ei(e){return Yt(e)}function Yt(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Fe)}}function Xt(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Ee)}}function ti(e){let t=!0;return t=t&&"counterPartyAddress"in e,t=t&&"counterPartyParticipantId"in e,t=t&&"contractOfferId"in e,t=t&&"policyJsonLd"in e,t=t&&"assetId"in e,t}function ri(e){return jt(e)}function jt(e,t){return e==null?e:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}function er(e){if(e!==void 0)return e===null?null:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}const ni={InProgress:"IN_PROGRESS",Agreed:"AGREED",Terminated:"TERMINATED"};function tr(e){return rr(e)}function rr(e,t){return e}function ii(e){return e}function ai(e){let t=!0;return t=t&&"name"in e,t=t&&"code"in e,t=t&&"simplifiedState"in e,t}function nr(e){return ir(e)}function ir(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:tr(e.simplifiedState)}}function ar(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function si(e){let t=!0;return t=t&&"tokenUrl"in e,t=t&&"jwksUrl"in e,t}function sr(e){return or(e)}function or(e,t){return e==null?e:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function cr(e){if(e!==void 0)return e===null?null:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function oi(e){let t=!0;return t=t&&"url"in e,t=t&&"tokenUrl"in e,t=t&&"authorityId"in e,t}function dr(e){return ur(e)}function ur(e,t){return e==null?e:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function lr(e){if(e!==void 0)return e===null?null:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function ci(e){let t=!0;return t=t&&"numTotal"in e,t=t&&"numRunning"in e,t=t&&"numOk"in e,t=t&&"numError"in e,t}function Le(e){return fr(e)}function fr(e,t){return e==null?e:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function qe(e){if(e!==void 0)return e===null?null:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function di(e){let t=!0;return t=t&&"numAssets"in e,t=t&&"numPolicies"in e,t=t&&"numContractDefinitions"in e,t=t&&"numContractAgreementsConsuming"in e,t=t&&"numContractAgreementsProviding"in e,t=t&&"transferProcessesConsuming"in e,t=t&&"transferProcessesProviding"in e,t=t&&"connectorEndpoint"in e,t=t&&"connectorParticipantId"in e,t=t&&"connectorTitle"in e,t=t&&"connectorDescription"in e,t=t&&"connectorCuratorUrl"in e,t=t&&"connectorCuratorName"in e,t=t&&"connectorMaintainerUrl"in e,t=t&&"connectorMaintainerName"in e,t}function pr(e){return mr(e)}function mr(e,t){return e==null?e:{numAssets:e.numAssets,numPolicies:e.numPolicies,numContractDefinitions:e.numContractDefinitions,numContractAgreementsConsuming:e.numContractAgreementsConsuming,numContractAgreementsProviding:e.numContractAgreementsProviding,transferProcessesConsuming:Le(e.transferProcessesConsuming),transferProcessesProviding:Le(e.transferProcessesProviding),connectorEndpoint:e.connectorEndpoint,connectorParticipantId:e.connectorParticipantId,connectorTitle:e.connectorTitle,connectorDescription:e.connectorDescription,connectorCuratorUrl:e.connectorCuratorUrl,connectorCuratorName:e.connectorCuratorName,connectorMaintainerUrl:e.connectorMaintainerUrl,connectorMaintainerName:e.connectorMaintainerName,connectorDapsConfig:d(e,"connectorDapsConfig")?sr(e.connectorDapsConfig):void 0,connectorMiwConfig:d(e,"connectorMiwConfig")?dr(e.connectorMiwConfig):void 0}}function ui(e){if(e!==void 0)return e===null?null:{numAssets:e.numAssets,numPolicies:e.numPolicies,numContractDefinitions:e.numContractDefinitions,numContractAgreementsConsuming:e.numContractAgreementsConsuming,numContractAgreementsProviding:e.numContractAgreementsProviding,transferProcessesConsuming:qe(e.transferProcessesConsuming),transferProcessesProviding:qe(e.transferProcessesProviding),connectorEndpoint:e.connectorEndpoint,connectorParticipantId:e.connectorParticipantId,connectorTitle:e.connectorTitle,connectorDescription:e.connectorDescription,connectorCuratorUrl:e.connectorCuratorUrl,connectorCuratorName:e.connectorCuratorName,connectorMaintainerUrl:e.connectorMaintainerUrl,connectorMaintainerName:e.connectorMaintainerName,connectorDapsConfig:cr(e.connectorDapsConfig),connectorMiwConfig:lr(e.connectorMiwConfig)}}function li(e){let t=!0;return t=t&&"id"in e,t=t&&"lastUpdatedDate"in e,t}function k(e){return gr(e)}function gr(e,t){return e==null?e:{id:e.id,lastUpdatedDate:new Date(e.lastUpdatedDate)}}function fi(e){if(e!==void 0)return e===null?null:{id:e.id,lastUpdatedDate:e.lastUpdatedDate.toISOString()}}function pi(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"transferProcessRequestJsonLd"in e,t}function mi(e){return hr(e)}function hr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function yr(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function gi(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"dataSinkProperties"in e,t=t&&"transferProcessProperties"in e,t}function hi(e){return Sr(e)}function Sr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function vr(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function yi(e){let t=!0;return t=t&&"incomingTransferProcessCounts"in e,t=t&&"outgoingTransferProcessCounts"in e,t}function Tr(e){return Cr(e)}function Cr(e,t){return e==null?e:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Or(e){if(e!==void 0)return e===null?null:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Si(e){let t=!0;return t=t&&"assetsCount"in e,t=t&&"policiesCount"in e,t=t&&"contractDefinitionsCount"in e,t=t&&"contractAgreementsCount"in e,t=t&&"transferProcessDto"in e,t}function _r(e){return wr(e)}function wr(e,t){return e==null?e:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Tr(e.transferProcessDto)}}function vi(e){if(e!==void 0)return e===null?null:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Or(e.transferProcessDto)}}function Ti(e){return!0}function Nr(e){return Pr(e)}function Pr(e,t){return e==null?e:{constraints:d(e,"constraints")?e.constraints.map(ke):void 0}}function Ir(e){if(e!==void 0)return e===null?null:{constraints:e.constraints===void 0?void 0:e.constraints.map(Ue)}}function Ci(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function Oi(e){return Ar(e)}function Ar(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:Nr(e.policy)}}function Dr(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:Ir(e.policy)}}function _i(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function Jr(e){return br(e)}function br(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:ge(e.policy)}}function Rr(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:he(e.policy)}}function wi(e){let t=!0;return t=t&&"policies"in e,t}function kr(e){return Ur(e)}function Ur(e,t){return e==null?e:{policies:e.policies.map(Jr)}}function Ni(e){if(e!==void 0)return e===null?null:{policies:e.policies.map(Rr)}}function Pi(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"createdDate"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t=t&&"contractAgreementId"in e,t=t&&"direction"in e,t=t&&"counterPartyConnectorEndpoint"in e,t=t&&"counterPartyParticipantId"in e,t=t&&"assetName"in e,t=t&&"assetId"in e,t}function Fr(e){return Er(e)}function Er(e,t){return e==null?e:{transferProcessId:e.transferProcessId,createdDate:new Date(e.createdDate),lastUpdatedDate:new Date(e.lastUpdatedDate),state:be(e.state),contractAgreementId:e.contractAgreementId,direction:Je(e.direction),counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:d(e,"errorMessage")?e.errorMessage:void 0}}function Lr(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,createdDate:e.createdDate.toISOString(),lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Re(e.state),contractAgreementId:e.contractAgreementId,direction:e.direction,counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:e.errorMessage}}function Ii(e){let t=!0;return t=t&&"transferEntries"in e,t}function qr(e){return Mr(e)}function Mr(e,t){return e==null?e:{transferEntries:e.transferEntries.map(Fr)}}function Ai(e){if(e!==void 0)return e===null?null:{transferEntries:e.transferEntries.map(Lr)}}function Di(e){let t=!0;return t=t&&"id"in e,t=t&&"dataAddressProperties"in e,t}function Ji(e){return xr(e)}function xr(e,t){return e==null?e:{id:e.id,title:d(e,"title")?e.title:void 0,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,dataAddressProperties:e.dataAddressProperties,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function Me(e){if(e!==void 0)return e===null?null:{id:e.id,title:e.title,language:e.language,description:e.description,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),dataAddressProperties:e.dataAddressProperties,customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function bi(e){return!0}function Ri(e){return Zr(e)}function Zr(e,t){return e==null?e:{title:d(e,"title")?e.title:void 0,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function $r(e){if(e!==void 0)return e===null?null:{title:e.title,language:e.language,description:e.description,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function ki(e){let t=!0;return t=t&&"contractNegotiationId"in e,t=t&&"createdAt"in e,t=t&&"state"in e,t}function xe(e){return Vr(e)}function Vr(e,t){return e==null?e:{contractNegotiationId:e.contractNegotiationId,createdAt:new Date(e.createdAt),contractAgreementId:d(e,"contractAgreementId")?e.contractAgreementId:void 0,state:nr(e.state)}}function Ui(e){if(e!==void 0)return e===null?null:{contractNegotiationId:e.contractNegotiationId,createdAt:e.createdAt.toISOString(),contractAgreementId:e.contractAgreementId,state:ar(e.state)}}function Fi(e){let t=!0;return t=t&&"contractOfferId"in e,t=t&&"policy"in e,t}function Hr(e){return zr(e)}function zr(e,t){return e==null?e:{contractOfferId:e.contractOfferId,policy:ge(e.policy)}}function Br(e){if(e!==void 0)return e===null?null:{contractOfferId:e.contractOfferId,policy:he(e.policy)}}function Ei(e){let t=!0;return t=t&&"endpoint"in e,t=t&&"participantId"in e,t=t&&"asset"in e,t=t&&"contractOffers"in e,t}function Ze(e){return Gr(e)}function Gr(e,t){return e==null?e:{endpoint:e.endpoint,participantId:e.participantId,asset:j(e.asset),contractOffers:e.contractOffers.map(Hr)}}function Li(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,participantId:e.participantId,asset:me(e.asset),contractOffers:e.contractOffers.map(Br)}}class Qr extends Q{async connectorLimitsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/connector-limits",method:"GET",headers:n,query:r},t);return new O(i,a=>gt(a))}async connectorLimits(t){return await(await this.connectorLimitsRaw(t)).value()}async fileUploadCreateAssetRaw(t,r){if(t.blobId===null||t.blobId===void 0)throw new R("blobId","Required parameter requestParameters.blobId was null or undefined when calling fileUploadCreateAsset.");if(t.uiAssetCreateRequest===null||t.uiAssetCreateRequest===void 0)throw new R("uiAssetCreateRequest","Required parameter requestParameters.uiAssetCreateRequest was null or undefined when calling fileUploadCreateAsset.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ee/file-upload/blobs/{blobId}/asset".replace("{blobId}",encodeURIComponent(String(t.blobId))),method:"POST",headers:i,query:n,body:Me(t.uiAssetCreateRequest)},r);return new Xe(a)}async fileUploadCreateAsset(t,r){await this.fileUploadCreateAssetRaw(t,r)}async fileUploadRequestSasTokenRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/file-upload/blobs",method:"POST",headers:n,query:r},t);return this.isJsonMime(i.headers.get("content-type"))?new O(i):new je(i)}async fileUploadRequestSasToken(t){return await(await this.fileUploadRequestSasTokenRaw(t)).value()}}class Kr extends Q{async createAssetRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets",method:"POST",headers:i,query:n,body:Me(t.uiAssetCreateRequest)},r);return new O(a,o=>k(o))}async createAsset(t={},r){return await(await this.createAssetRaw(t,r)).value()}async createContractDefinitionRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-definition-page/contract-definitions",method:"POST",headers:i,query:n,body:Xt(t.contractDefinitionRequest)},r);return new O(a,o=>k(o))}async createContractDefinition(t={},r){return await(await this.createContractDefinitionRaw(t,r)).value()}async createPolicyDefinitionRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/policy-page/policy-definitions",method:"POST",headers:i,query:n,body:Dr(t.policyDefinitionCreateRequest)},r);return new O(a,o=>k(o))}async createPolicyDefinition(t={},r){return await(await this.createPolicyDefinitionRaw(t,r)).value()}async deleteAssetRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new R("assetId","Required parameter requestParameters.assetId was null or undefined when calling deleteAsset.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>k(o))}async deleteAsset(t,r){return await(await this.deleteAssetRaw(t,r)).value()}async deleteContractDefinitionRaw(t,r){if(t.contractDefinitionId===null||t.contractDefinitionId===void 0)throw new R("contractDefinitionId","Required parameter requestParameters.contractDefinitionId was null or undefined when calling deleteContractDefinition.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/contract-definition-page/contract-definitions/{contractDefinitionId}".replace("{contractDefinitionId}",encodeURIComponent(String(t.contractDefinitionId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>k(o))}async deleteContractDefinition(t,r){return await(await this.deleteContractDefinitionRaw(t,r)).value()}async deletePolicyDefinitionRaw(t,r){if(t.policyId===null||t.policyId===void 0)throw new R("policyId","Required parameter requestParameters.policyId was null or undefined when calling deletePolicyDefinition.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/policy-page/policy-definitions/{policyId}".replace("{policyId}",encodeURIComponent(String(t.policyId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>k(o))}async deletePolicyDefinition(t,r){return await(await this.deletePolicyDefinitionRaw(t,r)).value()}async editAssetMetadataRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new R("assetId","Required parameter requestParameters.assetId was null or undefined when calling editAssetMetadata.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}/metadata".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"PUT",headers:i,query:n,body:$r(t.uiAssetEditMetadataRequest)},r);return new O(a,o=>k(o))}async editAssetMetadata(t,r){return await(await this.editAssetMetadataRaw(t,r)).value()}async getAssetPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/asset-page",method:"GET",headers:n,query:r},t);return new O(i,a=>tt(a))}async getAssetPage(t){return await(await this.getAssetPageRaw(t)).value()}async getCatalogPageDataOffersRaw(t,r){const n={};t.connectorEndpoint!==void 0&&(n.connectorEndpoint=t.connectorEndpoint);const i={},a=await this.request({path:"/wrapper/ui/pages/catalog-page/data-offers",method:"GET",headers:i,query:n},r);return new O(a,o=>o.map(Ze))}async getCatalogPageDataOffers(t={},r){return await(await this.getCatalogPageDataOffersRaw(t,r)).value()}async getContractAgreementPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/contract-agreement-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Et(a))}async getContractAgreementPage(t){return await(await this.getContractAgreementPageRaw(t)).value()}async getContractDefinitionPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/contract-definition-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Kt(a))}async getContractDefinitionPage(t){return await(await this.getContractDefinitionPageRaw(t)).value()}async getContractNegotiationRaw(t,r){if(t.contractNegotiationId===null||t.contractNegotiationId===void 0)throw new R("contractNegotiationId","Required parameter requestParameters.contractNegotiationId was null or undefined when calling getContractNegotiation.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/catalog-page/contract-negotiations/{contractNegotiationId}".replace("{contractNegotiationId}",encodeURIComponent(String(t.contractNegotiationId))),method:"GET",headers:i,query:n},r);return new O(a,o=>xe(o))}async getContractNegotiation(t,r){return await(await this.getContractNegotiationRaw(t,r)).value()}async getDashboardPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/dashboard-page",method:"GET",headers:n,query:r},t);return new O(i,a=>pr(a))}async getDashboardPage(t){return await(await this.getDashboardPageRaw(t)).value()}async getPolicyDefinitionPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/policy-page",method:"GET",headers:n,query:r},t);return new O(i,a=>kr(a))}async getPolicyDefinitionPage(t){return await(await this.getPolicyDefinitionPageRaw(t)).value()}async getTransferHistoryPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/transfer-history-page",method:"GET",headers:n,query:r},t);return new O(i,a=>qr(a))}async getTransferHistoryPage(t){return await(await this.getTransferHistoryPageRaw(t)).value()}async getTransferProcessAssetRaw(t,r){if(t.transferProcessId===null||t.transferProcessId===void 0)throw new R("transferProcessId","Required parameter requestParameters.transferProcessId was null or undefined when calling getTransferProcessAsset.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/transfer-history-page/transfer-processes/{transferProcessId}/asset".replace("{transferProcessId}",encodeURIComponent(String(t.transferProcessId))),method:"GET",headers:i,query:n},r);return new O(a,o=>j(o))}async getTransferProcessAsset(t,r){return await(await this.getTransferProcessAssetRaw(t,r)).value()}async initiateContractNegotiationRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/catalog-page/contract-negotiations",method:"POST",headers:i,query:n,body:er(t.contractNegotiationRequest)},r);return new O(a,o=>xe(o))}async initiateContractNegotiation(t={},r){return await(await this.initiateContractNegotiationRaw(t,r)).value()}async initiateCustomTransferRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page/transfers/custom",method:"POST",headers:i,query:n,body:yr(t.initiateCustomTransferRequest)},r);return new O(a,o=>k(o))}async initiateCustomTransfer(t={},r){return await(await this.initiateCustomTransferRaw(t,r)).value()}async initiateTransferRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page/transfers",method:"POST",headers:i,query:n,body:vr(t.initiateTransferRequest)},r);return new O(a,o=>k(o))}async initiateTransfer(t={},r){return await(await this.initiateTransferRaw(t,r)).value()}}class Wr extends Q{async getKpisRaw(t){const r={},n={},i=await this.request({path:"/wrapper/use-case-api/kpis",method:"GET",headers:n,query:r},t);return new O(i,a=>_r(a))}async getKpis(t){return await(await this.getKpisRaw(t)).value()}async getSupportedFunctionsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/use-case-api/supported-policy-functions",method:"GET",headers:n,query:r},t);return new O(i)}async getSupportedFunctions(t){return await(await this.getSupportedFunctionsRaw(t)).value()}async queryCatalogRaw(t,r){if(t.catalogQuery===null||t.catalogQuery===void 0)throw new R("catalogQuery","Required parameter requestParameters.catalogQuery was null or undefined when calling queryCatalog.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/use-case-api/catalog",method:"POST",headers:i,query:n,body:mt(t.catalogQuery)},r);return new O(a,o=>o.map(Ze))}async queryCatalog(t,r){return await(await this.queryCatalogRaw(t,r)).value()}}var C;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of a)o[c]=i[c];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var $e;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($e||($e={}));const f=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),x=e=>{switch(typeof e){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(e)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(e)?f.array:e===null?f.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?f.promise:typeof Map<"u"&&e instanceof Map?f.map:typeof Set<"u"&&e instanceof Set?f.set:typeof Date<"u"&&e instanceof Date?f.date:f.object;default:return f.unknown}},u=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qi=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class A extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let c=n,m=0;for(;m<o.path.length;){const l=o.path[m];m===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(r(o))):c[l]=c[l]||{_errors:[]},c=c[l],m++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}A.create=e=>new A(e);const ee=(e,t)=>{let r;switch(e.code){case u.invalid_type:e.received===f.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,C.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${C.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${C.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${C.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:r="Invalid function arguments";break;case u.invalid_return_type:r="Invalid function return type";break;case u.invalid_date:r="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:C.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case u.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case u.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case u.custom:r="Invalid input";break;case u.invalid_intersection_types:r="Intersection results could not be merged";break;case u.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:r="Number must be finite";break;default:r=t.defaultError,C.assertNever(e)}return{message:r}};let Yr=ee;function Mi(e){Yr=e}function ye(){return Yr}const Se=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};let c="";const m=n.filter(l=>!!l).slice().reverse();for(const l of m)c=l(o,{data:t,defaultError:c}).message;return{...i,path:a,message:i.message||c}},xi=[];function p(e,t){const r=Se({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ye(),ee].filter(n=>!!n)});e.common.issues.push(r)}class w{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return y;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return w.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return y;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const y=Object.freeze({status:"aborted"}),Xr=e=>({status:"dirty",value:e}),N=e=>({status:"valid",value:e}),Ve=e=>e.status==="aborted",He=e=>e.status==="dirty",te=e=>e.status==="valid",ve=e=>typeof Promise<"u"&&e instanceof Promise;var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(g||(g={}));class U{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const jr=(e,t)=>{if(te(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new A(e.common.issues);return this._error=r,this._error}}};function S(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,c)=>o.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:n??c.defaultError}:{message:r??c.defaultError},description:i}}class v{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return x(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:x(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new w,ctx:{common:t.parent.common,data:t.data,parsedType:x(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(ve(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:x(t)},a=this._parseSync({data:t,path:i.path,parent:i});return jr(i,a)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:x(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(ve(i)?i:Promise.resolve(i));return jr(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),c=()=>a.addIssue({code:u.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(m=>m?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new b({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return M.create(this,this._def)}nullable(){return G.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this,this._def)}promise(){return X.create(this,this._def)}or(t){return ae.create([this,t],this._def)}and(t){return se.create(this,t,this._def)}transform(t){return new b({...S(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new le({...S(this._def),innerType:this,defaultValue:r,typeName:h.ZodDefault})}brand(){return new tn({typeName:h.ZodBranded,type:this,...S(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Ne({...S(this._def),innerType:this,catchValue:r,typeName:h.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return fe.create(this,t)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zi=/^c[^\s-]{8,}$/i,$i=/^[a-z][a-z0-9]*$/,Vi=/^[0-9A-HJKMNP-TV-Z]{26}$/,Hi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zi=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ze;const Gi=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Qi=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ki=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Wi(e,t){return!!((t==="v4"||!t)&&Gi.test(e)||(t==="v6"||!t)&&Qi.test(e))}class D extends v{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==f.string){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new w;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,c=t.data.length<a.value;(o||c)&&(i=this._getOrReturnCtx(t,i),o?p(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&p(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")zi.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"email",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ze||(ze=new RegExp(Bi,"u")),ze.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"emoji",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Hi.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"uuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Zi.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"cuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")$i.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"cuid2",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Vi.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"ulid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),p(i,{validation:"url",code:u.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"regex",code:u.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ki(a).test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?Wi(t.data,a.version)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"ip",code:u.invalid_string,message:a.message}),n.dirty()):C.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:u.invalid_string,...g.errToObj(n)})}_addCheck(t){return new D({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,...g.errToObj(t==null?void 0:t.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...g.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...g.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...g.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...g.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...g.errToObj(r)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}D.create=e=>{var t;return new D({checks:[],typeName:h.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};function Yi(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class Z extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==f.number){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const i=new w;for(const a of this._def.checks)a.kind==="int"?C.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),p(n,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Yi(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_finite,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&C.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Z.create=e=>new Z({checks:[],typeName:h.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class $ extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==f.bigint){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const i=new w;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new $({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new $({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}$.create=e=>{var t;return new $({checks:[],typeName:h.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};class re extends v{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==f.boolean){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.boolean,received:n.parsedType}),y}return N(t.data)}}re.create=e=>new re({typeName:h.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class H extends v{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==f.date){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_date}),y}const n=new w;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):C.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new H({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}H.create=e=>new H({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:h.ZodDate,...S(e)});class Te extends v{_parse(t){if(this._getType(t)!==f.symbol){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.symbol,received:n.parsedType}),y}return N(t.data)}}Te.create=e=>new Te({typeName:h.ZodSymbol,...S(e)});class ne extends v{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.undefined,received:n.parsedType}),y}return N(t.data)}}ne.create=e=>new ne({typeName:h.ZodUndefined,...S(e)});class ie extends v{_parse(t){if(this._getType(t)!==f.null){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.null,received:n.parsedType}),y}return N(t.data)}}ie.create=e=>new ie({typeName:h.ZodNull,...S(e)});class K extends v{constructor(){super(...arguments),this._any=!0}_parse(t){return N(t.data)}}K.create=e=>new K({typeName:h.ZodAny,...S(e)});class z extends v{constructor(){super(...arguments),this._unknown=!0}_parse(t){return N(t.data)}}z.create=e=>new z({typeName:h.ZodUnknown,...S(e)});class q extends v{_parse(t){const r=this._getOrReturnCtx(t);return p(r,{code:u.invalid_type,expected:f.never,received:r.parsedType}),y}}q.create=e=>new q({typeName:h.ZodNever,...S(e)});class Ce extends v{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.void,received:n.parsedType}),y}return N(t.data)}}Ce.create=e=>new Ce({typeName:h.ZodVoid,...S(e)});class J extends v{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==f.array)return p(r,{code:u.invalid_type,expected:f.array,received:r.parsedType}),y;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(o||c)&&(p(r,{code:o?u.too_big:u.too_small,minimum:c?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(p(r,{code:u.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(p(r,{code:u.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,c)=>i.type._parseAsync(new U(r,o,r.path,c)))).then(o=>w.mergeArray(n,o));const a=[...r.data].map((o,c)=>i.type._parseSync(new U(r,o,r.path,c)));return w.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new J({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new J({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new J({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...S(t)});function W(e){if(e instanceof _){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=M.create(W(n))}return new _({...e._def,shape:()=>t})}else return e instanceof J?new J({...e._def,type:W(e.element)}):e instanceof M?M.create(W(e.unwrap())):e instanceof G?G.create(W(e.unwrap())):e instanceof F?F.create(e.items.map(t=>W(t))):e}class _ extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=C.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==f.object){const l=this._getOrReturnCtx(t);return p(l,{code:u.invalid_type,expected:f.object,received:l.parsedType}),y}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof q&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||c.push(l);const m=[];for(const l of o){const T=a[l],I=i.data[l];m.push({key:{status:"valid",value:l},value:T._parse(new U(i,I,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof q){const l=this._def.unknownKeys;if(l==="passthrough")for(const T of c)m.push({key:{status:"valid",value:T},value:{status:"valid",value:i.data[T]}});else if(l==="strict")c.length>0&&(p(i,{code:u.unrecognized_keys,keys:c}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const T of c){const I=i.data[T];m.push({key:{status:"valid",value:T},value:l._parse(new U(i,I,i.path,T)),alwaysSet:T in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const T of m){const I=await T.key;l.push({key:I,value:await T.value,alwaysSet:T.alwaysSet})}return l}).then(l=>w.mergeObjectSync(n,l)):w.mergeObjectSync(n,m)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new _({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,a,o,c;const m=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=g.errToObj(t).message)!==null&&c!==void 0?c:m}:{message:m}}}:{}})}strip(){return new _({...this._def,unknownKeys:"strip"})}passthrough(){return new _({...this._def,unknownKeys:"passthrough"})}extend(t){return new _({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:h.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new _({...this._def,catchall:t})}pick(t){const r={};return C.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new _({...this._def,shape:()=>r})}omit(t){const r={};return C.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new _({...this._def,shape:()=>r})}deepPartial(){return W(this)}partial(t){const r={};return C.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new _({...this._def,shape:()=>r})}required(t){const r={};return C.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof M;)a=a._def.innerType;r[n]=a}}),new _({...this._def,shape:()=>r})}keyof(){return en(C.objectKeys(this.shape))}}_.create=(e,t)=>new _({shape:()=>e,unknownKeys:"strip",catchall:q.create(),typeName:h.ZodObject,...S(t)}),_.strictCreate=(e,t)=>new _({shape:()=>e,unknownKeys:"strict",catchall:q.create(),typeName:h.ZodObject,...S(t)}),_.lazycreate=(e,t)=>new _({shape:e,unknownKeys:"strip",catchall:q.create(),typeName:h.ZodObject,...S(t)});class ae extends v{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const c of a)if(c.result.status==="valid")return c.result;for(const c of a)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const o=a.map(c=>new A(c.ctx.common.issues));return p(r,{code:u.invalid_union,unionErrors:o}),y}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const m of n){const l={...r,common:{...r.common,issues:[]},parent:null},T=m._parseSync({data:r.data,path:r.path,parent:l});if(T.status==="valid")return T;T.status==="dirty"&&!a&&(a={result:T,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const c=o.map(m=>new A(m));return p(r,{code:u.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ae.create=(e,t)=>new ae({options:e,typeName:h.ZodUnion,...S(t)});const Oe=e=>e instanceof ce?Oe(e.schema):e instanceof b?Oe(e.innerType()):e instanceof de?[e.value]:e instanceof V?e.options:e instanceof ue?Object.keys(e.enum):e instanceof le?Oe(e._def.innerType):e instanceof ne?[void 0]:e instanceof ie?[null]:null;class _e extends v{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.object)return p(r,{code:u.invalid_type,expected:f.object,received:r.parsedType}),y;const n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(p(r,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const i=new Map;for(const a of r){const o=Oe(a.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of o){if(i.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);i.set(c,a)}}return new _e({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...S(n)})}}function Be(e,t){const r=x(e),n=x(t);if(e===t)return{valid:!0,data:e};if(r===f.object&&n===f.object){const i=C.objectKeys(t),a=C.objectKeys(e).filter(c=>i.indexOf(c)!==-1),o={...e,...t};for(const c of a){const m=Be(e[c],t[c]);if(!m.valid)return{valid:!1};o[c]=m.data}return{valid:!0,data:o}}else if(r===f.array&&n===f.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=t[a],m=Be(o,c);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===f.date&&n===f.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class se extends v{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,o)=>{if(Ve(a)||Ve(o))return y;const c=Be(a.value,o.value);return c.valid?((He(a)||He(o))&&r.dirty(),{status:r.value,value:c.data}):(p(n,{code:u.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}se.create=(e,t,r)=>new se({left:e,right:t,typeName:h.ZodIntersection,...S(r)});class F extends v{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.array)return p(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return p(n,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,c)=>{const m=this._def.items[c]||this._def.rest;return m?m._parse(new U(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>w.mergeArray(r,o)):w.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new F({...this._def,rest:t})}}F.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new F({items:e,typeName:h.ZodTuple,rest:null,...S(t)})};class oe extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.object)return p(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),y;const i=[],a=this._def.keyType,o=this._def.valueType;for(const c in n.data)i.push({key:a._parse(new U(n,c,n.path,c)),value:o._parse(new U(n,n.data[c],n.path,c))});return n.common.async?w.mergeObjectAsync(r,i):w.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof v?new oe({keyType:t,valueType:r,typeName:h.ZodRecord,...S(n)}):new oe({keyType:D.create(),valueType:t,typeName:h.ZodRecord,...S(r)})}}class we extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.map)return p(n,{code:u.invalid_type,expected:f.map,received:n.parsedType}),y;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([c,m],l)=>({key:i._parse(new U(n,c,n.path,[l,"key"])),value:a._parse(new U(n,m,n.path,[l,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const m of o){const l=await m.key,T=await m.value;if(l.status==="aborted"||T.status==="aborted")return y;(l.status==="dirty"||T.status==="dirty")&&r.dirty(),c.set(l.value,T.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const m of o){const l=m.key,T=m.value;if(l.status==="aborted"||T.status==="aborted")return y;(l.status==="dirty"||T.status==="dirty")&&r.dirty(),c.set(l.value,T.value)}return{status:r.value,value:c}}}}we.create=(e,t,r)=>new we({valueType:t,keyType:e,typeName:h.ZodMap,...S(r)});class B extends v{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.set)return p(n,{code:u.invalid_type,expected:f.set,received:n.parsedType}),y;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(p(n,{code:u.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(p(n,{code:u.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(m){const l=new Set;for(const T of m){if(T.status==="aborted")return y;T.status==="dirty"&&r.dirty(),l.add(T.value)}return{status:r.value,value:l}}const c=[...n.data.values()].map((m,l)=>a._parse(new U(n,m,n.path,l)));return n.common.async?Promise.all(c).then(m=>o(m)):o(c)}min(t,r){return new B({...this._def,minSize:{value:t,message:g.toString(r)}})}max(t,r){return new B({...this._def,maxSize:{value:t,message:g.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}B.create=(e,t)=>new B({valueType:e,minSize:null,maxSize:null,typeName:h.ZodSet,...S(t)});class Y extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.function)return p(r,{code:u.invalid_type,expected:f.function,received:r.parsedType}),y;function n(c,m){return Se({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:m}})}function i(c,m){return Se({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:m}})}const a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof X){const c=this;return N(async function(...m){const l=new A([]),T=await c._def.args.parseAsync(m,a).catch(Ge=>{throw l.addIssue(n(m,Ge)),l}),I=await Reflect.apply(o,this,T);return await c._def.returns._def.type.parseAsync(I,a).catch(Ge=>{throw l.addIssue(i(I,Ge)),l})})}else{const c=this;return N(function(...m){const l=c._def.args.safeParse(m,a);if(!l.success)throw new A([n(m,l.error)]);const T=Reflect.apply(o,this,l.data),I=c._def.returns.safeParse(T,a);if(!I.success)throw new A([i(T,I.error)]);return I.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Y({...this._def,args:F.create(t).rest(z.create())})}returns(t){return new Y({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Y({args:t||F.create([]).rest(z.create()),returns:r||z.create(),typeName:h.ZodFunction,...S(n)})}}class ce extends v{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ce.create=(e,t)=>new ce({getter:e,typeName:h.ZodLazy,...S(t)});class de extends v{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return p(r,{received:r.data,code:u.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:t.data}}get value(){return this._def.value}}de.create=(e,t)=>new de({value:e,typeName:h.ZodLiteral,...S(t)});function en(e,t){return new V({values:e,typeName:h.ZodEnum,...S(t)})}class V extends v{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return p(r,{expected:C.joinValues(n),received:r.parsedType,code:u.invalid_type}),y}if(this._def.values.indexOf(t.data)===-1){const r=this._getOrReturnCtx(t),n=this._def.values;return p(r,{received:r.data,code:u.invalid_enum_value,options:n}),y}return N(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t){return V.create(t)}exclude(t){return V.create(this.options.filter(r=>!t.includes(r)))}}V.create=en;class ue extends v{_parse(t){const r=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==f.string&&n.parsedType!==f.number){const i=C.objectValues(r);return p(n,{expected:C.joinValues(i),received:n.parsedType,code:u.invalid_type}),y}if(r.indexOf(t.data)===-1){const i=C.objectValues(r);return p(n,{received:n.data,code:u.invalid_enum_value,options:i}),y}return N(t.data)}get enum(){return this._def.values}}ue.create=(e,t)=>new ue({values:e,typeName:h.ZodNativeEnum,...S(t)});class X extends v{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.promise&&r.common.async===!1)return p(r,{code:u.invalid_type,expected:f.promise,received:r.parsedType}),y;const n=r.parsedType===f.promise?r.data:Promise.resolve(r.data);return N(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}X.create=(e,t)=>new X({type:e,typeName:h.ZodPromise,...S(t)});class b extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{p(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(c=>this._def.schema._parseAsync({data:c,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=c=>{const m=i.refinement(c,a);if(n.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),o(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),o(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!te(o))return o;const c=i.transform(o.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>te(o)?Promise.resolve(i.transform(o.value,a)).then(c=>({status:r.value,value:c})):o);C.assertNever(i)}}b.create=(e,t,r)=>new b({schema:e,typeName:h.ZodEffects,effect:t,...S(r)}),b.createWithPreprocess=(e,t,r)=>new b({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...S(r)});class M extends v{_parse(t){return this._getType(t)===f.undefined?N(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}M.create=(e,t)=>new M({innerType:e,typeName:h.ZodOptional,...S(t)});class G extends v{_parse(t){return this._getType(t)===f.null?N(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}G.create=(e,t)=>new G({innerType:e,typeName:h.ZodNullable,...S(t)});class le extends v{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}le.create=(e,t)=>new le({innerType:e,typeName:h.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...S(t)});class Ne extends v{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ve(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new A(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new A(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...S(t)});class Pe extends v{_parse(t){if(this._getType(t)!==f.nan){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:t.data}}}Pe.create=e=>new Pe({typeName:h.ZodNaN,...S(e)});const Xi=Symbol("zod_brand");class tn extends v{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class fe extends v{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(r.dirty(),Xr(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?y:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new fe({in:t,out:r,typeName:h.ZodPipeline})}}class Ie extends v{_parse(t){const r=this._def.innerType._parse(t);return te(r)&&(r.value=Object.freeze(r.value)),r}}Ie.create=(e,t)=>new Ie({innerType:e,typeName:h.ZodReadonly,...S(t)});const rn=(e,t={},r)=>e?K.create().superRefine((n,i)=>{var a,o;if(!e(n)){const c=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,m=(o=(a=c.fatal)!==null&&a!==void 0?a:r)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;i.addIssue({code:"custom",...l,fatal:m})}}):K.create(),ji={object:_.lazycreate};var h;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(h||(h={}));const ea=(e,t={message:`Input not instance of ${e.name}`})=>rn(r=>r instanceof e,t),nn=D.create,an=Z.create,ta=Pe.create,ra=$.create,sn=re.create,na=H.create,ia=Te.create,aa=ne.create,sa=ie.create,oa=K.create,ca=z.create,da=q.create,ua=Ce.create,la=J.create,fa=_.create,pa=_.strictCreate,ma=ae.create,ga=_e.create,ha=se.create,ya=F.create,Sa=oe.create,va=we.create,Ta=B.create,Ca=Y.create,Oa=ce.create,_a=de.create,wa=V.create,Na=ue.create,Pa=X.create,on=b.create,Ia=M.create,Aa=G.create,Da=b.createWithPreprocess,Ja=fe.create;var pe=Object.freeze({__proto__:null,defaultErrorMap:ee,setErrorMap:Mi,getErrorMap:ye,makeIssue:Se,EMPTY_PATH:xi,addIssueToContext:p,ParseStatus:w,INVALID:y,DIRTY:Xr,OK:N,isAborted:Ve,isDirty:He,isValid:te,isAsync:ve,get util(){return C},get objectUtil(){return $e},ZodParsedType:f,getParsedType:x,ZodType:v,ZodString:D,ZodNumber:Z,ZodBigInt:$,ZodBoolean:re,ZodDate:H,ZodSymbol:Te,ZodUndefined:ne,ZodNull:ie,ZodAny:K,ZodUnknown:z,ZodNever:q,ZodVoid:Ce,ZodArray:J,ZodObject:_,ZodUnion:ae,ZodDiscriminatedUnion:_e,ZodIntersection:se,ZodTuple:F,ZodRecord:oe,ZodMap:we,ZodSet:B,ZodFunction:Y,ZodLazy:ce,ZodLiteral:de,ZodEnum:V,ZodNativeEnum:ue,ZodPromise:X,ZodEffects:b,ZodTransformer:b,ZodOptional:M,ZodNullable:G,ZodDefault:le,ZodCatch:Ne,ZodNaN:Pe,BRAND:Xi,ZodBranded:tn,ZodPipeline:fe,ZodReadonly:Ie,custom:rn,Schema:v,ZodSchema:v,late:ji,get ZodFirstPartyTypeKind(){return h},coerce:{string:e=>D.create({...e,coerce:!0}),number:e=>Z.create({...e,coerce:!0}),boolean:e=>re.create({...e,coerce:!0}),bigint:e=>$.create({...e,coerce:!0}),date:e=>H.create({...e,coerce:!0})},any:oa,array:la,bigint:ra,boolean:sn,date:na,discriminatedUnion:ga,effect:on,enum:wa,function:Ca,instanceof:ea,intersection:ha,lazy:Oa,literal:_a,map:va,nan:ta,nativeEnum:Na,never:da,null:sa,nullable:Aa,number:an,object:fa,oboolean:()=>sn().optional(),onumber:()=>an().optional(),optional:Ia,ostring:()=>nn().optional(),pipeline:Ja,preprocess:Da,promise:Pa,record:Sa,set:Ta,strictObject:pa,string:nn,symbol:ia,transformer:on,tuple:ya,undefined:aa,union:ma,unknown:ca,void:ua,NEVER:y,ZodIssueCode:u,quotelessJson:qi,ZodError:A});function ba(e){return e===401||e===403}function Ra(e){return Object.entries(e).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&")}const ka=pe.object({access_token:pe.string().min(1),token_type:pe.string(),expires_in:pe.number(),scope:pe.string()});async function Ua(e){let r=await(await fetch(e.tokenUrl,{method:"POST",body:Ra({grant_type:"client_credentials",client_id:e.clientId,client_secret:e.clientSecret}),headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json();return Fa(r)}function Fa(e){const t=ka.safeParse(e);if(!t.success)throw new Error("Bad access token response");return t.data}class Ea{constructor(t){E(this,"activeRequest",null);E(this,"refreshTimeout");E(this,"accessToken",null);this.clientCredentials=t}async getAccessToken(){return this.accessToken?this.accessToken:await this.refreshAccessToken()}async refreshAccessToken(){if(this.activeRequest)return await this.activeRequest,this.accessToken;this.accessToken=null,this.activeRequest=Ua(this.clientCredentials);const t=await this.activeRequest;return this.scheduleNextRefresh(t),this.accessToken=t.access_token,this.activeRequest=null,this.accessToken}scheduleNextRefresh(t){clearTimeout(this.refreshTimeout);const r=(t.expires_in-2)*1e3;this.refreshTimeout=setTimeout(()=>{this.accessToken=null},r)}}function cn(e,t){e.headers=La("Authorization",`Bearer ${t}`,e.headers)}function La(e,t,r){return r?Array.isArray(r)?r.map(([n,i])=>n!==e?[n,i]:[e,t]):qa(r)?(r.has(e)?r.set(e,t):r.append(e,t),r):(r[e]=t,r):(r={},r[e]=t,r)}function qa(e){return"append"in e&&"delete"in e&&"get"in e&&"has"in e&&"set"in e&&"forEach"in e}function Ma(e){const t=new Ea(e);return{pre:async r=>{const n=await t.getAccessToken();return cn(r.init,n),Promise.resolve({url:r.url,init:r.init})},post:async r=>{if(ba(r.response.status)){const n=await t.refreshAccessToken();return cn(r.init,n),await fetch(r.url,r.init)}return Promise.resolve(r.response)}}}function xa(e){let t=[],r={};e.clientCredentials&&t.push(Ma(e.clientCredentials)),e.managementApiKey&&(r=Za(e.managementApiKey));const n=new L({basePath:e.managementApiUrl,headers:r,credentials:"same-origin",middleware:t,...e.configOverrides});return{uiApi:new Kr(n),useCaseApi:new Wr(n),enterpriseEditionApi:new Qr(n)}}function Za(e){return{"X-Api-Key":e}}s.AssetPageFromJSON=tt,s.AssetPageFromJSONTyped=rt,s.AssetPageToJSON=yn,s.BASE_PATH=P,s.BaseAPI=Q,s.BlobApiResponse=mn,s.COLLECTION_FORMATS=ln,s.CatalogFilterExpressionFromJSON=ut,s.CatalogFilterExpressionFromJSONTyped=lt,s.CatalogFilterExpressionLiteralFromJSON=at,s.CatalogFilterExpressionLiteralFromJSONTyped=st,s.CatalogFilterExpressionLiteralToJSON=ot,s.CatalogFilterExpressionLiteralType=Sn,s.CatalogFilterExpressionLiteralTypeFromJSON=nt,s.CatalogFilterExpressionLiteralTypeFromJSONTyped=it,s.CatalogFilterExpressionLiteralTypeToJSON=vn,s.CatalogFilterExpressionOperator=Cn,s.CatalogFilterExpressionOperatorFromJSON=ct,s.CatalogFilterExpressionOperatorFromJSONTyped=dt,s.CatalogFilterExpressionOperatorToJSON=On,s.CatalogFilterExpressionToJSON=ft,s.CatalogQueryFromJSON=Nn,s.CatalogQueryFromJSONTyped=pt,s.CatalogQueryToJSON=mt,s.Configuration=L,s.ConnectorLimitsFromJSON=gt,s.ConnectorLimitsFromJSONTyped=ht,s.ConnectorLimitsToJSON=In,s.ContractAgreementCardFromJSON=kt,s.ContractAgreementCardFromJSONTyped=Ut,s.ContractAgreementCardToJSON=Ft,s.ContractAgreementDirection=An,s.ContractAgreementDirectionFromJSON=Je,s.ContractAgreementDirectionFromJSONTyped=yt,s.ContractAgreementDirectionToJSON=Dn,s.ContractAgreementPageFromJSON=Et,s.ContractAgreementPageFromJSONTyped=Lt,s.ContractAgreementPageToJSON=Vn,s.ContractAgreementTransferProcessFromJSON=Ct,s.ContractAgreementTransferProcessFromJSONTyped=Ot,s.ContractAgreementTransferProcessToJSON=_t,s.ContractDefinitionEntryFromJSON=Bt,s.ContractDefinitionEntryFromJSONTyped=Gt,s.ContractDefinitionEntryToJSON=Qt,s.ContractDefinitionPageFromJSON=Kt,s.ContractDefinitionPageFromJSONTyped=Wt,s.ContractDefinitionPageToJSON=Xn,s.ContractDefinitionRequestFromJSON=ei,s.ContractDefinitionRequestFromJSONTyped=Yt,s.ContractDefinitionRequestToJSON=Xt,s.ContractNegotiationRequestFromJSON=ri,s.ContractNegotiationRequestFromJSONTyped=jt,s.ContractNegotiationRequestToJSON=er,s.ContractNegotiationSimplifiedState=ni,s.ContractNegotiationSimplifiedStateFromJSON=tr,s.ContractNegotiationSimplifiedStateFromJSONTyped=rr,s.ContractNegotiationSimplifiedStateToJSON=ii,s.ContractNegotiationStateFromJSON=nr,s.ContractNegotiationStateFromJSONTyped=ir,s.ContractNegotiationStateToJSON=ar,s.DashboardDapsConfigFromJSON=sr,s.DashboardDapsConfigFromJSONTyped=or,s.DashboardDapsConfigToJSON=cr,s.DashboardMiwConfigFromJSON=dr,s.DashboardMiwConfigFromJSONTyped=ur,s.DashboardMiwConfigToJSON=lr,s.DashboardPageFromJSON=pr,s.DashboardPageFromJSONTyped=mr,s.DashboardPageToJSON=ui,s.DashboardTransferAmountsFromJSON=Le,s.DashboardTransferAmountsFromJSONTyped=fr,s.DashboardTransferAmountsToJSON=qe,s.DefaultConfig=Qe,s.EnterpriseEditionApi=Qr,s.FetchError=We,s.IdResponseDtoFromJSON=k,s.IdResponseDtoFromJSONTyped=gr,s.IdResponseDtoToJSON=fi,s.InitiateCustomTransferRequestFromJSON=mi,s.InitiateCustomTransferRequestFromJSONTyped=hr,s.InitiateCustomTransferRequestToJSON=yr,s.InitiateTransferRequestFromJSON=hi,s.InitiateTransferRequestFromJSONTyped=Sr,s.InitiateTransferRequestToJSON=vr,s.JSONApiResponse=O,s.KpiResultFromJSON=_r,s.KpiResultFromJSONTyped=wr,s.KpiResultToJSON=vi,s.OperatorDto=Un,s.OperatorDtoFromJSON=wt,s.OperatorDtoFromJSONTyped=Nt,s.OperatorDtoToJSON=Fn,s.PolicyDefinitionCreateRequestFromJSON=Oi,s.PolicyDefinitionCreateRequestFromJSONTyped=Ar,s.PolicyDefinitionCreateRequestToJSON=Dr,s.PolicyDefinitionDtoFromJSON=Jr,s.PolicyDefinitionDtoFromJSONTyped=br,s.PolicyDefinitionDtoToJSON=Rr,s.PolicyDefinitionPageFromJSON=kr,s.PolicyDefinitionPageFromJSONTyped=Ur,s.PolicyDefinitionPageToJSON=Ni,s.RequiredError=R,s.ResponseError=Ke,s.TextApiResponse=je,s.TransferHistoryEntryFromJSON=Fr,s.TransferHistoryEntryFromJSONTyped=Er,s.TransferHistoryEntryToJSON=Lr,s.TransferHistoryPageFromJSON=qr,s.TransferHistoryPageFromJSONTyped=Mr,s.TransferHistoryPageToJSON=Ai,s.TransferProcessSimplifiedState=Jn,s.TransferProcessSimplifiedStateFromJSON=St,s.TransferProcessSimplifiedStateFromJSONTyped=vt,s.TransferProcessSimplifiedStateToJSON=bn,s.TransferProcessStateFromJSON=be,s.TransferProcessStateFromJSONTyped=Tt,s.TransferProcessStateToJSON=Re,s.TransferProcessStatesDtoFromJSON=Tr,s.TransferProcessStatesDtoFromJSONTyped=Cr,s.TransferProcessStatesDtoToJSON=Or,s.UIApi=Kr,s.UiAssetCreateRequestFromJSON=Ji,s.UiAssetCreateRequestFromJSONTyped=xr,s.UiAssetCreateRequestToJSON=Me,s.UiAssetEditMetadataRequestFromJSON=Ri,s.UiAssetEditMetadataRequestFromJSONTyped=Zr,s.UiAssetEditMetadataRequestToJSON=$r,s.UiAssetFromJSON=j,s.UiAssetFromJSONTyped=et,s.UiAssetToJSON=me,s.UiContractNegotiationFromJSON=xe,s.UiContractNegotiationFromJSONTyped=Vr,s.UiContractNegotiationToJSON=Ui,s.UiContractOfferFromJSON=Hr,s.UiContractOfferFromJSONTyped=zr,s.UiContractOfferToJSON=Br,s.UiCriterionFromJSON=Fe,s.UiCriterionFromJSONTyped=zt,s.UiCriterionLiteralFromJSON=xt,s.UiCriterionLiteralFromJSONTyped=Zt,s.UiCriterionLiteralToJSON=$t,s.UiCriterionLiteralType=Hn,s.UiCriterionLiteralTypeFromJSON=qt,s.UiCriterionLiteralTypeFromJSONTyped=Mt,s.UiCriterionLiteralTypeToJSON=zn,s.UiCriterionOperator=Gn,s.UiCriterionOperatorFromJSON=Vt,s.UiCriterionOperatorFromJSONTyped=Ht,s.UiCriterionOperatorToJSON=Qn,s.UiCriterionToJSON=Ee,s.UiDataOfferFromJSON=Ze,s.UiDataOfferFromJSONTyped=Gr,s.UiDataOfferToJSON=Li,s.UiPolicyConstraintFromJSON=ke,s.UiPolicyConstraintFromJSONTyped=bt,s.UiPolicyConstraintToJSON=Ue,s.UiPolicyCreateRequestFromJSON=Nr,s.UiPolicyCreateRequestFromJSONTyped=Pr,s.UiPolicyCreateRequestToJSON=Ir,s.UiPolicyFromJSON=ge,s.UiPolicyFromJSONTyped=Rt,s.UiPolicyLiteralFromJSON=At,s.UiPolicyLiteralFromJSONTyped=Dt,s.UiPolicyLiteralToJSON=Jt,s.UiPolicyLiteralType=En,s.UiPolicyLiteralTypeFromJSON=Pt,s.UiPolicyLiteralTypeFromJSONTyped=It,s.UiPolicyLiteralTypeToJSON=Ln,s.UiPolicyToJSON=he,s.UseCaseApi=Wr,s.VoidApiResponse=Xe,s.buildEdcClient=xa,s.canConsumeForm=pn,s.exists=d,s.instanceOfAssetPage=hn,s.instanceOfCatalogFilterExpression=_n,s.instanceOfCatalogFilterExpressionLiteral=Tn,s.instanceOfCatalogQuery=wn,s.instanceOfConnectorLimits=Pn,s.instanceOfContractAgreementCard=Zn,s.instanceOfContractAgreementPage=$n,s.instanceOfContractAgreementTransferProcess=kn,s.instanceOfContractDefinitionEntry=Wn,s.instanceOfContractDefinitionPage=Yn,s.instanceOfContractDefinitionRequest=jn,s.instanceOfContractNegotiationRequest=ti,s.instanceOfContractNegotiationState=ai,s.instanceOfDashboardDapsConfig=si,s.instanceOfDashboardMiwConfig=oi,s.instanceOfDashboardPage=di,s.instanceOfDashboardTransferAmounts=ci,s.instanceOfIdResponseDto=li,s.instanceOfInitiateCustomTransferRequest=pi,s.instanceOfInitiateTransferRequest=gi,s.instanceOfKpiResult=Si,s.instanceOfPolicyDefinitionCreateRequest=Ci,s.instanceOfPolicyDefinitionDto=_i,s.instanceOfPolicyDefinitionPage=wi,s.instanceOfTransferHistoryEntry=Pi,s.instanceOfTransferHistoryPage=Ii,s.instanceOfTransferProcessState=Rn,s.instanceOfTransferProcessStatesDto=yi,s.instanceOfUiAsset=gn,s.instanceOfUiAssetCreateRequest=Di,s.instanceOfUiAssetEditMetadataRequest=bi,s.instanceOfUiContractNegotiation=ki,s.instanceOfUiContractOffer=Fi,s.instanceOfUiCriterion=Kn,s.instanceOfUiCriterionLiteral=Bn,s.instanceOfUiDataOffer=Ei,s.instanceOfUiPolicy=xn,s.instanceOfUiPolicyConstraint=Mn,s.instanceOfUiPolicyCreateRequest=Ti,s.instanceOfUiPolicyLiteral=qn,s.mapValues=fn,s.querystring=De,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
1
+ (function(s,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(s=typeof globalThis<"u"?globalThis:s||self,P(s["sovity-edc-client"]={}))})(this,function(s){"use strict";var cs=Object.defineProperty;var ds=(s,P,L)=>P in s?cs(s,P,{enumerable:!0,configurable:!0,writable:!0,value:L}):s[P]=L;var E=(s,P,L)=>(ds(s,typeof P!="symbol"?P+"":P,L),L);const P="https://my-connector/api/management".replace(/\/+$/,"");class L{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:P}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||Je}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const Ye=new L,De=class De{constructor(t=Ye){E(this,"middleware");E(this,"fetchApi",async(t,r)=>{let n={url:t,init:r};for(const a of this.middleware)a.pre&&(n=await a.pre({fetch:this.fetchApi,...n})||n);let i;try{i=await(this.configuration.fetchApi||fetch)(n.url,n.init)}catch(a){for(const o of this.middleware)o.onError&&(i=await o.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:a,response:i?i.clone():void 0})||i);if(i===void 0)throw a instanceof Error?new je(a,"The request failed and the interceptors did not return an alternative response"):a}for(const a of this.middleware)a.post&&(i=await a.post({fetch:this.fetchApi,url:n.url,init:n.init,response:i.clone()})||i);return i});this.configuration=t,this.middleware=t.middleware}withMiddleware(...t){const r=this.clone();return r.middleware=r.middleware.concat(...t),r}withPreMiddleware(...t){const r=t.map(n=>({pre:n}));return this.withMiddleware(...r)}withPostMiddleware(...t){const r=t.map(n=>({post:n}));return this.withMiddleware(...r)}isJsonMime(t){return t?De.jsonRegex.test(t):!1}async request(t,r){const{url:n,init:i}=await this.createFetchParams(t,r),a=await this.fetchApi(n,i);if(a&&a.status>=200&&a.status<300)return a;throw new Xe(a,"Response returned an error code")}async createFetchParams(t,r){let n=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(n+="?"+this.configuration.queryParamsStringify(t.query));const i=Object.assign({},this.configuration.headers,t.headers);Object.keys(i).forEach(l=>i[l]===void 0?delete i[l]:{});const a=typeof r=="function"?r:async()=>r,o={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},c={...o,...await a({init:o,context:t})},m={...c,body:Nn(c.body)||c.body instanceof URLSearchParams||On(c.body)?c.body:JSON.stringify(c.body)};return{url:n,init:m}}clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}};E(De,"jsonRegex",new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"));let Q=De;function On(e){return typeof Blob<"u"&&e instanceof Blob}function Nn(e){return typeof FormData<"u"&&e instanceof FormData}class Xe extends Error{constructor(r,n){super(n);E(this,"name","ResponseError");this.response=r}}class je extends Error{constructor(r,n){super(n);E(this,"name","FetchError");this.cause=r}}class F extends Error{constructor(r,n){super(n);E(this,"name","RequiredError");this.field=r}}const _n={csv:",",ssv:" ",tsv:" ",pipes:"|"};function d(e,t){const r=e[t];return r!=null}function Je(e,t=""){return Object.keys(e).map(r=>et(r,e[r],t)).filter(r=>r.length>0).join("&")}function et(e,t,r=""){const n=r+(r.length?`[${e}]`:e);if(t instanceof Array){const i=t.map(a=>encodeURIComponent(String(a))).join(`&${encodeURIComponent(n)}=`);return`${encodeURIComponent(n)}=${i}`}if(t instanceof Set){const i=Array.from(t);return et(e,i,r)}return t instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?Je(t,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`}function wn(e,t){return Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n])}),{})}function Pn(e){for(const t of e)if(t.contentType==="multipart/form-data")return!0;return!1}class O{constructor(t,r=n=>n){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class tt{constructor(t){this.raw=t}async value(){}}class In{constructor(t){this.raw=t}async value(){return await this.raw.blob()}}class rt{constructor(t){this.raw=t}async value(){return await this.raw.text()}}function Dn(e){let t=!0;return t=t&&"assetId"in e,t=t&&"connectorEndpoint"in e,t=t&&"participantId"in e,t=t&&"title"in e,t=t&&"creatorOrganizationName"in e,t=t&&"isOwnConnector"in e,t}function j(e){return nt(e)}function nt(e,t){return e==null?e:{assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,descriptionShortText:d(e,"descriptionShortText")?e.descriptionShortText:void 0,isOwnConnector:e.isOwnConnector,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,httpDatasourceHintsProxyMethod:d(e,"httpDatasourceHintsProxyMethod")?e.httpDatasourceHintsProxyMethod:void 0,httpDatasourceHintsProxyPath:d(e,"httpDatasourceHintsProxyPath")?e.httpDatasourceHintsProxyPath:void 0,httpDatasourceHintsProxyQueryParams:d(e,"httpDatasourceHintsProxyQueryParams")?e.httpDatasourceHintsProxyQueryParams:void 0,httpDatasourceHintsProxyBody:d(e,"httpDatasourceHintsProxyBody")?e.httpDatasourceHintsProxyBody:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,assetJsonLd:d(e,"assetJsonLd")?e.assetJsonLd:void 0,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function me(e){if(e!==void 0)return e===null?null:{assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,language:e.language,description:e.description,descriptionShortText:e.descriptionShortText,isOwnConnector:e.isOwnConnector,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,httpDatasourceHintsProxyMethod:e.httpDatasourceHintsProxyMethod,httpDatasourceHintsProxyPath:e.httpDatasourceHintsProxyPath,httpDatasourceHintsProxyQueryParams:e.httpDatasourceHintsProxyQueryParams,httpDatasourceHintsProxyBody:e.httpDatasourceHintsProxyBody,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),assetJsonLd:e.assetJsonLd,customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function Jn(e){let t=!0;return t=t&&"assets"in e,t}function it(e){return at(e)}function at(e,t){return e==null?e:{assets:e.assets.map(j)}}function An(e){if(e!==void 0)return e===null?null:{assets:e.assets.map(me)}}const bn={Eq:"EQ",Neq:"NEQ",Gt:"GT",Geq:"GEQ",Lt:"LT",Leq:"LEQ",In:"IN",HasPart:"HAS_PART",IsA:"IS_A",IsAllOf:"IS_ALL_OF",IsAnyOf:"IS_ANY_OF",IsNoneOf:"IS_NONE_OF"};function Ae(e){return st(e)}function st(e,t){return e}function Rn(e){return e}function Fn(e){let t=!0;return t=t&&"leftExpression"in e,t=t&&"operator"in e,t=t&&"rightExpression"in e,t}function ot(e){return ct(e)}function ct(e,t){return e==null?e:{leftExpression:e.leftExpression,operator:Ae(e.operator),rightExpression:e.rightExpression}}function dt(e){if(e!==void 0)return e===null?null:{leftExpression:e.leftExpression,operator:e.operator,rightExpression:e.rightExpression}}const kn={Value:"VALUE",ValueList:"VALUE_LIST"};function ut(e){return lt(e)}function lt(e,t){return e}function Un(e){return e}function En(e){return!0}function ft(e){return pt(e)}function pt(e,t){return e==null?e:{type:d(e,"type")?ut(e.type):void 0,value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function mt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const Ln={Like:"LIKE",Eq:"EQ",In:"IN"};function gt(e){return ht(e)}function ht(e,t){return e}function qn(e){return e}function xn(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function yt(e){return St(e)}function St(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:gt(e.operator),operandRight:ft(e.operandRight)}}function Tt(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:mt(e.operandRight)}}function Mn(e){let t=!0;return t=t&&"connectorEndpoint"in e,t}function Zn(e){return vt(e)}function vt(e,t){return e==null?e:{connectorEndpoint:e.connectorEndpoint,limit:d(e,"limit")?e.limit:void 0,offset:d(e,"offset")?e.offset:void 0,filterExpressions:d(e,"filterExpressions")?e.filterExpressions.map(yt):void 0}}function Ct(e){if(e!==void 0)return e===null?null:{connectorEndpoint:e.connectorEndpoint,limit:e.limit,offset:e.offset,filterExpressions:e.filterExpressions===void 0?void 0:e.filterExpressions.map(Tt)}}function $n(e){let t=!0;return t=t&&"numActiveConsumingContractAgreements"in e,t}function Ot(e){return Nt(e)}function Nt(e,t){return e==null?e:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:d(e,"maxActiveConsumingContractAgreements")?e.maxActiveConsumingContractAgreements:void 0}}function Vn(e){if(e!==void 0)return e===null?null:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:e.maxActiveConsumingContractAgreements}}const Hn={Consuming:"CONSUMING",Providing:"PROVIDING"};function be(e){return _t(e)}function _t(e,t){return e}function zn(e){return e}const Bn={Running:"RUNNING",Ok:"OK",Error:"ERROR"};function wt(e){return Pt(e)}function Pt(e,t){return e}function Gn(e){return e}function Qn(e){let t=!0;return t=t&&"name"in e,t=t&&"code"in e,t=t&&"simplifiedState"in e,t}function Re(e){return It(e)}function It(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:wt(e.simplifiedState)}}function Fe(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function Kn(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t}function Dt(e){return Jt(e)}function Jt(e,t){return e==null?e:{transferProcessId:e.transferProcessId,lastUpdatedDate:new Date(e.lastUpdatedDate),state:Re(e.state),errorMessage:d(e,"errorMessage")?e.errorMessage:void 0}}function At(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Fe(e.state),errorMessage:e.errorMessage}}const Wn={String:"STRING",StringList:"STRING_LIST",Json:"JSON"};function bt(e){return Rt(e)}function Rt(e,t){return e}function Yn(e){return e}function Xn(e){let t=!0;return t=t&&"type"in e,t}function Ft(e){return kt(e)}function kt(e,t){return e==null?e:{type:bt(e.type),value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function Ut(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}function jn(e){let t=!0;return t=t&&"left"in e,t=t&&"operator"in e,t=t&&"right"in e,t}function ke(e){return Et(e)}function Et(e,t){return e==null?e:{left:e.left,operator:Ae(e.operator),right:Ft(e.right)}}function Ue(e){if(e!==void 0)return e===null?null:{left:e.left,operator:e.operator,right:Ut(e.right)}}function ei(e){let t=!0;return t=t&&"policyJsonLd"in e,t=t&&"errors"in e,t}function ge(e){return Lt(e)}function Lt(e,t){return e==null?e:{policyJsonLd:e.policyJsonLd,constraints:d(e,"constraints")?e.constraints.map(ke):void 0,errors:e.errors}}function he(e){if(e!==void 0)return e===null?null:{policyJsonLd:e.policyJsonLd,constraints:e.constraints===void 0?void 0:e.constraints.map(Ue),errors:e.errors}}function ti(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"contractNegotiationId"in e,t=t&&"direction"in e,t=t&&"counterPartyAddress"in e,t=t&&"counterPartyId"in e,t=t&&"contractSigningDate"in e,t=t&&"asset"in e,t=t&&"contractPolicy"in e,t=t&&"transferProcesses"in e,t}function qt(e){return xt(e)}function xt(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,contractNegotiationId:e.contractNegotiationId,direction:be(e.direction),counterPartyAddress:e.counterPartyAddress,counterPartyId:e.counterPartyId,contractSigningDate:new Date(e.contractSigningDate),asset:j(e.asset),contractPolicy:ge(e.contractPolicy),transferProcesses:e.transferProcesses.map(Dt)}}function Mt(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,contractNegotiationId:e.contractNegotiationId,direction:e.direction,counterPartyAddress:e.counterPartyAddress,counterPartyId:e.counterPartyId,contractSigningDate:e.contractSigningDate.toISOString(),asset:me(e.asset),contractPolicy:he(e.contractPolicy),transferProcesses:e.transferProcesses.map(At)}}function ri(e){let t=!0;return t=t&&"contractAgreements"in e,t}function Zt(e){return $t(e)}function $t(e,t){return e==null?e:{contractAgreements:e.contractAgreements.map(qt)}}function ni(e){if(e!==void 0)return e===null?null:{contractAgreements:e.contractAgreements.map(Mt)}}const ii={Value:"VALUE",ValueList:"VALUE_LIST"};function Vt(e){return Ht(e)}function Ht(e,t){return e}function ai(e){return e}function si(e){return!0}function zt(e){return Bt(e)}function Bt(e,t){return e==null?e:{type:d(e,"type")?Vt(e.type):void 0,value:d(e,"value")?e.value:void 0,valueList:d(e,"valueList")?e.valueList:void 0}}function Gt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const oi={Eq:"EQ",In:"IN",Like:"LIKE"};function Qt(e){return Kt(e)}function Kt(e,t){return e}function ci(e){return e}function di(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function Ee(e){return Wt(e)}function Wt(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:Qt(e.operator),operandRight:zt(e.operandRight)}}function Le(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:Gt(e.operandRight)}}function ui(e){let t=!0;return t=t&&"contractDefinitionId"in e,t=t&&"accessPolicyId"in e,t=t&&"contractPolicyId"in e,t=t&&"assetSelector"in e,t}function Yt(e){return Xt(e)}function Xt(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Ee)}}function jt(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Le)}}function li(e){let t=!0;return t=t&&"contractDefinitions"in e,t}function er(e){return tr(e)}function tr(e,t){return e==null?e:{contractDefinitions:e.contractDefinitions.map(Yt)}}function fi(e){if(e!==void 0)return e===null?null:{contractDefinitions:e.contractDefinitions.map(jt)}}function pi(e){let t=!0;return t=t&&"contractDefinitionId"in e,t=t&&"contractPolicyId"in e,t=t&&"accessPolicyId"in e,t=t&&"assetSelector"in e,t}function mi(e){return rr(e)}function rr(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Ee)}}function nr(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Le)}}function gi(e){let t=!0;return t=t&&"counterPartyAddress"in e,t=t&&"counterPartyParticipantId"in e,t=t&&"contractOfferId"in e,t=t&&"policyJsonLd"in e,t=t&&"assetId"in e,t}function hi(e){return ir(e)}function ir(e,t){return e==null?e:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}function ar(e){if(e!==void 0)return e===null?null:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}const yi={InProgress:"IN_PROGRESS",Agreed:"AGREED",Terminated:"TERMINATED"};function sr(e){return or(e)}function or(e,t){return e}function Si(e){return e}function Ti(e){let t=!0;return t=t&&"name"in e,t=t&&"code"in e,t=t&&"simplifiedState"in e,t}function cr(e){return dr(e)}function dr(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:sr(e.simplifiedState)}}function ur(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function vi(e){let t=!0;return t=t&&"tokenUrl"in e,t=t&&"jwksUrl"in e,t}function lr(e){return fr(e)}function fr(e,t){return e==null?e:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function pr(e){if(e!==void 0)return e===null?null:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function Ci(e){let t=!0;return t=t&&"url"in e,t=t&&"tokenUrl"in e,t=t&&"authorityId"in e,t}function mr(e){return gr(e)}function gr(e,t){return e==null?e:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function hr(e){if(e!==void 0)return e===null?null:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function Oi(e){let t=!0;return t=t&&"numTotal"in e,t=t&&"numRunning"in e,t=t&&"numOk"in e,t=t&&"numError"in e,t}function qe(e){return yr(e)}function yr(e,t){return e==null?e:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function xe(e){if(e!==void 0)return e===null?null:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function Ni(e){let t=!0;return t=t&&"numAssets"in e,t=t&&"numPolicies"in e,t=t&&"numContractDefinitions"in e,t=t&&"numContractAgreementsConsuming"in e,t=t&&"numContractAgreementsProviding"in e,t=t&&"transferProcessesConsuming"in e,t=t&&"transferProcessesProviding"in e,t=t&&"connectorEndpoint"in e,t=t&&"connectorParticipantId"in e,t=t&&"connectorTitle"in e,t=t&&"connectorDescription"in e,t=t&&"connectorCuratorUrl"in e,t=t&&"connectorCuratorName"in e,t=t&&"connectorMaintainerUrl"in e,t=t&&"connectorMaintainerName"in e,t}function Sr(e){return Tr(e)}function Tr(e,t){return e==null?e:{numAssets:e.numAssets,numPolicies:e.numPolicies,numContractDefinitions:e.numContractDefinitions,numContractAgreementsConsuming:e.numContractAgreementsConsuming,numContractAgreementsProviding:e.numContractAgreementsProviding,transferProcessesConsuming:qe(e.transferProcessesConsuming),transferProcessesProviding:qe(e.transferProcessesProviding),connectorEndpoint:e.connectorEndpoint,connectorParticipantId:e.connectorParticipantId,connectorTitle:e.connectorTitle,connectorDescription:e.connectorDescription,connectorCuratorUrl:e.connectorCuratorUrl,connectorCuratorName:e.connectorCuratorName,connectorMaintainerUrl:e.connectorMaintainerUrl,connectorMaintainerName:e.connectorMaintainerName,connectorDapsConfig:d(e,"connectorDapsConfig")?lr(e.connectorDapsConfig):void 0,connectorMiwConfig:d(e,"connectorMiwConfig")?mr(e.connectorMiwConfig):void 0}}function _i(e){if(e!==void 0)return e===null?null:{numAssets:e.numAssets,numPolicies:e.numPolicies,numContractDefinitions:e.numContractDefinitions,numContractAgreementsConsuming:e.numContractAgreementsConsuming,numContractAgreementsProviding:e.numContractAgreementsProviding,transferProcessesConsuming:xe(e.transferProcessesConsuming),transferProcessesProviding:xe(e.transferProcessesProviding),connectorEndpoint:e.connectorEndpoint,connectorParticipantId:e.connectorParticipantId,connectorTitle:e.connectorTitle,connectorDescription:e.connectorDescription,connectorCuratorUrl:e.connectorCuratorUrl,connectorCuratorName:e.connectorCuratorName,connectorMaintainerUrl:e.connectorMaintainerUrl,connectorMaintainerName:e.connectorMaintainerName,connectorDapsConfig:pr(e.connectorDapsConfig),connectorMiwConfig:hr(e.connectorMiwConfig)}}const wi={AtomicConstraint:"ATOMIC_CONSTRAINT",And:"AND",Or:"OR",Xor:"XOR"};function vr(e){return Cr(e)}function Cr(e,t){return e}function Pi(e){return e}function Ii(e){return!0}function Me(e){return Or(e)}function Or(e,t){return e==null?e:{expressionType:d(e,"expressionType")?vr(e.expressionType):void 0,expressions:d(e,"expressions")?e.expressions.map(Me):void 0,atomicConstraint:d(e,"atomicConstraint")?ot(e.atomicConstraint):void 0}}function Ze(e){if(e!==void 0)return e===null?null:{expressionType:e.expressionType,expressions:e.expressions===void 0?void 0:e.expressions.map(Ze),atomicConstraint:dt(e.atomicConstraint)}}function Di(e){let t=!0;return t=t&&"id"in e,t=t&&"lastUpdatedDate"in e,t}function D(e){return Nr(e)}function Nr(e,t){return e==null?e:{id:e.id,lastUpdatedDate:new Date(e.lastUpdatedDate)}}function Ji(e){if(e!==void 0)return e===null?null:{id:e.id,lastUpdatedDate:e.lastUpdatedDate.toISOString()}}function Ai(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"transferProcessRequestJsonLd"in e,t}function bi(e){return _r(e)}function _r(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function wr(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function Ri(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"dataSinkProperties"in e,t=t&&"transferProcessProperties"in e,t}function Fi(e){return Pr(e)}function Pr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function Ir(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function ki(e){let t=!0;return t=t&&"incomingTransferProcessCounts"in e,t=t&&"outgoingTransferProcessCounts"in e,t}function Dr(e){return Jr(e)}function Jr(e,t){return e==null?e:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Ar(e){if(e!==void 0)return e===null?null:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Ui(e){let t=!0;return t=t&&"assetsCount"in e,t=t&&"policiesCount"in e,t=t&&"contractDefinitionsCount"in e,t=t&&"contractAgreementsCount"in e,t=t&&"transferProcessDto"in e,t}function br(e){return Rr(e)}function Rr(e,t){return e==null?e:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Dr(e.transferProcessDto)}}function Ei(e){if(e!==void 0)return e===null?null:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Ar(e.transferProcessDto)}}function Li(e){let t=!0;return t=t&&"expression"in e,t}function Fr(e){return kr(e)}function kr(e,t){return e==null?e:{expression:Me(e.expression)}}function Ur(e){if(e!==void 0)return e===null?null:{expression:Ze(e.expression)}}function qi(e){let t=!0;return t=t&&"policyDefinitionId"in e,t}function xi(e){return Er(e)}function Er(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,permission:d(e,"permission")?Fr(e.permission):void 0}}function Lr(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,permission:Ur(e.permission)}}function Mi(e){return!0}function qr(e){return xr(e)}function xr(e,t){return e==null?e:{constraints:d(e,"constraints")?e.constraints.map(ke):void 0}}function Mr(e){if(e!==void 0)return e===null?null:{constraints:e.constraints===void 0?void 0:e.constraints.map(Ue)}}function Zi(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function $i(e){return Zr(e)}function Zr(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:qr(e.policy)}}function $r(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:Mr(e.policy)}}function Vi(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function Vr(e){return Hr(e)}function Hr(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:ge(e.policy)}}function zr(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:he(e.policy)}}function Hi(e){let t=!0;return t=t&&"policies"in e,t}function Br(e){return Gr(e)}function Gr(e,t){return e==null?e:{policies:e.policies.map(Vr)}}function zi(e){if(e!==void 0)return e===null?null:{policies:e.policies.map(zr)}}function Bi(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"createdDate"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t=t&&"contractAgreementId"in e,t=t&&"direction"in e,t=t&&"counterPartyConnectorEndpoint"in e,t=t&&"counterPartyParticipantId"in e,t=t&&"assetName"in e,t=t&&"assetId"in e,t}function Qr(e){return Kr(e)}function Kr(e,t){return e==null?e:{transferProcessId:e.transferProcessId,createdDate:new Date(e.createdDate),lastUpdatedDate:new Date(e.lastUpdatedDate),state:Re(e.state),contractAgreementId:e.contractAgreementId,direction:be(e.direction),counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:d(e,"errorMessage")?e.errorMessage:void 0}}function Wr(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,createdDate:e.createdDate.toISOString(),lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Fe(e.state),contractAgreementId:e.contractAgreementId,direction:e.direction,counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:e.errorMessage}}function Gi(e){let t=!0;return t=t&&"transferEntries"in e,t}function Yr(e){return Xr(e)}function Xr(e,t){return e==null?e:{transferEntries:e.transferEntries.map(Qr)}}function Qi(e){if(e!==void 0)return e===null?null:{transferEntries:e.transferEntries.map(Wr)}}function Ki(e){let t=!0;return t=t&&"id"in e,t=t&&"dataAddressProperties"in e,t}function Wi(e){return jr(e)}function jr(e,t){return e==null?e:{id:e.id,title:d(e,"title")?e.title:void 0,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,dataAddressProperties:e.dataAddressProperties,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function $e(e){if(e!==void 0)return e===null?null:{id:e.id,title:e.title,language:e.language,description:e.description,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),dataAddressProperties:e.dataAddressProperties,customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function Yi(e){return!0}function Xi(e){return en(e)}function en(e,t){return e==null?e:{title:d(e,"title")?e.title:void 0,language:d(e,"language")?e.language:void 0,description:d(e,"description")?e.description:void 0,publisherHomepage:d(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:d(e,"licenseUrl")?e.licenseUrl:void 0,version:d(e,"version")?e.version:void 0,keywords:d(e,"keywords")?e.keywords:void 0,mediaType:d(e,"mediaType")?e.mediaType:void 0,landingPageUrl:d(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:d(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:d(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:d(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:d(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:d(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:d(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:d(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:d(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:d(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:d(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:d(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:d(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:d(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:d(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:d(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:d(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:d(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:d(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:d(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function tn(e){if(e!==void 0)return e===null?null:{title:e.title,language:e.language,description:e.description,publisherHomepage:e.publisherHomepage,licenseUrl:e.licenseUrl,version:e.version,keywords:e.keywords,mediaType:e.mediaType,landingPageUrl:e.landingPageUrl,dataCategory:e.dataCategory,dataSubcategory:e.dataSubcategory,dataModel:e.dataModel,geoReferenceMethod:e.geoReferenceMethod,transportMode:e.transportMode,sovereignLegalName:e.sovereignLegalName,geoLocation:e.geoLocation,nutsLocations:e.nutsLocations,dataSampleUrls:e.dataSampleUrls,referenceFileUrls:e.referenceFileUrls,referenceFilesDescription:e.referenceFilesDescription,conditionsForUse:e.conditionsForUse,dataUpdateFrequency:e.dataUpdateFrequency,temporalCoverageFrom:e.temporalCoverageFrom===void 0?void 0:e.temporalCoverageFrom.toISOString().substr(0,10),temporalCoverageToInclusive:e.temporalCoverageToInclusive===void 0?void 0:e.temporalCoverageToInclusive.toISOString().substr(0,10),customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function ji(e){let t=!0;return t=t&&"contractNegotiationId"in e,t=t&&"createdAt"in e,t=t&&"state"in e,t}function Ve(e){return rn(e)}function rn(e,t){return e==null?e:{contractNegotiationId:e.contractNegotiationId,createdAt:new Date(e.createdAt),contractAgreementId:d(e,"contractAgreementId")?e.contractAgreementId:void 0,state:cr(e.state)}}function ea(e){if(e!==void 0)return e===null?null:{contractNegotiationId:e.contractNegotiationId,createdAt:e.createdAt.toISOString(),contractAgreementId:e.contractAgreementId,state:ur(e.state)}}function ta(e){let t=!0;return t=t&&"contractOfferId"in e,t=t&&"policy"in e,t}function nn(e){return an(e)}function an(e,t){return e==null?e:{contractOfferId:e.contractOfferId,policy:ge(e.policy)}}function sn(e){if(e!==void 0)return e===null?null:{contractOfferId:e.contractOfferId,policy:he(e.policy)}}function ra(e){let t=!0;return t=t&&"endpoint"in e,t=t&&"participantId"in e,t=t&&"asset"in e,t=t&&"contractOffers"in e,t}function He(e){return on(e)}function on(e,t){return e==null?e:{endpoint:e.endpoint,participantId:e.participantId,asset:j(e.asset),contractOffers:e.contractOffers.map(nn)}}function na(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,participantId:e.participantId,asset:me(e.asset),contractOffers:e.contractOffers.map(sn)}}class cn extends Q{async connectorLimitsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/connector-limits",method:"GET",headers:n,query:r},t);return new O(i,a=>Ot(a))}async connectorLimits(t){return await(await this.connectorLimitsRaw(t)).value()}async fileUploadCreateAssetRaw(t,r){if(t.blobId===null||t.blobId===void 0)throw new F("blobId","Required parameter requestParameters.blobId was null or undefined when calling fileUploadCreateAsset.");if(t.uiAssetCreateRequest===null||t.uiAssetCreateRequest===void 0)throw new F("uiAssetCreateRequest","Required parameter requestParameters.uiAssetCreateRequest was null or undefined when calling fileUploadCreateAsset.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ee/file-upload/blobs/{blobId}/asset".replace("{blobId}",encodeURIComponent(String(t.blobId))),method:"POST",headers:i,query:n,body:$e(t.uiAssetCreateRequest)},r);return new tt(a)}async fileUploadCreateAsset(t,r){await this.fileUploadCreateAssetRaw(t,r)}async fileUploadRequestSasTokenRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/file-upload/blobs",method:"POST",headers:n,query:r},t);return this.isJsonMime(i.headers.get("content-type"))?new O(i):new rt(i)}async fileUploadRequestSasToken(t){return await(await this.fileUploadRequestSasTokenRaw(t)).value()}}class dn extends Q{async createAssetRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets",method:"POST",headers:i,query:n,body:$e(t.uiAssetCreateRequest)},r);return new O(a,o=>D(o))}async createAsset(t={},r){return await(await this.createAssetRaw(t,r)).value()}async createContractDefinitionRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-definition-page/contract-definitions",method:"POST",headers:i,query:n,body:nr(t.contractDefinitionRequest)},r);return new O(a,o=>D(o))}async createContractDefinition(t={},r){return await(await this.createContractDefinitionRaw(t,r)).value()}async createPolicyDefinitionRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/policy-page/policy-definitions",method:"POST",headers:i,query:n,body:$r(t.policyDefinitionCreateRequest)},r);return new O(a,o=>D(o))}async createPolicyDefinition(t={},r){return await(await this.createPolicyDefinitionRaw(t,r)).value()}async deleteAssetRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new F("assetId","Required parameter requestParameters.assetId was null or undefined when calling deleteAsset.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>D(o))}async deleteAsset(t,r){return await(await this.deleteAssetRaw(t,r)).value()}async deleteContractDefinitionRaw(t,r){if(t.contractDefinitionId===null||t.contractDefinitionId===void 0)throw new F("contractDefinitionId","Required parameter requestParameters.contractDefinitionId was null or undefined when calling deleteContractDefinition.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/contract-definition-page/contract-definitions/{contractDefinitionId}".replace("{contractDefinitionId}",encodeURIComponent(String(t.contractDefinitionId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>D(o))}async deleteContractDefinition(t,r){return await(await this.deleteContractDefinitionRaw(t,r)).value()}async deletePolicyDefinitionRaw(t,r){if(t.policyId===null||t.policyId===void 0)throw new F("policyId","Required parameter requestParameters.policyId was null or undefined when calling deletePolicyDefinition.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/policy-page/policy-definitions/{policyId}".replace("{policyId}",encodeURIComponent(String(t.policyId))),method:"DELETE",headers:i,query:n},r);return new O(a,o=>D(o))}async deletePolicyDefinition(t,r){return await(await this.deletePolicyDefinitionRaw(t,r)).value()}async editAssetMetadataRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new F("assetId","Required parameter requestParameters.assetId was null or undefined when calling editAssetMetadata.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}/metadata".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"PUT",headers:i,query:n,body:tn(t.uiAssetEditMetadataRequest)},r);return new O(a,o=>D(o))}async editAssetMetadata(t,r){return await(await this.editAssetMetadataRaw(t,r)).value()}async getAssetPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/asset-page",method:"GET",headers:n,query:r},t);return new O(i,a=>it(a))}async getAssetPage(t){return await(await this.getAssetPageRaw(t)).value()}async getCatalogPageDataOffersRaw(t,r){const n={};t.connectorEndpoint!==void 0&&(n.connectorEndpoint=t.connectorEndpoint);const i={},a=await this.request({path:"/wrapper/ui/pages/catalog-page/data-offers",method:"GET",headers:i,query:n},r);return new O(a,o=>o.map(He))}async getCatalogPageDataOffers(t={},r){return await(await this.getCatalogPageDataOffersRaw(t,r)).value()}async getContractAgreementPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/contract-agreement-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Zt(a))}async getContractAgreementPage(t){return await(await this.getContractAgreementPageRaw(t)).value()}async getContractDefinitionPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/contract-definition-page",method:"GET",headers:n,query:r},t);return new O(i,a=>er(a))}async getContractDefinitionPage(t){return await(await this.getContractDefinitionPageRaw(t)).value()}async getContractNegotiationRaw(t,r){if(t.contractNegotiationId===null||t.contractNegotiationId===void 0)throw new F("contractNegotiationId","Required parameter requestParameters.contractNegotiationId was null or undefined when calling getContractNegotiation.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/catalog-page/contract-negotiations/{contractNegotiationId}".replace("{contractNegotiationId}",encodeURIComponent(String(t.contractNegotiationId))),method:"GET",headers:i,query:n},r);return new O(a,o=>Ve(o))}async getContractNegotiation(t,r){return await(await this.getContractNegotiationRaw(t,r)).value()}async getDashboardPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/dashboard-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Sr(a))}async getDashboardPage(t){return await(await this.getDashboardPageRaw(t)).value()}async getPolicyDefinitionPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/policy-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Br(a))}async getPolicyDefinitionPage(t){return await(await this.getPolicyDefinitionPageRaw(t)).value()}async getTransferHistoryPageRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ui/pages/transfer-history-page",method:"GET",headers:n,query:r},t);return new O(i,a=>Yr(a))}async getTransferHistoryPage(t){return await(await this.getTransferHistoryPageRaw(t)).value()}async getTransferProcessAssetRaw(t,r){if(t.transferProcessId===null||t.transferProcessId===void 0)throw new F("transferProcessId","Required parameter requestParameters.transferProcessId was null or undefined when calling getTransferProcessAsset.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/transfer-history-page/transfer-processes/{transferProcessId}/asset".replace("{transferProcessId}",encodeURIComponent(String(t.transferProcessId))),method:"GET",headers:i,query:n},r);return new O(a,o=>j(o))}async getTransferProcessAsset(t,r){return await(await this.getTransferProcessAssetRaw(t,r)).value()}async initiateContractNegotiationRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/catalog-page/contract-negotiations",method:"POST",headers:i,query:n,body:ar(t.contractNegotiationRequest)},r);return new O(a,o=>Ve(o))}async initiateContractNegotiation(t={},r){return await(await this.initiateContractNegotiationRaw(t,r)).value()}async initiateCustomTransferRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page/transfers/custom",method:"POST",headers:i,query:n,body:wr(t.initiateCustomTransferRequest)},r);return new O(a,o=>D(o))}async initiateCustomTransfer(t={},r){return await(await this.initiateCustomTransferRaw(t,r)).value()}async initiateTransferRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page/transfers",method:"POST",headers:i,query:n,body:Ir(t.initiateTransferRequest)},r);return new O(a,o=>D(o))}async initiateTransfer(t={},r){return await(await this.initiateTransferRaw(t,r)).value()}}class un extends Q{async createPolicyDefinitionUseCaseRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/use-case-api/policy-definition",method:"POST",headers:i,query:n,body:Lr(t.policyCreateRequest)},r);return new O(a,o=>D(o))}async createPolicyDefinitionUseCase(t={},r){return await(await this.createPolicyDefinitionUseCaseRaw(t,r)).value()}async getKpisRaw(t){const r={},n={},i=await this.request({path:"/wrapper/use-case-api/kpis",method:"GET",headers:n,query:r},t);return new O(i,a=>br(a))}async getKpis(t){return await(await this.getKpisRaw(t)).value()}async getSupportedFunctionsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/use-case-api/supported-policy-functions",method:"GET",headers:n,query:r},t);return new O(i)}async getSupportedFunctions(t){return await(await this.getSupportedFunctionsRaw(t)).value()}async queryCatalogRaw(t,r){if(t.catalogQuery===null||t.catalogQuery===void 0)throw new F("catalogQuery","Required parameter requestParameters.catalogQuery was null or undefined when calling queryCatalog.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/use-case-api/catalog",method:"POST",headers:i,query:n,body:Ct(t.catalogQuery)},r);return new O(a,o=>o.map(He))}async queryCatalog(t,r){return await(await this.queryCatalogRaw(t,r)).value()}}var C;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of a)o[c]=i[c];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var ze;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(ze||(ze={}));const f=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),M=e=>{switch(typeof e){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(e)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(e)?f.array:e===null?f.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?f.promise:typeof Map<"u"&&e instanceof Map?f.map:typeof Set<"u"&&e instanceof Set?f.set:typeof Date<"u"&&e instanceof Date?f.date:f.object;default:return f.unknown}},u=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ia=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class J extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let c=n,m=0;for(;m<o.path.length;){const l=o.path[m];m===o.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(r(o))):c[l]=c[l]||{_errors:[]},c=c[l],m++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}J.create=e=>new J(e);const ee=(e,t)=>{let r;switch(e.code){case u.invalid_type:e.received===f.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,C.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${C.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${C.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${C.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:r="Invalid function arguments";break;case u.invalid_return_type:r="Invalid function return type";break;case u.invalid_date:r="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:C.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case u.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case u.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case u.custom:r="Invalid input";break;case u.invalid_intersection_types:r="Intersection results could not be merged";break;case u.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:r="Number must be finite";break;default:r=t.defaultError,C.assertNever(e)}return{message:r}};let ln=ee;function aa(e){ln=e}function ye(){return ln}const Se=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],o={...i,path:a};let c="";const m=n.filter(l=>!!l).slice().reverse();for(const l of m)c=l(o,{data:t,defaultError:c}).message;return{...i,path:a,message:i.message||c}},sa=[];function p(e,t){const r=Se({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ye(),ee].filter(n=>!!n)});e.common.issues.push(r)}class _{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return y;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return _.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return y;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const y=Object.freeze({status:"aborted"}),fn=e=>({status:"dirty",value:e}),w=e=>({status:"valid",value:e}),Be=e=>e.status==="aborted",Ge=e=>e.status==="dirty",te=e=>e.status==="valid",Te=e=>typeof Promise<"u"&&e instanceof Promise;var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(g||(g={}));class k{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pn=(e,t)=>{if(te(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new J(e.common.issues);return this._error=r,this._error}}};function S(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,c)=>o.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:n??c.defaultError}:{message:r??c.defaultError},description:i}}class T{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return M(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:M(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _,ctx:{common:t.parent.common,data:t.data,parsedType:M(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Te(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:M(t)},a=this._parseSync({data:t,path:i.path,parent:i});return pn(i,a)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:M(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Te(i)?i:Promise.resolve(i));return pn(n,a)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=t(i),c=()=>a.addIssue({code:u.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(m=>m?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new R({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return x.create(this,this._def)}nullable(){return G.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return b.create(this,this._def)}promise(){return X.create(this,this._def)}or(t){return ae.create([this,t],this._def)}and(t){return se.create(this,t,this._def)}transform(t){return new R({...S(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new le({...S(this._def),innerType:this,defaultValue:r,typeName:h.ZodDefault})}brand(){return new gn({typeName:h.ZodBranded,type:this,...S(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new we({...S(this._def),innerType:this,catchValue:r,typeName:h.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return fe.create(this,t)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const oa=/^c[^\s-]{8,}$/i,ca=/^[a-z][a-z0-9]*$/,da=/^[0-9A-HJKMNP-TV-Z]{26}$/,ua=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,la=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fa="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qe;const pa=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ma=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ga=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ha(e,t){return!!((t==="v4"||!t)&&pa.test(e)||(t==="v6"||!t)&&ma.test(e))}class A extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==f.string){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new _;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,c=t.data.length<a.value;(o||c)&&(i=this._getOrReturnCtx(t,i),o?p(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&p(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")la.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"email",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Qe||(Qe=new RegExp(fa,"u")),Qe.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"emoji",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")ua.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"uuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")oa.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"cuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")ca.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"cuid2",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")da.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"ulid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),p(i,{validation:"url",code:u.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"regex",code:u.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ga(a).test(t.data)||(i=this._getOrReturnCtx(t,i),p(i,{code:u.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?ha(t.data,a.version)||(i=this._getOrReturnCtx(t,i),p(i,{validation:"ip",code:u.invalid_string,message:a.message}),n.dirty()):C.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:u.invalid_string,...g.errToObj(n)})}_addCheck(t){return new A({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,...g.errToObj(t==null?void 0:t.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...g.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...g.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...g.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...g.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...g.errToObj(r)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}A.create=e=>{var t;return new A({checks:[],typeName:h.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};function ya(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class Z extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==f.number){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const i=new _;for(const a of this._def.checks)a.kind==="int"?C.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),p(n,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?ya(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_finite,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&C.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Z.create=e=>new Z({checks:[],typeName:h.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class $ extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==f.bigint){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const i=new _;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),p(n,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,g.toString(r))}gt(t,r){return this.setLimit("min",t,!1,g.toString(r))}lte(t,r){return this.setLimit("max",t,!0,g.toString(r))}lt(t,r){return this.setLimit("max",t,!1,g.toString(r))}setLimit(t,r,n,i){return new $({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new $({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}$.create=e=>{var t;return new $({checks:[],typeName:h.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};class re extends T{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==f.boolean){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.boolean,received:n.parsedType}),y}return w(t.data)}}re.create=e=>new re({typeName:h.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class H extends T{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==f.date){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return p(a,{code:u.invalid_date}),y}const n=new _;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),p(i,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):C.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new H({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}H.create=e=>new H({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:h.ZodDate,...S(e)});class ve extends T{_parse(t){if(this._getType(t)!==f.symbol){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.symbol,received:n.parsedType}),y}return w(t.data)}}ve.create=e=>new ve({typeName:h.ZodSymbol,...S(e)});class ne extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.undefined,received:n.parsedType}),y}return w(t.data)}}ne.create=e=>new ne({typeName:h.ZodUndefined,...S(e)});class ie extends T{_parse(t){if(this._getType(t)!==f.null){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.null,received:n.parsedType}),y}return w(t.data)}}ie.create=e=>new ie({typeName:h.ZodNull,...S(e)});class K extends T{constructor(){super(...arguments),this._any=!0}_parse(t){return w(t.data)}}K.create=e=>new K({typeName:h.ZodAny,...S(e)});class z extends T{constructor(){super(...arguments),this._unknown=!0}_parse(t){return w(t.data)}}z.create=e=>new z({typeName:h.ZodUnknown,...S(e)});class q extends T{_parse(t){const r=this._getOrReturnCtx(t);return p(r,{code:u.invalid_type,expected:f.never,received:r.parsedType}),y}}q.create=e=>new q({typeName:h.ZodNever,...S(e)});class Ce extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.void,received:n.parsedType}),y}return w(t.data)}}Ce.create=e=>new Ce({typeName:h.ZodVoid,...S(e)});class b extends T{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==f.array)return p(r,{code:u.invalid_type,expected:f.array,received:r.parsedType}),y;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(o||c)&&(p(r,{code:o?u.too_big:u.too_small,minimum:c?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(p(r,{code:u.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(p(r,{code:u.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,c)=>i.type._parseAsync(new k(r,o,r.path,c)))).then(o=>_.mergeArray(n,o));const a=[...r.data].map((o,c)=>i.type._parseSync(new k(r,o,r.path,c)));return _.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new b({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new b({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new b({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}}b.create=(e,t)=>new b({type:e,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...S(t)});function W(e){if(e instanceof N){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=x.create(W(n))}return new N({...e._def,shape:()=>t})}else return e instanceof b?new b({...e._def,type:W(e.element)}):e instanceof x?x.create(W(e.unwrap())):e instanceof G?G.create(W(e.unwrap())):e instanceof U?U.create(e.items.map(t=>W(t))):e}class N extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=C.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==f.object){const l=this._getOrReturnCtx(t);return p(l,{code:u.invalid_type,expected:f.object,received:l.parsedType}),y}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof q&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||c.push(l);const m=[];for(const l of o){const v=a[l],I=i.data[l];m.push({key:{status:"valid",value:l},value:v._parse(new k(i,I,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof q){const l=this._def.unknownKeys;if(l==="passthrough")for(const v of c)m.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(l==="strict")c.length>0&&(p(i,{code:u.unrecognized_keys,keys:c}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const v of c){const I=i.data[v];m.push({key:{status:"valid",value:v},value:l._parse(new k(i,I,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const v of m){const I=await v.key;l.push({key:I,value:await v.value,alwaysSet:v.alwaysSet})}return l}).then(l=>_.mergeObjectSync(n,l)):_.mergeObjectSync(n,m)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new N({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,a,o,c;const m=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=g.errToObj(t).message)!==null&&c!==void 0?c:m}:{message:m}}}:{}})}strip(){return new N({...this._def,unknownKeys:"strip"})}passthrough(){return new N({...this._def,unknownKeys:"passthrough"})}extend(t){return new N({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new N({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:h.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new N({...this._def,catchall:t})}pick(t){const r={};return C.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new N({...this._def,shape:()=>r})}omit(t){const r={};return C.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new N({...this._def,shape:()=>r})}deepPartial(){return W(this)}partial(t){const r={};return C.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new N({...this._def,shape:()=>r})}required(t){const r={};return C.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof x;)a=a._def.innerType;r[n]=a}}),new N({...this._def,shape:()=>r})}keyof(){return mn(C.objectKeys(this.shape))}}N.create=(e,t)=>new N({shape:()=>e,unknownKeys:"strip",catchall:q.create(),typeName:h.ZodObject,...S(t)}),N.strictCreate=(e,t)=>new N({shape:()=>e,unknownKeys:"strict",catchall:q.create(),typeName:h.ZodObject,...S(t)}),N.lazycreate=(e,t)=>new N({shape:e,unknownKeys:"strip",catchall:q.create(),typeName:h.ZodObject,...S(t)});class ae extends T{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(const c of a)if(c.result.status==="valid")return c.result;for(const c of a)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const o=a.map(c=>new J(c.ctx.common.issues));return p(r,{code:u.invalid_union,unionErrors:o}),y}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const m of n){const l={...r,common:{...r.common,issues:[]},parent:null},v=m._parseSync({data:r.data,path:r.path,parent:l});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const c=o.map(m=>new J(m));return p(r,{code:u.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}ae.create=(e,t)=>new ae({options:e,typeName:h.ZodUnion,...S(t)});const Oe=e=>e instanceof ce?Oe(e.schema):e instanceof R?Oe(e.innerType()):e instanceof de?[e.value]:e instanceof V?e.options:e instanceof ue?Object.keys(e.enum):e instanceof le?Oe(e._def.innerType):e instanceof ne?[void 0]:e instanceof ie?[null]:null;class Ne extends T{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.object)return p(r,{code:u.invalid_type,expected:f.object,received:r.parsedType}),y;const n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(p(r,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const i=new Map;for(const a of r){const o=Oe(a.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of o){if(i.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);i.set(c,a)}}return new Ne({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...S(n)})}}function Ke(e,t){const r=M(e),n=M(t);if(e===t)return{valid:!0,data:e};if(r===f.object&&n===f.object){const i=C.objectKeys(t),a=C.objectKeys(e).filter(c=>i.indexOf(c)!==-1),o={...e,...t};for(const c of a){const m=Ke(e[c],t[c]);if(!m.valid)return{valid:!1};o[c]=m.data}return{valid:!0,data:o}}else if(r===f.array&&n===f.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=t[a],m=Ke(o,c);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===f.date&&n===f.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class se extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,o)=>{if(Be(a)||Be(o))return y;const c=Ke(a.value,o.value);return c.valid?((Ge(a)||Ge(o))&&r.dirty(),{status:r.value,value:c.data}):(p(n,{code:u.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}se.create=(e,t,r)=>new se({left:e,right:t,typeName:h.ZodIntersection,...S(r)});class U extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.array)return p(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return p(n,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,c)=>{const m=this._def.items[c]||this._def.rest;return m?m._parse(new k(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>_.mergeArray(r,o)):_.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new U({...this._def,rest:t})}}U.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new U({items:e,typeName:h.ZodTuple,rest:null,...S(t)})};class oe extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.object)return p(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),y;const i=[],a=this._def.keyType,o=this._def.valueType;for(const c in n.data)i.push({key:a._parse(new k(n,c,n.path,c)),value:o._parse(new k(n,n.data[c],n.path,c))});return n.common.async?_.mergeObjectAsync(r,i):_.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new oe({keyType:t,valueType:r,typeName:h.ZodRecord,...S(n)}):new oe({keyType:A.create(),valueType:t,typeName:h.ZodRecord,...S(r)})}}class _e extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.map)return p(n,{code:u.invalid_type,expected:f.map,received:n.parsedType}),y;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([c,m],l)=>({key:i._parse(new k(n,c,n.path,[l,"key"])),value:a._parse(new k(n,m,n.path,[l,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const m of o){const l=await m.key,v=await m.value;if(l.status==="aborted"||v.status==="aborted")return y;(l.status==="dirty"||v.status==="dirty")&&r.dirty(),c.set(l.value,v.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const m of o){const l=m.key,v=m.value;if(l.status==="aborted"||v.status==="aborted")return y;(l.status==="dirty"||v.status==="dirty")&&r.dirty(),c.set(l.value,v.value)}return{status:r.value,value:c}}}}_e.create=(e,t,r)=>new _e({valueType:t,keyType:e,typeName:h.ZodMap,...S(r)});class B extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.set)return p(n,{code:u.invalid_type,expected:f.set,received:n.parsedType}),y;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(p(n,{code:u.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(p(n,{code:u.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(m){const l=new Set;for(const v of m){if(v.status==="aborted")return y;v.status==="dirty"&&r.dirty(),l.add(v.value)}return{status:r.value,value:l}}const c=[...n.data.values()].map((m,l)=>a._parse(new k(n,m,n.path,l)));return n.common.async?Promise.all(c).then(m=>o(m)):o(c)}min(t,r){return new B({...this._def,minSize:{value:t,message:g.toString(r)}})}max(t,r){return new B({...this._def,maxSize:{value:t,message:g.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}B.create=(e,t)=>new B({valueType:e,minSize:null,maxSize:null,typeName:h.ZodSet,...S(t)});class Y extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.function)return p(r,{code:u.invalid_type,expected:f.function,received:r.parsedType}),y;function n(c,m){return Se({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:m}})}function i(c,m){return Se({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:m}})}const a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof X){const c=this;return w(async function(...m){const l=new J([]),v=await c._def.args.parseAsync(m,a).catch(We=>{throw l.addIssue(n(m,We)),l}),I=await Reflect.apply(o,this,v);return await c._def.returns._def.type.parseAsync(I,a).catch(We=>{throw l.addIssue(i(I,We)),l})})}else{const c=this;return w(function(...m){const l=c._def.args.safeParse(m,a);if(!l.success)throw new J([n(m,l.error)]);const v=Reflect.apply(o,this,l.data),I=c._def.returns.safeParse(v,a);if(!I.success)throw new J([i(v,I.error)]);return I.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Y({...this._def,args:U.create(t).rest(z.create())})}returns(t){return new Y({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Y({args:t||U.create([]).rest(z.create()),returns:r||z.create(),typeName:h.ZodFunction,...S(n)})}}class ce extends T{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ce.create=(e,t)=>new ce({getter:e,typeName:h.ZodLazy,...S(t)});class de extends T{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return p(r,{received:r.data,code:u.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:t.data}}get value(){return this._def.value}}de.create=(e,t)=>new de({value:e,typeName:h.ZodLiteral,...S(t)});function mn(e,t){return new V({values:e,typeName:h.ZodEnum,...S(t)})}class V extends T{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return p(r,{expected:C.joinValues(n),received:r.parsedType,code:u.invalid_type}),y}if(this._def.values.indexOf(t.data)===-1){const r=this._getOrReturnCtx(t),n=this._def.values;return p(r,{received:r.data,code:u.invalid_enum_value,options:n}),y}return w(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t){return V.create(t)}exclude(t){return V.create(this.options.filter(r=>!t.includes(r)))}}V.create=mn;class ue extends T{_parse(t){const r=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==f.string&&n.parsedType!==f.number){const i=C.objectValues(r);return p(n,{expected:C.joinValues(i),received:n.parsedType,code:u.invalid_type}),y}if(r.indexOf(t.data)===-1){const i=C.objectValues(r);return p(n,{received:n.data,code:u.invalid_enum_value,options:i}),y}return w(t.data)}get enum(){return this._def.values}}ue.create=(e,t)=>new ue({values:e,typeName:h.ZodNativeEnum,...S(t)});class X extends T{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.promise&&r.common.async===!1)return p(r,{code:u.invalid_type,expected:f.promise,received:r.parsedType}),y;const n=r.parsedType===f.promise?r.data:Promise.resolve(r.data);return w(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}X.create=(e,t)=>new X({type:e,typeName:h.ZodPromise,...S(t)});class R extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{p(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(c=>this._def.schema._parseAsync({data:c,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=c=>{const m=i.refinement(c,a);if(n.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),o(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),o(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!te(o))return o;const c=i.transform(o.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>te(o)?Promise.resolve(i.transform(o.value,a)).then(c=>({status:r.value,value:c})):o);C.assertNever(i)}}R.create=(e,t,r)=>new R({schema:e,typeName:h.ZodEffects,effect:t,...S(r)}),R.createWithPreprocess=(e,t,r)=>new R({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...S(r)});class x extends T{_parse(t){return this._getType(t)===f.undefined?w(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}x.create=(e,t)=>new x({innerType:e,typeName:h.ZodOptional,...S(t)});class G extends T{_parse(t){return this._getType(t)===f.null?w(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}G.create=(e,t)=>new G({innerType:e,typeName:h.ZodNullable,...S(t)});class le extends T{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}le.create=(e,t)=>new le({innerType:e,typeName:h.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...S(t)});class we extends T{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Te(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new J(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new J(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}we.create=(e,t)=>new we({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...S(t)});class Pe extends T{_parse(t){if(this._getType(t)!==f.nan){const n=this._getOrReturnCtx(t);return p(n,{code:u.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:t.data}}}Pe.create=e=>new Pe({typeName:h.ZodNaN,...S(e)});const Sa=Symbol("zod_brand");class gn extends T{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class fe extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(r.dirty(),fn(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?y:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new fe({in:t,out:r,typeName:h.ZodPipeline})}}class Ie extends T{_parse(t){const r=this._def.innerType._parse(t);return te(r)&&(r.value=Object.freeze(r.value)),r}}Ie.create=(e,t)=>new Ie({innerType:e,typeName:h.ZodReadonly,...S(t)});const hn=(e,t={},r)=>e?K.create().superRefine((n,i)=>{var a,o;if(!e(n)){const c=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,m=(o=(a=c.fatal)!==null&&a!==void 0?a:r)!==null&&o!==void 0?o:!0,l=typeof c=="string"?{message:c}:c;i.addIssue({code:"custom",...l,fatal:m})}}):K.create(),Ta={object:N.lazycreate};var h;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(h||(h={}));const va=(e,t={message:`Input not instance of ${e.name}`})=>hn(r=>r instanceof e,t),yn=A.create,Sn=Z.create,Ca=Pe.create,Oa=$.create,Tn=re.create,Na=H.create,_a=ve.create,wa=ne.create,Pa=ie.create,Ia=K.create,Da=z.create,Ja=q.create,Aa=Ce.create,ba=b.create,Ra=N.create,Fa=N.strictCreate,ka=ae.create,Ua=Ne.create,Ea=se.create,La=U.create,qa=oe.create,xa=_e.create,Ma=B.create,Za=Y.create,$a=ce.create,Va=de.create,Ha=V.create,za=ue.create,Ba=X.create,vn=R.create,Ga=x.create,Qa=G.create,Ka=R.createWithPreprocess,Wa=fe.create;var pe=Object.freeze({__proto__:null,defaultErrorMap:ee,setErrorMap:aa,getErrorMap:ye,makeIssue:Se,EMPTY_PATH:sa,addIssueToContext:p,ParseStatus:_,INVALID:y,DIRTY:fn,OK:w,isAborted:Be,isDirty:Ge,isValid:te,isAsync:Te,get util(){return C},get objectUtil(){return ze},ZodParsedType:f,getParsedType:M,ZodType:T,ZodString:A,ZodNumber:Z,ZodBigInt:$,ZodBoolean:re,ZodDate:H,ZodSymbol:ve,ZodUndefined:ne,ZodNull:ie,ZodAny:K,ZodUnknown:z,ZodNever:q,ZodVoid:Ce,ZodArray:b,ZodObject:N,ZodUnion:ae,ZodDiscriminatedUnion:Ne,ZodIntersection:se,ZodTuple:U,ZodRecord:oe,ZodMap:_e,ZodSet:B,ZodFunction:Y,ZodLazy:ce,ZodLiteral:de,ZodEnum:V,ZodNativeEnum:ue,ZodPromise:X,ZodEffects:R,ZodTransformer:R,ZodOptional:x,ZodNullable:G,ZodDefault:le,ZodCatch:we,ZodNaN:Pe,BRAND:Sa,ZodBranded:gn,ZodPipeline:fe,ZodReadonly:Ie,custom:hn,Schema:T,ZodSchema:T,late:Ta,get ZodFirstPartyTypeKind(){return h},coerce:{string:e=>A.create({...e,coerce:!0}),number:e=>Z.create({...e,coerce:!0}),boolean:e=>re.create({...e,coerce:!0}),bigint:e=>$.create({...e,coerce:!0}),date:e=>H.create({...e,coerce:!0})},any:Ia,array:ba,bigint:Oa,boolean:Tn,date:Na,discriminatedUnion:Ua,effect:vn,enum:Ha,function:Za,instanceof:va,intersection:Ea,lazy:$a,literal:Va,map:xa,nan:Ca,nativeEnum:za,never:Ja,null:Pa,nullable:Qa,number:Sn,object:Ra,oboolean:()=>Tn().optional(),onumber:()=>Sn().optional(),optional:Ga,ostring:()=>yn().optional(),pipeline:Wa,preprocess:Ka,promise:Ba,record:qa,set:Ma,strictObject:Fa,string:yn,symbol:_a,transformer:vn,tuple:La,undefined:wa,union:ka,unknown:Da,void:Aa,NEVER:y,ZodIssueCode:u,quotelessJson:ia,ZodError:J});function Ya(e){return e===401||e===403}function Xa(e){return Object.entries(e).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&")}const ja=pe.object({access_token:pe.string().min(1),token_type:pe.string(),expires_in:pe.number(),scope:pe.string()});async function es(e){let r=await(await fetch(e.tokenUrl,{method:"POST",body:Xa({grant_type:"client_credentials",client_id:e.clientId,client_secret:e.clientSecret}),headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json();return ts(r)}function ts(e){const t=ja.safeParse(e);if(!t.success)throw new Error("Bad access token response");return t.data}class rs{constructor(t){E(this,"activeRequest",null);E(this,"refreshTimeout");E(this,"accessToken",null);this.clientCredentials=t}async getAccessToken(){return this.accessToken?this.accessToken:await this.refreshAccessToken()}async refreshAccessToken(){if(this.activeRequest)return await this.activeRequest,this.accessToken;this.accessToken=null,this.activeRequest=es(this.clientCredentials);const t=await this.activeRequest;return this.scheduleNextRefresh(t),this.accessToken=t.access_token,this.activeRequest=null,this.accessToken}scheduleNextRefresh(t){clearTimeout(this.refreshTimeout);const r=(t.expires_in-2)*1e3;this.refreshTimeout=setTimeout(()=>{this.accessToken=null},r)}}function Cn(e,t){e.headers=ns("Authorization",`Bearer ${t}`,e.headers)}function ns(e,t,r){return r?Array.isArray(r)?r.map(([n,i])=>n!==e?[n,i]:[e,t]):is(r)?(r.has(e)?r.set(e,t):r.append(e,t),r):(r[e]=t,r):(r={},r[e]=t,r)}function is(e){return"append"in e&&"delete"in e&&"get"in e&&"has"in e&&"set"in e&&"forEach"in e}function as(e){const t=new rs(e);return{pre:async r=>{const n=await t.getAccessToken();return Cn(r.init,n),Promise.resolve({url:r.url,init:r.init})},post:async r=>{if(Ya(r.response.status)){const n=await t.refreshAccessToken();return Cn(r.init,n),await fetch(r.url,r.init)}return Promise.resolve(r.response)}}}function ss(e){let t=[],r={};e.clientCredentials&&t.push(as(e.clientCredentials)),e.managementApiKey&&(r=os(e.managementApiKey));const n=new L({basePath:e.managementApiUrl,headers:r,credentials:"same-origin",middleware:t,...e.configOverrides});return{uiApi:new dn(n),useCaseApi:new un(n),enterpriseEditionApi:new cn(n)}}function os(e){return{"X-Api-Key":e}}s.AssetPageFromJSON=it,s.AssetPageFromJSONTyped=at,s.AssetPageToJSON=An,s.AtomicConstraintDtoFromJSON=ot,s.AtomicConstraintDtoFromJSONTyped=ct,s.AtomicConstraintDtoToJSON=dt,s.BASE_PATH=P,s.BaseAPI=Q,s.BlobApiResponse=In,s.COLLECTION_FORMATS=_n,s.CatalogFilterExpressionFromJSON=yt,s.CatalogFilterExpressionFromJSONTyped=St,s.CatalogFilterExpressionLiteralFromJSON=ft,s.CatalogFilterExpressionLiteralFromJSONTyped=pt,s.CatalogFilterExpressionLiteralToJSON=mt,s.CatalogFilterExpressionLiteralType=kn,s.CatalogFilterExpressionLiteralTypeFromJSON=ut,s.CatalogFilterExpressionLiteralTypeFromJSONTyped=lt,s.CatalogFilterExpressionLiteralTypeToJSON=Un,s.CatalogFilterExpressionOperator=Ln,s.CatalogFilterExpressionOperatorFromJSON=gt,s.CatalogFilterExpressionOperatorFromJSONTyped=ht,s.CatalogFilterExpressionOperatorToJSON=qn,s.CatalogFilterExpressionToJSON=Tt,s.CatalogQueryFromJSON=Zn,s.CatalogQueryFromJSONTyped=vt,s.CatalogQueryToJSON=Ct,s.Configuration=L,s.ConnectorLimitsFromJSON=Ot,s.ConnectorLimitsFromJSONTyped=Nt,s.ConnectorLimitsToJSON=Vn,s.ContractAgreementCardFromJSON=qt,s.ContractAgreementCardFromJSONTyped=xt,s.ContractAgreementCardToJSON=Mt,s.ContractAgreementDirection=Hn,s.ContractAgreementDirectionFromJSON=be,s.ContractAgreementDirectionFromJSONTyped=_t,s.ContractAgreementDirectionToJSON=zn,s.ContractAgreementPageFromJSON=Zt,s.ContractAgreementPageFromJSONTyped=$t,s.ContractAgreementPageToJSON=ni,s.ContractAgreementTransferProcessFromJSON=Dt,s.ContractAgreementTransferProcessFromJSONTyped=Jt,s.ContractAgreementTransferProcessToJSON=At,s.ContractDefinitionEntryFromJSON=Yt,s.ContractDefinitionEntryFromJSONTyped=Xt,s.ContractDefinitionEntryToJSON=jt,s.ContractDefinitionPageFromJSON=er,s.ContractDefinitionPageFromJSONTyped=tr,s.ContractDefinitionPageToJSON=fi,s.ContractDefinitionRequestFromJSON=mi,s.ContractDefinitionRequestFromJSONTyped=rr,s.ContractDefinitionRequestToJSON=nr,s.ContractNegotiationRequestFromJSON=hi,s.ContractNegotiationRequestFromJSONTyped=ir,s.ContractNegotiationRequestToJSON=ar,s.ContractNegotiationSimplifiedState=yi,s.ContractNegotiationSimplifiedStateFromJSON=sr,s.ContractNegotiationSimplifiedStateFromJSONTyped=or,s.ContractNegotiationSimplifiedStateToJSON=Si,s.ContractNegotiationStateFromJSON=cr,s.ContractNegotiationStateFromJSONTyped=dr,s.ContractNegotiationStateToJSON=ur,s.DashboardDapsConfigFromJSON=lr,s.DashboardDapsConfigFromJSONTyped=fr,s.DashboardDapsConfigToJSON=pr,s.DashboardMiwConfigFromJSON=mr,s.DashboardMiwConfigFromJSONTyped=gr,s.DashboardMiwConfigToJSON=hr,s.DashboardPageFromJSON=Sr,s.DashboardPageFromJSONTyped=Tr,s.DashboardPageToJSON=_i,s.DashboardTransferAmountsFromJSON=qe,s.DashboardTransferAmountsFromJSONTyped=yr,s.DashboardTransferAmountsToJSON=xe,s.DefaultConfig=Ye,s.EnterpriseEditionApi=cn,s.ExpressionFromJSON=Me,s.ExpressionFromJSONTyped=Or,s.ExpressionToJSON=Ze,s.ExpressionType=wi,s.ExpressionTypeFromJSON=vr,s.ExpressionTypeFromJSONTyped=Cr,s.ExpressionTypeToJSON=Pi,s.FetchError=je,s.IdResponseDtoFromJSON=D,s.IdResponseDtoFromJSONTyped=Nr,s.IdResponseDtoToJSON=Ji,s.InitiateCustomTransferRequestFromJSON=bi,s.InitiateCustomTransferRequestFromJSONTyped=_r,s.InitiateCustomTransferRequestToJSON=wr,s.InitiateTransferRequestFromJSON=Fi,s.InitiateTransferRequestFromJSONTyped=Pr,s.InitiateTransferRequestToJSON=Ir,s.JSONApiResponse=O,s.KpiResultFromJSON=br,s.KpiResultFromJSONTyped=Rr,s.KpiResultToJSON=Ei,s.OperatorDto=bn,s.OperatorDtoFromJSON=Ae,s.OperatorDtoFromJSONTyped=st,s.OperatorDtoToJSON=Rn,s.PermissionDtoFromJSON=Fr,s.PermissionDtoFromJSONTyped=kr,s.PermissionDtoToJSON=Ur,s.PolicyCreateRequestFromJSON=xi,s.PolicyCreateRequestFromJSONTyped=Er,s.PolicyCreateRequestToJSON=Lr,s.PolicyDefinitionCreateRequestFromJSON=$i,s.PolicyDefinitionCreateRequestFromJSONTyped=Zr,s.PolicyDefinitionCreateRequestToJSON=$r,s.PolicyDefinitionDtoFromJSON=Vr,s.PolicyDefinitionDtoFromJSONTyped=Hr,s.PolicyDefinitionDtoToJSON=zr,s.PolicyDefinitionPageFromJSON=Br,s.PolicyDefinitionPageFromJSONTyped=Gr,s.PolicyDefinitionPageToJSON=zi,s.RequiredError=F,s.ResponseError=Xe,s.TextApiResponse=rt,s.TransferHistoryEntryFromJSON=Qr,s.TransferHistoryEntryFromJSONTyped=Kr,s.TransferHistoryEntryToJSON=Wr,s.TransferHistoryPageFromJSON=Yr,s.TransferHistoryPageFromJSONTyped=Xr,s.TransferHistoryPageToJSON=Qi,s.TransferProcessSimplifiedState=Bn,s.TransferProcessSimplifiedStateFromJSON=wt,s.TransferProcessSimplifiedStateFromJSONTyped=Pt,s.TransferProcessSimplifiedStateToJSON=Gn,s.TransferProcessStateFromJSON=Re,s.TransferProcessStateFromJSONTyped=It,s.TransferProcessStateToJSON=Fe,s.TransferProcessStatesDtoFromJSON=Dr,s.TransferProcessStatesDtoFromJSONTyped=Jr,s.TransferProcessStatesDtoToJSON=Ar,s.UIApi=dn,s.UiAssetCreateRequestFromJSON=Wi,s.UiAssetCreateRequestFromJSONTyped=jr,s.UiAssetCreateRequestToJSON=$e,s.UiAssetEditMetadataRequestFromJSON=Xi,s.UiAssetEditMetadataRequestFromJSONTyped=en,s.UiAssetEditMetadataRequestToJSON=tn,s.UiAssetFromJSON=j,s.UiAssetFromJSONTyped=nt,s.UiAssetToJSON=me,s.UiContractNegotiationFromJSON=Ve,s.UiContractNegotiationFromJSONTyped=rn,s.UiContractNegotiationToJSON=ea,s.UiContractOfferFromJSON=nn,s.UiContractOfferFromJSONTyped=an,s.UiContractOfferToJSON=sn,s.UiCriterionFromJSON=Ee,s.UiCriterionFromJSONTyped=Wt,s.UiCriterionLiteralFromJSON=zt,s.UiCriterionLiteralFromJSONTyped=Bt,s.UiCriterionLiteralToJSON=Gt,s.UiCriterionLiteralType=ii,s.UiCriterionLiteralTypeFromJSON=Vt,s.UiCriterionLiteralTypeFromJSONTyped=Ht,s.UiCriterionLiteralTypeToJSON=ai,s.UiCriterionOperator=oi,s.UiCriterionOperatorFromJSON=Qt,s.UiCriterionOperatorFromJSONTyped=Kt,s.UiCriterionOperatorToJSON=ci,s.UiCriterionToJSON=Le,s.UiDataOfferFromJSON=He,s.UiDataOfferFromJSONTyped=on,s.UiDataOfferToJSON=na,s.UiPolicyConstraintFromJSON=ke,s.UiPolicyConstraintFromJSONTyped=Et,s.UiPolicyConstraintToJSON=Ue,s.UiPolicyCreateRequestFromJSON=qr,s.UiPolicyCreateRequestFromJSONTyped=xr,s.UiPolicyCreateRequestToJSON=Mr,s.UiPolicyFromJSON=ge,s.UiPolicyFromJSONTyped=Lt,s.UiPolicyLiteralFromJSON=Ft,s.UiPolicyLiteralFromJSONTyped=kt,s.UiPolicyLiteralToJSON=Ut,s.UiPolicyLiteralType=Wn,s.UiPolicyLiteralTypeFromJSON=bt,s.UiPolicyLiteralTypeFromJSONTyped=Rt,s.UiPolicyLiteralTypeToJSON=Yn,s.UiPolicyToJSON=he,s.UseCaseApi=un,s.VoidApiResponse=tt,s.buildEdcClient=ss,s.canConsumeForm=Pn,s.exists=d,s.instanceOfAssetPage=Jn,s.instanceOfAtomicConstraintDto=Fn,s.instanceOfCatalogFilterExpression=xn,s.instanceOfCatalogFilterExpressionLiteral=En,s.instanceOfCatalogQuery=Mn,s.instanceOfConnectorLimits=$n,s.instanceOfContractAgreementCard=ti,s.instanceOfContractAgreementPage=ri,s.instanceOfContractAgreementTransferProcess=Kn,s.instanceOfContractDefinitionEntry=ui,s.instanceOfContractDefinitionPage=li,s.instanceOfContractDefinitionRequest=pi,s.instanceOfContractNegotiationRequest=gi,s.instanceOfContractNegotiationState=Ti,s.instanceOfDashboardDapsConfig=vi,s.instanceOfDashboardMiwConfig=Ci,s.instanceOfDashboardPage=Ni,s.instanceOfDashboardTransferAmounts=Oi,s.instanceOfExpression=Ii,s.instanceOfIdResponseDto=Di,s.instanceOfInitiateCustomTransferRequest=Ai,s.instanceOfInitiateTransferRequest=Ri,s.instanceOfKpiResult=Ui,s.instanceOfPermissionDto=Li,s.instanceOfPolicyCreateRequest=qi,s.instanceOfPolicyDefinitionCreateRequest=Zi,s.instanceOfPolicyDefinitionDto=Vi,s.instanceOfPolicyDefinitionPage=Hi,s.instanceOfTransferHistoryEntry=Bi,s.instanceOfTransferHistoryPage=Gi,s.instanceOfTransferProcessState=Qn,s.instanceOfTransferProcessStatesDto=ki,s.instanceOfUiAsset=Dn,s.instanceOfUiAssetCreateRequest=Ki,s.instanceOfUiAssetEditMetadataRequest=Yi,s.instanceOfUiContractNegotiation=ji,s.instanceOfUiContractOffer=ta,s.instanceOfUiCriterion=di,s.instanceOfUiCriterionLiteral=si,s.instanceOfUiDataOffer=ra,s.instanceOfUiPolicy=ei,s.instanceOfUiPolicyConstraint=jn,s.instanceOfUiPolicyCreateRequest=Mi,s.instanceOfUiPolicyLiteral=Xn,s.mapValues=wn,s.querystring=Je,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=sovity-edc-client.umd.cjs.map