@sovity.de/edc-client 9.0.0 → 10.0.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(o,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(o=typeof globalThis<"u"?globalThis:o||self,_(o["sovity-edc-client"]={}))})(this,function(o){"use strict";var ns=Object.defineProperty;var is=(o,_,q)=>_ in o?ns(o,_,{enumerable:!0,configurable:!0,writable:!0,value:q}):o[_]=q;var k=(o,_,q)=>(is(o,typeof _!="symbol"?_+"":_,q),q);const _="https://my-connector/api/management".replace(/\/+$/,"");class q{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:_}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 et=new q,Ie=class Ie{constructor(t=et){k(this,"middleware");k(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 s of this.middleware)s.onError&&(i=await s.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 rt(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?Ie.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 tt(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,s={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},d={...s,...await a({init:s,context:t})},p={...d,body:Xn(d.body)||d.body instanceof URLSearchParams||Yn(d.body)?d.body:JSON.stringify(d.body)};return{url:n,init:p}}clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}};k(Ie,"jsonRegex",new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"));let G=Ie;function Yn(e){return typeof Blob<"u"&&e instanceof Blob}function Xn(e){return typeof FormData<"u"&&e instanceof FormData}class tt extends Error{constructor(r,n){super(n);k(this,"name","ResponseError");this.response=r}}class rt extends Error{constructor(r,n){super(n);k(this,"name","FetchError");this.cause=r}}class J extends Error{constructor(r,n){super(n);k(this,"name","RequiredError");this.field=r}}const jn={csv:",",ssv:" ",tsv:" ",pipes:"|"};function c(e,t){const r=e[t];return r!=null}function Je(e,t=""){return Object.keys(e).map(r=>nt(r,e[r],t)).filter(r=>r.length>0).join("&")}function nt(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 nt(e,i,r)}return t instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?Je(t,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`}function ei(e,t){return Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n])}),{})}function ti(e){for(const t of e)if(t.contentType==="multipart/form-data")return!0;return!1}class v{constructor(t,r=n=>n){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class it{constructor(t){this.raw=t}async value(){}}class ri{constructor(t){this.raw=t}async value(){return await this.raw.blob()}}class at{constructor(t){this.raw=t}async value(){return await this.raw.text()}}const ni={Live:"LIVE",OnRequest:"ON_REQUEST"};function ot(e){return st(e)}function st(e,t){return e}function ii(e){return e}function ai(e){let t=!0;return t=t&&"dataSourceAvailability"in e,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 ct(e)}function ct(e,t){return e==null?e:{dataSourceAvailability:ot(e.dataSourceAvailability),assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,onRequestContactEmail:c(e,"onRequestContactEmail")?e.onRequestContactEmail:void 0,onRequestContactEmailSubject:c(e,"onRequestContactEmailSubject")?e.onRequestContactEmailSubject:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,descriptionShortText:c(e,"descriptionShortText")?e.descriptionShortText:void 0,isOwnConnector:e.isOwnConnector,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,httpDatasourceHintsProxyMethod:c(e,"httpDatasourceHintsProxyMethod")?e.httpDatasourceHintsProxyMethod:void 0,httpDatasourceHintsProxyPath:c(e,"httpDatasourceHintsProxyPath")?e.httpDatasourceHintsProxyPath:void 0,httpDatasourceHintsProxyQueryParams:c(e,"httpDatasourceHintsProxyQueryParams")?e.httpDatasourceHintsProxyQueryParams:void 0,httpDatasourceHintsProxyBody:c(e,"httpDatasourceHintsProxyBody")?e.httpDatasourceHintsProxyBody:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,assetJsonLd:c(e,"assetJsonLd")?e.assetJsonLd:void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function pe(e){if(e!==void 0)return e===null?null:{dataSourceAvailability:e.dataSourceAvailability,assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,onRequestContactEmail:e.onRequestContactEmail,onRequestContactEmailSubject:e.onRequestContactEmailSubject,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 oi(e){let t=!0;return t=t&&"assets"in e,t}function dt(e){return ut(e)}function ut(e,t){return e==null?e:{assets:e.assets.map(j)}}function si(e){if(e!==void 0)return e===null?null:{assets:e.assets.map(pe)}}const ci={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 lt(e)}function lt(e,t){return e}function di(e){return e}function ui(e){let t=!0;return t=t&&"leftExpression"in e,t=t&&"operator"in e,t=t&&"rightExpression"in e,t}function ft(e){return mt(e)}function mt(e,t){return e==null?e:{leftExpression:e.leftExpression,operator:Ae(e.operator),rightExpression:e.rightExpression}}function pt(e){if(e!==void 0)return e===null?null:{leftExpression:e.leftExpression,operator:e.operator,rightExpression:e.rightExpression}}const li={Value:"VALUE",ValueList:"VALUE_LIST"};function gt(e){return ht(e)}function ht(e,t){return e}function fi(e){return e}function mi(e){return!0}function yt(e){return St(e)}function St(e,t){return e==null?e:{type:c(e,"type")?gt(e.type):void 0,value:c(e,"value")?e.value:void 0,valueList:c(e,"valueList")?e.valueList:void 0}}function Tt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const pi={Like:"LIKE",Eq:"EQ",In:"IN"};function Ot(e){return Ct(e)}function Ct(e,t){return e}function gi(e){return e}function hi(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function vt(e){return Nt(e)}function Nt(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:Ot(e.operator),operandRight:yt(e.operandRight)}}function Pt(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:Tt(e.operandRight)}}function yi(e){let t=!0;return t=t&&"connectorEndpoint"in e,t}function Si(e){return wt(e)}function wt(e,t){return e==null?e:{connectorEndpoint:e.connectorEndpoint,limit:c(e,"limit")?e.limit:void 0,offset:c(e,"offset")?e.offset:void 0,filterExpressions:c(e,"filterExpressions")?e.filterExpressions.map(vt):void 0}}function _t(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(Pt)}}function Ti(e){let t=!0;return t=t&&"numActiveConsumingContractAgreements"in e,t}function Dt(e){return It(e)}function It(e,t){return e==null?e:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:c(e,"maxActiveConsumingContractAgreements")?e.maxActiveConsumingContractAgreements:void 0}}function Oi(e){if(e!==void 0)return e===null?null:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:e.maxActiveConsumingContractAgreements}}const Ci={Consuming:"CONSUMING",Providing:"PROVIDING"};function be(e){return Jt(e)}function Jt(e,t){return e}function vi(e){return e}const Ni={Self:"SELF",Counterparty:"COUNTERPARTY"};function At(e){return bt(e)}function bt(e,t){return e}function Pi(e){return e}function wi(e){let t=!0;return t=t&&"terminatedAt"in e,t=t&&"reason"in e,t=t&&"detail"in e,t=t&&"terminatedBy"in e,t}function Rt(e){return Ft(e)}function Ft(e,t){return e==null?e:{terminatedAt:new Date(e.terminatedAt),reason:e.reason,detail:e.detail,terminatedBy:At(e.terminatedBy)}}function Ut(e){if(e!==void 0)return e===null?null:{terminatedAt:e.terminatedAt.toISOString(),reason:e.reason,detail:e.detail,terminatedBy:e.terminatedBy}}const _i={Running:"RUNNING",Ok:"OK",Error:"ERROR"};function Et(e){return kt(e)}function kt(e,t){return e}function Di(e){return e}function Ii(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 qt(e)}function qt(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:Et(e.simplifiedState)}}function Fe(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function Ji(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t}function Lt(e){return Mt(e)}function Mt(e,t){return e==null?e:{transferProcessId:e.transferProcessId,lastUpdatedDate:new Date(e.lastUpdatedDate),state:Re(e.state),errorMessage:c(e,"errorMessage")?e.errorMessage:void 0}}function Zt(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Fe(e.state),errorMessage:e.errorMessage}}const Ai={Ongoing:"ONGOING",Terminated:"TERMINATED"};function Ue(e){return xt(e)}function xt(e,t){return e}function bi(e){return e}const Ri={String:"STRING",StringList:"STRING_LIST",Json:"JSON"};function Ht(e){return Vt(e)}function Vt(e,t){return e}function Fi(e){return e}function Ui(e){let t=!0;return t=t&&"type"in e,t}function $t(e){return zt(e)}function zt(e,t){return e==null?e:{type:Ht(e.type),value:c(e,"value")?e.value:void 0,valueList:c(e,"valueList")?e.valueList:void 0}}function Bt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}function Ei(e){let t=!0;return t=t&&"left"in e,t=t&&"operator"in e,t=t&&"right"in e,t}function Ee(e){return Qt(e)}function Qt(e,t){return e==null?e:{left:e.left,operator:Ae(e.operator),right:$t(e.right)}}function ke(e){if(e!==void 0)return e===null?null:{left:e.left,operator:e.operator,right:Bt(e.right)}}function ki(e){let t=!0;return t=t&&"policyJsonLd"in e,t=t&&"errors"in e,t}function ge(e){return Gt(e)}function Gt(e,t){return e==null?e:{policyJsonLd:e.policyJsonLd,constraints:c(e,"constraints")?e.constraints.map(Ee):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(ke),errors:e.errors}}function qi(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=t&&"terminationStatus"in e,t}function Kt(e){return Wt(e)}function Wt(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(Lt),terminationStatus:Ue(e.terminationStatus),terminationInformation:c(e,"terminationInformation")?Rt(e.terminationInformation):void 0}}function Yt(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:pe(e.asset),contractPolicy:he(e.contractPolicy),transferProcesses:e.transferProcesses.map(Zt),terminationStatus:e.terminationStatus,terminationInformation:Ut(e.terminationInformation)}}function Li(e){let t=!0;return t=t&&"contractAgreements"in e,t}function Xt(e){return jt(e)}function jt(e,t){return e==null?e:{contractAgreements:e.contractAgreements.map(Kt)}}function Mi(e){if(e!==void 0)return e===null?null:{contractAgreements:e.contractAgreements.map(Yt)}}function Zi(e){return!0}function xi(e){return er(e)}function er(e,t){return e==null?e:{terminationStatus:c(e,"terminationStatus")?Ue(e.terminationStatus):void 0}}function tr(e){if(e!==void 0)return e===null?null:{terminationStatus:e.terminationStatus}}const Hi={Value:"VALUE",ValueList:"VALUE_LIST"};function rr(e){return nr(e)}function nr(e,t){return e}function Vi(e){return e}function $i(e){return!0}function ir(e){return ar(e)}function ar(e,t){return e==null?e:{type:c(e,"type")?rr(e.type):void 0,value:c(e,"value")?e.value:void 0,valueList:c(e,"valueList")?e.valueList:void 0}}function or(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const zi={Eq:"EQ",In:"IN",Like:"LIKE"};function sr(e){return cr(e)}function cr(e,t){return e}function Bi(e){return e}function Qi(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function qe(e){return dr(e)}function dr(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:sr(e.operator),operandRight:ir(e.operandRight)}}function Le(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:or(e.operandRight)}}function Gi(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 ur(e){return lr(e)}function lr(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(qe)}}function fr(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Le)}}function Ki(e){let t=!0;return t=t&&"contractDefinitions"in e,t}function mr(e){return pr(e)}function pr(e,t){return e==null?e:{contractDefinitions:e.contractDefinitions.map(ur)}}function Wi(e){if(e!==void 0)return e===null?null:{contractDefinitions:e.contractDefinitions.map(fr)}}function Yi(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 Xi(e){return gr(e)}function gr(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(qe)}}function hr(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Le)}}function ji(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 ea(e){return yr(e)}function yr(e,t){return e==null?e:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}function Sr(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 ta={InProgress:"IN_PROGRESS",Agreed:"AGREED",Terminated:"TERMINATED"};function Tr(e){return Or(e)}function Or(e,t){return e}function ra(e){return e}function na(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 vr(e)}function vr(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:Tr(e.simplifiedState)}}function Nr(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function ia(e){let t=!0;return t=t&&"reason"in e,t}function aa(e){return Pr(e)}function Pr(e,t){return e==null?e:{reason:e.reason,detail:c(e,"detail")?e.detail:void 0}}function wr(e){if(e!==void 0)return e===null?null:{reason:e.reason,detail:e.detail}}function oa(e){let t=!0;return t=t&&"tokenUrl"in e,t=t&&"jwksUrl"in e,t}function _r(e){return Dr(e)}function Dr(e,t){return e==null?e:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function Ir(e){if(e!==void 0)return e===null?null:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function sa(e){let t=!0;return t=t&&"url"in e,t=t&&"tokenUrl"in e,t=t&&"authorityId"in e,t}function Jr(e){return Ar(e)}function Ar(e,t){return e==null?e:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function br(e){if(e!==void 0)return e===null?null:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function ca(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 Me(e){return Rr(e)}function Rr(e,t){return e==null?e:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function Ze(e){if(e!==void 0)return e===null?null:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function da(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 Fr(e){return Ur(e)}function Ur(e,t){return e==null?e:{numAssets:e.numAssets,numPolicies:e.numPolicies,numContractDefinitions:e.numContractDefinitions,numContractAgreementsConsuming:e.numContractAgreementsConsuming,numContractAgreementsProviding:e.numContractAgreementsProviding,transferProcessesConsuming:Me(e.transferProcessesConsuming),transferProcessesProviding:Me(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:c(e,"connectorDapsConfig")?_r(e.connectorDapsConfig):void 0,connectorMiwConfig:c(e,"connectorMiwConfig")?Jr(e.connectorMiwConfig):void 0}}function ua(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:Ze(e.transferProcessesConsuming),transferProcessesProviding:Ze(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:Ir(e.connectorDapsConfig),connectorMiwConfig:br(e.connectorMiwConfig)}}const la={HttpData:"HTTP_DATA",OnRequest:"ON_REQUEST",Custom:"CUSTOM"};function Er(e){return kr(e)}function kr(e,t){return e}function fa(e){return e}const ma={AtomicConstraint:"ATOMIC_CONSTRAINT",And:"AND",Or:"OR",Xor:"XOR"};function qr(e){return Lr(e)}function Lr(e,t){return e}function pa(e){return e}function ga(e){return!0}function xe(e){return Mr(e)}function Mr(e,t){return e==null?e:{expressionType:c(e,"expressionType")?qr(e.expressionType):void 0,expressions:c(e,"expressions")?e.expressions.map(xe):void 0,atomicConstraint:c(e,"atomicConstraint")?ft(e.atomicConstraint):void 0}}function He(e){if(e!==void 0)return e===null?null:{expressionType:e.expressionType,expressions:e.expressions===void 0?void 0:e.expressions.map(He),atomicConstraint:pt(e.atomicConstraint)}}function ha(e){let t=!0;return t=t&&"id"in e,t=t&&"lastUpdatedDate"in e,t}function D(e){return Zr(e)}function Zr(e,t){return e==null?e:{id:e.id,lastUpdatedDate:new Date(e.lastUpdatedDate)}}function ya(e){if(e!==void 0)return e===null?null:{id:e.id,lastUpdatedDate:e.lastUpdatedDate.toISOString()}}function Sa(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"transferProcessRequestJsonLd"in e,t}function Ta(e){return xr(e)}function xr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function Hr(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function Oa(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"dataSinkProperties"in e,t=t&&"transferProcessProperties"in e,t}function Ca(e){return Vr(e)}function Vr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function $r(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,dataSinkProperties:e.dataSinkProperties,transferProcessProperties:e.transferProcessProperties}}function va(e){let t=!0;return t=t&&"incomingTransferProcessCounts"in e,t=t&&"outgoingTransferProcessCounts"in e,t}function zr(e){return Br(e)}function Br(e,t){return e==null?e:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Qr(e){if(e!==void 0)return e===null?null:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Na(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 Gr(e){return Kr(e)}function Kr(e,t){return e==null?e:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:zr(e.transferProcessDto)}}function Pa(e){if(e!==void 0)return e===null?null:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Qr(e.transferProcessDto)}}function wa(e){let t=!0;return t=t&&"expression"in e,t}function Wr(e){return Yr(e)}function Yr(e,t){return e==null?e:{expression:xe(e.expression)}}function Xr(e){if(e!==void 0)return e===null?null:{expression:He(e.expression)}}function _a(e){let t=!0;return t=t&&"policyDefinitionId"in e,t}function Da(e){return jr(e)}function jr(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,permission:c(e,"permission")?Wr(e.permission):void 0}}function en(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,permission:Xr(e.permission)}}function Ia(e){return!0}function tn(e){return rn(e)}function rn(e,t){return e==null?e:{constraints:c(e,"constraints")?e.constraints.map(Ee):void 0}}function nn(e){if(e!==void 0)return e===null?null:{constraints:e.constraints===void 0?void 0:e.constraints.map(ke)}}function Ja(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function Aa(e){return an(e)}function an(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:tn(e.policy)}}function on(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:nn(e.policy)}}function ba(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function sn(e){return cn(e)}function cn(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:ge(e.policy)}}function dn(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:he(e.policy)}}function Ra(e){let t=!0;return t=t&&"policies"in e,t}function un(e){return ln(e)}function ln(e,t){return e==null?e:{policies:e.policies.map(sn)}}function Fa(e){if(e!==void 0)return e===null?null:{policies:e.policies.map(dn)}}function Ua(e){return!0}function fn(e){return mn(e)}function mn(e,t){return e==null?e:{secretName:c(e,"secretName")?e.secretName:void 0,rawValue:c(e,"rawValue")?e.rawValue:void 0}}function pn(e){if(e!==void 0)return e===null?null:{secretName:e.secretName,rawValue:e.rawValue}}function Ea(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 gn(e){return hn(e)}function hn(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:c(e,"errorMessage")?e.errorMessage:void 0}}function yn(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 ka(e){let t=!0;return t=t&&"transferEntries"in e,t}function Sn(e){return Tn(e)}function Tn(e,t){return e==null?e:{transferEntries:e.transferEntries.map(gn)}}function qa(e){if(e!==void 0)return e===null?null:{transferEntries:e.transferEntries.map(yn)}}const La={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Options:"OPTIONS"};function On(e){return Cn(e)}function Cn(e,t){return e}function Ma(e){return e}function Za(e){let t=!0;return t=t&&"baseUrl"in e,t}function vn(e){return Nn(e)}function Nn(e,t){return e==null?e:{method:c(e,"method")?On(e.method):void 0,baseUrl:e.baseUrl,queryString:c(e,"queryString")?e.queryString:void 0,authHeaderName:c(e,"authHeaderName")?e.authHeaderName:void 0,authHeaderValue:c(e,"authHeaderValue")?fn(e.authHeaderValue):void 0,headers:c(e,"headers")?e.headers:void 0,enableMethodParameterization:c(e,"enableMethodParameterization")?e.enableMethodParameterization:void 0,enablePathParameterization:c(e,"enablePathParameterization")?e.enablePathParameterization:void 0,enableQueryParameterization:c(e,"enableQueryParameterization")?e.enableQueryParameterization:void 0,enableBodyParameterization:c(e,"enableBodyParameterization")?e.enableBodyParameterization:void 0}}function Pn(e){if(e!==void 0)return e===null?null:{method:e.method,baseUrl:e.baseUrl,queryString:e.queryString,authHeaderName:e.authHeaderName,authHeaderValue:pn(e.authHeaderValue),headers:e.headers,enableMethodParameterization:e.enableMethodParameterization,enablePathParameterization:e.enablePathParameterization,enableQueryParameterization:e.enableQueryParameterization,enableBodyParameterization:e.enableBodyParameterization}}function xa(e){let t=!0;return t=t&&"contactEmail"in e,t=t&&"contactPreferredEmailSubject"in e,t}function wn(e){return _n(e)}function _n(e,t){return e==null?e:{contactEmail:e.contactEmail,contactPreferredEmailSubject:e.contactPreferredEmailSubject}}function Dn(e){if(e!==void 0)return e===null?null:{contactEmail:e.contactEmail,contactPreferredEmailSubject:e.contactPreferredEmailSubject}}function Ha(e){let t=!0;return t=t&&"type"in e,t}function Ve(e){return In(e)}function In(e,t){return e==null?e:{type:Er(e.type),httpData:c(e,"httpData")?vn(e.httpData):void 0,onRequest:c(e,"onRequest")?wn(e.onRequest):void 0,customProperties:c(e,"customProperties")?e.customProperties:void 0}}function $e(e){if(e!==void 0)return e===null?null:{type:e.type,httpData:Pn(e.httpData),onRequest:Dn(e.onRequest),customProperties:e.customProperties}}function Va(e){let t=!0;return t=t&&"dataSource"in e,t=t&&"id"in e,t}function $a(e){return Jn(e)}function Jn(e,t){return e==null?e:{dataSource:Ve(e.dataSource),id:e.id,title:c(e,"title")?e.title:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function ze(e){if(e!==void 0)return e===null?null:{dataSource:$e(e.dataSource),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),customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function za(e){return!0}function Ba(e){return An(e)}function An(e,t){return e==null?e:{dataSourceOverrideOrNull:c(e,"dataSourceOverrideOrNull")?Ve(e.dataSourceOverrideOrNull):void 0,title:c(e,"title")?e.title:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function bn(e){if(e!==void 0)return e===null?null:{dataSourceOverrideOrNull:$e(e.dataSourceOverrideOrNull),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 Qa(e){let t=!0;return t=t&&"contractNegotiationId"in e,t=t&&"createdAt"in e,t=t&&"state"in e,t}function Be(e){return Rn(e)}function Rn(e,t){return e==null?e:{contractNegotiationId:e.contractNegotiationId,createdAt:new Date(e.createdAt),contractAgreementId:c(e,"contractAgreementId")?e.contractAgreementId:void 0,state:Cr(e.state)}}function Ga(e){if(e!==void 0)return e===null?null:{contractNegotiationId:e.contractNegotiationId,createdAt:e.createdAt.toISOString(),contractAgreementId:e.contractAgreementId,state:Nr(e.state)}}function Ka(e){let t=!0;return t=t&&"contractOfferId"in e,t=t&&"policy"in e,t}function Fn(e){return Un(e)}function Un(e,t){return e==null?e:{contractOfferId:e.contractOfferId,policy:ge(e.policy)}}function En(e){if(e!==void 0)return e===null?null:{contractOfferId:e.contractOfferId,policy:he(e.policy)}}function Wa(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 Qe(e){return kn(e)}function kn(e,t){return e==null?e:{endpoint:e.endpoint,participantId:e.participantId,asset:j(e.asset),contractOffers:e.contractOffers.map(Fn)}}function Ya(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,participantId:e.participantId,asset:pe(e.asset),contractOffers:e.contractOffers.map(En)}}class qn extends G{async connectorLimitsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/connector-limits",method:"GET",headers:n,query:r},t);return new v(i,a=>Dt(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 J("blobId","Required parameter requestParameters.blobId was null or undefined when calling fileUploadCreateAsset.");if(t.uiAssetCreateRequest===null||t.uiAssetCreateRequest===void 0)throw new J("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:ze(t.uiAssetCreateRequest)},r);return new it(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 v(i):new at(i)}async fileUploadRequestSasToken(t){return await(await this.fileUploadRequestSasTokenRaw(t)).value()}}class Ln extends G{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:ze(t.uiAssetCreateRequest)},r);return new v(a,s=>D(s))}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:hr(t.contractDefinitionRequest)},r);return new v(a,s=>D(s))}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:on(t.policyDefinitionCreateRequest)},r);return new v(a,s=>D(s))}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 J("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 v(a,s=>D(s))}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 J("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 v(a,s=>D(s))}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 J("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 v(a,s=>D(s))}async deletePolicyDefinition(t,r){return await(await this.deletePolicyDefinitionRaw(t,r)).value()}async editAssetRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new J("assetId","Required parameter requestParameters.assetId was null or undefined when calling editAsset.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"PUT",headers:i,query:n,body:bn(t.uiAssetEditRequest)},r);return new v(a,s=>D(s))}async editAsset(t,r){return await(await this.editAssetRaw(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 v(i,a=>dt(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 v(a,s=>s.map(Qe))}async getCatalogPageDataOffers(t={},r){return await(await this.getCatalogPageDataOffersRaw(t,r)).value()}async getContractAgreementPageRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page",method:"POST",headers:i,query:n,body:tr(t.contractAgreementPageQuery)},r);return new v(a,s=>Xt(s))}async getContractAgreementPage(t={},r){return await(await this.getContractAgreementPageRaw(t,r)).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 v(i,a=>mr(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 J("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 v(a,s=>Be(s))}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 v(i,a=>Fr(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 v(i,a=>un(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 v(i,a=>Sn(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 J("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 v(a,s=>j(s))}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:Sr(t.contractNegotiationRequest)},r);return new v(a,s=>Be(s))}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:Hr(t.initiateCustomTransferRequest)},r);return new v(a,s=>D(s))}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:$r(t.initiateTransferRequest)},r);return new v(a,s=>D(s))}async initiateTransfer(t={},r){return await(await this.initiateTransferRaw(t,r)).value()}async terminateContractAgreementRaw(t,r){if(t.contractAgreementId===null||t.contractAgreementId===void 0)throw new J("contractAgreementId","Required parameter requestParameters.contractAgreementId was null or undefined when calling terminateContractAgreement.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/content-agreement-page/{contractAgreementId}/terminate".replace("{contractAgreementId}",encodeURIComponent(String(t.contractAgreementId))),method:"POST",headers:i,query:n,body:wr(t.contractTerminationRequest)},r);return new v(a,s=>D(s))}async terminateContractAgreement(t,r){return await(await this.terminateContractAgreementRaw(t,r)).value()}}class Mn extends G{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:en(t.policyCreateRequest)},r);return new v(a,s=>D(s))}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 v(i,a=>Gr(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 v(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 J("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:_t(t.catalogQuery)},r);return new v(a,s=>s.map(Qe))}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 s of i)a[s]=s;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),s={};for(const d of a)s[d]=i[d];return e.objectValues(s)},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 s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(const s of i)if(a(s))return s},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(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var Ge;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ge||(Ge={}));const f=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=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"]),Xa=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 s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let d=n,p=0;for(;p<s.path.length;){const l=s.path[p];p===s.path.length-1?(d[l]=d[l]||{_errors:[]},d[l]._errors.push(r(s))):d[l]=d[l]||{_errors:[]},d=d[l],p++}}};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 Zn=ee;function ja(e){Zn=e}function ye(){return Zn}const Se=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};let d="";const p=n.filter(l=>!!l).slice().reverse();for(const l of p)d=l(s,{data:t,defaultError:d}).message;return{...i,path:a,message:i.message||d}},eo=[];function m(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 P{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 P.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return y;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}}const y=Object.freeze({status:"aborted"}),xn=e=>({status:"dirty",value:e}),w=e=>({status:"valid",value:e}),Ke=e=>e.status==="aborted",We=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 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 Hn=(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:(s,d)=>s.code!=="invalid_type"?{message:d.defaultError}:typeof d.data>"u"?{message:n??d.defaultError}:{message:r??d.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 Z(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new P,ctx:{common:t.parent.common,data:t.data,parsedType:Z(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:Z(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Hn(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:Z(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Te(i)?i:Promise.resolve(i));return Hn(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 s=t(i),d=()=>a.addIssue({code:u.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(p=>p?!0:(d(),!1)):s?!0:(d(),!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 F({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 Q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return X.create(this,this._def)}or(t){return ae.create([this,t],this._def)}and(t){return oe.create(this,t,this._def)}transform(t){return new F({...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 $n({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 De.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const to=/^c[^\s-]{8,}$/i,ro=/^[a-z][a-z0-9]*$/,no=/^[0-9A-HJKMNP-TV-Z]{26}$/,io=/^[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,ao=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ye;const so=/^(((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}))$/,co=/^(([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})))$/,uo=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 lo(e,t){return!!((t==="v4"||!t)&&so.test(e)||(t==="v6"||!t)&&co.test(e))}class b extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==f.string){const a=this._getOrReturnCtx(t);return m(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new P;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),m(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),m(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 s=t.data.length>a.value,d=t.data.length<a.value;(s||d)&&(i=this._getOrReturnCtx(t,i),s?m(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&m(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")ao.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"email",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ye||(Ye=new RegExp(oo,"u")),Ye.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"emoji",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")io.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"uuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")to.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"cuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")ro.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"cuid2",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")no.test(t.data)||(i=this._getOrReturnCtx(t,i),m(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),m(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),m(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),m(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),m(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),m(i,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?uo(a).test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?lo(t.data,a.version)||(i=this._getOrReturnCtx(t,i),m(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 b({...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 b({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new b({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new b({...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}}b.create=e=>{var t;return new b({checks:[],typeName:h.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};function fo(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(".","")),s=parseInt(t.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}class x 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 m(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const i=new P;for(const a of this._def.checks)a.kind==="int"?C.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),m(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),m(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),m(n,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?fo(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),m(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),m(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 x({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new x({...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)}}x.create=e=>new x({checks:[],typeName:h.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class H 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 m(a,{code:u.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const i=new P;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),m(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),m(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),m(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 H({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new H({...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}}H.create=e=>{var t;return new H({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 m(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 $ 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 m(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return m(a,{code:u.invalid_date}),y}const n=new P;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),m(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),m(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 $({...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}}$.create=e=>new $({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:h.ZodDate,...S(e)});class Oe extends T{_parse(t){if(this._getType(t)!==f.symbol){const n=this._getOrReturnCtx(t);return m(n,{code:u.invalid_type,expected:f.symbol,received:n.parsedType}),y}return w(t.data)}}Oe.create=e=>new Oe({typeName:h.ZodSymbol,...S(e)});class ne extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return m(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 m(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 L extends T{_parse(t){const r=this._getOrReturnCtx(t);return m(r,{code:u.invalid_type,expected:f.never,received:r.parsedType}),y}}L.create=e=>new L({typeName:h.ZodNever,...S(e)});class Ce extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return m(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 R extends T{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==f.array)return m(r,{code:u.invalid_type,expected:f.array,received:r.parsedType}),y;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(s||d)&&(m(r,{code:s?u.too_big:u.too_small,minimum:d?i.exactLength.value:void 0,maximum:s?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&&(m(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&&(m(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((s,d)=>i.type._parseAsync(new U(r,s,r.path,d)))).then(s=>P.mergeArray(n,s));const a=[...r.data].map((s,d)=>i.type._parseSync(new U(r,s,r.path,d)));return P.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new R({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new R({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new R({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}}R.create=(e,t)=>new R({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]=M.create(W(n))}return new N({...e._def,shape:()=>t})}else return e instanceof R?new R({...e._def,type:W(e.element)}):e instanceof M?M.create(W(e.unwrap())):e instanceof Q?Q.create(W(e.unwrap())):e instanceof E?E.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 m(l,{code:u.invalid_type,expected:f.object,received:l.parsedType}),y}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),d=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||d.push(l);const p=[];for(const l of s){const O=a[l],I=i.data[l];p.push({key:{status:"valid",value:l},value:O._parse(new U(i,I,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof L){const l=this._def.unknownKeys;if(l==="passthrough")for(const O of d)p.push({key:{status:"valid",value:O},value:{status:"valid",value:i.data[O]}});else if(l==="strict")d.length>0&&(m(i,{code:u.unrecognized_keys,keys:d}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const O of d){const I=i.data[O];p.push({key:{status:"valid",value:O},value:l._parse(new U(i,I,i.path,O)),alwaysSet:O in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const O of p){const I=await O.key;l.push({key:I,value:await O.value,alwaysSet:O.alwaysSet})}return l}).then(l=>P.mergeObjectSync(n,l)):P.mergeObjectSync(n,p)}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,s,d;const p=(s=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(d=g.errToObj(t).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}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 M;)a=a._def.innerType;r[n]=a}}),new N({...this._def,shape:()=>r})}keyof(){return Vn(C.objectKeys(this.shape))}}N.create=(e,t)=>new N({shape:()=>e,unknownKeys:"strip",catchall:L.create(),typeName:h.ZodObject,...S(t)}),N.strictCreate=(e,t)=>new N({shape:()=>e,unknownKeys:"strict",catchall:L.create(),typeName:h.ZodObject,...S(t)}),N.lazycreate=(e,t)=>new N({shape:e,unknownKeys:"strip",catchall:L.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 d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const s=a.map(d=>new A(d.ctx.common.issues));return m(r,{code:u.invalid_union,unionErrors:s}),y}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const p of n){const l={...r,common:{...r.common,issues:[]},parent:null},O=p._parseSync({data:r.data,path:r.path,parent:l});if(O.status==="valid")return O;O.status==="dirty"&&!a&&(a={result:O,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const d=s.map(p=>new A(p));return m(r,{code:u.invalid_union,unionErrors:d}),y}}get options(){return this._def.options}}ae.create=(e,t)=>new ae({options:e,typeName:h.ZodUnion,...S(t)});const ve=e=>e instanceof ce?ve(e.schema):e instanceof F?ve(e.innerType()):e instanceof de?[e.value]:e instanceof V?e.options:e instanceof ue?Object.keys(e.enum):e instanceof le?ve(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 m(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}):(m(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 s=ve(a.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of s){if(i.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);i.set(d,a)}}return new Ne({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...S(n)})}}function Xe(e,t){const r=Z(e),n=Z(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(d=>i.indexOf(d)!==-1),s={...e,...t};for(const d of a){const p=Xe(e[d],t[d]);if(!p.valid)return{valid:!1};s[d]=p.data}return{valid:!0,data:s}}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 s=e[a],d=t[a],p=Xe(s,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===f.date&&n===f.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class oe extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{if(Ke(a)||Ke(s))return y;const d=Xe(a.value,s.value);return d.valid?((We(a)||We(s))&&r.dirty(),{status:r.value,value:d.data}):(m(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,s])=>i(a,s)):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}))}}oe.create=(e,t,r)=>new oe({left:e,right:t,typeName:h.ZodIntersection,...S(r)});class E extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.array)return m(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return m(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&&(m(n,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new U(n,s,n.path,d)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>P.mergeArray(r,s)):P.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new E({...this._def,rest:t})}}E.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:e,typeName:h.ZodTuple,rest:null,...S(t)})};class se 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 m(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),y;const i=[],a=this._def.keyType,s=this._def.valueType;for(const d in n.data)i.push({key:a._parse(new U(n,d,n.path,d)),value:s._parse(new U(n,n.data[d],n.path,d))});return n.common.async?P.mergeObjectAsync(r,i):P.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new se({keyType:t,valueType:r,typeName:h.ZodRecord,...S(n)}):new se({keyType:b.create(),valueType:t,typeName:h.ZodRecord,...S(r)})}}class Pe 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 m(n,{code:u.invalid_type,expected:f.map,received:n.parsedType}),y;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([d,p],l)=>({key:i._parse(new U(n,d,n.path,[l,"key"])),value:a._parse(new U(n,p,n.path,[l,"value"]))}));if(n.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of s){const l=await p.key,O=await p.value;if(l.status==="aborted"||O.status==="aborted")return y;(l.status==="dirty"||O.status==="dirty")&&r.dirty(),d.set(l.value,O.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const p of s){const l=p.key,O=p.value;if(l.status==="aborted"||O.status==="aborted")return y;(l.status==="dirty"||O.status==="dirty")&&r.dirty(),d.set(l.value,O.value)}return{status:r.value,value:d}}}}Pe.create=(e,t,r)=>new Pe({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 m(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&&(m(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&&(m(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 s(p){const l=new Set;for(const O of p){if(O.status==="aborted")return y;O.status==="dirty"&&r.dirty(),l.add(O.value)}return{status:r.value,value:l}}const d=[...n.data.values()].map((p,l)=>a._parse(new U(n,p,n.path,l)));return n.common.async?Promise.all(d).then(p=>s(p)):s(d)}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 m(r,{code:u.invalid_type,expected:f.function,received:r.parsedType}),y;function n(d,p){return Se({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:p}})}function i(d,p){return Se({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ye(),ee].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:p}})}const a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof X){const d=this;return w(async function(...p){const l=new A([]),O=await d._def.args.parseAsync(p,a).catch(je=>{throw l.addIssue(n(p,je)),l}),I=await Reflect.apply(s,this,O);return await d._def.returns._def.type.parseAsync(I,a).catch(je=>{throw l.addIssue(i(I,je)),l})})}else{const d=this;return w(function(...p){const l=d._def.args.safeParse(p,a);if(!l.success)throw new A([n(p,l.error)]);const O=Reflect.apply(s,this,l.data),I=d._def.returns.safeParse(O,a);if(!I.success)throw new A([i(O,I.error)]);return I.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Y({...this._def,args:E.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||E.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 m(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 Vn(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 m(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 m(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=Vn;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 m(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 m(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 m(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 F 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:s=>{m(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(s).then(d=>this._def.schema._parseAsync({data:d,path:n.path,parent:n})):this._def.schema._parseSync({data:s,path:n.path,parent:n})}if(i.type==="refinement"){const s=d=>{const p=i.refinement(d,a);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(n.common.async===!1){const d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return d.status==="aborted"?y:(d.status==="dirty"&&r.dirty(),s(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>d.status==="aborted"?y:(d.status==="dirty"&&r.dirty(),s(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!te(s))return s;const d=i.transform(s.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>te(s)?Promise.resolve(i.transform(s.value,a)).then(d=>({status:r.value,value:d})):s);C.assertNever(i)}}F.create=(e,t,r)=>new F({schema:e,typeName:h.ZodEffects,effect:t,...S(r)}),F.createWithPreprocess=(e,t,r)=>new F({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...S(r)});class M extends T{_parse(t){return this._getType(t)===f.undefined?w(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 Q extends T{_parse(t){return this._getType(t)===f.null?w(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Q.create=(e,t)=>new Q({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 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}}we.create=(e,t)=>new we({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...S(t)});class _e extends T{_parse(t){if(this._getType(t)!==f.nan){const n=this._getOrReturnCtx(t);return m(n,{code:u.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:t.data}}}_e.create=e=>new _e({typeName:h.ZodNaN,...S(e)});const mo=Symbol("zod_brand");class $n 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(),xn(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 De extends T{_parse(t){const r=this._def.innerType._parse(t);return te(r)&&(r.value=Object.freeze(r.value)),r}}De.create=(e,t)=>new De({innerType:e,typeName:h.ZodReadonly,...S(t)});const zn=(e,t={},r)=>e?K.create().superRefine((n,i)=>{var a,s;if(!e(n)){const d=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,p=(s=(a=d.fatal)!==null&&a!==void 0?a:r)!==null&&s!==void 0?s:!0,l=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...l,fatal:p})}}):K.create(),po={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 go=(e,t={message:`Input not instance of ${e.name}`})=>zn(r=>r instanceof e,t),Bn=b.create,Qn=x.create,ho=_e.create,yo=H.create,Gn=re.create,So=$.create,To=Oe.create,Oo=ne.create,Co=ie.create,vo=K.create,No=z.create,Po=L.create,wo=Ce.create,_o=R.create,Do=N.create,Io=N.strictCreate,Jo=ae.create,Ao=Ne.create,bo=oe.create,Ro=E.create,Fo=se.create,Uo=Pe.create,Eo=B.create,ko=Y.create,qo=ce.create,Lo=de.create,Mo=V.create,Zo=ue.create,xo=X.create,Kn=F.create,Ho=M.create,Vo=Q.create,$o=F.createWithPreprocess,zo=fe.create;var me=Object.freeze({__proto__:null,defaultErrorMap:ee,setErrorMap:ja,getErrorMap:ye,makeIssue:Se,EMPTY_PATH:eo,addIssueToContext:m,ParseStatus:P,INVALID:y,DIRTY:xn,OK:w,isAborted:Ke,isDirty:We,isValid:te,isAsync:Te,get util(){return C},get objectUtil(){return Ge},ZodParsedType:f,getParsedType:Z,ZodType:T,ZodString:b,ZodNumber:x,ZodBigInt:H,ZodBoolean:re,ZodDate:$,ZodSymbol:Oe,ZodUndefined:ne,ZodNull:ie,ZodAny:K,ZodUnknown:z,ZodNever:L,ZodVoid:Ce,ZodArray:R,ZodObject:N,ZodUnion:ae,ZodDiscriminatedUnion:Ne,ZodIntersection:oe,ZodTuple:E,ZodRecord:se,ZodMap:Pe,ZodSet:B,ZodFunction:Y,ZodLazy:ce,ZodLiteral:de,ZodEnum:V,ZodNativeEnum:ue,ZodPromise:X,ZodEffects:F,ZodTransformer:F,ZodOptional:M,ZodNullable:Q,ZodDefault:le,ZodCatch:we,ZodNaN:_e,BRAND:mo,ZodBranded:$n,ZodPipeline:fe,ZodReadonly:De,custom:zn,Schema:T,ZodSchema:T,late:po,get ZodFirstPartyTypeKind(){return h},coerce:{string:e=>b.create({...e,coerce:!0}),number:e=>x.create({...e,coerce:!0}),boolean:e=>re.create({...e,coerce:!0}),bigint:e=>H.create({...e,coerce:!0}),date:e=>$.create({...e,coerce:!0})},any:vo,array:_o,bigint:yo,boolean:Gn,date:So,discriminatedUnion:Ao,effect:Kn,enum:Mo,function:ko,instanceof:go,intersection:bo,lazy:qo,literal:Lo,map:Uo,nan:ho,nativeEnum:Zo,never:Po,null:Co,nullable:Vo,number:Qn,object:Do,oboolean:()=>Gn().optional(),onumber:()=>Qn().optional(),optional:Ho,ostring:()=>Bn().optional(),pipeline:zo,preprocess:$o,promise:xo,record:Fo,set:Eo,strictObject:Io,string:Bn,symbol:To,transformer:Kn,tuple:Ro,undefined:Oo,union:Jo,unknown:No,void:wo,NEVER:y,ZodIssueCode:u,quotelessJson:Xa,ZodError:A});function Bo(e){return e===401||e===403}function Qo(e){return Object.entries(e).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&")}const Go=me.object({access_token:me.string().min(1),token_type:me.string(),expires_in:me.number(),scope:me.string()});async function Ko(e){let r=await(await fetch(e.tokenUrl,{method:"POST",body:Qo({grant_type:"client_credentials",client_id:e.clientId,client_secret:e.clientSecret}),headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json();return Wo(r)}function Wo(e){const t=Go.safeParse(e);if(!t.success)throw new Error("Bad access token response");return t.data}class Yo{constructor(t){k(this,"activeRequest",null);k(this,"refreshTimeout");k(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=Ko(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 Wn(e,t){e.headers=Xo("Authorization",`Bearer ${t}`,e.headers)}function Xo(e,t,r){return r?Array.isArray(r)?r.map(([n,i])=>n!==e?[n,i]:[e,t]):jo(r)?(r.has(e)?r.set(e,t):r.append(e,t),r):(r[e]=t,r):(r={},r[e]=t,r)}function jo(e){return"append"in e&&"delete"in e&&"get"in e&&"has"in e&&"set"in e&&"forEach"in e}function es(e){const t=new Yo(e);return{pre:async r=>{const n=await t.getAccessToken();return Wn(r.init,n),Promise.resolve({url:r.url,init:r.init})},post:async r=>{if(Bo(r.response.status)){const n=await t.refreshAccessToken();return Wn(r.init,n),await fetch(r.url,r.init)}return Promise.resolve(r.response)}}}function ts(e){let t=[],r={};e.clientCredentials&&t.push(es(e.clientCredentials)),e.managementApiKey&&(r=rs(e.managementApiKey));const n=new q({basePath:e.managementApiUrl,headers:r,credentials:"same-origin",middleware:t,...e.configOverrides});return{uiApi:new Ln(n),useCaseApi:new Mn(n),enterpriseEditionApi:new qn(n)}}function rs(e){return{"X-Api-Key":e}}o.AssetPageFromJSON=dt,o.AssetPageFromJSONTyped=ut,o.AssetPageToJSON=si,o.AtomicConstraintDtoFromJSON=ft,o.AtomicConstraintDtoFromJSONTyped=mt,o.AtomicConstraintDtoToJSON=pt,o.BASE_PATH=_,o.BaseAPI=G,o.BlobApiResponse=ri,o.COLLECTION_FORMATS=jn,o.CatalogFilterExpressionFromJSON=vt,o.CatalogFilterExpressionFromJSONTyped=Nt,o.CatalogFilterExpressionLiteralFromJSON=yt,o.CatalogFilterExpressionLiteralFromJSONTyped=St,o.CatalogFilterExpressionLiteralToJSON=Tt,o.CatalogFilterExpressionLiteralType=li,o.CatalogFilterExpressionLiteralTypeFromJSON=gt,o.CatalogFilterExpressionLiteralTypeFromJSONTyped=ht,o.CatalogFilterExpressionLiteralTypeToJSON=fi,o.CatalogFilterExpressionOperator=pi,o.CatalogFilterExpressionOperatorFromJSON=Ot,o.CatalogFilterExpressionOperatorFromJSONTyped=Ct,o.CatalogFilterExpressionOperatorToJSON=gi,o.CatalogFilterExpressionToJSON=Pt,o.CatalogQueryFromJSON=Si,o.CatalogQueryFromJSONTyped=wt,o.CatalogQueryToJSON=_t,o.Configuration=q,o.ConnectorLimitsFromJSON=Dt,o.ConnectorLimitsFromJSONTyped=It,o.ConnectorLimitsToJSON=Oi,o.ContractAgreementCardFromJSON=Kt,o.ContractAgreementCardFromJSONTyped=Wt,o.ContractAgreementCardToJSON=Yt,o.ContractAgreementDirection=Ci,o.ContractAgreementDirectionFromJSON=be,o.ContractAgreementDirectionFromJSONTyped=Jt,o.ContractAgreementDirectionToJSON=vi,o.ContractAgreementPageFromJSON=Xt,o.ContractAgreementPageFromJSONTyped=jt,o.ContractAgreementPageQueryFromJSON=xi,o.ContractAgreementPageQueryFromJSONTyped=er,o.ContractAgreementPageQueryToJSON=tr,o.ContractAgreementPageToJSON=Mi,o.ContractAgreementTerminationInfoFromJSON=Rt,o.ContractAgreementTerminationInfoFromJSONTyped=Ft,o.ContractAgreementTerminationInfoToJSON=Ut,o.ContractAgreementTransferProcessFromJSON=Lt,o.ContractAgreementTransferProcessFromJSONTyped=Mt,o.ContractAgreementTransferProcessToJSON=Zt,o.ContractDefinitionEntryFromJSON=ur,o.ContractDefinitionEntryFromJSONTyped=lr,o.ContractDefinitionEntryToJSON=fr,o.ContractDefinitionPageFromJSON=mr,o.ContractDefinitionPageFromJSONTyped=pr,o.ContractDefinitionPageToJSON=Wi,o.ContractDefinitionRequestFromJSON=Xi,o.ContractDefinitionRequestFromJSONTyped=gr,o.ContractDefinitionRequestToJSON=hr,o.ContractNegotiationRequestFromJSON=ea,o.ContractNegotiationRequestFromJSONTyped=yr,o.ContractNegotiationRequestToJSON=Sr,o.ContractNegotiationSimplifiedState=ta,o.ContractNegotiationSimplifiedStateFromJSON=Tr,o.ContractNegotiationSimplifiedStateFromJSONTyped=Or,o.ContractNegotiationSimplifiedStateToJSON=ra,o.ContractNegotiationStateFromJSON=Cr,o.ContractNegotiationStateFromJSONTyped=vr,o.ContractNegotiationStateToJSON=Nr,o.ContractTerminatedBy=Ni,o.ContractTerminatedByFromJSON=At,o.ContractTerminatedByFromJSONTyped=bt,o.ContractTerminatedByToJSON=Pi,o.ContractTerminationRequestFromJSON=aa,o.ContractTerminationRequestFromJSONTyped=Pr,o.ContractTerminationRequestToJSON=wr,o.ContractTerminationStatus=Ai,o.ContractTerminationStatusFromJSON=Ue,o.ContractTerminationStatusFromJSONTyped=xt,o.ContractTerminationStatusToJSON=bi,o.DashboardDapsConfigFromJSON=_r,o.DashboardDapsConfigFromJSONTyped=Dr,o.DashboardDapsConfigToJSON=Ir,o.DashboardMiwConfigFromJSON=Jr,o.DashboardMiwConfigFromJSONTyped=Ar,o.DashboardMiwConfigToJSON=br,o.DashboardPageFromJSON=Fr,o.DashboardPageFromJSONTyped=Ur,o.DashboardPageToJSON=ua,o.DashboardTransferAmountsFromJSON=Me,o.DashboardTransferAmountsFromJSONTyped=Rr,o.DashboardTransferAmountsToJSON=Ze,o.DataSourceAvailability=ni,o.DataSourceAvailabilityFromJSON=ot,o.DataSourceAvailabilityFromJSONTyped=st,o.DataSourceAvailabilityToJSON=ii,o.DataSourceType=la,o.DataSourceTypeFromJSON=Er,o.DataSourceTypeFromJSONTyped=kr,o.DataSourceTypeToJSON=fa,o.DefaultConfig=et,o.EnterpriseEditionApi=qn,o.ExpressionFromJSON=xe,o.ExpressionFromJSONTyped=Mr,o.ExpressionToJSON=He,o.ExpressionType=ma,o.ExpressionTypeFromJSON=qr,o.ExpressionTypeFromJSONTyped=Lr,o.ExpressionTypeToJSON=pa,o.FetchError=rt,o.IdResponseDtoFromJSON=D,o.IdResponseDtoFromJSONTyped=Zr,o.IdResponseDtoToJSON=ya,o.InitiateCustomTransferRequestFromJSON=Ta,o.InitiateCustomTransferRequestFromJSONTyped=xr,o.InitiateCustomTransferRequestToJSON=Hr,o.InitiateTransferRequestFromJSON=Ca,o.InitiateTransferRequestFromJSONTyped=Vr,o.InitiateTransferRequestToJSON=$r,o.JSONApiResponse=v,o.KpiResultFromJSON=Gr,o.KpiResultFromJSONTyped=Kr,o.KpiResultToJSON=Pa,o.OperatorDto=ci,o.OperatorDtoFromJSON=Ae,o.OperatorDtoFromJSONTyped=lt,o.OperatorDtoToJSON=di,o.PermissionDtoFromJSON=Wr,o.PermissionDtoFromJSONTyped=Yr,o.PermissionDtoToJSON=Xr,o.PolicyCreateRequestFromJSON=Da,o.PolicyCreateRequestFromJSONTyped=jr,o.PolicyCreateRequestToJSON=en,o.PolicyDefinitionCreateRequestFromJSON=Aa,o.PolicyDefinitionCreateRequestFromJSONTyped=an,o.PolicyDefinitionCreateRequestToJSON=on,o.PolicyDefinitionDtoFromJSON=sn,o.PolicyDefinitionDtoFromJSONTyped=cn,o.PolicyDefinitionDtoToJSON=dn,o.PolicyDefinitionPageFromJSON=un,o.PolicyDefinitionPageFromJSONTyped=ln,o.PolicyDefinitionPageToJSON=Fa,o.RequiredError=J,o.ResponseError=tt,o.SecretValueFromJSON=fn,o.SecretValueFromJSONTyped=mn,o.SecretValueToJSON=pn,o.TextApiResponse=at,o.TransferHistoryEntryFromJSON=gn,o.TransferHistoryEntryFromJSONTyped=hn,o.TransferHistoryEntryToJSON=yn,o.TransferHistoryPageFromJSON=Sn,o.TransferHistoryPageFromJSONTyped=Tn,o.TransferHistoryPageToJSON=qa,o.TransferProcessSimplifiedState=_i,o.TransferProcessSimplifiedStateFromJSON=Et,o.TransferProcessSimplifiedStateFromJSONTyped=kt,o.TransferProcessSimplifiedStateToJSON=Di,o.TransferProcessStateFromJSON=Re,o.TransferProcessStateFromJSONTyped=qt,o.TransferProcessStateToJSON=Fe,o.TransferProcessStatesDtoFromJSON=zr,o.TransferProcessStatesDtoFromJSONTyped=Br,o.TransferProcessStatesDtoToJSON=Qr,o.UIApi=Ln,o.UiAssetCreateRequestFromJSON=$a,o.UiAssetCreateRequestFromJSONTyped=Jn,o.UiAssetCreateRequestToJSON=ze,o.UiAssetEditRequestFromJSON=Ba,o.UiAssetEditRequestFromJSONTyped=An,o.UiAssetEditRequestToJSON=bn,o.UiAssetFromJSON=j,o.UiAssetFromJSONTyped=ct,o.UiAssetToJSON=pe,o.UiContractNegotiationFromJSON=Be,o.UiContractNegotiationFromJSONTyped=Rn,o.UiContractNegotiationToJSON=Ga,o.UiContractOfferFromJSON=Fn,o.UiContractOfferFromJSONTyped=Un,o.UiContractOfferToJSON=En,o.UiCriterionFromJSON=qe,o.UiCriterionFromJSONTyped=dr,o.UiCriterionLiteralFromJSON=ir,o.UiCriterionLiteralFromJSONTyped=ar,o.UiCriterionLiteralToJSON=or,o.UiCriterionLiteralType=Hi,o.UiCriterionLiteralTypeFromJSON=rr,o.UiCriterionLiteralTypeFromJSONTyped=nr,o.UiCriterionLiteralTypeToJSON=Vi,o.UiCriterionOperator=zi,o.UiCriterionOperatorFromJSON=sr,o.UiCriterionOperatorFromJSONTyped=cr,o.UiCriterionOperatorToJSON=Bi,o.UiCriterionToJSON=Le,o.UiDataOfferFromJSON=Qe,o.UiDataOfferFromJSONTyped=kn,o.UiDataOfferToJSON=Ya,o.UiDataSourceFromJSON=Ve,o.UiDataSourceFromJSONTyped=In,o.UiDataSourceHttpDataFromJSON=vn,o.UiDataSourceHttpDataFromJSONTyped=Nn,o.UiDataSourceHttpDataMethod=La,o.UiDataSourceHttpDataMethodFromJSON=On,o.UiDataSourceHttpDataMethodFromJSONTyped=Cn,o.UiDataSourceHttpDataMethodToJSON=Ma,o.UiDataSourceHttpDataToJSON=Pn,o.UiDataSourceOnRequestFromJSON=wn,o.UiDataSourceOnRequestFromJSONTyped=_n,o.UiDataSourceOnRequestToJSON=Dn,o.UiDataSourceToJSON=$e,o.UiPolicyConstraintFromJSON=Ee,o.UiPolicyConstraintFromJSONTyped=Qt,o.UiPolicyConstraintToJSON=ke,o.UiPolicyCreateRequestFromJSON=tn,o.UiPolicyCreateRequestFromJSONTyped=rn,o.UiPolicyCreateRequestToJSON=nn,o.UiPolicyFromJSON=ge,o.UiPolicyFromJSONTyped=Gt,o.UiPolicyLiteralFromJSON=$t,o.UiPolicyLiteralFromJSONTyped=zt,o.UiPolicyLiteralToJSON=Bt,o.UiPolicyLiteralType=Ri,o.UiPolicyLiteralTypeFromJSON=Ht,o.UiPolicyLiteralTypeFromJSONTyped=Vt,o.UiPolicyLiteralTypeToJSON=Fi,o.UiPolicyToJSON=he,o.UseCaseApi=Mn,o.VoidApiResponse=it,o.buildEdcClient=ts,o.canConsumeForm=ti,o.exists=c,o.instanceOfAssetPage=oi,o.instanceOfAtomicConstraintDto=ui,o.instanceOfCatalogFilterExpression=hi,o.instanceOfCatalogFilterExpressionLiteral=mi,o.instanceOfCatalogQuery=yi,o.instanceOfConnectorLimits=Ti,o.instanceOfContractAgreementCard=qi,o.instanceOfContractAgreementPage=Li,o.instanceOfContractAgreementPageQuery=Zi,o.instanceOfContractAgreementTerminationInfo=wi,o.instanceOfContractAgreementTransferProcess=Ji,o.instanceOfContractDefinitionEntry=Gi,o.instanceOfContractDefinitionPage=Ki,o.instanceOfContractDefinitionRequest=Yi,o.instanceOfContractNegotiationRequest=ji,o.instanceOfContractNegotiationState=na,o.instanceOfContractTerminationRequest=ia,o.instanceOfDashboardDapsConfig=oa,o.instanceOfDashboardMiwConfig=sa,o.instanceOfDashboardPage=da,o.instanceOfDashboardTransferAmounts=ca,o.instanceOfExpression=ga,o.instanceOfIdResponseDto=ha,o.instanceOfInitiateCustomTransferRequest=Sa,o.instanceOfInitiateTransferRequest=Oa,o.instanceOfKpiResult=Na,o.instanceOfPermissionDto=wa,o.instanceOfPolicyCreateRequest=_a,o.instanceOfPolicyDefinitionCreateRequest=Ja,o.instanceOfPolicyDefinitionDto=ba,o.instanceOfPolicyDefinitionPage=Ra,o.instanceOfSecretValue=Ua,o.instanceOfTransferHistoryEntry=Ea,o.instanceOfTransferHistoryPage=ka,o.instanceOfTransferProcessState=Ii,o.instanceOfTransferProcessStatesDto=va,o.instanceOfUiAsset=ai,o.instanceOfUiAssetCreateRequest=Va,o.instanceOfUiAssetEditRequest=za,o.instanceOfUiContractNegotiation=Qa,o.instanceOfUiContractOffer=Ka,o.instanceOfUiCriterion=Qi,o.instanceOfUiCriterionLiteral=$i,o.instanceOfUiDataOffer=Wa,o.instanceOfUiDataSource=Ha,o.instanceOfUiDataSourceHttpData=Za,o.instanceOfUiDataSourceOnRequest=xa,o.instanceOfUiPolicy=ki,o.instanceOfUiPolicyConstraint=Ei,o.instanceOfUiPolicyCreateRequest=Ia,o.instanceOfUiPolicyLiteral=Ui,o.mapValues=ei,o.querystring=Je,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(o=typeof globalThis<"u"?globalThis:o||self,_(o["sovity-edc-client"]={}))})(this,function(o){"use strict";var jo=Object.defineProperty;var es=(o,_,q)=>_ in o?jo(o,_,{enumerable:!0,configurable:!0,writable:!0,value:q}):o[_]=q;var k=(o,_,q)=>(es(o,typeof _!="symbol"?_+"":_,q),q);const _="https://my-connector/api/management".replace(/\/+$/,"");class q{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:_}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||Re}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 et=new q,be=class be{constructor(t=et){k(this,"middleware");k(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 s of this.middleware)s.onError&&(i=await s.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 rt(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?be.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 tt(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,s={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},d={...s,...await a({init:s,context:t})},p={...d,body:Gn(d.body)||d.body instanceof URLSearchParams||Qn(d.body)?d.body:JSON.stringify(d.body)};return{url:n,init:p}}clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}};k(be,"jsonRegex",new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"));let G=be;function Qn(e){return typeof Blob<"u"&&e instanceof Blob}function Gn(e){return typeof FormData<"u"&&e instanceof FormData}class tt extends Error{constructor(r,n){super(n);k(this,"name","ResponseError");this.response=r}}class rt extends Error{constructor(r,n){super(n);k(this,"name","FetchError");this.cause=r}}class I extends Error{constructor(r,n){super(n);k(this,"name","RequiredError");this.field=r}}const Kn={csv:",",ssv:" ",tsv:" ",pipes:"|"};function c(e,t){const r=e[t];return r!=null}function Re(e,t=""){return Object.keys(e).map(r=>nt(r,e[r],t)).filter(r=>r.length>0).join("&")}function nt(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 nt(e,i,r)}return t instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?Re(t,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`}function Wn(e,t){return Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n])}),{})}function Yn(e){for(const t of e)if(t.contentType==="multipart/form-data")return!0;return!1}class C{constructor(t,r=n=>n){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class it{constructor(t){this.raw=t}async value(){}}class Xn{constructor(t){this.raw=t}async value(){return await this.raw.blob()}}class at{constructor(t){this.raw=t}async value(){return await this.raw.text()}}const jn={Live:"LIVE",OnRequest:"ON_REQUEST"};function ot(e){return st(e)}function st(e,t){return e}function ei(e){return e}function ti(e){let t=!0;return t=t&&"dataSourceAvailability"in e,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 ct(e)}function ct(e,t){return e==null?e:{dataSourceAvailability:ot(e.dataSourceAvailability),assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,onRequestContactEmail:c(e,"onRequestContactEmail")?e.onRequestContactEmail:void 0,onRequestContactEmailSubject:c(e,"onRequestContactEmailSubject")?e.onRequestContactEmailSubject:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,descriptionShortText:c(e,"descriptionShortText")?e.descriptionShortText:void 0,isOwnConnector:e.isOwnConnector,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,httpDatasourceHintsProxyMethod:c(e,"httpDatasourceHintsProxyMethod")?e.httpDatasourceHintsProxyMethod:void 0,httpDatasourceHintsProxyPath:c(e,"httpDatasourceHintsProxyPath")?e.httpDatasourceHintsProxyPath:void 0,httpDatasourceHintsProxyQueryParams:c(e,"httpDatasourceHintsProxyQueryParams")?e.httpDatasourceHintsProxyQueryParams:void 0,httpDatasourceHintsProxyBody:c(e,"httpDatasourceHintsProxyBody")?e.httpDatasourceHintsProxyBody:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,assetJsonLd:c(e,"assetJsonLd")?e.assetJsonLd:void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function pe(e){if(e!==void 0)return e===null?null:{dataSourceAvailability:e.dataSourceAvailability,assetId:e.assetId,connectorEndpoint:e.connectorEndpoint,participantId:e.participantId,title:e.title,creatorOrganizationName:e.creatorOrganizationName,onRequestContactEmail:e.onRequestContactEmail,onRequestContactEmailSubject:e.onRequestContactEmailSubject,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 ri(e){let t=!0;return t=t&&"assets"in e,t}function dt(e){return ut(e)}function ut(e,t){return e==null?e:{assets:e.assets.map(j)}}function ni(e){if(e!==void 0)return e===null?null:{assets:e.assets.map(pe)}}const ii={Value:"VALUE",ValueList:"VALUE_LIST"};function lt(e){return ft(e)}function ft(e,t){return e}function ai(e){return e}function oi(e){return!0}function mt(e){return pt(e)}function pt(e,t){return e==null?e:{type:c(e,"type")?lt(e.type):void 0,value:c(e,"value")?e.value:void 0,valueList:c(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 si={Like:"LIKE",Eq:"EQ",In:"IN"};function ht(e){return yt(e)}function yt(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 St(e){return Tt(e)}function Tt(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:ht(e.operator),operandRight:mt(e.operandRight)}}function Ot(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&&"connectorEndpoint"in e,t}function li(e){return vt(e)}function vt(e,t){return e==null?e:{connectorEndpoint:e.connectorEndpoint,limit:c(e,"limit")?e.limit:void 0,offset:c(e,"offset")?e.offset:void 0,filterExpressions:c(e,"filterExpressions")?e.filterExpressions.map(St):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(Ot)}}function fi(e){let t=!0;return t=t&&"numActiveConsumingContractAgreements"in e,t}function Nt(e){return Pt(e)}function Pt(e,t){return e==null?e:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:c(e,"maxActiveConsumingContractAgreements")?e.maxActiveConsumingContractAgreements:void 0}}function mi(e){if(e!==void 0)return e===null?null:{numActiveConsumingContractAgreements:e.numActiveConsumingContractAgreements,maxActiveConsumingContractAgreements:e.maxActiveConsumingContractAgreements}}const pi={Consuming:"CONSUMING",Providing:"PROVIDING"};function Ue(e){return wt(e)}function wt(e,t){return e}function gi(e){return e}const hi={Self:"SELF",Counterparty:"COUNTERPARTY"};function _t(e){return It(e)}function It(e,t){return e}function yi(e){return e}function Si(e){let t=!0;return t=t&&"terminatedAt"in e,t=t&&"reason"in e,t=t&&"detail"in e,t=t&&"terminatedBy"in e,t}function Dt(e){return Jt(e)}function Jt(e,t){return e==null?e:{terminatedAt:new Date(e.terminatedAt),reason:e.reason,detail:e.detail,terminatedBy:_t(e.terminatedBy)}}function At(e){if(e!==void 0)return e===null?null:{terminatedAt:e.terminatedAt.toISOString(),reason:e.reason,detail:e.detail,terminatedBy:e.terminatedBy}}const Ti={Running:"RUNNING",Ok:"OK",Error:"ERROR"};function bt(e){return Rt(e)}function Rt(e,t){return e}function Oi(e){return e}function vi(e){let t=!0;return t=t&&"name"in e,t=t&&"code"in e,t=t&&"simplifiedState"in e,t}function Fe(e){return Ut(e)}function Ut(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:bt(e.simplifiedState)}}function Ee(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function Ci(e){let t=!0;return t=t&&"transferProcessId"in e,t=t&&"lastUpdatedDate"in e,t=t&&"state"in e,t}function Ft(e){return Et(e)}function Et(e,t){return e==null?e:{transferProcessId:e.transferProcessId,lastUpdatedDate:new Date(e.lastUpdatedDate),state:Fe(e.state),errorMessage:c(e,"errorMessage")?e.errorMessage:void 0}}function kt(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Ee(e.state),errorMessage:e.errorMessage}}const Ni={Ongoing:"ONGOING",Terminated:"TERMINATED"};function ke(e){return qt(e)}function qt(e,t){return e}function Pi(e){return e}const wi={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 Lt(e){return Mt(e)}function Mt(e,t){return e}function _i(e){return e}const Ii={String:"STRING",StringList:"STRING_LIST",Json:"JSON"};function Zt(e){return xt(e)}function xt(e,t){return e}function Di(e){return e}function Ji(e){let t=!0;return t=t&&"type"in e,t}function Ht(e){return Vt(e)}function Vt(e,t){return e==null?e:{type:Zt(e.type),value:c(e,"value")?e.value:void 0,valueList:c(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}}function Ai(e){let t=!0;return t=t&&"left"in e,t=t&&"operator"in e,t=t&&"right"in e,t}function qe(e){return zt(e)}function zt(e,t){return e==null?e:{left:e.left,operator:Lt(e.operator),right:Ht(e.right)}}function Le(e){if(e!==void 0)return e===null?null:{left:e.left,operator:e.operator,right:$t(e.right)}}const bi={Empty:"EMPTY",Constraint:"CONSTRAINT",And:"AND",Or:"OR",Xone:"XONE"};function Bt(e){return Qt(e)}function Qt(e,t){return e}function Ri(e){return e}function Ui(e){let t=!0;return t=t&&"type"in e,t}function ge(e){return Gt(e)}function Gt(e,t){return e==null?e:{type:Bt(e.type),expressions:c(e,"expressions")?e.expressions.map(ge):void 0,constraint:c(e,"constraint")?qe(e.constraint):void 0}}function he(e){if(e!==void 0)return e===null?null:{type:e.type,expressions:e.expressions===void 0?void 0:e.expressions.map(he),constraint:Le(e.constraint)}}function Fi(e){let t=!0;return t=t&&"policyJsonLd"in e,t=t&&"errors"in e,t}function ye(e){return Kt(e)}function Kt(e,t){return e==null?e:{policyJsonLd:e.policyJsonLd,expression:c(e,"expression")?ge(e.expression):void 0,errors:e.errors}}function Se(e){if(e!==void 0)return e===null?null:{policyJsonLd:e.policyJsonLd,expression:he(e.expression),errors:e.errors}}function Ei(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=t&&"terminationStatus"in e,t}function Wt(e){return Yt(e)}function Yt(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,contractNegotiationId:e.contractNegotiationId,direction:Ue(e.direction),counterPartyAddress:e.counterPartyAddress,counterPartyId:e.counterPartyId,contractSigningDate:new Date(e.contractSigningDate),asset:j(e.asset),contractPolicy:ye(e.contractPolicy),transferProcesses:e.transferProcesses.map(Ft),terminationStatus:ke(e.terminationStatus),terminationInformation:c(e,"terminationInformation")?Dt(e.terminationInformation):void 0}}function Xt(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:pe(e.asset),contractPolicy:Se(e.contractPolicy),transferProcesses:e.transferProcesses.map(kt),terminationStatus:e.terminationStatus,terminationInformation:At(e.terminationInformation)}}function ki(e){let t=!0;return t=t&&"contractAgreements"in e,t}function jt(e){return er(e)}function er(e,t){return e==null?e:{contractAgreements:e.contractAgreements.map(Wt)}}function qi(e){if(e!==void 0)return e===null?null:{contractAgreements:e.contractAgreements.map(Xt)}}function Li(e){return!0}function Mi(e){return tr(e)}function tr(e,t){return e==null?e:{terminationStatus:c(e,"terminationStatus")?ke(e.terminationStatus):void 0}}function rr(e){if(e!==void 0)return e===null?null:{terminationStatus:e.terminationStatus}}const Zi={Value:"VALUE",ValueList:"VALUE_LIST"};function nr(e){return ir(e)}function ir(e,t){return e}function xi(e){return e}function Hi(e){return!0}function ar(e){return or(e)}function or(e,t){return e==null?e:{type:c(e,"type")?nr(e.type):void 0,value:c(e,"value")?e.value:void 0,valueList:c(e,"valueList")?e.valueList:void 0}}function sr(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value,valueList:e.valueList}}const Vi={Eq:"EQ",In:"IN",Like:"LIKE"};function cr(e){return dr(e)}function dr(e,t){return e}function $i(e){return e}function zi(e){let t=!0;return t=t&&"operandLeft"in e,t=t&&"operator"in e,t=t&&"operandRight"in e,t}function Me(e){return ur(e)}function ur(e,t){return e==null?e:{operandLeft:e.operandLeft,operator:cr(e.operator),operandRight:ar(e.operandRight)}}function Ze(e){if(e!==void 0)return e===null?null:{operandLeft:e.operandLeft,operator:e.operator,operandRight:sr(e.operandRight)}}function Bi(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 lr(e){return fr(e)}function fr(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Me)}}function mr(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,accessPolicyId:e.accessPolicyId,contractPolicyId:e.contractPolicyId,assetSelector:e.assetSelector.map(Ze)}}function Qi(e){let t=!0;return t=t&&"contractDefinitions"in e,t}function pr(e){return gr(e)}function gr(e,t){return e==null?e:{contractDefinitions:e.contractDefinitions.map(lr)}}function Gi(e){if(e!==void 0)return e===null?null:{contractDefinitions:e.contractDefinitions.map(mr)}}function Ki(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 Wi(e){return hr(e)}function hr(e,t){return e==null?e:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Me)}}function yr(e){if(e!==void 0)return e===null?null:{contractDefinitionId:e.contractDefinitionId,contractPolicyId:e.contractPolicyId,accessPolicyId:e.accessPolicyId,assetSelector:e.assetSelector.map(Ze)}}function Yi(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 Xi(e){return Sr(e)}function Sr(e,t){return e==null?e:{counterPartyAddress:e.counterPartyAddress,counterPartyParticipantId:e.counterPartyParticipantId,contractOfferId:e.contractOfferId,policyJsonLd:e.policyJsonLd,assetId:e.assetId}}function Tr(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 ji={InProgress:"IN_PROGRESS",Agreed:"AGREED",Terminated:"TERMINATED"};function Or(e){return vr(e)}function vr(e,t){return e}function ea(e){return e}function ta(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 Nr(e)}function Nr(e,t){return e==null?e:{name:e.name,code:e.code,simplifiedState:Or(e.simplifiedState)}}function Pr(e){if(e!==void 0)return e===null?null:{name:e.name,code:e.code,simplifiedState:e.simplifiedState}}function ra(e){let t=!0;return t=t&&"detail"in e,t=t&&"reason"in e,t}function na(e){return wr(e)}function wr(e,t){return e==null?e:{detail:e.detail,reason:e.reason}}function _r(e){if(e!==void 0)return e===null?null:{detail:e.detail,reason:e.reason}}function ia(e){let t=!0;return t=t&&"tokenUrl"in e,t=t&&"jwksUrl"in e,t}function Ir(e){return Dr(e)}function Dr(e,t){return e==null?e:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function Jr(e){if(e!==void 0)return e===null?null:{tokenUrl:e.tokenUrl,jwksUrl:e.jwksUrl}}function aa(e){let t=!0;return t=t&&"url"in e,t=t&&"tokenUrl"in e,t=t&&"authorityId"in e,t}function Ar(e){return br(e)}function br(e,t){return e==null?e:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function Rr(e){if(e!==void 0)return e===null?null:{url:e.url,tokenUrl:e.tokenUrl,authorityId:e.authorityId}}function oa(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 xe(e){return Ur(e)}function Ur(e,t){return e==null?e:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function He(e){if(e!==void 0)return e===null?null:{numTotal:e.numTotal,numRunning:e.numRunning,numOk:e.numOk,numError:e.numError}}function sa(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 Fr(e){return Er(e)}function Er(e,t){return e==null?e:{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:c(e,"connectorDapsConfig")?Ir(e.connectorDapsConfig):void 0,connectorMiwConfig:c(e,"connectorMiwConfig")?Ar(e.connectorMiwConfig):void 0}}function ca(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:He(e.transferProcessesConsuming),transferProcessesProviding:He(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:Jr(e.connectorDapsConfig),connectorMiwConfig:Rr(e.connectorMiwConfig)}}const da={HttpData:"HTTP_DATA",OnRequest:"ON_REQUEST",Custom:"CUSTOM"};function kr(e){return qr(e)}function qr(e,t){return e}function ua(e){return e}function la(e){let t=!0;return t=t&&"id"in e,t}function Te(e){return Lr(e)}function Lr(e,t){return e==null?e:{id:e.id,available:c(e,"available")?e.available:void 0}}function fa(e){if(e!==void 0)return e===null?null:{id:e.id,available:e.available}}function ma(e){let t=!0;return t=t&&"id"in e,t=t&&"lastUpdatedDate"in e,t}function D(e){return Mr(e)}function Mr(e,t){return e==null?e:{id:e.id,lastUpdatedDate:new Date(e.lastUpdatedDate)}}function pa(e){if(e!==void 0)return e===null?null:{id:e.id,lastUpdatedDate:e.lastUpdatedDate.toISOString()}}function ga(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"transferProcessRequestJsonLd"in e,t}function ha(e){return Zr(e)}function Zr(e,t){return e==null?e:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function xr(e){if(e!==void 0)return e===null?null:{contractAgreementId:e.contractAgreementId,transferProcessRequestJsonLd:e.transferProcessRequestJsonLd}}function ya(e){let t=!0;return t=t&&"contractAgreementId"in e,t=t&&"dataSinkProperties"in e,t=t&&"transferProcessProperties"in e,t}function Sa(e){return Hr(e)}function Hr(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 Ta(e){let t=!0;return t=t&&"incomingTransferProcessCounts"in e,t=t&&"outgoingTransferProcessCounts"in e,t}function $r(e){return zr(e)}function zr(e,t){return e==null?e:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Br(e){if(e!==void 0)return e===null?null:{incomingTransferProcessCounts:e.incomingTransferProcessCounts,outgoingTransferProcessCounts:e.outgoingTransferProcessCounts}}function Oa(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 Qr(e){return Gr(e)}function Gr(e,t){return e==null?e:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:$r(e.transferProcessDto)}}function va(e){if(e!==void 0)return e===null?null:{assetsCount:e.assetsCount,policiesCount:e.policiesCount,contractDefinitionsCount:e.contractDefinitionsCount,contractAgreementsCount:e.contractAgreementsCount,transferProcessDto:Br(e.transferProcessDto)}}function Ca(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"expression"in e,t}function Na(e){return Kr(e)}function Kr(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,expression:ge(e.expression)}}function Wr(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,expression:he(e.expression)}}function Pa(e){return!0}function Yr(e){return Xr(e)}function Xr(e,t){return e==null?e:{constraints:c(e,"constraints")?e.constraints.map(qe):void 0}}function jr(e){if(e!==void 0)return e===null?null:{constraints:e.constraints===void 0?void 0:e.constraints.map(Le)}}function wa(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function _a(e){return en(e)}function en(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:Yr(e.policy)}}function tn(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:jr(e.policy)}}function Ia(e){let t=!0;return t=t&&"policyDefinitionId"in e,t=t&&"policy"in e,t}function rn(e){return nn(e)}function nn(e,t){return e==null?e:{policyDefinitionId:e.policyDefinitionId,policy:ye(e.policy)}}function an(e){if(e!==void 0)return e===null?null:{policyDefinitionId:e.policyDefinitionId,policy:Se(e.policy)}}function Da(e){let t=!0;return t=t&&"policies"in e,t}function on(e){return sn(e)}function sn(e,t){return e==null?e:{policies:e.policies.map(rn)}}function Ja(e){if(e!==void 0)return e===null?null:{policies:e.policies.map(an)}}function Aa(e){return!0}function cn(e){return dn(e)}function dn(e,t){return e==null?e:{secretName:c(e,"secretName")?e.secretName:void 0,rawValue:c(e,"rawValue")?e.rawValue:void 0}}function un(e){if(e!==void 0)return e===null?null:{secretName:e.secretName,rawValue:e.rawValue}}function ba(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 ln(e){return fn(e)}function fn(e,t){return e==null?e:{transferProcessId:e.transferProcessId,createdDate:new Date(e.createdDate),lastUpdatedDate:new Date(e.lastUpdatedDate),state:Fe(e.state),contractAgreementId:e.contractAgreementId,direction:Ue(e.direction),counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:c(e,"errorMessage")?e.errorMessage:void 0}}function mn(e){if(e!==void 0)return e===null?null:{transferProcessId:e.transferProcessId,createdDate:e.createdDate.toISOString(),lastUpdatedDate:e.lastUpdatedDate.toISOString(),state:Ee(e.state),contractAgreementId:e.contractAgreementId,direction:e.direction,counterPartyConnectorEndpoint:e.counterPartyConnectorEndpoint,counterPartyParticipantId:e.counterPartyParticipantId,assetName:e.assetName,assetId:e.assetId,errorMessage:e.errorMessage}}function Ra(e){let t=!0;return t=t&&"transferEntries"in e,t}function pn(e){return gn(e)}function gn(e,t){return e==null?e:{transferEntries:e.transferEntries.map(ln)}}function Ua(e){if(e!==void 0)return e===null?null:{transferEntries:e.transferEntries.map(mn)}}const Fa={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Options:"OPTIONS"};function hn(e){return yn(e)}function yn(e,t){return e}function Ea(e){return e}function ka(e){let t=!0;return t=t&&"baseUrl"in e,t}function Sn(e){return Tn(e)}function Tn(e,t){return e==null?e:{method:c(e,"method")?hn(e.method):void 0,baseUrl:e.baseUrl,queryString:c(e,"queryString")?e.queryString:void 0,authHeaderName:c(e,"authHeaderName")?e.authHeaderName:void 0,authHeaderValue:c(e,"authHeaderValue")?cn(e.authHeaderValue):void 0,headers:c(e,"headers")?e.headers:void 0,enableMethodParameterization:c(e,"enableMethodParameterization")?e.enableMethodParameterization:void 0,enablePathParameterization:c(e,"enablePathParameterization")?e.enablePathParameterization:void 0,enableQueryParameterization:c(e,"enableQueryParameterization")?e.enableQueryParameterization:void 0,enableBodyParameterization:c(e,"enableBodyParameterization")?e.enableBodyParameterization:void 0}}function On(e){if(e!==void 0)return e===null?null:{method:e.method,baseUrl:e.baseUrl,queryString:e.queryString,authHeaderName:e.authHeaderName,authHeaderValue:un(e.authHeaderValue),headers:e.headers,enableMethodParameterization:e.enableMethodParameterization,enablePathParameterization:e.enablePathParameterization,enableQueryParameterization:e.enableQueryParameterization,enableBodyParameterization:e.enableBodyParameterization}}function qa(e){let t=!0;return t=t&&"contactEmail"in e,t=t&&"contactPreferredEmailSubject"in e,t}function vn(e){return Cn(e)}function Cn(e,t){return e==null?e:{contactEmail:e.contactEmail,contactPreferredEmailSubject:e.contactPreferredEmailSubject}}function Nn(e){if(e!==void 0)return e===null?null:{contactEmail:e.contactEmail,contactPreferredEmailSubject:e.contactPreferredEmailSubject}}function La(e){let t=!0;return t=t&&"type"in e,t}function Ve(e){return Pn(e)}function Pn(e,t){return e==null?e:{type:kr(e.type),httpData:c(e,"httpData")?Sn(e.httpData):void 0,onRequest:c(e,"onRequest")?vn(e.onRequest):void 0,customProperties:c(e,"customProperties")?e.customProperties:void 0}}function $e(e){if(e!==void 0)return e===null?null:{type:e.type,httpData:On(e.httpData),onRequest:Nn(e.onRequest),customProperties:e.customProperties}}function Ma(e){let t=!0;return t=t&&"dataSource"in e,t=t&&"id"in e,t}function Za(e){return wn(e)}function wn(e,t){return e==null?e:{dataSource:Ve(e.dataSource),id:e.id,title:c(e,"title")?e.title:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function ze(e){if(e!==void 0)return e===null?null:{dataSource:$e(e.dataSource),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),customJsonAsString:e.customJsonAsString,customJsonLdAsString:e.customJsonLdAsString,privateCustomJsonAsString:e.privateCustomJsonAsString,privateCustomJsonLdAsString:e.privateCustomJsonLdAsString}}function xa(e){return!0}function Ha(e){return _n(e)}function _n(e,t){return e==null?e:{dataSourceOverrideOrNull:c(e,"dataSourceOverrideOrNull")?Ve(e.dataSourceOverrideOrNull):void 0,title:c(e,"title")?e.title:void 0,language:c(e,"language")?e.language:void 0,description:c(e,"description")?e.description:void 0,publisherHomepage:c(e,"publisherHomepage")?e.publisherHomepage:void 0,licenseUrl:c(e,"licenseUrl")?e.licenseUrl:void 0,version:c(e,"version")?e.version:void 0,keywords:c(e,"keywords")?e.keywords:void 0,mediaType:c(e,"mediaType")?e.mediaType:void 0,landingPageUrl:c(e,"landingPageUrl")?e.landingPageUrl:void 0,dataCategory:c(e,"dataCategory")?e.dataCategory:void 0,dataSubcategory:c(e,"dataSubcategory")?e.dataSubcategory:void 0,dataModel:c(e,"dataModel")?e.dataModel:void 0,geoReferenceMethod:c(e,"geoReferenceMethod")?e.geoReferenceMethod:void 0,transportMode:c(e,"transportMode")?e.transportMode:void 0,sovereignLegalName:c(e,"sovereignLegalName")?e.sovereignLegalName:void 0,geoLocation:c(e,"geoLocation")?e.geoLocation:void 0,nutsLocations:c(e,"nutsLocations")?e.nutsLocations:void 0,dataSampleUrls:c(e,"dataSampleUrls")?e.dataSampleUrls:void 0,referenceFileUrls:c(e,"referenceFileUrls")?e.referenceFileUrls:void 0,referenceFilesDescription:c(e,"referenceFilesDescription")?e.referenceFilesDescription:void 0,conditionsForUse:c(e,"conditionsForUse")?e.conditionsForUse:void 0,dataUpdateFrequency:c(e,"dataUpdateFrequency")?e.dataUpdateFrequency:void 0,temporalCoverageFrom:c(e,"temporalCoverageFrom")?new Date(e.temporalCoverageFrom):void 0,temporalCoverageToInclusive:c(e,"temporalCoverageToInclusive")?new Date(e.temporalCoverageToInclusive):void 0,customJsonAsString:c(e,"customJsonAsString")?e.customJsonAsString:void 0,customJsonLdAsString:c(e,"customJsonLdAsString")?e.customJsonLdAsString:void 0,privateCustomJsonAsString:c(e,"privateCustomJsonAsString")?e.privateCustomJsonAsString:void 0,privateCustomJsonLdAsString:c(e,"privateCustomJsonLdAsString")?e.privateCustomJsonLdAsString:void 0}}function In(e){if(e!==void 0)return e===null?null:{dataSourceOverrideOrNull:$e(e.dataSourceOverrideOrNull),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 Va(e){let t=!0;return t=t&&"contractNegotiationId"in e,t=t&&"createdAt"in e,t=t&&"state"in e,t}function Be(e){return Dn(e)}function Dn(e,t){return e==null?e:{contractNegotiationId:e.contractNegotiationId,createdAt:new Date(e.createdAt),contractAgreementId:c(e,"contractAgreementId")?e.contractAgreementId:void 0,state:Cr(e.state)}}function $a(e){if(e!==void 0)return e===null?null:{contractNegotiationId:e.contractNegotiationId,createdAt:e.createdAt.toISOString(),contractAgreementId:e.contractAgreementId,state:Pr(e.state)}}function za(e){let t=!0;return t=t&&"contractOfferId"in e,t=t&&"policy"in e,t}function Jn(e){return An(e)}function An(e,t){return e==null?e:{contractOfferId:e.contractOfferId,policy:ye(e.policy)}}function bn(e){if(e!==void 0)return e===null?null:{contractOfferId:e.contractOfferId,policy:Se(e.policy)}}function Ba(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 Qe(e){return Rn(e)}function Rn(e,t){return e==null?e:{endpoint:e.endpoint,participantId:e.participantId,asset:j(e.asset),contractOffers:e.contractOffers.map(Jn)}}function Qa(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,participantId:e.participantId,asset:pe(e.asset),contractOffers:e.contractOffers.map(bn)}}class Un extends G{async connectorLimitsRaw(t){const r={},n={},i=await this.request({path:"/wrapper/ee/connector-limits",method:"GET",headers:n,query:r},t);return new C(i,a=>Nt(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 I("blobId","Required parameter requestParameters.blobId was null or undefined when calling fileUploadCreateAsset.");if(t.uiAssetCreateRequest===null||t.uiAssetCreateRequest===void 0)throw new I("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:ze(t.uiAssetCreateRequest)},r);return new it(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 C(i):new at(i)}async fileUploadRequestSasToken(t){return await(await this.fileUploadRequestSasTokenRaw(t)).value()}}class Fn extends G{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:ze(t.uiAssetCreateRequest)},r);return new C(a,s=>D(s))}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:yr(t.contractDefinitionRequest)},r);return new C(a,s=>D(s))}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:tn(t.policyDefinitionCreateRequest)},r);return new C(a,s=>D(s))}async createPolicyDefinition(t={},r){return await(await this.createPolicyDefinitionRaw(t,r)).value()}async createPolicyDefinitionV2Raw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/v2/pages/policy-page/policy-definitions",method:"POST",headers:i,query:n,body:Wr(t.policyDefinitionCreateDto)},r);return new C(a,s=>D(s))}async createPolicyDefinitionV2(t={},r){return await(await this.createPolicyDefinitionV2Raw(t,r)).value()}async deleteAssetRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new I("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 C(a,s=>D(s))}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 I("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 C(a,s=>D(s))}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 I("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 C(a,s=>D(s))}async deletePolicyDefinition(t,r){return await(await this.deletePolicyDefinitionRaw(t,r)).value()}async editAssetRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new I("assetId","Required parameter requestParameters.assetId was null or undefined when calling editAsset.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/asset-page/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"PUT",headers:i,query:n,body:In(t.uiAssetEditRequest)},r);return new C(a,s=>D(s))}async editAsset(t,r){return await(await this.editAssetRaw(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 C(i,a=>dt(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 C(a,s=>s.map(Qe))}async getCatalogPageDataOffers(t={},r){return await(await this.getCatalogPageDataOffersRaw(t,r)).value()}async getContractAgreementPageRaw(t,r){const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/contract-agreement-page",method:"POST",headers:i,query:n,body:rr(t.contractAgreementPageQuery)},r);return new C(a,s=>jt(s))}async getContractAgreementPage(t={},r){return await(await this.getContractAgreementPageRaw(t,r)).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 C(i,a=>pr(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 I("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 C(a,s=>Be(s))}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 C(i,a=>Fr(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 C(i,a=>on(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 C(i,a=>pn(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 I("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 C(a,s=>j(s))}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:Tr(t.contractNegotiationRequest)},r);return new C(a,s=>Be(s))}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:xr(t.initiateCustomTransferRequest)},r);return new C(a,s=>D(s))}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 C(a,s=>D(s))}async initiateTransfer(t={},r){return await(await this.initiateTransferRaw(t,r)).value()}async isAssetIdAvailableRaw(t,r){if(t.assetId===null||t.assetId===void 0)throw new I("assetId","Required parameter requestParameters.assetId was null or undefined when calling isAssetIdAvailable.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/data-offer-page/validate-asset-id/{assetId}".replace("{assetId}",encodeURIComponent(String(t.assetId))),method:"GET",headers:i,query:n},r);return new C(a,s=>Te(s))}async isAssetIdAvailable(t,r){return await(await this.isAssetIdAvailableRaw(t,r)).value()}async isContractDefinitionIdAvailableRaw(t,r){if(t.contractDefinitionId===null||t.contractDefinitionId===void 0)throw new I("contractDefinitionId","Required parameter requestParameters.contractDefinitionId was null or undefined when calling isContractDefinitionIdAvailable.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/data-offer-page/validate-contract-definition-id/{contractDefinitionId}".replace("{contractDefinitionId}",encodeURIComponent(String(t.contractDefinitionId))),method:"GET",headers:i,query:n},r);return new C(a,s=>Te(s))}async isContractDefinitionIdAvailable(t,r){return await(await this.isContractDefinitionIdAvailableRaw(t,r)).value()}async isPolicyIdAvailableRaw(t,r){if(t.policyId===null||t.policyId===void 0)throw new I("policyId","Required parameter requestParameters.policyId was null or undefined when calling isPolicyIdAvailable.");const n={},i={},a=await this.request({path:"/wrapper/ui/pages/data-offer-page/validate-policy-id/{policyId}".replace("{policyId}",encodeURIComponent(String(t.policyId))),method:"GET",headers:i,query:n},r);return new C(a,s=>Te(s))}async isPolicyIdAvailable(t,r){return await(await this.isPolicyIdAvailableRaw(t,r)).value()}async terminateContractAgreementRaw(t,r){if(t.contractAgreementId===null||t.contractAgreementId===void 0)throw new I("contractAgreementId","Required parameter requestParameters.contractAgreementId was null or undefined when calling terminateContractAgreement.");const n={},i={};i["Content-Type"]="application/json";const a=await this.request({path:"/wrapper/ui/pages/content-agreement-page/{contractAgreementId}/terminate".replace("{contractAgreementId}",encodeURIComponent(String(t.contractAgreementId))),method:"POST",headers:i,query:n,body:_r(t.contractTerminationRequest)},r);return new C(a,s=>D(s))}async terminateContractAgreement(t,r){return await(await this.terminateContractAgreementRaw(t,r)).value()}}class En extends G{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 C(i,a=>Qr(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 C(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 I("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 C(a,s=>s.map(Qe))}async queryCatalog(t,r){return await(await this.queryCatalogRaw(t,r)).value()}}var v;(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 s of i)a[s]=s;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),s={};for(const d of a)s[d]=i[d];return e.objectValues(s)},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 s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(const s of i)if(a(s))return s},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(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Ge;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ge||(Ge={}));const f=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=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=v.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"]),Ga=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 s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let d=n,p=0;for(;p<s.path.length;){const l=s.path[p];p===s.path.length-1?(d[l]=d[l]||{_errors:[]},d[l]._errors.push(r(s))):d[l]=d[l]||{_errors:[]},d=d[l],p++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.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,v.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${v.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${v.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${v.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}"`:v.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,v.assertNever(e)}return{message:r}};let kn=ee;function Ka(e){kn=e}function Oe(){return kn}const ve=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};let d="";const p=n.filter(l=>!!l).slice().reverse();for(const l of p)d=l(s,{data:t,defaultError:d}).message;return{...i,path:a,message:i.message||d}},Wa=[];function m(e,t){const r=ve({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Oe(),ee].filter(n=>!!n)});e.common.issues.push(r)}class P{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 P.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return y;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}}const y=Object.freeze({status:"aborted"}),qn=e=>({status:"dirty",value:e}),w=e=>({status:"valid",value:e}),Ke=e=>e.status==="aborted",We=e=>e.status==="dirty",te=e=>e.status==="valid",Ce=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 F{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 Ln=(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:(s,d)=>s.code!=="invalid_type"?{message:d.defaultError}:typeof d.data>"u"?{message:n??d.defaultError}:{message:r??d.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 Z(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new P,ctx:{common:t.parent.common,data:t.data,parsedType:Z(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Ce(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:Z(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Ln(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:Z(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Ce(i)?i:Promise.resolve(i));return Ln(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 s=t(i),d=()=>a.addIssue({code:u.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(p=>p?!0:(d(),!1)):s?!0:(d(),!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 U({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 Q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R.create(this,this._def)}promise(){return X.create(this,this._def)}or(t){return ae.create([this,t],this._def)}and(t){return oe.create(this,t,this._def)}transform(t){return new U({...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 Zn({typeName:h.ZodBranded,type:this,...S(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new De({...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 Ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ya=/^c[^\s-]{8,}$/i,Xa=/^[a-z][a-z0-9]*$/,ja=/^[0-9A-HJKMNP-TV-Z]{26}$/,eo=/^[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,to=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ro="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ye;const no=/^(((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}))$/,io=/^(([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})))$/,ao=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 oo(e,t){return!!((t==="v4"||!t)&&no.test(e)||(t==="v6"||!t)&&io.test(e))}class b extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==f.string){const a=this._getOrReturnCtx(t);return m(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),y}const n=new P;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),m(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),m(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 s=t.data.length>a.value,d=t.data.length<a.value;(s||d)&&(i=this._getOrReturnCtx(t,i),s?m(i,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&m(i,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")to.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"email",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ye||(Ye=new RegExp(ro,"u")),Ye.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"emoji",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")eo.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"uuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ya.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"cuid",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Xa.test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"cuid2",code:u.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")ja.test(t.data)||(i=this._getOrReturnCtx(t,i),m(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),m(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),m(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),m(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),m(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),m(i,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ao(a).test(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?oo(t.data,a.version)||(i=this._getOrReturnCtx(t,i),m(i,{validation:"ip",code:u.invalid_string,message:a.message}),n.dirty()):v.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 b({...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 b({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new b({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new b({...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}}b.create=e=>{var t;return new b({checks:[],typeName:h.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...S(e)})};function so(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(".","")),s=parseInt(t.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}class x 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 m(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),y}let n;const i=new P;for(const a of this._def.checks)a.kind==="int"?v.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),m(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),m(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),m(n,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?so(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),m(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),m(n,{code:u.not_finite,message:a.message}),i.dirty()):v.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 x({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new x({...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"&&v.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)}}x.create=e=>new x({checks:[],typeName:h.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...S(e)});class H 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 m(a,{code:u.invalid_type,expected:f.bigint,received:a.parsedType}),y}let n;const i=new P;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),m(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),m(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),m(n,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):v.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 H({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:g.toString(i)}]})}_addCheck(t){return new H({...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}}H.create=e=>{var t;return new H({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 m(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 $ 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 m(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),y}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return m(a,{code:u.invalid_date}),y}const n=new P;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),m(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),m(i,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):v.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $({...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}}$.create=e=>new $({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:h.ZodDate,...S(e)});class Ne extends T{_parse(t){if(this._getType(t)!==f.symbol){const n=this._getOrReturnCtx(t);return m(n,{code:u.invalid_type,expected:f.symbol,received:n.parsedType}),y}return w(t.data)}}Ne.create=e=>new Ne({typeName:h.ZodSymbol,...S(e)});class ne extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return m(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 m(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 L extends T{_parse(t){const r=this._getOrReturnCtx(t);return m(r,{code:u.invalid_type,expected:f.never,received:r.parsedType}),y}}L.create=e=>new L({typeName:h.ZodNever,...S(e)});class Pe extends T{_parse(t){if(this._getType(t)!==f.undefined){const n=this._getOrReturnCtx(t);return m(n,{code:u.invalid_type,expected:f.void,received:n.parsedType}),y}return w(t.data)}}Pe.create=e=>new Pe({typeName:h.ZodVoid,...S(e)});class R extends T{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==f.array)return m(r,{code:u.invalid_type,expected:f.array,received:r.parsedType}),y;if(i.exactLength!==null){const s=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(s||d)&&(m(r,{code:s?u.too_big:u.too_small,minimum:d?i.exactLength.value:void 0,maximum:s?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&&(m(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&&(m(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((s,d)=>i.type._parseAsync(new F(r,s,r.path,d)))).then(s=>P.mergeArray(n,s));const a=[...r.data].map((s,d)=>i.type._parseSync(new F(r,s,r.path,d)));return P.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new R({...this._def,minLength:{value:t,message:g.toString(r)}})}max(t,r){return new R({...this._def,maxLength:{value:t,message:g.toString(r)}})}length(t,r){return new R({...this._def,exactLength:{value:t,message:g.toString(r)}})}nonempty(t){return this.min(1,t)}}R.create=(e,t)=>new R({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]=M.create(W(n))}return new N({...e._def,shape:()=>t})}else return e instanceof R?new R({...e._def,type:W(e.element)}):e instanceof M?M.create(W(e.unwrap())):e instanceof Q?Q.create(W(e.unwrap())):e instanceof E?E.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=v.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==f.object){const l=this._getOrReturnCtx(t);return m(l,{code:u.invalid_type,expected:f.object,received:l.parsedType}),y}const{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),d=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||d.push(l);const p=[];for(const l of s){const O=a[l],J=i.data[l];p.push({key:{status:"valid",value:l},value:O._parse(new F(i,J,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof L){const l=this._def.unknownKeys;if(l==="passthrough")for(const O of d)p.push({key:{status:"valid",value:O},value:{status:"valid",value:i.data[O]}});else if(l==="strict")d.length>0&&(m(i,{code:u.unrecognized_keys,keys:d}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const O of d){const J=i.data[O];p.push({key:{status:"valid",value:O},value:l._parse(new F(i,J,i.path,O)),alwaysSet:O in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const O of p){const J=await O.key;l.push({key:J,value:await O.value,alwaysSet:O.alwaysSet})}return l}).then(l=>P.mergeObjectSync(n,l)):P.mergeObjectSync(n,p)}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,s,d;const p=(s=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(d=g.errToObj(t).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}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 v.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 v.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 v.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 v.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 N({...this._def,shape:()=>r})}keyof(){return Mn(v.objectKeys(this.shape))}}N.create=(e,t)=>new N({shape:()=>e,unknownKeys:"strip",catchall:L.create(),typeName:h.ZodObject,...S(t)}),N.strictCreate=(e,t)=>new N({shape:()=>e,unknownKeys:"strict",catchall:L.create(),typeName:h.ZodObject,...S(t)}),N.lazycreate=(e,t)=>new N({shape:e,unknownKeys:"strip",catchall:L.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 d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const s=a.map(d=>new A(d.ctx.common.issues));return m(r,{code:u.invalid_union,unionErrors:s}),y}if(r.common.async)return Promise.all(n.map(async a=>{const s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const p of n){const l={...r,common:{...r.common,issues:[]},parent:null},O=p._parseSync({data:r.data,path:r.path,parent:l});if(O.status==="valid")return O;O.status==="dirty"&&!a&&(a={result:O,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const d=s.map(p=>new A(p));return m(r,{code:u.invalid_union,unionErrors:d}),y}}get options(){return this._def.options}}ae.create=(e,t)=>new ae({options:e,typeName:h.ZodUnion,...S(t)});const we=e=>e instanceof ce?we(e.schema):e instanceof U?we(e.innerType()):e instanceof de?[e.value]:e instanceof V?e.options:e instanceof ue?Object.keys(e.enum):e instanceof le?we(e._def.innerType):e instanceof ne?[void 0]:e instanceof ie?[null]:null;class _e extends T{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==f.object)return m(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}):(m(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 s=we(a.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of s){if(i.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);i.set(d,a)}}return new _e({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...S(n)})}}function Xe(e,t){const r=Z(e),n=Z(t);if(e===t)return{valid:!0,data:e};if(r===f.object&&n===f.object){const i=v.objectKeys(t),a=v.objectKeys(e).filter(d=>i.indexOf(d)!==-1),s={...e,...t};for(const d of a){const p=Xe(e[d],t[d]);if(!p.valid)return{valid:!1};s[d]=p.data}return{valid:!0,data:s}}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 s=e[a],d=t[a],p=Xe(s,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===f.date&&n===f.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class oe extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{if(Ke(a)||Ke(s))return y;const d=Xe(a.value,s.value);return d.valid?((We(a)||We(s))&&r.dirty(),{status:r.value,value:d.data}):(m(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,s])=>i(a,s)):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}))}}oe.create=(e,t,r)=>new oe({left:e,right:t,typeName:h.ZodIntersection,...S(r)});class E extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==f.array)return m(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return m(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&&(m(n,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((s,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new F(n,s,n.path,d)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>P.mergeArray(r,s)):P.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new E({...this._def,rest:t})}}E.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:e,typeName:h.ZodTuple,rest:null,...S(t)})};class se 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 m(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),y;const i=[],a=this._def.keyType,s=this._def.valueType;for(const d in n.data)i.push({key:a._parse(new F(n,d,n.path,d)),value:s._parse(new F(n,n.data[d],n.path,d))});return n.common.async?P.mergeObjectAsync(r,i):P.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new se({keyType:t,valueType:r,typeName:h.ZodRecord,...S(n)}):new se({keyType:b.create(),valueType:t,typeName:h.ZodRecord,...S(r)})}}class Ie 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 m(n,{code:u.invalid_type,expected:f.map,received:n.parsedType}),y;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([d,p],l)=>({key:i._parse(new F(n,d,n.path,[l,"key"])),value:a._parse(new F(n,p,n.path,[l,"value"]))}));if(n.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of s){const l=await p.key,O=await p.value;if(l.status==="aborted"||O.status==="aborted")return y;(l.status==="dirty"||O.status==="dirty")&&r.dirty(),d.set(l.value,O.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const p of s){const l=p.key,O=p.value;if(l.status==="aborted"||O.status==="aborted")return y;(l.status==="dirty"||O.status==="dirty")&&r.dirty(),d.set(l.value,O.value)}return{status:r.value,value:d}}}}Ie.create=(e,t,r)=>new Ie({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 m(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&&(m(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&&(m(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 s(p){const l=new Set;for(const O of p){if(O.status==="aborted")return y;O.status==="dirty"&&r.dirty(),l.add(O.value)}return{status:r.value,value:l}}const d=[...n.data.values()].map((p,l)=>a._parse(new F(n,p,n.path,l)));return n.common.async?Promise.all(d).then(p=>s(p)):s(d)}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 m(r,{code:u.invalid_type,expected:f.function,received:r.parsedType}),y;function n(d,p){return ve({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Oe(),ee].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:p}})}function i(d,p){return ve({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Oe(),ee].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:p}})}const a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof X){const d=this;return w(async function(...p){const l=new A([]),O=await d._def.args.parseAsync(p,a).catch(je=>{throw l.addIssue(n(p,je)),l}),J=await Reflect.apply(s,this,O);return await d._def.returns._def.type.parseAsync(J,a).catch(je=>{throw l.addIssue(i(J,je)),l})})}else{const d=this;return w(function(...p){const l=d._def.args.safeParse(p,a);if(!l.success)throw new A([n(p,l.error)]);const O=Reflect.apply(s,this,l.data),J=d._def.returns.safeParse(O,a);if(!J.success)throw new A([i(O,J.error)]);return J.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Y({...this._def,args:E.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||E.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 m(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 m(r,{expected:v.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 m(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=v.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==f.string&&n.parsedType!==f.number){const i=v.objectValues(r);return m(n,{expected:v.joinValues(i),received:n.parsedType,code:u.invalid_type}),y}if(r.indexOf(t.data)===-1){const i=v.objectValues(r);return m(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 m(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 U 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:s=>{m(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(s).then(d=>this._def.schema._parseAsync({data:d,path:n.path,parent:n})):this._def.schema._parseSync({data:s,path:n.path,parent:n})}if(i.type==="refinement"){const s=d=>{const p=i.refinement(d,a);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(n.common.async===!1){const d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return d.status==="aborted"?y:(d.status==="dirty"&&r.dirty(),s(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>d.status==="aborted"?y:(d.status==="dirty"&&r.dirty(),s(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!te(s))return s;const d=i.transform(s.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>te(s)?Promise.resolve(i.transform(s.value,a)).then(d=>({status:r.value,value:d})):s);v.assertNever(i)}}U.create=(e,t,r)=>new U({schema:e,typeName:h.ZodEffects,effect:t,...S(r)}),U.createWithPreprocess=(e,t,r)=>new U({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...S(r)});class M extends T{_parse(t){return this._getType(t)===f.undefined?w(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 Q extends T{_parse(t){return this._getType(t)===f.null?w(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Q.create=(e,t)=>new Q({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 De 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 Ce(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}}De.create=(e,t)=>new De({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...S(t)});class Je extends T{_parse(t){if(this._getType(t)!==f.nan){const n=this._getOrReturnCtx(t);return m(n,{code:u.invalid_type,expected:f.nan,received:n.parsedType}),y}return{status:"valid",value:t.data}}}Je.create=e=>new Je({typeName:h.ZodNaN,...S(e)});const co=Symbol("zod_brand");class Zn 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(),qn(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 Ae extends T{_parse(t){const r=this._def.innerType._parse(t);return te(r)&&(r.value=Object.freeze(r.value)),r}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:h.ZodReadonly,...S(t)});const xn=(e,t={},r)=>e?K.create().superRefine((n,i)=>{var a,s;if(!e(n)){const d=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,p=(s=(a=d.fatal)!==null&&a!==void 0?a:r)!==null&&s!==void 0?s:!0,l=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...l,fatal:p})}}):K.create(),uo={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 lo=(e,t={message:`Input not instance of ${e.name}`})=>xn(r=>r instanceof e,t),Hn=b.create,Vn=x.create,fo=Je.create,mo=H.create,$n=re.create,po=$.create,go=Ne.create,ho=ne.create,yo=ie.create,So=K.create,To=z.create,Oo=L.create,vo=Pe.create,Co=R.create,No=N.create,Po=N.strictCreate,wo=ae.create,_o=_e.create,Io=oe.create,Do=E.create,Jo=se.create,Ao=Ie.create,bo=B.create,Ro=Y.create,Uo=ce.create,Fo=de.create,Eo=V.create,ko=ue.create,qo=X.create,zn=U.create,Lo=M.create,Mo=Q.create,Zo=U.createWithPreprocess,xo=fe.create;var me=Object.freeze({__proto__:null,defaultErrorMap:ee,setErrorMap:Ka,getErrorMap:Oe,makeIssue:ve,EMPTY_PATH:Wa,addIssueToContext:m,ParseStatus:P,INVALID:y,DIRTY:qn,OK:w,isAborted:Ke,isDirty:We,isValid:te,isAsync:Ce,get util(){return v},get objectUtil(){return Ge},ZodParsedType:f,getParsedType:Z,ZodType:T,ZodString:b,ZodNumber:x,ZodBigInt:H,ZodBoolean:re,ZodDate:$,ZodSymbol:Ne,ZodUndefined:ne,ZodNull:ie,ZodAny:K,ZodUnknown:z,ZodNever:L,ZodVoid:Pe,ZodArray:R,ZodObject:N,ZodUnion:ae,ZodDiscriminatedUnion:_e,ZodIntersection:oe,ZodTuple:E,ZodRecord:se,ZodMap:Ie,ZodSet:B,ZodFunction:Y,ZodLazy:ce,ZodLiteral:de,ZodEnum:V,ZodNativeEnum:ue,ZodPromise:X,ZodEffects:U,ZodTransformer:U,ZodOptional:M,ZodNullable:Q,ZodDefault:le,ZodCatch:De,ZodNaN:Je,BRAND:co,ZodBranded:Zn,ZodPipeline:fe,ZodReadonly:Ae,custom:xn,Schema:T,ZodSchema:T,late:uo,get ZodFirstPartyTypeKind(){return h},coerce:{string:e=>b.create({...e,coerce:!0}),number:e=>x.create({...e,coerce:!0}),boolean:e=>re.create({...e,coerce:!0}),bigint:e=>H.create({...e,coerce:!0}),date:e=>$.create({...e,coerce:!0})},any:So,array:Co,bigint:mo,boolean:$n,date:po,discriminatedUnion:_o,effect:zn,enum:Eo,function:Ro,instanceof:lo,intersection:Io,lazy:Uo,literal:Fo,map:Ao,nan:fo,nativeEnum:ko,never:Oo,null:yo,nullable:Mo,number:Vn,object:No,oboolean:()=>$n().optional(),onumber:()=>Vn().optional(),optional:Lo,ostring:()=>Hn().optional(),pipeline:xo,preprocess:Zo,promise:qo,record:Jo,set:bo,strictObject:Po,string:Hn,symbol:go,transformer:zn,tuple:Do,undefined:ho,union:wo,unknown:To,void:vo,NEVER:y,ZodIssueCode:u,quotelessJson:Ga,ZodError:A});function Ho(e){return e===401||e===403}function Vo(e){return Object.entries(e).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&")}const $o=me.object({access_token:me.string().min(1),token_type:me.string(),expires_in:me.number(),scope:me.string()});async function zo(e){let r=await(await fetch(e.tokenUrl,{method:"POST",body:Vo({grant_type:"client_credentials",client_id:e.clientId,client_secret:e.clientSecret}),headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json();return Bo(r)}function Bo(e){const t=$o.safeParse(e);if(!t.success)throw new Error("Bad access token response");return t.data}class Qo{constructor(t){k(this,"activeRequest",null);k(this,"refreshTimeout");k(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=zo(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 Bn(e,t){e.headers=Go("Authorization",`Bearer ${t}`,e.headers)}function Go(e,t,r){return r?Array.isArray(r)?r.map(([n,i])=>n!==e?[n,i]:[e,t]):Ko(r)?(r.has(e)?r.set(e,t):r.append(e,t),r):(r[e]=t,r):(r={},r[e]=t,r)}function Ko(e){return"append"in e&&"delete"in e&&"get"in e&&"has"in e&&"set"in e&&"forEach"in e}function Wo(e){const t=new Qo(e);return{pre:async r=>{const n=await t.getAccessToken();return Bn(r.init,n),Promise.resolve({url:r.url,init:r.init})},post:async r=>{if(Ho(r.response.status)){const n=await t.refreshAccessToken();return Bn(r.init,n),await fetch(r.url,r.init)}return Promise.resolve(r.response)}}}function Yo(e){let t=[],r={};e.clientCredentials&&t.push(Wo(e.clientCredentials)),e.managementApiKey&&(r=Xo(e.managementApiKey));const n=new q({basePath:e.managementApiUrl,headers:r,credentials:"same-origin",middleware:t,...e.configOverrides});return{uiApi:new Fn(n),useCaseApi:new En(n),enterpriseEditionApi:new Un(n)}}function Xo(e){return{"X-Api-Key":e}}o.AssetPageFromJSON=dt,o.AssetPageFromJSONTyped=ut,o.AssetPageToJSON=ni,o.BASE_PATH=_,o.BaseAPI=G,o.BlobApiResponse=Xn,o.COLLECTION_FORMATS=Kn,o.CatalogFilterExpressionFromJSON=St,o.CatalogFilterExpressionFromJSONTyped=Tt,o.CatalogFilterExpressionLiteralFromJSON=mt,o.CatalogFilterExpressionLiteralFromJSONTyped=pt,o.CatalogFilterExpressionLiteralToJSON=gt,o.CatalogFilterExpressionLiteralType=ii,o.CatalogFilterExpressionLiteralTypeFromJSON=lt,o.CatalogFilterExpressionLiteralTypeFromJSONTyped=ft,o.CatalogFilterExpressionLiteralTypeToJSON=ai,o.CatalogFilterExpressionOperator=si,o.CatalogFilterExpressionOperatorFromJSON=ht,o.CatalogFilterExpressionOperatorFromJSONTyped=yt,o.CatalogFilterExpressionOperatorToJSON=ci,o.CatalogFilterExpressionToJSON=Ot,o.CatalogQueryFromJSON=li,o.CatalogQueryFromJSONTyped=vt,o.CatalogQueryToJSON=Ct,o.Configuration=q,o.ConnectorLimitsFromJSON=Nt,o.ConnectorLimitsFromJSONTyped=Pt,o.ConnectorLimitsToJSON=mi,o.ContractAgreementCardFromJSON=Wt,o.ContractAgreementCardFromJSONTyped=Yt,o.ContractAgreementCardToJSON=Xt,o.ContractAgreementDirection=pi,o.ContractAgreementDirectionFromJSON=Ue,o.ContractAgreementDirectionFromJSONTyped=wt,o.ContractAgreementDirectionToJSON=gi,o.ContractAgreementPageFromJSON=jt,o.ContractAgreementPageFromJSONTyped=er,o.ContractAgreementPageQueryFromJSON=Mi,o.ContractAgreementPageQueryFromJSONTyped=tr,o.ContractAgreementPageQueryToJSON=rr,o.ContractAgreementPageToJSON=qi,o.ContractAgreementTerminationInfoFromJSON=Dt,o.ContractAgreementTerminationInfoFromJSONTyped=Jt,o.ContractAgreementTerminationInfoToJSON=At,o.ContractAgreementTransferProcessFromJSON=Ft,o.ContractAgreementTransferProcessFromJSONTyped=Et,o.ContractAgreementTransferProcessToJSON=kt,o.ContractDefinitionEntryFromJSON=lr,o.ContractDefinitionEntryFromJSONTyped=fr,o.ContractDefinitionEntryToJSON=mr,o.ContractDefinitionPageFromJSON=pr,o.ContractDefinitionPageFromJSONTyped=gr,o.ContractDefinitionPageToJSON=Gi,o.ContractDefinitionRequestFromJSON=Wi,o.ContractDefinitionRequestFromJSONTyped=hr,o.ContractDefinitionRequestToJSON=yr,o.ContractNegotiationRequestFromJSON=Xi,o.ContractNegotiationRequestFromJSONTyped=Sr,o.ContractNegotiationRequestToJSON=Tr,o.ContractNegotiationSimplifiedState=ji,o.ContractNegotiationSimplifiedStateFromJSON=Or,o.ContractNegotiationSimplifiedStateFromJSONTyped=vr,o.ContractNegotiationSimplifiedStateToJSON=ea,o.ContractNegotiationStateFromJSON=Cr,o.ContractNegotiationStateFromJSONTyped=Nr,o.ContractNegotiationStateToJSON=Pr,o.ContractTerminatedBy=hi,o.ContractTerminatedByFromJSON=_t,o.ContractTerminatedByFromJSONTyped=It,o.ContractTerminatedByToJSON=yi,o.ContractTerminationRequestFromJSON=na,o.ContractTerminationRequestFromJSONTyped=wr,o.ContractTerminationRequestToJSON=_r,o.ContractTerminationStatus=Ni,o.ContractTerminationStatusFromJSON=ke,o.ContractTerminationStatusFromJSONTyped=qt,o.ContractTerminationStatusToJSON=Pi,o.DashboardDapsConfigFromJSON=Ir,o.DashboardDapsConfigFromJSONTyped=Dr,o.DashboardDapsConfigToJSON=Jr,o.DashboardMiwConfigFromJSON=Ar,o.DashboardMiwConfigFromJSONTyped=br,o.DashboardMiwConfigToJSON=Rr,o.DashboardPageFromJSON=Fr,o.DashboardPageFromJSONTyped=Er,o.DashboardPageToJSON=ca,o.DashboardTransferAmountsFromJSON=xe,o.DashboardTransferAmountsFromJSONTyped=Ur,o.DashboardTransferAmountsToJSON=He,o.DataSourceAvailability=jn,o.DataSourceAvailabilityFromJSON=ot,o.DataSourceAvailabilityFromJSONTyped=st,o.DataSourceAvailabilityToJSON=ei,o.DataSourceType=da,o.DataSourceTypeFromJSON=kr,o.DataSourceTypeFromJSONTyped=qr,o.DataSourceTypeToJSON=ua,o.DefaultConfig=et,o.EnterpriseEditionApi=Un,o.FetchError=rt,o.IdAvailabilityResponseFromJSON=Te,o.IdAvailabilityResponseFromJSONTyped=Lr,o.IdAvailabilityResponseToJSON=fa,o.IdResponseDtoFromJSON=D,o.IdResponseDtoFromJSONTyped=Mr,o.IdResponseDtoToJSON=pa,o.InitiateCustomTransferRequestFromJSON=ha,o.InitiateCustomTransferRequestFromJSONTyped=Zr,o.InitiateCustomTransferRequestToJSON=xr,o.InitiateTransferRequestFromJSON=Sa,o.InitiateTransferRequestFromJSONTyped=Hr,o.InitiateTransferRequestToJSON=Vr,o.JSONApiResponse=C,o.KpiResultFromJSON=Qr,o.KpiResultFromJSONTyped=Gr,o.KpiResultToJSON=va,o.OperatorDto=wi,o.OperatorDtoFromJSON=Lt,o.OperatorDtoFromJSONTyped=Mt,o.OperatorDtoToJSON=_i,o.PolicyDefinitionCreateDtoFromJSON=Na,o.PolicyDefinitionCreateDtoFromJSONTyped=Kr,o.PolicyDefinitionCreateDtoToJSON=Wr,o.PolicyDefinitionCreateRequestFromJSON=_a,o.PolicyDefinitionCreateRequestFromJSONTyped=en,o.PolicyDefinitionCreateRequestToJSON=tn,o.PolicyDefinitionDtoFromJSON=rn,o.PolicyDefinitionDtoFromJSONTyped=nn,o.PolicyDefinitionDtoToJSON=an,o.PolicyDefinitionPageFromJSON=on,o.PolicyDefinitionPageFromJSONTyped=sn,o.PolicyDefinitionPageToJSON=Ja,o.RequiredError=I,o.ResponseError=tt,o.SecretValueFromJSON=cn,o.SecretValueFromJSONTyped=dn,o.SecretValueToJSON=un,o.TextApiResponse=at,o.TransferHistoryEntryFromJSON=ln,o.TransferHistoryEntryFromJSONTyped=fn,o.TransferHistoryEntryToJSON=mn,o.TransferHistoryPageFromJSON=pn,o.TransferHistoryPageFromJSONTyped=gn,o.TransferHistoryPageToJSON=Ua,o.TransferProcessSimplifiedState=Ti,o.TransferProcessSimplifiedStateFromJSON=bt,o.TransferProcessSimplifiedStateFromJSONTyped=Rt,o.TransferProcessSimplifiedStateToJSON=Oi,o.TransferProcessStateFromJSON=Fe,o.TransferProcessStateFromJSONTyped=Ut,o.TransferProcessStateToJSON=Ee,o.TransferProcessStatesDtoFromJSON=$r,o.TransferProcessStatesDtoFromJSONTyped=zr,o.TransferProcessStatesDtoToJSON=Br,o.UIApi=Fn,o.UiAssetCreateRequestFromJSON=Za,o.UiAssetCreateRequestFromJSONTyped=wn,o.UiAssetCreateRequestToJSON=ze,o.UiAssetEditRequestFromJSON=Ha,o.UiAssetEditRequestFromJSONTyped=_n,o.UiAssetEditRequestToJSON=In,o.UiAssetFromJSON=j,o.UiAssetFromJSONTyped=ct,o.UiAssetToJSON=pe,o.UiContractNegotiationFromJSON=Be,o.UiContractNegotiationFromJSONTyped=Dn,o.UiContractNegotiationToJSON=$a,o.UiContractOfferFromJSON=Jn,o.UiContractOfferFromJSONTyped=An,o.UiContractOfferToJSON=bn,o.UiCriterionFromJSON=Me,o.UiCriterionFromJSONTyped=ur,o.UiCriterionLiteralFromJSON=ar,o.UiCriterionLiteralFromJSONTyped=or,o.UiCriterionLiteralToJSON=sr,o.UiCriterionLiteralType=Zi,o.UiCriterionLiteralTypeFromJSON=nr,o.UiCriterionLiteralTypeFromJSONTyped=ir,o.UiCriterionLiteralTypeToJSON=xi,o.UiCriterionOperator=Vi,o.UiCriterionOperatorFromJSON=cr,o.UiCriterionOperatorFromJSONTyped=dr,o.UiCriterionOperatorToJSON=$i,o.UiCriterionToJSON=Ze,o.UiDataOfferFromJSON=Qe,o.UiDataOfferFromJSONTyped=Rn,o.UiDataOfferToJSON=Qa,o.UiDataSourceFromJSON=Ve,o.UiDataSourceFromJSONTyped=Pn,o.UiDataSourceHttpDataFromJSON=Sn,o.UiDataSourceHttpDataFromJSONTyped=Tn,o.UiDataSourceHttpDataMethod=Fa,o.UiDataSourceHttpDataMethodFromJSON=hn,o.UiDataSourceHttpDataMethodFromJSONTyped=yn,o.UiDataSourceHttpDataMethodToJSON=Ea,o.UiDataSourceHttpDataToJSON=On,o.UiDataSourceOnRequestFromJSON=vn,o.UiDataSourceOnRequestFromJSONTyped=Cn,o.UiDataSourceOnRequestToJSON=Nn,o.UiDataSourceToJSON=$e,o.UiPolicyConstraintFromJSON=qe,o.UiPolicyConstraintFromJSONTyped=zt,o.UiPolicyConstraintToJSON=Le,o.UiPolicyCreateRequestFromJSON=Yr,o.UiPolicyCreateRequestFromJSONTyped=Xr,o.UiPolicyCreateRequestToJSON=jr,o.UiPolicyExpressionFromJSON=ge,o.UiPolicyExpressionFromJSONTyped=Gt,o.UiPolicyExpressionToJSON=he,o.UiPolicyExpressionType=bi,o.UiPolicyExpressionTypeFromJSON=Bt,o.UiPolicyExpressionTypeFromJSONTyped=Qt,o.UiPolicyExpressionTypeToJSON=Ri,o.UiPolicyFromJSON=ye,o.UiPolicyFromJSONTyped=Kt,o.UiPolicyLiteralFromJSON=Ht,o.UiPolicyLiteralFromJSONTyped=Vt,o.UiPolicyLiteralToJSON=$t,o.UiPolicyLiteralType=Ii,o.UiPolicyLiteralTypeFromJSON=Zt,o.UiPolicyLiteralTypeFromJSONTyped=xt,o.UiPolicyLiteralTypeToJSON=Di,o.UiPolicyToJSON=Se,o.UseCaseApi=En,o.VoidApiResponse=it,o.buildEdcClient=Yo,o.canConsumeForm=Yn,o.exists=c,o.instanceOfAssetPage=ri,o.instanceOfCatalogFilterExpression=di,o.instanceOfCatalogFilterExpressionLiteral=oi,o.instanceOfCatalogQuery=ui,o.instanceOfConnectorLimits=fi,o.instanceOfContractAgreementCard=Ei,o.instanceOfContractAgreementPage=ki,o.instanceOfContractAgreementPageQuery=Li,o.instanceOfContractAgreementTerminationInfo=Si,o.instanceOfContractAgreementTransferProcess=Ci,o.instanceOfContractDefinitionEntry=Bi,o.instanceOfContractDefinitionPage=Qi,o.instanceOfContractDefinitionRequest=Ki,o.instanceOfContractNegotiationRequest=Yi,o.instanceOfContractNegotiationState=ta,o.instanceOfContractTerminationRequest=ra,o.instanceOfDashboardDapsConfig=ia,o.instanceOfDashboardMiwConfig=aa,o.instanceOfDashboardPage=sa,o.instanceOfDashboardTransferAmounts=oa,o.instanceOfIdAvailabilityResponse=la,o.instanceOfIdResponseDto=ma,o.instanceOfInitiateCustomTransferRequest=ga,o.instanceOfInitiateTransferRequest=ya,o.instanceOfKpiResult=Oa,o.instanceOfPolicyDefinitionCreateDto=Ca,o.instanceOfPolicyDefinitionCreateRequest=wa,o.instanceOfPolicyDefinitionDto=Ia,o.instanceOfPolicyDefinitionPage=Da,o.instanceOfSecretValue=Aa,o.instanceOfTransferHistoryEntry=ba,o.instanceOfTransferHistoryPage=Ra,o.instanceOfTransferProcessState=vi,o.instanceOfTransferProcessStatesDto=Ta,o.instanceOfUiAsset=ti,o.instanceOfUiAssetCreateRequest=Ma,o.instanceOfUiAssetEditRequest=xa,o.instanceOfUiContractNegotiation=Va,o.instanceOfUiContractOffer=za,o.instanceOfUiCriterion=zi,o.instanceOfUiCriterionLiteral=Hi,o.instanceOfUiDataOffer=Ba,o.instanceOfUiDataSource=La,o.instanceOfUiDataSourceHttpData=ka,o.instanceOfUiDataSourceOnRequest=qa,o.instanceOfUiPolicy=Fi,o.instanceOfUiPolicyConstraint=Ai,o.instanceOfUiPolicyCreateRequest=Pa,o.instanceOfUiPolicyExpression=Ui,o.instanceOfUiPolicyLiteral=Ji,o.mapValues=Wn,o.querystring=Re,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=sovity-edc-client.umd.cjs.map