@amp-labs/react 2.9.12 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/amp-react.cjs.js +21 -21
- package/build/amp-react.cjs.js.map +1 -1
- package/build/amp-react.es.js +4568 -4606
- package/build/amp-react.es.js.map +1 -1
- package/build/index.d.ts +17 -1
- package/package.json +1 -1
package/build/amp-react.cjs.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";var Rg=Object.defineProperty;var Ku=e=>{throw TypeError(e)};var Pg=(e,t,n)=>t in e?Rg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ui=(e,t,n)=>Pg(e,typeof t!="symbol"?t+"":t,n),Hs=(e,t,n)=>t.has(e)||Ku("Cannot "+n);var T=(e,t,n)=>(Hs(e,t,"read from private field"),n?n.call(e):t.get(e)),pe=(e,t,n)=>t.has(e)?Ku("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),re=(e,t,n,r)=>(Hs(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ce=(e,t,n)=>(Hs(e,t,"access private method"),n);var Mo=(e,t,n,r)=>({set _(i){re(e,t,i,n)},get _(){return T(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),C=require("react");require("react-dom");function Fg(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const W=Fg(C),Dg="https://api.withampersand.com/v1".replace(/\/+$/,"");class vl{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:Dg}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||af}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 Mg=new vl,Cs=class Cs{constructor(t=Mg){this.configuration=t,this.fetchApi=async(n,r)=>{let i={url:n,init:r};for(const s of this.middleware)s.pre&&(i=await s.pre({fetch:this.fetchApi,...i})||i);let o;try{o=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(s){for(const a of this.middleware)a.onError&&(o=await a.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:s,response:o?o.clone():void 0})||o);if(o===void 0)throw s instanceof Error?new Bg(s,"The request failed and the interceptors did not return an alternative response"):s}for(const s of this.middleware)s.post&&(o=await s.post({fetch:this.fetchApi,url:i.url,init:i.init,response:o.clone()})||o);return o},this.middleware=t.middleware}withMiddleware(...t){const n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(...t){const n=t.map(r=>({pre:r}));return this.withMiddleware(...n)}withPostMiddleware(...t){const n=t.map(r=>({post:r}));return this.withMiddleware(...n)}isJsonMime(t){return t?Cs.jsonRegex.test(t):!1}async request(t,n){const{url:r,init:i}=await this.createFetchParams(t,n),o=await this.fetchApi(r,i);if(o&&o.status>=200&&o.status<300)return o;throw new bl(o,"Response returned an error code")}async createFetchParams(t,n){let r=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(r+="?"+this.configuration.queryParamsStringify(t.query));const i=Object.assign({},this.configuration.headers,t.headers);Object.keys(i).forEach(c=>i[c]===void 0?delete i[c]:{});const o=typeof n=="function"?n:async()=>n,s={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},a={...s,...await o({init:s,context:t})},l={...a,body:Lg(a.body)||a.body instanceof URLSearchParams||jg(a.body)?a.body:JSON.stringify(a.body)};return{url:r,init:l}}clone(){const t=this.constructor,n=new t(this.configuration);return n.middleware=this.middleware.slice(),n}};Cs.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");let Tn=Cs;function jg(e){return typeof Blob<"u"&&e instanceof Blob}function Lg(e){return typeof FormData<"u"&&e instanceof FormData}class bl extends Error{constructor(t,n){super(n),this.response=t,this.name="ResponseError"}}class Bg extends Error{constructor(t,n){super(n),this.cause=t,this.name="FetchError"}}class fe extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}function k(e,t){const n=e[t];return n!=null}function af(e,t=""){return Object.keys(e).map(n=>lf(n,e[n],t)).filter(n=>n.length>0).join("&")}function lf(e,t,n=""){const r=n+(n.length?`[${e}]`:e);if(t instanceof Array){const i=t.map(o=>encodeURIComponent(String(o))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${i}`}if(t instanceof Set){const i=Array.from(t);return lf(e,i,n)}return t instanceof Date?`${encodeURIComponent(r)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?af(t,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(t))}`}function nt(e,t){return Object.keys(e).reduce((n,r)=>({...n,[r]:t(e[r])}),{})}class Qe{constructor(t,n=r=>r){this.raw=t,this.transformer=n}async value(){return this.transformer(await this.raw.json())}}class vi{constructor(t){this.raw=t}async value(){}}class Hu{constructor(t){this.raw=t}async value(){return await this.raw.text()}}function Vg(e){return Ug(e)}function Ug(e,t){return e==null?e:{fieldUsed:k(e,"fieldUsed")?e.fieldUsed:void 0,keyFormat:k(e,"keyFormat")?e.keyFormat:void 0}}function $g(e){return qg(e)}function qg(e,t){return e==null?e:{name:e.name,valuePrefix:k(e,"valuePrefix")?e.valuePrefix:void 0}}function zg(e){return Kg(e)}function Kg(e,t){return e==null?e:{name:e.name}}function Hg(e){return Jg(e)}function Jg(e,t){return e==null?e:{attachmentType:e.attachmentType,query:k(e,"query")?zg(e.query):void 0,header:k(e,"header")?$g(e.header):void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Wg(e){return Qg(e)}function Qg(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,includeFullRecords:k(e,"includeFullRecords")?e.includeFullRecords:void 0}}function Gg(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,includeFullRecords:e.includeFullRecords}}function Xg(e){return Yg(e)}function Yg(e,t){return e==null?e:{url:e.url,method:k(e,"method")?e.method:void 0,successStatusCodes:k(e,"successStatusCodes")?e.successStatusCodes:void 0}}const Ju={ApiKey:"apiKey",Basic:"basic"};function Zg(e){return ey(e)}function ey(e,t){return e}function ty(e){return ny(e)}function ny(e,t){return e==null?e:{days:k(e,"days")?e.days:void 0,fullHistory:k(e,"fullHistory")?e.fullHistory:void 0}}function ry(e){if(e!==void 0)return e===null?null:{days:e.days,fullHistory:e.fullHistory}}function uf(e){return iy(e)}function iy(e,t){return e==null?e:{defaultPeriod:ty(e.defaultPeriod)}}function oy(e){if(e!==void 0)return e===null?null:{defaultPeriod:ry(e.defaultPeriod)}}function sy(e){return ay(e)}function ay(e,t){return e==null?e:{days:k(e,"days")?e.days:void 0,fullHistory:k(e,"fullHistory")?e.fullHistory:void 0}}function ly(e){if(e!==void 0)return e===null?null:{days:e.days,fullHistory:e.fullHistory}}function uy(e){return cy(e)}function cy(e,t){return e==null?e:{defaultPeriod:sy(e.defaultPeriod)}}function cf(e){if(e!==void 0)return e===null?null:{defaultPeriod:ly(e.defaultPeriod)}}function dy(e){return fy(e)}function fy(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function df(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function py(e){return hy(e)}function hy(e,t){return e==null?e:{mappedValue:e.mappedValue,mappedDisplayValue:e.mappedDisplayValue}}function my(e){if(e!==void 0)return e===null?null:{mappedValue:e.mappedValue,mappedDisplayValue:e.mappedDisplayValue}}function gy(e){return yy(e)}function yy(e,t){return e==null?e:{mapToName:e.mapToName,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,prompt:k(e,"prompt")?e.prompt:void 0,mappedValues:k(e,"mappedValues")?e.mappedValues.map(py):void 0,fieldName:k(e,"fieldName")?e.fieldName:void 0}}function ff(e){if(e!==void 0)return e===null?null:{mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,prompt:e.prompt,mappedValues:e.mappedValues===void 0?void 0:e.mappedValues.map(my),fieldName:e.fieldName}}function vy(e){return by(e)}function by(e,t){return e}function wy(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,schedule:e.schedule,disabled:e.disabled,destination:e.destination,selectedFields:e.selectedFields,selectedValueMappings:e.selectedValueMappings,dynamicMappingsInput:e.dynamicMappingsInput===void 0?void 0:e.dynamicMappingsInput.map(ff),selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:e.selectedFieldsAuto,backfill:cf(e.backfill)}}function xy(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,wy)}}function Iy(e){return Cy(e)}function Cy(e,t){return e==null?e:{stringValue:k(e,"stringValue")?e.stringValue:void 0,integerValue:k(e,"integerValue")?e.integerValue:void 0,booleanValue:k(e,"booleanValue")?e.booleanValue:void 0}}function Sy(e){if(e!==void 0)return e===null?null:{stringValue:e.stringValue,integerValue:e.integerValue,booleanValue:e.booleanValue}}const Oy={Always:"always",Never:"never"},Ey={Always:"always",Never:"never"};function _y(e){return Ty(e)}function Ty(e,t){return e==null?e:{default:k(e,"default")?Iy(e.default):void 0,writeOnCreate:k(e,"writeOnCreate")?e.writeOnCreate:void 0,writeOnUpdate:k(e,"writeOnUpdate")?e.writeOnUpdate:void 0}}function pf(e){if(e!==void 0)return e===null?null:{default:Sy(e.default),writeOnCreate:e.writeOnCreate,writeOnUpdate:e.writeOnUpdate}}function Ny(e){let t=!0;return t=t&&"value"in e,t}function ky(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function Ay(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Ry(e){let t=!0;return t=t&&"value"in e,t}function Py(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function Fy(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Dy(e){let t=!0;return t=t&&"value"in e,t}function My(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function jy(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Ly(e){return By(e)}function By(e,t){return e==null?e:{...ky(e),...Py(e),...My(e)}}function hf(e){if(e!==void 0)return e===null?null:Ny(e)?Ay(e):Ry(e)?Fy(e):Dy(e)?jy(e):{}}function Vy(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,selectedValueDefaults:e.selectedValueDefaults===void 0?void 0:nt(e.selectedValueDefaults,hf),selectedFieldSettings:e.selectedFieldSettings===void 0?void 0:nt(e.selectedFieldSettings,pf)}}function Uy(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,Vy)}}function $y(e){return qy(e)}function qy(e,t){return e==null?e:{enabled:e.enabled}}function zy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Ky(e){return Hy(e)}function Hy(e,t){return e==null?e:{enabled:e.enabled}}function Jy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Wy(e){return Qy(e)}function Qy(e,t){return e==null?e:{enabled:e.enabled,watchFieldsAuto:k(e,"watchFieldsAuto")?e.watchFieldsAuto:void 0,requiredWatchFields:k(e,"requiredWatchFields")?e.requiredWatchFields:void 0}}function Gy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,watchFieldsAuto:e.watchFieldsAuto,requiredWatchFields:e.requiredWatchFields}}function Xy(e){return Yy(e)}function Yy(e,t){return e==null?e:{apiKeyAsBasic:k(e,"apiKeyAsBasic")?e.apiKeyAsBasic:void 0,apiKeyAsBasicOpts:k(e,"apiKeyAsBasicOpts")?Vg(e.apiKeyAsBasicOpts):void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Zy(e){if(e!==void 0)return e===null?null:{sourceZipUrl:e.sourceZipUrl,sourceYaml:e.sourceYaml}}function jo(e){return ev(e)}function ev(e,t){return e==null?e:{supported:e.supported,defaultRecordLimit:k(e,"defaultRecordLimit")?e.defaultRecordLimit:void 0,objectRecordLimits:k(e,"objectRecordLimits")?e.objectRecordLimits:void 0}}function tv(e){return nv(e)}function nv(e,t){return e==null?e:{_delete:jo(e.delete),create:jo(e.create),update:jo(e.update),upsert:jo(e.upsert)}}function rv(e){return iv(e)}function iv(e,t){return e==null?e:{value:e.value}}function ov(e){return sv(e)}function sv(e,t){return e==null?e:{brandingRemoval:k(e,"brandingRemoval")?rv(e.brandingRemoval):void 0}}function Lo(e){return av(e)}function av(e,t){return e==null?e:{id:e.id,name:e.name,appName:e.appName,orgId:k(e,"orgId")?e.orgId:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,entitlements:k(e,"entitlements")?ov(e.entitlements):void 0}}function lv(e){return uv(e)}function uv(e,t){return e==null?e:{insert:e.insert,update:e.update,upsert:e.upsert,_delete:e.delete}}function cv(e){return dv(e)}function dv(e,t){return e==null?e:{objectName:e.objectName,schedule:k(e,"schedule")?e.schedule:void 0,disabled:k(e,"disabled")?e.disabled:void 0,destination:k(e,"destination")?e.destination:void 0,selectedFields:e.selectedFields,selectedValueMappings:k(e,"selectedValueMappings")?e.selectedValueMappings:void 0,dynamicMappingsInput:k(e,"dynamicMappingsInput")?e.dynamicMappingsInput.map(gy):void 0,selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:k(e,"selectedFieldsAuto")?vy(e.selectedFieldsAuto):void 0,backfill:k(e,"backfill")?uy(e.backfill):void 0}}function fv(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,schedule:e.schedule,disabled:e.disabled,destination:e.destination,selectedFields:e.selectedFields,selectedValueMappings:e.selectedValueMappings,dynamicMappingsInput:e.dynamicMappingsInput===void 0?void 0:e.dynamicMappingsInput.map(ff),selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:e.selectedFieldsAuto,backfill:cf(e.backfill)}}function pv(e){return hv(e)}function hv(e,t){return e==null?e:{objects:nt(e.objects,cv)}}function mv(e){if(e!==void 0)return e===null?null:{objects:nt(e.objects,fv)}}function gv(e){return yv(e)}function yv(e,t){return e==null?e:{inheritFieldsAndMappings:e.inheritFieldsAndMappings,objectName:e.objectName,destination:e.destination,createEvent:k(e,"createEvent")?$y(e.createEvent):void 0,updateEvent:k(e,"updateEvent")?Wy(e.updateEvent):void 0,deleteEvent:k(e,"deleteEvent")?Ky(e.deleteEvent):void 0}}function vv(e){if(e!==void 0)return e===null?null:{inheritFieldsAndMappings:e.inheritFieldsAndMappings,objectName:e.objectName,destination:e.destination,createEvent:zy(e.createEvent),updateEvent:Gy(e.updateEvent),deleteEvent:Jy(e.deleteEvent)}}function bv(e){return wv(e)}function wv(e,t){return e==null?e:{objects:nt(e.objects,gv)}}function xv(e){if(e!==void 0)return e===null?null:{objects:nt(e.objects,vv)}}function Iv(e){return Cv(e)}function Cv(e,t){return e==null?e:{objectName:e.objectName,selectedValueDefaults:k(e,"selectedValueDefaults")?nt(e.selectedValueDefaults,Ly):void 0,selectedFieldSettings:k(e,"selectedFieldSettings")?nt(e.selectedFieldSettings,_y):void 0}}function Sv(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,selectedValueDefaults:e.selectedValueDefaults===void 0?void 0:nt(e.selectedValueDefaults,hf),selectedFieldSettings:e.selectedFieldSettings===void 0?void 0:nt(e.selectedFieldSettings,pf)}}function Ov(e){return Ev(e)}function Ev(e,t){return e==null?e:{objects:k(e,"objects")?nt(e.objects,Iv):void 0}}function _v(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,Sv)}}function Tv(e){return Nv(e)}function Nv(e,t){return e==null?e:{provider:e.provider,read:k(e,"read")?pv(e.read):void 0,write:k(e,"write")?Ov(e.write):void 0,proxy:k(e,"proxy")?dy(e.proxy):void 0,subscribe:k(e,"subscribe")?bv(e.subscribe):void 0}}function kv(e){if(e!==void 0)return e===null?null:{provider:e.provider,read:mv(e.read),write:_v(e.write),proxy:df(e.proxy),subscribe:xv(e.subscribe)}}function Av(e){return Rv(e)}function Rv(e,t){return e==null?e:{id:e.id,revisionId:e.revisionId,createTime:new Date(e.createTime),createdBy:e.createdBy,content:Tv(e.content)}}function Pv(e){return Fv(e)}function Fv(e,t){return e==null?e:{consumerRef:e.consumerRef,consumerName:e.consumerName,projectId:e.projectId,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function mf(e){return Dv(e)}function Dv(e,t){return e==null?e:{groupRef:e.groupRef,groupName:e.groupName,projectId:e.projectId,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function Mv(e){return jv(e)}function jv(e,t){return e==null?e:{token:e.token,issuedAt:k(e,"issuedAt")?new Date(e.issuedAt):void 0,expiresAt:k(e,"expiresAt")?new Date(e.expiresAt):void 0}}function Lv(e){return Bv(e)}function Bv(e,t){return e==null?e:{token:e.token,issuedAt:k(e,"issuedAt")?new Date(e.issuedAt):void 0,expiresAt:k(e,"expiresAt")?new Date(e.expiresAt):void 0}}function Vv(e){return Uv(e)}function Uv(e,t){return e==null?e:{accessToken:k(e,"accessToken")?Mv(e.accessToken):void 0,refreshToken:k(e,"refreshToken")?Lv(e.refreshToken):void 0,scopes:k(e,"scopes")?e.scopes:void 0}}function Go(e){return $v(e)}function $v(e,t){return e==null?e:{id:e.id,projectId:e.projectId,externalRef:k(e,"externalRef")?e.externalRef:void 0,provider:e.provider,clientId:e.clientId,scopes:k(e,"scopes")?e.scopes:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function qv(e){return zv(e)}function zv(e,t){return e==null?e:{value:e.value,source:e.source,displayName:k(e,"displayName")?e.displayName:void 0}}function wl(e){if(e!==void 0)return e===null?null:{value:e.value,source:e.source,displayName:e.displayName}}function Ji(e){return Kv(e)}function Kv(e,t){return e==null?e:{id:e.id,projectId:e.projectId,provider:e.provider,providerApp:k(e,"providerApp")?Go(e.providerApp):void 0,group:mf(e.group),consumer:Pv(e.consumer),providerWorkspaceRef:k(e,"providerWorkspaceRef")?e.providerWorkspaceRef:void 0,providerConsumerRef:k(e,"providerConsumerRef")?e.providerConsumerRef:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,authScheme:e.authScheme,status:e.status,oauth2AuthorizationCode:k(e,"oauth2AuthorizationCode")?Vv(e.oauth2AuthorizationCode):void 0,apiKey:k(e,"apiKey")?e.apiKey:void 0,providerMetadata:k(e,"providerMetadata")?nt(e.providerMetadata,qv):void 0}}function gf(e){if(e!==void 0)return e===null?null:{username:e.username,password:e.password}}function yf(e){if(e!==void 0)return e===null?null:{clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function vf(e){if(e!==void 0)return e===null?null:{username:e.username,password:e.password,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function Hv(e){if(e!==void 0)return e===null?null:{token:e.token,expiresAt:e.expiresAt===void 0?void 0:e.expiresAt.toISOString(),issuedAt:e.issuedAt===void 0?void 0:e.issuedAt.toISOString()}}function Jv(e){if(e!==void 0)return e===null?null:{token:e.token,expiresAt:e.expiresAt===void 0?void 0:e.expiresAt.toISOString(),issuedAt:e.issuedAt===void 0?void 0:e.issuedAt.toISOString()}}function bf(e){if(e!==void 0)return e===null?null:{accessToken:Hv(e.accessToken),refreshToken:Jv(e.refreshToken),scopes:e.scopes}}function Wv(e){if(e!==void 0)return e===null?null:{providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,wl),groupName:e.groupName,groupRef:e.groupRef,consumerName:e.consumerName,consumerRef:e.consumerRef,provider:e.provider,apiKey:e.apiKey,customAuth:e.customAuth,basicAuth:gf(e.basicAuth),oauth2ClientCredentials:yf(e.oauth2ClientCredentials),oauth2PasswordCredentials:vf(e.oauth2PasswordCredentials),oauth2AuthorizationCode:bf(e.oauth2AuthorizationCode)}}function Qv(e){return Gv(e)}function Gv(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function Xv(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Yv(e){if(e!==void 0)return e===null?null:{revisionId:e.revisionId,createdBy:e.createdBy,content:kv(e.content)}}function Zv(e){if(e!==void 0)return e===null?null:{groupRef:e.groupRef,connectionId:e.connectionId,config:Yv(e.config)}}function eb(e){return tb(e)}function tb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,useModule:k(e,"useModule")?e.useModule:void 0}}function nb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,useModule:e.useModule}}function rb(e){return ib(e)}function ib(e,t){return e==null?e:{mode:k(e,"mode")?e.mode:void 0,pageSize:k(e,"pageSize")?e.pageSize:void 0}}function ob(e){if(e!==void 0)return e===null?null:{mode:e.mode,pageSize:e.pageSize}}function sb(e){let t=!0;return t=t&&"fieldName"in e,t}function ab(e,t){return e==null?e:{fieldName:e.fieldName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0}}function lb(e){if(e!==void 0)return e===null?null:{fieldName:e.fieldName,mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName}}function ub(e){let t=!0;return t=t&&"mapToName"in e,t}function wf(e,t){return e==null?e:{mapToName:e.mapToName,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,_default:k(e,"default")?e.default:void 0,prompt:k(e,"prompt")?e.prompt:void 0}}function cb(e){if(e!==void 0)return e===null?null:{mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,default:e._default,prompt:e.prompt}}function Wu(e){return db(e)}function db(e,t){return e==null?e:{...ab(e),...wf(e)}}function Qu(e){if(e!==void 0)return e===null?null:sb(e)?lb(e):ub(e)?cb(e):{}}function xf(e){return fb(e)}function fb(e,t){return e}function pb(e){return hb(e)}function hb(e,t){return e==null?e:{objectName:e.objectName,destination:e.destination,schedule:e.schedule,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,requiredFields:k(e,"requiredFields")?e.requiredFields.map(Wu):void 0,optionalFields:k(e,"optionalFields")?e.optionalFields.map(Wu):void 0,optionalFieldsAuto:k(e,"optionalFieldsAuto")?xf(e.optionalFieldsAuto):void 0,backfill:k(e,"backfill")?uf(e.backfill):void 0,delivery:k(e,"delivery")?rb(e.delivery):void 0,enabled:k(e,"enabled")?e.enabled:void 0}}function mb(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,destination:e.destination,schedule:e.schedule,mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,requiredFields:e.requiredFields===void 0?void 0:e.requiredFields.map(Qu),optionalFields:e.optionalFields===void 0?void 0:e.optionalFields.map(Qu),optionalFieldsAuto:e.optionalFieldsAuto,backfill:oy(e.backfill),delivery:ob(e.delivery),enabled:e.enabled}}function gb(e){return yb(e)}function yb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(pb):void 0}}function vb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(mb)}}function bb(e){return wb(e)}function wb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function xb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Ib(e){return Cb(e)}function Cb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,watchFieldsAuto:k(e,"watchFieldsAuto")?e.watchFieldsAuto:void 0,requiredWatchFields:k(e,"requiredWatchFields")?e.requiredWatchFields:void 0}}function Sb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,watchFieldsAuto:e.watchFieldsAuto,requiredWatchFields:e.requiredWatchFields}}function Ob(e){return Eb(e)}function Eb(e,t){return e==null?e:{objectName:e.objectName,destination:e.destination,inheritFieldsAndMapping:k(e,"inheritFieldsAndMapping")?e.inheritFieldsAndMapping:void 0,createEvent:k(e,"createEvent")?Qv(e.createEvent):void 0,updateEvent:k(e,"updateEvent")?Ib(e.updateEvent):void 0,deleteEvent:k(e,"deleteEvent")?bb(e.deleteEvent):void 0,associationChangeEvent:k(e,"associationChangeEvent")?Wg(e.associationChangeEvent):void 0,otherEvents:k(e,"otherEvents")?e.otherEvents:void 0}}function _b(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,destination:e.destination,inheritFieldsAndMapping:e.inheritFieldsAndMapping,createEvent:Xv(e.createEvent),updateEvent:Sb(e.updateEvent),deleteEvent:xb(e.deleteEvent),associationChangeEvent:Gg(e.associationChangeEvent),otherEvents:e.otherEvents}}function Tb(e){return Nb(e)}function Nb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(Ob):void 0}}function kb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(_b)}}function If(e){return Ab(e)}function Ab(e,t){return e==null?e:{allowAnyFields:k(e,"allowAnyFields")?e.allowAnyFields:void 0}}function Rb(e){if(e!==void 0)return e===null?null:{allowAnyFields:e.allowAnyFields}}function Pb(e){return Fb(e)}function Fb(e,t){return e==null?e:{objectName:e.objectName,inheritMapping:k(e,"inheritMapping")?e.inheritMapping:void 0,valueDefaults:k(e,"valueDefaults")?If(e.valueDefaults):void 0}}function Db(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,inheritMapping:e.inheritMapping,valueDefaults:Rb(e.valueDefaults)}}function Mb(e){return jb(e)}function jb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(Pb):void 0}}function Lb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(Db)}}function Bb(e){return Vb(e)}function Vb(e,t){return e==null?e:{name:e.name,provider:e.provider,displayName:k(e,"displayName")?e.displayName:void 0,module:k(e,"module")?e.module:void 0,read:k(e,"read")?gb(e.read):void 0,write:k(e,"write")?Mb(e.write):void 0,proxy:k(e,"proxy")?eb(e.proxy):void 0,subscribe:k(e,"subscribe")?Tb(e.subscribe):void 0}}function Ub(e){if(e!==void 0)return e===null?null:{name:e.name,provider:e.provider,displayName:e.displayName,module:e.module,read:vb(e.read),write:Lb(e.write),proxy:nb(e.proxy),subscribe:kb(e.subscribe)}}function $b(e){if(e!==void 0)return e===null?null:{specVersion:e.specVersion,content:Ub(e.content)}}function qb(e){if(e!==void 0)return e===null?null:{name:e.name,provider:e.provider,latestRevision:$b(e.latestRevision)}}function zb(e){if(e!==void 0)return e===null?null:{appName:e.appName,name:e.name,orgId:e.orgId}}function Kb(e){if(e!==void 0)return e===null?null:{externalRef:e.externalRef,provider:e.provider,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function Hb(e){if(e!==void 0)return e===null?null:{sourceZipUrl:e.sourceZipUrl,sourceYaml:e.sourceYaml}}function Jb(e){return Wb(e)}function Wb(e,t){return e==null?e:{name:e.name,valueTemplate:e.valueTemplate}}function Qb(e){return Gb(e)}function Gb(e,t){return e==null?e:{name:e.name,displayName:e.displayName,prompt:k(e,"prompt")?e.prompt:void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Xb(e){return Yb(e)}function Yb(e,t){return e==null?e:{name:e.name,valueTemplate:e.valueTemplate}}function Zb(e){return ew(e)}function ew(e,t){return e==null?e:{headers:k(e,"headers")?e.headers.map(Jb):void 0,queryParams:k(e,"queryParams")?e.queryParams.map(Xb):void 0,inputs:k(e,"inputs")?e.inputs.map(Qb):void 0}}function tw(e){return nw(e)}function nw(e,t){return e==null?e:{value:e.value,displayValue:e.displayValue}}function rw(e){return iw(e)}function iw(e,t){return e==null?e:{fieldName:e.fieldName,displayName:e.displayName,valueType:k(e,"valueType")?e.valueType:void 0,providerType:k(e,"providerType")?e.providerType:void 0,readOnly:k(e,"readOnly")?e.readOnly:void 0,values:k(e,"values")?e.values.map(tw):void 0}}function ow(e){if(e!==void 0)return e===null?null:{providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,wl),groupName:e.groupName,groupRef:e.groupRef,consumerName:e.consumerName,consumerRef:e.consumerRef,provider:e.provider,apiKey:e.apiKey,customAuth:e.customAuth,basicAuth:gf(e.basicAuth),oauth2ClientCredentials:yf(e.oauth2ClientCredentials),oauth2PasswordCredentials:vf(e.oauth2PasswordCredentials),oauth2AuthorizationCode:bf(e.oauth2AuthorizationCode)}}function sw(e){return aw(e)}function aw(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,useModule:k(e,"useModule")?e.useModule:void 0}}function lw(e,t){return e==null?e:{fieldName:e.fieldName,displayName:e.displayName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0}}function Js(e){return uw(e)}function uw(e,t){return e==null?e:{...lw(e),...wf(e)}}function cw(e){return dw(e)}function dw(e,t){return e==null?e:{error:k(e,"error")?e.error:void 0,objectName:e.objectName,displayName:e.displayName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,destination:e.destination,schedule:e.schedule,requiredFields:k(e,"requiredFields")?e.requiredFields.map(Js):void 0,optionalFields:k(e,"optionalFields")?e.optionalFields.map(Js):void 0,optionalFieldsAuto:k(e,"optionalFieldsAuto")?xf(e.optionalFieldsAuto):void 0,allFieldsMetadata:k(e,"allFieldsMetadata")?nt(e.allFieldsMetadata,rw):void 0,allFields:k(e,"allFields")?e.allFields.map(Js):void 0,backfill:k(e,"backfill")?uf(e.backfill):void 0}}function fw(e){return pw(e)}function pw(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(cw):void 0}}function hw(e){return mw(e)}function mw(e,t){return e==null?e:{objectName:e.objectName,displayName:e.displayName,valueDefaults:k(e,"valueDefaults")?If(e.valueDefaults):void 0}}function gw(e){return yw(e)}function yw(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(hw):void 0}}function vw(e){return bw(e)}function bw(e,t){return e==null?e:{name:e.name,displayName:k(e,"displayName")?e.displayName:void 0,module:k(e,"module")?e.module:void 0,provider:e.provider,read:k(e,"read")?fw(e.read):void 0,write:k(e,"write")?gw(e.write):void 0,proxy:k(e,"proxy")?sw(e.proxy):void 0}}function ww(e){return xw(e)}function xw(e,t){return e==null?e:{id:e.id,specVersion:e.specVersion,createTime:new Date(e.createTime),content:vw(e.content)}}function $i(e){return Iw(e)}function Iw(e,t){return e==null?e:{id:e.id,projectId:e.projectId,integrationId:e.integrationId,group:k(e,"group")?mf(e.group):void 0,healthStatus:e.healthStatus,connection:Ji(e.connection),createTime:new Date(e.createTime),createdBy:e.createdBy,updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,config:Av(e.config)}}function Cw(e){return Sw(e)}function Sw(e,t){return e==null?e:{id:e.id,specVersion:e.specVersion,createTime:new Date(e.createTime),content:Bb(e.content)}}function Ws(e){return Ow(e)}function Ow(e,t){return e==null?e:{id:e.id,projectId:e.projectId,name:e.name,provider:e.provider,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,latestRevision:Cw(e.latestRevision)}}function Ew(e){return _w(e)}function _w(e,t){return e==null?e:{iconURL:k(e,"iconURL")?e.iconURL:void 0,logoURL:k(e,"logoURL")?e.logoURL:void 0}}function Tw(e){return Nw(e)}function Nw(e,t){return e==null?e:{iconURL:k(e,"iconURL")?e.iconURL:void 0,logoURL:k(e,"logoURL")?e.logoURL:void 0}}function kw(e){return Aw(e)}function Aw(e,t){return e==null?e:{regular:k(e,"regular")?Tw(e.regular):void 0,darkMode:k(e,"darkMode")?Ew(e.darkMode):void 0}}function Rw(e){return Pw(e)}function Pw(e,t){return e==null?e:{name:e.name,displayName:k(e,"displayName")?e.displayName:void 0,prompt:k(e,"prompt")?e.prompt:void 0,defaultValue:k(e,"defaultValue")?e.defaultValue:void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0,moduleDependencies:k(e,"moduleDependencies")?e.moduleDependencies:void 0}}function Fw(e){return Dw(e)}function Dw(e,t){return e==null?e:{name:e.name,moduleDependencies:k(e,"moduleDependencies")?e.moduleDependencies:void 0}}function Mw(e){return jw(e)}function jw(e,t){return e==null?e:{create:k(e,"create")?e.create:void 0,update:k(e,"update")?e.update:void 0,_delete:k(e,"delete")?e.delete:void 0,passThrough:k(e,"passThrough")?e.passThrough:void 0}}function Cf(e){return Lw(e)}function Lw(e,t){return e==null?e:{bulkWrite:lv(e.bulkWrite),proxy:e.proxy,read:e.read,subscribe:e.subscribe,write:e.write,subscribeSupport:k(e,"subscribeSupport")?Mw(e.subscribeSupport):void 0,batchWrite:k(e,"batchWrite")?tv(e.batchWrite):void 0}}function Bw(e){return Vw(e)}function Vw(e,t){return e==null?e:{displayName:e.displayName,baseURL:e.baseURL,support:Cf(e.support)}}function Uw(e){return $w(e)}function $w(e,t){return e==null?e:{name:e.name,displayName:e.displayName,path:e.path,capture:k(e,"capture")?e.capture:void 0}}function qw(e){return zw(e)}function zw(e,t){return e==null?e:{workspaceRefField:k(e,"workspaceRefField")?e.workspaceRefField:void 0,consumerRefField:k(e,"consumerRefField")?e.consumerRefField:void 0,scopesField:k(e,"scopesField")?e.scopesField:void 0,otherFields:k(e,"otherFields")?e.otherFields.map(Uw):void 0}}const Qs={AuthorizationCode:"authorizationCode",AuthorizationCodePkce:"authorizationCodePKCE",ClientCredentials:"clientCredentials"};function Kw(e){return Hw(e)}function Hw(e,t){return e==null?e:{grantType:e.grantType,authURL:k(e,"authURL")?e.authURL:void 0,tokenURL:e.tokenURL,explicitScopesRequired:e.explicitScopesRequired,explicitWorkspaceRequired:e.explicitWorkspaceRequired,audience:k(e,"audience")?e.audience:void 0,tokenMetadataFields:qw(e.tokenMetadataFields),docsURL:k(e,"docsURL")?e.docsURL:void 0,authURLParams:k(e,"authURLParams")?e.authURLParams:void 0}}function Jw(e){if(e!==void 0)return e===null?null:{projectId:e.projectId,provider:e.provider,groupRef:e.groupRef,groupName:e.groupName,consumerRef:e.consumerRef,consumerName:e.consumerName,providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,wl),providerAppId:e.providerAppId,enableCSRFProtection:e.enableCSRFProtection}}function Ww(e){return Qw(e)}function Qw(e,t){return e==null?e:{input:k(e,"input")?e.input.map(Rw):void 0,postAuthentication:k(e,"postAuthentication")?e.postAuthentication.map(Fw):void 0}}function Gw(e){return Xw(e)}function Xw(e,t){return e==null?e:{subscriptionScope:e.subscriptionScope,targetURLScope:e.targetURLScope,registrationTiming:e.registrationTiming}}function Gu(e){return Yw(e)}function Yw(e,t){return e==null?e:{name:e.name,authType:Zg(e.authType),baseURL:e.baseURL,defaultModule:e.defaultModule,oauth2Opts:k(e,"oauth2Opts")?Kw(e.oauth2Opts):void 0,apiKeyOpts:k(e,"apiKeyOpts")?Hg(e.apiKeyOpts):void 0,basicOpts:k(e,"basicOpts")?Xy(e.basicOpts):void 0,customOpts:k(e,"customOpts")?Zb(e.customOpts):void 0,support:Cf(e.support),providerOpts:e.providerOpts,authHealthCheck:k(e,"authHealthCheck")?Xg(e.authHealthCheck):void 0,displayName:k(e,"displayName")?e.displayName:void 0,postAuthInfoNeeded:k(e,"postAuthInfoNeeded")?e.postAuthInfoNeeded:void 0,media:k(e,"media")?kw(e.media):void 0,labels:k(e,"labels")?e.labels:void 0,subscribeOpts:k(e,"subscribeOpts")?Gw(e.subscribeOpts):void 0,modules:k(e,"modules")?nt(e.modules,Bw):void 0,metadata:k(e,"metadata")?Ww(e.metadata):void 0}}function Zw(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,connection:Wv(e.connection)}}function ex(e){if(e!==void 0)return e===null?null:{provider:e.provider,read:xy(e.read),write:Uy(e.write),proxy:df(e.proxy)}}function tx(e){if(e!==void 0)return e===null?null:{revisionId:e.revisionId,createdBy:e.createdBy,content:ex(e.content)}}function nx(e){if(e!==void 0)return e===null?null:{connectionId:e.connectionId,config:tx(e.config)}}function rx(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,installation:nx(e.installation)}}function ix(e){if(e!==void 0)return e===null?null:{appName:e.appName,name:e.name}}function ox(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,project:ix(e.project)}}function sx(e){if(e!==void 0)return e===null?null:{externalRef:e.externalRef,provider:e.provider,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function ax(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,providerApp:sx(e.providerApp)}}class lx extends Tn{async deleteConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling deleteConnection.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"DELETE",headers:i,query:r},n);return new vi(o)}async deleteConnection(t,n){await this.deleteConnectionRaw(t,n)}async generateConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling generateConnection.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections:generate".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:ow(t.generateConnectionParams)},n);return new Qe(o,s=>Ji(s))}async generateConnection(t,n){return await(await this.generateConnectionRaw(t,n)).value()}async getConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling getConnection.");const r={};t.includeCreds!==void 0&&(r.includeCreds=t.includeCreds),t.includeRefreshToken!==void 0&&(r.includeRefreshToken=t.includeRefreshToken),t.refresh!==void 0&&(r.refresh=t.refresh);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Ji(s))}async getConnection(t,n){return await(await this.getConnectionRaw(t,n)).value()}async listConnectionsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listConnections.");const r={};t.provider!==void 0&&(r.provider=t.provider),t.groupRef!==void 0&&(r.groupRef=t.groupRef),t.consumerRef!==void 0&&(r.consumerRef=t.consumerRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Ji))}async listConnections(t,n){return await(await this.listConnectionsRaw(t,n)).value()}async updateConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling updateConnection.");if(t.updateConnectionRequest===null||t.updateConnectionRequest===void 0)throw new fe("updateConnectionRequest","Required parameter requestParameters.updateConnectionRequest was null or undefined when calling updateConnection.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"PATCH",headers:i,query:r,body:Zw(t.updateConnectionRequest)},n);return new Qe(o,s=>Ji(s))}async updateConnection(t,n){return await(await this.updateConnectionRaw(t,n)).value()}}class ux extends Tn{async createInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling createInstallation.");if(t.installation===null||t.installation===void 0)throw new fe("installation","Required parameter requestParameters.installation was null or undefined when calling createInstallation.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"POST",headers:i,query:r,body:Zv(t.installation)},n);return new Qe(o,s=>$i(s))}async createInstallation(t,n){return await(await this.createInstallationRaw(t,n)).value()}async deleteInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling deleteInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling deleteInstallation.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"DELETE",headers:i,query:r},n);return new vi(o)}async deleteInstallation(t,n){await this.deleteInstallationRaw(t,n)}async getInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling getInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling getInstallation.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>$i(s))}async getInstallation(t,n){return await(await this.getInstallationRaw(t,n)).value()}async listInstallationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listInstallations.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling listInstallations.");const r={};t.groupRef!==void 0&&(r.groupRef=t.groupRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map($i))}async listInstallations(t,n){return await(await this.listInstallationsRaw(t,n)).value()}async listInstallationsForProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listInstallationsForProject.");const r={};t.groupRef!==void 0&&(r.groupRef=t.groupRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map($i))}async listInstallationsForProject(t,n){return await(await this.listInstallationsForProjectRaw(t,n)).value()}async updateInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling updateInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling updateInstallation.");if(t.installationUpdate===null||t.installationUpdate===void 0)throw new fe("installationUpdate","Required parameter requestParameters.installationUpdate was null or undefined when calling updateInstallation.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"PATCH",headers:i,query:r,body:rx(t.installationUpdate)},n);return new Qe(o,s=>$i(s))}async updateInstallation(t,n){return await(await this.updateInstallationRaw(t,n)).value()}}class cx extends Tn{async batchUpsertIntegrationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling batchUpsertIntegrations.");if(t.batchUpsertIntegrationsRequest===null||t.batchUpsertIntegrationsRequest===void 0)throw new fe("batchUpsertIntegrationsRequest","Required parameter requestParameters.batchUpsertIntegrationsRequest was null or undefined when calling batchUpsertIntegrations.");const r={};t.destructive!==void 0&&(r.destructive=t.destructive);const i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations:batch".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"PUT",headers:i,query:r,body:Zy(t.batchUpsertIntegrationsRequest)},n);return new Qe(o,s=>s.map(Ws))}async batchUpsertIntegrations(t,n){return await(await this.batchUpsertIntegrationsRaw(t,n)).value()}async createIntegrationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createIntegration.");if(t.integration===null||t.integration===void 0)throw new fe("integration","Required parameter requestParameters.integration was null or undefined when calling createIntegration.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:qb(t.integration)},n);return new vi(o)}async createIntegration(t,n){await this.createIntegrationRaw(t,n)}async deleteIntegrationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteIntegration.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling deleteIntegration.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"DELETE",headers:i,query:r},n);return new vi(o)}async deleteIntegration(t,n){await this.deleteIntegrationRaw(t,n)}async getIntegrationRaw(t,n){if(t.integrationIdOrName===null||t.integrationIdOrName===void 0)throw new fe("integrationIdOrName","Required parameter requestParameters.integrationIdOrName was null or undefined when calling getIntegration.");if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getIntegration.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationIdOrName}".replace("{integrationIdOrName}",encodeURIComponent(String(t.integrationIdOrName))).replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Ws(s))}async getIntegration(t,n){return await(await this.getIntegrationRaw(t,n)).value()}async listIntegrationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listIntegrations.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Ws))}async listIntegrations(t,n){return await(await this.listIntegrationsRaw(t,n)).value()}}class dx extends Tn{async oauthConnectRaw(t,n){if(t.connectOAuthParams===null||t.connectOAuthParams===void 0)throw new fe("connectOAuthParams","Required parameter requestParameters.connectOAuthParams was null or undefined when calling oauthConnect.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/oauth-connect",method:"POST",headers:i,query:r,body:Jw(t.connectOAuthParams)},n);return this.isJsonMime(o.headers.get("content-type"))?new Qe(o):new Hu(o)}async oauthConnect(t,n){return await(await this.oauthConnectRaw(t,n)).value()}async oauthUpdateRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling oauthUpdate.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling oauthUpdate.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}:oauth-update".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"PATCH",headers:i,query:r},n);return this.isJsonMime(o.headers.get("content-type"))?new Qe(o):new Hu(o)}async oauthUpdate(t,n){return await(await this.oauthUpdateRaw(t,n)).value()}}class fx extends Tn{async createProjectRaw(t,n){if(t.project===null||t.project===void 0)throw new fe("project","Required parameter requestParameters.project was null or undefined when calling createProject.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects",method:"POST",headers:i,query:r,body:zb(t.project)},n);return new Qe(o,s=>Lo(s))}async createProject(t,n){return await(await this.createProjectRaw(t,n)).value()}async getProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getProject.");const r={};t.includeEntitlements!==void 0&&(r.includeEntitlements=t.includeEntitlements);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Lo(s))}async getProject(t,n){return await(await this.getProjectRaw(t,n)).value()}async listProjectsRaw(t){const n={},r={};if(this.configuration&&this.configuration.apiKey&&(r["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const o=this.configuration.accessToken,s=await o("Bearer",[]);s&&(r.Authorization=`Bearer ${s}`)}const i=await this.request({path:"/projects",method:"GET",headers:r,query:n},t);return new Qe(i,o=>o.map(Lo))}async listProjects(t){return await(await this.listProjectsRaw(t)).value()}async updateProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateProject.");if(t.projectUpdate===null||t.projectUpdate===void 0)throw new fe("projectUpdate","Required parameter requestParameters.projectUpdate was null or undefined when calling updateProject.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"PATCH",headers:i,query:r,body:ox(t.projectUpdate)},n);return new Qe(o,s=>Lo(s))}async updateProject(t,n){return await(await this.updateProjectRaw(t,n)).value()}}class px extends Tn{async getProviderRaw(t,n){if(t.provider===null||t.provider===void 0)throw new fe("provider","Required parameter requestParameters.provider was null or undefined when calling getProvider.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/providers/{provider}".replace("{provider}",encodeURIComponent(String(t.provider))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Gu(s))}async getProvider(t,n){return await(await this.getProviderRaw(t,n)).value()}async listProvidersRaw(t){const n={},r={};if(this.configuration&&this.configuration.apiKey&&(r["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const o=this.configuration.accessToken,s=await o("Bearer",[]);s&&(r.Authorization=`Bearer ${s}`)}const i=await this.request({path:"/providers",method:"GET",headers:r,query:n},t);return new Qe(i,o=>nt(o,Gu))}async listProviders(t){return await(await this.listProvidersRaw(t)).value()}}class hx extends Tn{async createProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createProviderApp.");if(t.providerApp===null||t.providerApp===void 0)throw new fe("providerApp","Required parameter requestParameters.providerApp was null or undefined when calling createProviderApp.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:Kb(t.providerApp)},n);return new Qe(o,s=>Go(s))}async createProviderApp(t,n){return await(await this.createProviderAppRaw(t,n)).value()}async deleteProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteProviderApp.");if(t.providerAppId===null||t.providerAppId===void 0)throw new fe("providerAppId","Required parameter requestParameters.providerAppId was null or undefined when calling deleteProviderApp.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps/{providerAppId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{providerAppId}",encodeURIComponent(String(t.providerAppId))),method:"DELETE",headers:i,query:r},n);return new vi(o)}async deleteProviderApp(t,n){await this.deleteProviderAppRaw(t,n)}async listProviderAppsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listProviderApps.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Go))}async listProviderApps(t,n){return await(await this.listProviderAppsRaw(t,n)).value()}async updateProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateProviderApp.");if(t.providerAppId===null||t.providerAppId===void 0)throw new fe("providerAppId","Required parameter requestParameters.providerAppId was null or undefined when calling updateProviderApp.");if(t.providerAppUpdate===null||t.providerAppUpdate===void 0)throw new fe("providerAppUpdate","Required parameter requestParameters.providerAppUpdate was null or undefined when calling updateProviderApp.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps/{providerAppId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{providerAppId}",encodeURIComponent(String(t.providerAppId))),method:"PATCH",headers:i,query:r,body:ax(t.providerAppUpdate)},n);return new Qe(o,s=>Go(s))}async updateProviderApp(t,n){return await(await this.updateProviderAppRaw(t,n)).value()}}class mx extends Tn{async createRevisionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createRevision.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling createRevision.");if(t.revision===null||t.revision===void 0)throw new fe("revision","Required parameter requestParameters.revision was null or undefined when calling createRevision.");const r={};t.destructive!==void 0&&(r.destructive=t.destructive);const i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/revisions".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"POST",headers:i,query:r,body:Hb(t.revision)},n);return new vi(o)}async createRevision(t,n){await this.createRevisionRaw(t,n)}async getHydratedRevisionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getHydratedRevision.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling getHydratedRevision.");if(t.revisionId===null||t.revisionId===void 0)throw new fe("revisionId","Required parameter requestParameters.revisionId was null or undefined when calling getHydratedRevision.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling getHydratedRevision.");const r={};t.connectionId!==void 0&&(r.connectionId=t.connectionId);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/revisions/{revisionId}:hydrate".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{revisionId}",encodeURIComponent(String(t.revisionId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>ww(s))}async getHydratedRevision(t,n){return await(await this.getHydratedRevisionRaw(t,n)).value()}}var ki=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gx={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},In,Ar,Qd,yx=(Qd=class{constructor(){pe(this,In,gx);pe(this,Ar,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&T(this,Ar)&&e!==T(this,In)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:T(this,In),provider:e}),re(this,In,e),process.env.NODE_ENV!=="production"&&re(this,Ar,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&re(this,Ar,!0),T(this,In).setTimeout(e,t)}clearTimeout(e){T(this,In).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&re(this,Ar,!0),T(this,In).setInterval(e,t)}clearInterval(e){T(this,In).clearInterval(e)}},In=new WeakMap,Ar=new WeakMap,Qd),Nr=new yx;function vx(e){setTimeout(e,0)}var $r=typeof window>"u"||"Deno"in globalThis;function Pt(){}function bx(e,t){return typeof e=="function"?e(t):e}function Sa(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fr(e,t){return typeof e=="function"?e(t):e}function on(e,t){return typeof e=="function"?e(t):e}function Xu(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==xl(s,t.options))return!1}else if(!to(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function Yu(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(qr(t.options.mutationKey)!==qr(o))return!1}else if(!to(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function xl(e,t){return((t==null?void 0:t.queryKeyHashFn)||qr)(e)}function qr(e){return JSON.stringify(e,(t,n)=>Ea(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function to(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>to(e[n],t[n])):!1}var wx=Object.prototype.hasOwnProperty;function Oa(e,t){if(e===t)return e;const n=Zu(e)&&Zu(t);if(!n&&!(Ea(e)&&Ea(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,a=n?new Array(s):{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c],d=e[u],h=t[u];if(d===h){a[u]=d,(n?c<i:wx.call(e,u))&&l++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){a[u]=h;continue}const f=Oa(d,h);a[u]=f,f===d&&l++}return i===s&&l===i?e:a}function is(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Zu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ea(e){if(!ec(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ec(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ec(e){return Object.prototype.toString.call(e)==="[object Object]"}function xx(e){return new Promise(t=>{Nr.setTimeout(t,e)})}function _a(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Oa(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Oa(e,t)}return t}function Ix(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Cx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var os=Symbol();function Of(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===os&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===os?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ef(e,t){return typeof e=="function"?e(...t):!!e}var Rr,ir,si,Gd,Sx=(Gd=class extends ki{constructor(){super();pe(this,Rr);pe(this,ir);pe(this,si);re(this,si,t=>{if(!$r&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,ir)||this.setEventListener(T(this,si))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,ir))==null||t.call(this),re(this,ir,void 0))}setEventListener(t){var n;re(this,si,t),(n=T(this,ir))==null||n.call(this),re(this,ir,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Rr)!==t&&(re(this,Rr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Rr)=="boolean"?T(this,Rr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Rr=new WeakMap,ir=new WeakMap,si=new WeakMap,Gd),Il=new Sx;function Ta(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Ox=vx;function Ex(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=Ox;const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var dt=Ex(),ai,or,li,Xd,_x=(Xd=class extends ki{constructor(){super();pe(this,ai,!0);pe(this,or);pe(this,li);re(this,li,t=>{if(!$r&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,or)||this.setEventListener(T(this,li))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,or))==null||t.call(this),re(this,or,void 0))}setEventListener(t){var n;re(this,li,t),(n=T(this,or))==null||n.call(this),re(this,or,t(this.setOnline.bind(this)))}setOnline(t){T(this,ai)!==t&&(re(this,ai,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,ai)}},ai=new WeakMap,or=new WeakMap,li=new WeakMap,Xd),ss=new _x;function Tx(e){return Math.min(1e3*2**e,3e4)}function _f(e){return(e??"online")==="online"?ss.isOnline():!0}var Na=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Tf(e){let t=!1,n=0,r;const i=Ta(),o=()=>i.status!=="pending",s=g=>{var v;if(!o()){const w=new Na(g);h(w),(v=e.onCancel)==null||v.call(e,w)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>Il.isFocused()&&(e.networkMode==="always"||ss.isOnline())&&e.canRun(),u=()=>_f(e.networkMode)&&e.canRun(),d=g=>{o()||(r==null||r(),i.resolve(g))},h=g=>{o()||(r==null||r(),i.reject(g))},f=()=>new Promise(g=>{var v;r=w=>{(o()||c())&&g(w)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;r=void 0,o()||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(o())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var E;if(o())return;const y=e.retry??($r?0:3),b=e.retryDelay??Tx,x=typeof b=="function"?b(n,w):b,S=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!S){h(w);return}n++,(E=e.onFail)==null||E.call(e,n,w),xx(x).then(()=>c()?void 0:f()).then(()=>{t?h(w):m()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var Pr,Yd,Nf=(Yd=class{constructor(){pe(this,Pr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sa(this.gcTime)&&re(this,Pr,Nr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($r?1/0:5*60*1e3))}clearGcTimeout(){T(this,Pr)&&(Nr.clearTimeout(T(this,Pr)),re(this,Pr,void 0))}},Pr=new WeakMap,Yd),Fr,ui,rn,Dr,ht,uo,Mr,hn,Ln,Zd,Nx=(Zd=class extends Nf{constructor(t){super();pe(this,hn);pe(this,Fr);pe(this,ui);pe(this,rn);pe(this,Dr);pe(this,ht);pe(this,uo);pe(this,Mr);re(this,Mr,!1),re(this,uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,Dr,t.client),re(this,rn,T(this,Dr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,Fr,tc(this.options)),this.state=t.state??T(this,Fr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,ht))==null?void 0:t.promise}setOptions(t){if(this.options={...T(this,uo),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=tc(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),re(this,Fr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,rn).remove(this)}setData(t,n){const r=_a(this.state.data,t,this.options);return Ce(this,hn,Ln).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ce(this,hn,Ln).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,ht))==null?void 0:r.promise;return(i=T(this,ht))==null||i.cancel(t),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Fr))}isActive(){return this.observers.some(t=>on(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===os||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Sf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,ht))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,ht))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,ht)&&(T(this,Mr)?T(this,ht).cancel({revert:!0}):T(this,ht).cancelRetry()),this.scheduleGc()),T(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,hn,Ln).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,u,d,h,f,m,g,v,w,y,b;if(this.state.fetchStatus!=="idle"&&((l=T(this,ht))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,ht))return T(this,ht).continueRetry(),T(this,ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(S=>S.options.queryFn);x&&this.setOptions(x.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(re(this,Mr,!0),r.signal)})},o=()=>{const x=Of(this.options,n),E=(()=>{const D={client:T(this,Dr),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return re(this,Mr,!1),this.options.persister?this.options.persister(x,E,this):x(E)},a=(()=>{const x={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Dr),state:this.state,fetchFn:o};return i(x),x})();(c=this.options.behavior)==null||c.onFetch(a,this),re(this,ui,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ce(this,hn,Ln).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),re(this,ht,Tf({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Na&&x.revert&&this.setState({...T(this,ui),fetchStatus:"idle"}),r.abort()},onFail:(x,S)=>{Ce(this,hn,Ln).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Ce(this,hn,Ln).call(this,{type:"pause"})},onContinue:()=>{Ce(this,hn,Ln).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await T(this,ht).start();if(x===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(x),(f=(h=T(this,rn).config).onSuccess)==null||f.call(h,x,this),(g=(m=T(this,rn).config).onSettled)==null||g.call(m,x,this.state.error,this),x}catch(x){if(x instanceof Na){if(x.silent)return T(this,ht).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Ce(this,hn,Ln).call(this,{type:"error",error:x}),(w=(v=T(this,rn).config).onError)==null||w.call(v,x,this),(b=(y=T(this,rn).config).onSettled)==null||b.call(y,this.state.data,x,this),x}finally{this.scheduleGc()}}},Fr=new WeakMap,ui=new WeakMap,rn=new WeakMap,Dr=new WeakMap,ht=new WeakMap,uo=new WeakMap,Mr=new WeakMap,hn=new WeakSet,Ln=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...kf(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,ui,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,rn).notify({query:this,type:"updated",action:t})})},Zd);function kf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_f(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jt,Te,co,At,jr,ci,Bn,sr,fo,di,fi,Lr,Br,ar,pi,je,Wi,ka,Aa,Ra,Pa,Fa,Da,Ma,Af,ef,kx=(ef=class extends ki{constructor(t,n){super();pe(this,je);pe(this,jt);pe(this,Te);pe(this,co);pe(this,At);pe(this,jr);pe(this,ci);pe(this,Bn);pe(this,sr);pe(this,fo);pe(this,di);pe(this,fi);pe(this,Lr);pe(this,Br);pe(this,ar);pe(this,pi,new Set);this.options=n,re(this,jt,t),re(this,sr,null),re(this,Bn,Ta()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Te).addObserver(this),nc(T(this,Te),this.options)?Ce(this,je,Wi).call(this):this.updateResult(),Ce(this,je,Pa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ja(T(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ja(T(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,je,Fa).call(this),Ce(this,je,Da).call(this),T(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,Te);if(this.options=T(this,jt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,T(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,je,Ma).call(this),T(this,Te).setOptions(this.options),n._defaulted&&!is(this.options,n)&&T(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Te),observer:this});const i=this.hasListeners();i&&rc(T(this,Te),r,this.options,n)&&Ce(this,je,Wi).call(this),this.updateResult(),i&&(T(this,Te)!==r||on(this.options.enabled,T(this,Te))!==on(n.enabled,T(this,Te))||fr(this.options.staleTime,T(this,Te))!==fr(n.staleTime,T(this,Te)))&&Ce(this,je,ka).call(this);const o=Ce(this,je,Aa).call(this);i&&(T(this,Te)!==r||on(this.options.enabled,T(this,Te))!==on(n.enabled,T(this,Te))||o!==T(this,ar))&&Ce(this,je,Ra).call(this,o)}getOptimisticResult(t){const n=T(this,jt).getQueryCache().build(T(this,jt),t),r=this.createResult(n,t);return Rx(this,r)&&(re(this,At,r),re(this,ci,this.options),re(this,jr,T(this,Te).state)),r}getCurrentResult(){return T(this,At)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&T(this,Bn).status==="pending"&&T(this,Bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){T(this,pi).add(t)}getCurrentQuery(){return T(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,jt).defaultQueryOptions(t),r=T(this,jt).getQueryCache().build(T(this,jt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ce(this,je,Wi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,At)))}createResult(t,n){var M;const r=T(this,Te),i=this.options,o=T(this,At),s=T(this,jr),a=T(this,ci),c=t!==r?t.state:T(this,co),{state:u}=t;let d={...u},h=!1,f;if(n._optimisticResults){const R=this.hasListeners(),P=!R&&nc(t,n),F=R&&rc(t,r,n,i);(P||F)&&(d={...d,...kf(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:v}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=o.data,w=!0):R=typeof n.placeholderData=="function"?n.placeholderData((M=T(this,fi))==null?void 0:M.state.data,T(this,fi)):n.placeholderData,R!==void 0&&(v="success",f=_a(o==null?void 0:o.data,R,n),h=!0)}if(n.select&&f!==void 0&&!w)if(o&&f===(s==null?void 0:s.data)&&n.select===T(this,fo))f=T(this,di);else try{re(this,fo,n.select),f=n.select(f),f=_a(o==null?void 0:o.data,f,n),re(this,di,f),re(this,sr,null)}catch(R){re(this,sr,R)}T(this,sr)&&(m=T(this,sr),f=T(this,di),g=Date.now(),v="error");const y=d.fetchStatus==="fetching",b=v==="pending",x=v==="error",S=b&&y,E=f!==void 0,N={status:v,fetchStatus:d.fetchStatus,isPending:b,isSuccess:v==="success",isError:x,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&E,isStale:Cl(t,n),refetch:this.refetch,promise:T(this,Bn),isEnabled:on(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=U=>{N.status==="error"?U.reject(N.error):N.data!==void 0&&U.resolve(N.data)},P=()=>{const U=re(this,Bn,N.promise=Ta());R(U)},F=T(this,Bn);switch(F.status){case"pending":t.queryHash===r.queryHash&&R(F);break;case"fulfilled":(N.status==="error"||N.data!==F.value)&&P();break;case"rejected":(N.status!=="error"||N.error!==F.reason)&&P();break}}return N}updateResult(){const t=T(this,At),n=this.createResult(T(this,Te),this.options);if(re(this,jr,T(this,Te).state),re(this,ci,this.options),T(this,jr).data!==void 0&&re(this,fi,T(this,Te)),is(n,t))return;re(this,At,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!T(this,pi).size)return!0;const s=new Set(o??T(this,pi));return this.options.throwOnError&&s.add("error"),Object.keys(T(this,At)).some(a=>{const l=a;return T(this,At)[l]!==t[l]&&s.has(l)})};Ce(this,je,Af).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,je,Pa).call(this)}},jt=new WeakMap,Te=new WeakMap,co=new WeakMap,At=new WeakMap,jr=new WeakMap,ci=new WeakMap,Bn=new WeakMap,sr=new WeakMap,fo=new WeakMap,di=new WeakMap,fi=new WeakMap,Lr=new WeakMap,Br=new WeakMap,ar=new WeakMap,pi=new WeakMap,je=new WeakSet,Wi=function(t){Ce(this,je,Ma).call(this);let n=T(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pt)),n},ka=function(){Ce(this,je,Fa).call(this);const t=fr(this.options.staleTime,T(this,Te));if($r||T(this,At).isStale||!Sa(t))return;const r=Sf(T(this,At).dataUpdatedAt,t)+1;re(this,Lr,Nr.setTimeout(()=>{T(this,At).isStale||this.updateResult()},r))},Aa=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Te)):this.options.refetchInterval)??!1},Ra=function(t){Ce(this,je,Da).call(this),re(this,ar,t),!($r||on(this.options.enabled,T(this,Te))===!1||!Sa(T(this,ar))||T(this,ar)===0)&&re(this,Br,Nr.setInterval(()=>{(this.options.refetchIntervalInBackground||Il.isFocused())&&Ce(this,je,Wi).call(this)},T(this,ar)))},Pa=function(){Ce(this,je,ka).call(this),Ce(this,je,Ra).call(this,Ce(this,je,Aa).call(this))},Fa=function(){T(this,Lr)&&(Nr.clearTimeout(T(this,Lr)),re(this,Lr,void 0))},Da=function(){T(this,Br)&&(Nr.clearInterval(T(this,Br)),re(this,Br,void 0))},Ma=function(){const t=T(this,jt).getQueryCache().build(T(this,jt),this.options);if(t===T(this,Te))return;const n=T(this,Te);re(this,Te,t),re(this,co,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Af=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,At))}),T(this,jt).getQueryCache().notify({query:T(this,Te),type:"observerResultsUpdated"})})},ef);function Ax(e,t){return on(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nc(e,t){return Ax(e,t)||e.state.data!==void 0&&ja(e,t,t.refetchOnMount)}function ja(e,t,n){if(on(t.enabled,e)!==!1&&fr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Cl(e,t)}return!1}function rc(e,t,n,r){return(e!==t||on(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Cl(e,n)}function Cl(e,t){return on(t.enabled,e)!==!1&&e.isStaleByTime(fr(t.staleTime,e))}function Rx(e,t){return!is(e.getCurrentResult(),t)}function ic(e){return{onFetch:(t,n)=>{var u,d,h,f,m;const r=t.options,i=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Of(t.options,t.fetchOptions),y=async(b,x,S)=>{if(g)return Promise.reject();if(x==null&&b.pages.length)return Promise.resolve(b);const D=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:x,direction:S?"backward":"forward",meta:t.options.meta};return v(P),P})(),N=await w(D),{maxPages:M}=t.options,R=S?Cx:Ix;return{pages:R(b.pages,N,M),pageParams:R(b.pageParams,x,M)}};if(i&&o.length){const b=i==="backward",x=b?Px:oc,S={pages:o,pageParams:s},E=x(r,S);a=await y(S,E,b)}else{const b=e??o.length;do{const x=l===0?s[0]??r.initialPageParam:oc(r,a);if(l>0&&x==null)break;a=await y(a,x),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function oc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Px(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var po,Cn,Rt,Vr,Sn,nr,tf,Fx=(tf=class extends Nf{constructor(t){super();pe(this,Sn);pe(this,po);pe(this,Cn);pe(this,Rt);pe(this,Vr);re(this,po,t.client),this.mutationId=t.mutationId,re(this,Rt,t.mutationCache),re(this,Cn,[]),this.state=t.state||Rf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Cn).includes(t)||(T(this,Cn).push(t),this.clearGcTimeout(),T(this,Rt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,Cn,T(this,Cn).filter(n=>n!==t)),this.scheduleGc(),T(this,Rt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Cn).length||(this.state.status==="pending"?this.scheduleGc():T(this,Rt).remove(this))}continue(){var t;return((t=T(this,Vr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,c,u,d,h,f,m,g,v,w,y,b,x,S,E,D,N,M;const n=()=>{Ce(this,Sn,nr).call(this,{type:"continue"})},r={client:T(this,po),meta:this.options.meta,mutationKey:this.options.mutationKey};re(this,Vr,Tf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,P)=>{Ce(this,Sn,nr).call(this,{type:"failed",failureCount:R,error:P})},onPause:()=>{Ce(this,Sn,nr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Rt).canRun(this)}));const i=this.state.status==="pending",o=!T(this,Vr).canStart();try{if(i)n();else{Ce(this,Sn,nr).call(this,{type:"pending",variables:t,isPaused:o}),await((a=(s=T(this,Rt).config).onMutate)==null?void 0:a.call(s,t,this,r));const P=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));P!==this.state.context&&Ce(this,Sn,nr).call(this,{type:"pending",context:P,variables:t,isPaused:o})}const R=await T(this,Vr).start();return await((d=(u=T(this,Rt).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this,r)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,R,t,this.state.context,r)),await((g=(m=T(this,Rt).config).onSettled)==null?void 0:g.call(m,R,null,this.state.variables,this.state.context,this,r)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,R,null,t,this.state.context,r)),Ce(this,Sn,nr).call(this,{type:"success",data:R}),R}catch(R){try{throw await((b=(y=T(this,Rt).config).onError)==null?void 0:b.call(y,R,t,this.state.context,this,r)),await((S=(x=this.options).onError)==null?void 0:S.call(x,R,t,this.state.context,r)),await((D=(E=T(this,Rt).config).onSettled)==null?void 0:D.call(E,void 0,R,this.state.variables,this.state.context,this,r)),await((M=(N=this.options).onSettled)==null?void 0:M.call(N,void 0,R,t,this.state.context,r)),R}finally{Ce(this,Sn,nr).call(this,{type:"error",error:R})}}finally{T(this,Rt).runNext(this)}}},po=new WeakMap,Cn=new WeakMap,Rt=new WeakMap,Vr=new WeakMap,Sn=new WeakSet,nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dt.batch(()=>{T(this,Cn).forEach(r=>{r.onMutationUpdate(t)}),T(this,Rt).notify({mutation:this,type:"updated",action:t})})},tf);function Rf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vn,mn,ho,nf,Dx=(nf=class extends ki{constructor(t={}){super();pe(this,Vn);pe(this,mn);pe(this,ho);this.config=t,re(this,Vn,new Set),re(this,mn,new Map),re(this,ho,0)}build(t,n,r){const i=new Fx({client:t,mutationCache:this,mutationId:++Mo(this,ho)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){T(this,Vn).add(t);const n=Bo(t);if(typeof n=="string"){const r=T(this,mn).get(n);r?r.push(t):T(this,mn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,Vn).delete(t)){const n=Bo(t);if(typeof n=="string"){const r=T(this,mn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&T(this,mn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Bo(t);if(typeof n=="string"){const r=T(this,mn).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Bo(t);if(typeof n=="string"){const i=(r=T(this,mn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{T(this,Vn).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,Vn).clear(),T(this,mn).clear()})}getAll(){return Array.from(T(this,Vn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Yu(n,r))}findAll(t={}){return this.getAll().filter(n=>Yu(t,n))}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pt))))}},Vn=new WeakMap,mn=new WeakMap,ho=new WeakMap,nf);function Bo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Un,lr,Lt,$n,zn,Xo,La,rf,Mx=(rf=class extends ki{constructor(n,r){super();pe(this,zn);pe(this,Un);pe(this,lr);pe(this,Lt);pe(this,$n);re(this,Un,n),this.setOptions(r),this.bindMethods(),Ce(this,zn,Xo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=T(this,Un).defaultMutationOptions(n),is(this.options,r)||T(this,Un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Lt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&qr(r.mutationKey)!==qr(this.options.mutationKey)?this.reset():((i=T(this,Lt))==null?void 0:i.state.status)==="pending"&&T(this,Lt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,Lt))==null||n.removeObserver(this)}onMutationUpdate(n){Ce(this,zn,Xo).call(this),Ce(this,zn,La).call(this,n)}getCurrentResult(){return T(this,lr)}reset(){var n;(n=T(this,Lt))==null||n.removeObserver(this),re(this,Lt,void 0),Ce(this,zn,Xo).call(this),Ce(this,zn,La).call(this)}mutate(n,r){var i;return re(this,$n,r),(i=T(this,Lt))==null||i.removeObserver(this),re(this,Lt,T(this,Un).getMutationCache().build(T(this,Un),this.options)),T(this,Lt).addObserver(this),T(this,Lt).execute(n)}},Un=new WeakMap,lr=new WeakMap,Lt=new WeakMap,$n=new WeakMap,zn=new WeakSet,Xo=function(){var r;const n=((r=T(this,Lt))==null?void 0:r.state)??Rf();re(this,lr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},La=function(n){dt.batch(()=>{var r,i,o,s,a,l,c,u;if(T(this,$n)&&this.hasListeners()){const d=T(this,lr).variables,h=T(this,lr).context,f={client:T(this,Un),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((i=(r=T(this,$n)).onSuccess)==null||i.call(r,n.data,d,h,f),(s=(o=T(this,$n)).onSettled)==null||s.call(o,n.data,null,d,h,f)):(n==null?void 0:n.type)==="error"&&((l=(a=T(this,$n)).onError)==null||l.call(a,n.error,d,h,f),(u=(c=T(this,$n)).onSettled)==null||u.call(c,void 0,n.error,d,h,f))}this.listeners.forEach(d=>{d(T(this,lr))})})},rf),On,of,jx=(of=class extends ki{constructor(t={}){super();pe(this,On);this.config=t,re(this,On,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??xl(i,n);let s=this.get(o);return s||(s=new Nx({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){T(this,On).has(t.queryHash)||(T(this,On).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,On).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,On).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,On).get(t)}getAll(){return[...T(this,On).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Xu(t,r)):n}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},On=new WeakMap,of),et,ur,cr,hi,mi,dr,gi,yi,sf,Lx=(sf=class{constructor(e={}){pe(this,et);pe(this,ur);pe(this,cr);pe(this,hi);pe(this,mi);pe(this,dr);pe(this,gi);pe(this,yi);re(this,et,e.queryCache||new jx),re(this,ur,e.mutationCache||new Dx),re(this,cr,e.defaultOptions||{}),re(this,hi,new Map),re(this,mi,new Map),re(this,dr,0)}mount(){Mo(this,dr)._++,T(this,dr)===1&&(re(this,gi,Il.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,et).onFocus())})),re(this,yi,ss.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,et).onOnline())})))}unmount(){var e,t;Mo(this,dr)._--,T(this,dr)===0&&((e=T(this,gi))==null||e.call(this),re(this,gi,void 0),(t=T(this,yi))==null||t.call(this),re(this,yi,void 0))}isFetching(e){return T(this,et).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,ur).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,et).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,et).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,et).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=T(this,et).get(r.queryHash),o=i==null?void 0:i.state.data,s=bx(t,o);if(s!==void 0)return T(this,et).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return dt.batch(()=>T(this,et).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,et).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,et);dt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,et);return dt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dt.batch(()=>T(this,et).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return dt.batch(()=>(T(this,et).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=dt.batch(()=>T(this,et).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,et).build(this,t);return n.isStaleByTime(fr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}fetchInfiniteQuery(e){return e.behavior=ic(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e.behavior=ic(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ss.isOnline()?T(this,ur).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,et)}getMutationCache(){return T(this,ur)}getDefaultOptions(){return T(this,cr)}setDefaultOptions(e){re(this,cr,e)}setQueryDefaults(e,t){T(this,hi).set(qr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,hi).values()],n={};return t.forEach(r=>{to(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,mi).set(qr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,mi).values()],n={};return t.forEach(r=>{to(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,cr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===os&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,cr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,et).clear(),T(this,ur).clear()}},et=new WeakMap,ur=new WeakMap,cr=new WeakMap,hi=new WeakMap,mi=new WeakMap,dr=new WeakMap,gi=new WeakMap,yi=new WeakMap,sf),Pf=W.createContext(void 0),st=e=>{const t=W.useContext(Pf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bx=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Pf.Provider,{value:e,children:t})),Ff=W.createContext(!1),Vx=()=>W.useContext(Ff);Ff.Provider;function Ux(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $x=W.createContext(Ux()),qx=()=>W.useContext($x),zx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Kx=e=>{W.useEffect(()=>{e.clearReset()},[e])},Hx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ef(n,[e.error,r])),Jx=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Wx=(e,t)=>e.isLoading&&e.isFetching&&!t,Qx=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Gx(e,t,n){var d,h,f,m,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Vx(),i=qx(),o=st(),s=o.defaultQueryOptions(e);(h=(d=o.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=r?"isRestoring":"optimistic",Jx(s),zx(s,i),Kx(i);const a=!o.getQueryCache().get(s.queryHash),[l]=W.useState(()=>new t(o,s)),c=l.getOptimisticResult(s),u=!r&&e.subscribed!==!1;if(W.useSyncExternalStore(W.useCallback(v=>{const w=u?l.subscribe(dt.batchCalls(v)):Pt;return l.updateResult(),w},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),W.useEffect(()=>{l.setOptions(s)},[s,l]),Qx(s,c))throw sc(s,l,i);if(Hx({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:o.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((m=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,s,c),s.experimental_prefetchInRender&&!$r&&Wx(c,r)){const v=a?sc(s,l,i):(g=o.getQueryCache().get(s.queryHash))==null?void 0:g.promise;v==null||v.catch(Pt).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Wr(e,t){return Gx(e,kx)}function Kn(e,t){const n=st(),[r]=W.useState(()=>new Mx(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);const i=W.useSyncExternalStore(W.useCallback(s=>r.subscribe(dt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=W.useCallback((s,a)=>{r.mutate(s,a).catch(Pt)},[r]);if(i.error&&Ef(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const Df=C.createContext(null),Xx=Df.Provider,Mf=()=>C.useContext(Df);var Ee=(e=>(e.MAPPING="mappingError",e.INTEGRATION_LIST="integrationListError",e.PROJECT="projectError",e.CONNECTION_LIST="connectionListError",e.HYDRATED_REVISION="hydratedRevisionError",e.INSTALLATION_LIST="installationListError",e.INSTALLATION_MUTATION="installationMutationError",e.VALUE_MAPPING="valueMappingError",e))(Ee||{});const jf=C.createContext(void 0);function An(){const e=C.useContext(jf);if(!e)throw new Error("useErrorState must be used within a ErrorProvider");return e}const Yx=(()=>{const e={};return Object.values(Ee).forEach(t=>{e[t]={}}),e})();function Zx({children:e}){const[t,n]=C.useState(Yx),r=C.useCallback((u,d,h=!0)=>{n(f=>{const m={...f};return m[u]=m[u]||{},m[u][d]=h,m})},[n]),i=C.useCallback((u,d)=>{var h;return!!((h=t[u])!=null&&h[d])},[t]),o=C.useCallback((u,d)=>{var h;return(h=t[u])==null?void 0:h[d]},[t]),s=C.useCallback((u,d)=>{n(h=>{var m;const f={...h};return(m=f[u])==null||delete m[d],f})},[n]),a=C.useCallback(u=>{n(d=>{const h={...d};return h[u]={},h})},[n]),l=C.useCallback((u,d)=>{n(h=>{const f={...h};return f[u]=f[u]||{},d.forEach(m=>{f[u][m]=!0}),f})},[n]),c=C.useMemo(()=>({errorState:t,setErrorState:n,setError:r,isError:i,removeError:s,resetBoundary:a,setErrors:l,getError:o}),[t,n,r,i,s,a,l,o]);return p.jsx(jf.Provider,{value:c,children:e})}new TextEncoder;const Ba=new TextDecoder;function eI(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function tI(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Ba.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Ba.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return eI(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class Lf extends Error{constructor(n,r){var i;super(n,r);Ui(this,"code","ERR_JOSE_GENERIC");this.name=this.constructor.name,(i=Error.captureStackTrace)==null||i.call(Error,this,this.constructor)}}Ui(Lf,"code","ERR_JOSE_GENERIC");class rr extends Lf{constructor(){super(...arguments);Ui(this,"code","ERR_JWT_INVALID")}}Ui(rr,"code","ERR_JWT_INVALID");function nI(e){return typeof e=="object"&&e!==null}const rI=e=>{if(!nI(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function iI(e){if(typeof e!="string")throw new rr("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(n===5)throw new rr("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new rr("Invalid JWT");if(!t)throw new rr("JWTs must contain a payload");let r;try{r=tI(t)}catch{throw new rr("Failed to base64url decode the payload")}let i;try{i=JSON.parse(Ba.decode(r))}catch{throw new rr("Failed to parse the decoded payload as JSON")}if(!rI(i))throw new rr("Invalid JWT Claims Set");return i}const Va="amp-labs_jwt_",oI=10*60*1e3,ac=(e,t)=>`${e}:${t}`,lc=e=>`${Va}${e}`,Bf=C.createContext(null),sI=e=>{try{const t=iI(e);return t.exp&&typeof t.exp=="number"?t.exp*1e3:null}catch(t){return console.warn("Failed to decode JWT token:",t),null}};function aI({getTokenCallback:e,children:t}){const[n,r]=C.useState(new Map);C.useEffect(()=>{try{const l=new Map,c=Date.now();Object.keys(sessionStorage).forEach(u=>{if(u.startsWith(Va)){const d=u.replace(Va,""),h=sessionStorage.getItem(u);if(h)try{const f=JSON.parse(h);f.expiresAt>c?l.set(d,f):sessionStorage.removeItem(u)}catch{sessionStorage.removeItem(u)}}}),l.size>0&&r(l)}catch{console.warn("Failed to load JWT tokens from sessionStorage")}},[]);const i=C.useCallback((l,c)=>{const u=ac(l,c),d=Date.now(),h=n.get(u);if(h&&h.expiresAt>d)return h.token;n.delete(u);const f=lc(u),m=sessionStorage.getItem(f);if(m)try{const g=JSON.parse(m);if(g.expiresAt>d)return r(v=>new Map(v).set(u,g)),g.token;sessionStorage.removeItem(f)}catch{sessionStorage.removeItem(f)}return null},[n]),o=C.useCallback(async(l,c,u)=>{const d=ac(l,c),f=await sI(u)||Date.now()+oI,m={token:u,expiresAt:f};r(g=>new Map(g).set(d,m));try{sessionStorage.setItem(lc(d),JSON.stringify(m))}catch{console.warn("Failed to store JWT token in sessionStorage")}},[]),s=C.useCallback(async({consumerRef:l,groupRef:c})=>{const u=i(l,c);if(u)return u;if(!e)throw new Error("JWT token callback not provided");try{const d=await e({consumerRef:l,groupRef:c});return await o(l,c,d),d}catch(d){throw console.error("Failed to get JWT token:",d),new Error("Failed to get JWT token")}},[e,i,o]),a={getToken:e?s:void 0};return p.jsx(Bf.Provider,{value:a,children:t})}const lI=()=>{const e=C.useContext(Bf);if(!e)throw new Error("useJwtToken must be used within a JwtTokenProvider");return e},Sl=C.createContext(null);function Ye(){const e=C.useContext(Sl);if(!e)throw new Error(`Cannot call useAmpersandProvider unless your
|
|
2
|
-
component is wrapped with AmpersandProvider`);return e}const uI=new Lx({defaultOptions:{queries:{retry:(e,t)=>{if(t instanceof bl){const n=t.response.status;if(n>=400&&n<500)return!1}return e<3}}}});function cI(e){const{options:{apiKey:t,projectId:n,project:r,getToken:i},children:o}=e,s=r||n;if(n&&r)throw new Error("Use AmpersandProvider either with projectId or project but not both.");if(!s)throw new Error("Cannot use AmpersandProvider without a projectId or name.");if(!t&&!i)throw new Error("Cannot use AmpersandProvider without an apiKey or getToken.");if(t&&i)throw new Error("Cannot use AmpersandProvider with both apiKey and getToken.");const a={options:e.options,projectIdOrName:s};return p.jsx(Bx,{client:uI,children:p.jsx(Sl.Provider,{value:a,children:p.jsx(Zx,{children:p.jsx(aI,{getTokenCallback:i||null,children:p.jsx(Xx,{value:t||null,children:o})})})})})}var Vf=Symbol.for("immer-nothing"),uc=Symbol.for("immer-draftable"),Qt=Symbol.for("immer-state"),dI=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Bt(e,...t){if(process.env.NODE_ENV!=="production"){const n=dI[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var bi=Object.getPrototypeOf;function wi(e){return!!e&&!!e[Qt]}function zr(e){var t;return e?Uf(e)||Array.isArray(e)||!!e[uc]||!!((t=e.constructor)!=null&&t[uc])||mo(e)||Os(e):!1}var fI=Object.prototype.constructor.toString();function Uf(e){if(!e||typeof e!="object")return!1;const t=bi(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===fI}function as(e,t){Ss(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ss(e){const t=e[Qt];return t?t.type_:Array.isArray(e)?1:mo(e)?2:Os(e)?3:0}function Ua(e,t){return Ss(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $f(e,t,n){const r=Ss(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function pI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mo(e){return e instanceof Map}function Os(e){return e instanceof Set}function _r(e){return e.copy_||e.base_}function $a(e,t){if(mo(e))return new Map(e);if(Os(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Uf(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Qt];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(bi(e),r)}else{const r=bi(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Ol(e,t=!1){return Es(e)||wi(e)||!zr(e)||(Ss(e)>1&&Object.defineProperties(e,{set:{value:Vo},add:{value:Vo},clear:{value:Vo},delete:{value:Vo}}),Object.freeze(e),t&&Object.values(e).forEach(n=>Ol(n,!0))),e}function Vo(){Bt(2)}function Es(e){return Object.isFrozen(e)}var hI={};function Kr(e){const t=hI[e];return t||Bt(0,e),t}var no;function qf(){return no}function mI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function cc(e,t){t&&(Kr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qa(e){za(e),e.drafts_.forEach(gI),e.drafts_=null}function za(e){e===no&&(no=e.parent_)}function dc(e){return no=mI(no,e)}function gI(e){const t=e[Qt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Qt].modified_&&(qa(t),Bt(4)),zr(e)&&(e=ls(t,e),t.parent_||us(t,e)),t.patches_&&Kr("Patches").generateReplacementPatches_(n[Qt].base_,e,t.patches_,t.inversePatches_)):e=ls(t,n,[]),qa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Vf?e:void 0}function ls(e,t,n){if(Es(t))return t;const r=t[Qt];if(!r)return as(t,(i,o)=>pc(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return us(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),as(o,(a,l)=>pc(e,r,i,a,l,n,s)),us(e,i,!1),n&&e.patches_&&Kr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function pc(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&Bt(5),wi(i)){const a=o&&t&&t.type_!==3&&!Ua(t.assigned_,r)?o.concat(r):void 0,l=ls(e,i,a);if($f(n,r,l),wi(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(zr(i)&&!Es(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ls(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(mo(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&us(e,i)}}function us(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ol(t,n)}function yI(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:qf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=El;n&&(i=[r],o=ro);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var El={get(e,t){if(t===Qt)return e;const n=_r(e);if(!Ua(n,t))return vI(e,n,t);const r=n[t];return e.finalized_||!zr(r)?r:r===Gs(e.base_,t)?(Xs(e),e.copy_[t]=Ha(r,e)):r},has(e,t){return t in _r(e)},ownKeys(e){return Reflect.ownKeys(_r(e))},set(e,t,n){const r=zf(_r(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Gs(_r(e),t),o=i==null?void 0:i[Qt];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(pI(n,i)&&(n!==void 0||Ua(e.base_,t)))return!0;Xs(e),Ka(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Gs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xs(e),Ka(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=_r(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Bt(11)},getPrototypeOf(e){return bi(e.base_)},setPrototypeOf(){Bt(12)}},ro={};as(El,(e,t)=>{ro[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ro.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Bt(13),ro.set.call(this,e,t,void 0)};ro.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Bt(14),El.set.call(this,e[0],t,n,e[0])};function Gs(e,t){const n=e[Qt];return(n?_r(n):e)[t]}function vI(e,t,n){var i;const r=zf(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function zf(e,t){if(!(t in e))return;let n=bi(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=bi(n)}}function Ka(e){e.modified_||(e.modified_=!0,e.parent_&&Ka(e.parent_))}function Xs(e){e.copy_||(e.copy_=$a(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Bt(6),r!==void 0&&typeof r!="function"&&Bt(7);let i;if(zr(t)){const o=dc(this),s=Ha(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?qa(o):za(o)}return cc(o,r),fc(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Vf&&(i=void 0),this.autoFreeze_&&Ol(i,!0),r){const o=[],s=[];Kr("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else Bt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){zr(e)||Bt(8),wi(e)&&(e=wI(e));const t=dc(this),n=Ha(e,void 0);return n[Qt].isManual_=!0,za(t),n}finishDraft(e,t){const n=e&&e[Qt];(!n||!n.isManual_)&&Bt(9);const{scope_:r}=n;return cc(r,t),fc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Kr("Patches").applyPatches_;return wi(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Ha(e,t){const n=mo(e)?Kr("MapSet").proxyMap_(e,t):Os(e)?Kr("MapSet").proxySet_(e,t):yI(e,t);return(t?t.scope_:qf()).drafts_.push(n),n}function wI(e){return wi(e)||Bt(10,e),Kf(e)}function Kf(e){if(!zr(e)||Es(e))return e;const t=e[Qt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$a(e,t.scope_.immer_.useStrictShallowCopy_)}else n=$a(e,!0);return as(n,(r,i)=>{$f(n,r,Kf(i))}),t&&(t.finalized_=!1),n}var xI=new bI,Kt=xI.produce,an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cs={exports:{}};cs.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",m="[object GeneratorFunction]",g="[object Map]",v="[object Number]",w="[object Null]",y="[object Object]",b="[object Promise]",x="[object Proxy]",S="[object RegExp]",E="[object Set]",D="[object String]",N="[object Symbol]",M="[object Undefined]",R="[object WeakMap]",P="[object ArrayBuffer]",F="[object DataView]",U="[object Float32Array]",B="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",ce="[object Int32Array]",ge="[object Uint8Array]",be="[object Uint8ClampedArray]",I="[object Uint16Array]",J="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,O=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,$={};$[U]=$[B]=$[X]=$[se]=$[ce]=$[ge]=$[be]=$[I]=$[J]=!0,$[a]=$[l]=$[P]=$[u]=$[F]=$[d]=$[h]=$[f]=$[g]=$[v]=$[y]=$[S]=$[E]=$[D]=$[R]=!1;var Y=typeof an=="object"&&an&&an.Object===Object&&an,ne=typeof self=="object"&&self&&self.Object===Object&&self,te=Y||ne||Function("return this")(),ae=t&&!t.nodeType&&t,Z=ae&&!0&&e&&!e.nodeType&&e,ye=Z&&Z.exports===ae,q=ye&&Y.process,we=function(){try{return q&&q.binding&&q.binding("util")}catch{}}(),ee=we&&we.isTypedArray;function Ke(_,A){for(var K=-1,le=_==null?0:_.length,He=0,xe=[];++K<le;){var Ze=_[K];A(Ze,K,_)&&(xe[He++]=Ze)}return xe}function Be(_,A){for(var K=-1,le=A.length,He=_.length;++K<le;)_[He+K]=A[K];return _}function Le(_,A){for(var K=-1,le=_==null?0:_.length;++K<le;)if(A(_[K],K,_))return!0;return!1}function tt(_,A){for(var K=-1,le=Array(_);++K<_;)le[K]=A(K);return le}function at(_){return function(A){return _(A)}}function lt(_,A){return _.has(A)}function Oe(_,A){return _==null?void 0:_[A]}function ft(_){var A=-1,K=Array(_.size);return _.forEach(function(le,He){K[++A]=[He,le]}),K}function _t(_,A){return function(K){return _(A(K))}}function mt(_){var A=-1,K=Array(_.size);return _.forEach(function(le){K[++A]=le}),K}var rt=Array.prototype,L=Function.prototype,H=Object.prototype,j=te["__core-js_shared__"],oe=L.toString,ue=H.hasOwnProperty,Je=function(){var _=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),Tt=H.toString,gt=RegExp("^"+oe.call(ue).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wt=ye?te.Buffer:void 0,Ve=te.Symbol,ke=te.Uint8Array,Nt=H.propertyIsEnumerable,yt=rt.splice,Ft=Ve?Ve.toStringTag:void 0,Wn=Object.getOwnPropertySymbols,Qn=wt?wt.isBuffer:void 0,Gn=_t(Object.keys,Object),bn=Zr(te,"DataView"),cn=Zr(te,"Map"),Xn=Zr(te,"Promise"),We=Zr(te,"Set"),ut=Zr(te,"WeakMap"),he=Zr(Object,"create"),_e=Sr(bn),kt=Sr(cn),Mn=Sr(Xn),ie=Sr(We),me=Sr(ut),de=Ve?Ve.prototype:void 0,Ne=de?de.valueOf:void 0;function Ue(_){var A=-1,K=_==null?0:_.length;for(this.clear();++A<K;){var le=_[A];this.set(le[0],le[1])}}function Yt(){this.__data__=he?he(null):{},this.size=0}function Zt(_){var A=this.has(_)&&delete this.__data__[_];return this.size-=A?1:0,A}function vt(_){var A=this.__data__;if(he){var K=A[_];return K===r?void 0:K}return ue.call(A,_)?A[_]:void 0}function Dt(_){var A=this.__data__;return he?A[_]!==void 0:ue.call(A,_)}function $e(_,A){var K=this.__data__;return this.size+=this.has(_)?0:1,K[_]=he&&A===void 0?r:A,this}Ue.prototype.clear=Yt,Ue.prototype.delete=Zt,Ue.prototype.get=vt,Ue.prototype.has=Dt,Ue.prototype.set=$e;function xt(_){var A=-1,K=_==null?0:_.length;for(this.clear();++A<K;){var le=_[A];this.set(le[0],le[1])}}function qs(){this.__data__=[],this.size=0}function zs(_){var A=this.__data__,K=Ao(A,_);if(K<0)return!1;var le=A.length-1;return K==le?A.pop():yt.call(A,K,1),--this.size,!0}function _o(_){var A=this.__data__,K=Ao(A,_);return K<0?void 0:A[K][1]}function To(_){return Ao(this.__data__,_)>-1}function No(_,A){var K=this.__data__,le=Ao(K,_);return le<0?(++this.size,K.push([_,A])):K[le][1]=A,this}xt.prototype.clear=qs,xt.prototype.delete=zs,xt.prototype.get=_o,xt.prototype.has=To,xt.prototype.set=No;function wn(_){var A=-1,K=_==null?0:_.length;for(this.clear();++A<K;){var le=_[A];this.set(le[0],le[1])}}function ko(){this.size=0,this.__data__={hash:new Ue,map:new(cn||xt),string:new Ue}}function Ae(_){var A=Ro(this,_).delete(_);return this.size-=A?1:0,A}function dn(_){return Ro(this,_).get(_)}function ji(_){return Ro(this,_).has(_)}function Cr(_,A){var K=Ro(this,_),le=K.size;return K.set(_,A),this.size+=K.size==le?0:1,this}wn.prototype.clear=ko,wn.prototype.delete=Ae,wn.prototype.get=dn,wn.prototype.has=ji,wn.prototype.set=Cr;function Yr(_){var A=-1,K=_==null?0:_.length;for(this.__data__=new wn;++A<K;)this.add(_[A])}function Li(_){return this.__data__.set(_,r),this}function og(_){return this.__data__.has(_)}Yr.prototype.add=Yr.prototype.push=Li,Yr.prototype.has=og;function Yn(_){var A=this.__data__=new xt(_);this.size=A.size}function sg(){this.__data__=new xt,this.size=0}function ag(_){var A=this.__data__,K=A.delete(_);return this.size=A.size,K}function lg(_){return this.__data__.get(_)}function ug(_){return this.__data__.has(_)}function cg(_,A){var K=this.__data__;if(K instanceof xt){var le=K.__data__;if(!cn||le.length<n-1)return le.push([_,A]),this.size=++K.size,this;K=this.__data__=new wn(le)}return K.set(_,A),this.size=K.size,this}Yn.prototype.clear=sg,Yn.prototype.delete=ag,Yn.prototype.get=lg,Yn.prototype.has=ug,Yn.prototype.set=cg;function dg(_,A){var K=Po(_),le=!K&&Eg(_),He=!K&&!le&&Ks(_),xe=!K&&!le&&!He&&qu(_),Ze=K||le||He||xe,pt=Ze?tt(_.length,String):[],bt=pt.length;for(var Ge in _)ue.call(_,Ge)&&!(Ze&&(Ge=="length"||He&&(Ge=="offset"||Ge=="parent")||xe&&(Ge=="buffer"||Ge=="byteLength"||Ge=="byteOffset")||xg(Ge,bt)))&&pt.push(Ge);return pt}function Ao(_,A){for(var K=_.length;K--;)if(Bu(_[K][0],A))return K;return-1}function fg(_,A,K){var le=A(_);return Po(_)?le:Be(le,K(_))}function Bi(_){return _==null?_===void 0?M:w:Ft&&Ft in Object(_)?bg(_):Og(_)}function Du(_){return Vi(_)&&Bi(_)==a}function Mu(_,A,K,le,He){return _===A?!0:_==null||A==null||!Vi(_)&&!Vi(A)?_!==_&&A!==A:pg(_,A,K,le,Mu,He)}function pg(_,A,K,le,He,xe){var Ze=Po(_),pt=Po(A),bt=Ze?l:Zn(_),Ge=pt?l:Zn(A);bt=bt==a?y:bt,Ge=Ge==a?y:Ge;var qt=bt==y,fn=Ge==y,It=bt==Ge;if(It&&Ks(_)){if(!Ks(A))return!1;Ze=!0,qt=!1}if(It&&!qt)return xe||(xe=new Yn),Ze||qu(_)?ju(_,A,K,le,He,xe):yg(_,A,bt,K,le,He,xe);if(!(K&i)){var en=qt&&ue.call(_,"__wrapped__"),tn=fn&&ue.call(A,"__wrapped__");if(en||tn){var er=en?_.value():_,jn=tn?A.value():A;return xe||(xe=new Yn),He(er,jn,K,le,xe)}}return It?(xe||(xe=new Yn),vg(_,A,K,le,He,xe)):!1}function hg(_){if(!$u(_)||Cg(_))return!1;var A=Vu(_)?gt:O;return A.test(Sr(_))}function mg(_){return Vi(_)&&Uu(_.length)&&!!$[Bi(_)]}function gg(_){if(!Sg(_))return Gn(_);var A=[];for(var K in Object(_))ue.call(_,K)&&K!="constructor"&&A.push(K);return A}function ju(_,A,K,le,He,xe){var Ze=K&i,pt=_.length,bt=A.length;if(pt!=bt&&!(Ze&&bt>pt))return!1;var Ge=xe.get(_);if(Ge&&xe.get(A))return Ge==A;var qt=-1,fn=!0,It=K&o?new Yr:void 0;for(xe.set(_,A),xe.set(A,_);++qt<pt;){var en=_[qt],tn=A[qt];if(le)var er=Ze?le(tn,en,qt,A,_,xe):le(en,tn,qt,_,A,xe);if(er!==void 0){if(er)continue;fn=!1;break}if(It){if(!Le(A,function(jn,Or){if(!lt(It,Or)&&(en===jn||He(en,jn,K,le,xe)))return It.push(Or)})){fn=!1;break}}else if(!(en===tn||He(en,tn,K,le,xe))){fn=!1;break}}return xe.delete(_),xe.delete(A),fn}function yg(_,A,K,le,He,xe,Ze){switch(K){case F:if(_.byteLength!=A.byteLength||_.byteOffset!=A.byteOffset)return!1;_=_.buffer,A=A.buffer;case P:return!(_.byteLength!=A.byteLength||!xe(new ke(_),new ke(A)));case u:case d:case v:return Bu(+_,+A);case h:return _.name==A.name&&_.message==A.message;case S:case D:return _==A+"";case g:var pt=ft;case E:var bt=le&i;if(pt||(pt=mt),_.size!=A.size&&!bt)return!1;var Ge=Ze.get(_);if(Ge)return Ge==A;le|=o,Ze.set(_,A);var qt=ju(pt(_),pt(A),le,He,xe,Ze);return Ze.delete(_),qt;case N:if(Ne)return Ne.call(_)==Ne.call(A)}return!1}function vg(_,A,K,le,He,xe){var Ze=K&i,pt=Lu(_),bt=pt.length,Ge=Lu(A),qt=Ge.length;if(bt!=qt&&!Ze)return!1;for(var fn=bt;fn--;){var It=pt[fn];if(!(Ze?It in A:ue.call(A,It)))return!1}var en=xe.get(_);if(en&&xe.get(A))return en==A;var tn=!0;xe.set(_,A),xe.set(A,_);for(var er=Ze;++fn<bt;){It=pt[fn];var jn=_[It],Or=A[It];if(le)var zu=Ze?le(Or,jn,It,A,_,xe):le(jn,Or,It,_,A,xe);if(!(zu===void 0?jn===Or||He(jn,Or,K,le,xe):zu)){tn=!1;break}er||(er=It=="constructor")}if(tn&&!er){var Fo=_.constructor,Do=A.constructor;Fo!=Do&&"constructor"in _&&"constructor"in A&&!(typeof Fo=="function"&&Fo instanceof Fo&&typeof Do=="function"&&Do instanceof Do)&&(tn=!1)}return xe.delete(_),xe.delete(A),tn}function Lu(_){return fg(_,Ng,wg)}function Ro(_,A){var K=_.__data__;return Ig(A)?K[typeof A=="string"?"string":"hash"]:K.map}function Zr(_,A){var K=Oe(_,A);return hg(K)?K:void 0}function bg(_){var A=ue.call(_,Ft),K=_[Ft];try{_[Ft]=void 0;var le=!0}catch{}var He=Tt.call(_);return le&&(A?_[Ft]=K:delete _[Ft]),He}var wg=Wn?function(_){return _==null?[]:(_=Object(_),Ke(Wn(_),function(A){return Nt.call(_,A)}))}:kg,Zn=Bi;(bn&&Zn(new bn(new ArrayBuffer(1)))!=F||cn&&Zn(new cn)!=g||Xn&&Zn(Xn.resolve())!=b||We&&Zn(new We)!=E||ut&&Zn(new ut)!=R)&&(Zn=function(_){var A=Bi(_),K=A==y?_.constructor:void 0,le=K?Sr(K):"";if(le)switch(le){case _e:return F;case kt:return g;case Mn:return b;case ie:return E;case me:return R}return A});function xg(_,A){return A=A??s,!!A&&(typeof _=="number"||z.test(_))&&_>-1&&_%1==0&&_<A}function Ig(_){var A=typeof _;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?_!=="__proto__":_===null}function Cg(_){return!!Je&&Je in _}function Sg(_){var A=_&&_.constructor,K=typeof A=="function"&&A.prototype||H;return _===K}function Og(_){return Tt.call(_)}function Sr(_){if(_!=null){try{return oe.call(_)}catch{}try{return _+""}catch{}}return""}function Bu(_,A){return _===A||_!==_&&A!==A}var Eg=Du(function(){return arguments}())?Du:function(_){return Vi(_)&&ue.call(_,"callee")&&!Nt.call(_,"callee")},Po=Array.isArray;function _g(_){return _!=null&&Uu(_.length)&&!Vu(_)}var Ks=Qn||Ag;function Tg(_,A){return Mu(_,A)}function Vu(_){if(!$u(_))return!1;var A=Bi(_);return A==f||A==m||A==c||A==x}function Uu(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=s}function $u(_){var A=typeof _;return _!=null&&(A=="object"||A=="function")}function Vi(_){return _!=null&&typeof _=="object"}var qu=ee?at(ee):mg;function Ng(_){return _g(_)?dg(_):gg(_)}function kg(){return[]}function Ag(){return!1}e.exports=Tg})(cs,cs.exports);var II=cs.exports;const Hf=Ai(II),ot=async(e,t)=>{var n;if(e instanceof bl){const{status:r,statusText:i}=e.response;console.error(r===500?"Internal Server Error (500):":r===400?"Bad Request (400):":`Error (${r}):`,i);try{const s=await e.response.clone().json(),a=((n=s==null?void 0:s.causes)==null?void 0:n.join(`
|
|
1
|
+
"use strict";var Rg=Object.defineProperty;var qu=e=>{throw TypeError(e)};var Pg=(e,t,n)=>t in e?Rg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Vi=(e,t,n)=>Pg(e,typeof t!="symbol"?t+"":t,n),Ks=(e,t,n)=>t.has(e)||qu("Cannot "+n);var T=(e,t,n)=>(Ks(e,t,"read from private field"),n?n.call(e):t.get(e)),pe=(e,t,n)=>t.has(e)?qu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),re=(e,t,n,r)=>(Ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ce=(e,t,n)=>(Ks(e,t,"access private method"),n);var Do=(e,t,n,r)=>({set _(i){re(e,t,i,n)},get _(){return T(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),C=require("react");require("react-dom");function Fg(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const W=Fg(C),Dg="https://api.withampersand.com/v1".replace(/\/+$/,"");class yl{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:Dg}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||of}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 Mg=new yl,Is=class Is{constructor(t=Mg){this.configuration=t,this.fetchApi=async(n,r)=>{let i={url:n,init:r};for(const s of this.middleware)s.pre&&(i=await s.pre({fetch:this.fetchApi,...i})||i);let o;try{o=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(s){for(const a of this.middleware)a.onError&&(o=await a.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:s,response:o?o.clone():void 0})||o);if(o===void 0)throw s instanceof Error?new Bg(s,"The request failed and the interceptors did not return an alternative response"):s}for(const s of this.middleware)s.post&&(o=await s.post({fetch:this.fetchApi,url:i.url,init:i.init,response:o.clone()})||o);return o},this.middleware=t.middleware}withMiddleware(...t){const n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(...t){const n=t.map(r=>({pre:r}));return this.withMiddleware(...n)}withPostMiddleware(...t){const n=t.map(r=>({post:r}));return this.withMiddleware(...n)}isJsonMime(t){return t?Is.jsonRegex.test(t):!1}async request(t,n){const{url:r,init:i}=await this.createFetchParams(t,n),o=await this.fetchApi(r,i);if(o&&o.status>=200&&o.status<300)return o;throw new vl(o,"Response returned an error code")}async createFetchParams(t,n){let r=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(r+="?"+this.configuration.queryParamsStringify(t.query));const i=Object.assign({},this.configuration.headers,t.headers);Object.keys(i).forEach(c=>i[c]===void 0?delete i[c]:{});const o=typeof n=="function"?n:async()=>n,s={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},a={...s,...await o({init:s,context:t})},l={...a,body:Lg(a.body)||a.body instanceof URLSearchParams||jg(a.body)?a.body:JSON.stringify(a.body)};return{url:r,init:l}}clone(){const t=this.constructor,n=new t(this.configuration);return n.middleware=this.middleware.slice(),n}};Is.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");let _n=Is;function jg(e){return typeof Blob<"u"&&e instanceof Blob}function Lg(e){return typeof FormData<"u"&&e instanceof FormData}class vl extends Error{constructor(t,n){super(n),this.response=t,this.name="ResponseError"}}class Bg extends Error{constructor(t,n){super(n),this.cause=t,this.name="FetchError"}}class fe extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}function k(e,t){const n=e[t];return n!=null}function of(e,t=""){return Object.keys(e).map(n=>sf(n,e[n],t)).filter(n=>n.length>0).join("&")}function sf(e,t,n=""){const r=n+(n.length?`[${e}]`:e);if(t instanceof Array){const i=t.map(o=>encodeURIComponent(String(o))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${i}`}if(t instanceof Set){const i=Array.from(t);return sf(e,i,n)}return t instanceof Date?`${encodeURIComponent(r)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?of(t,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(t))}`}function nt(e,t){return Object.keys(e).reduce((n,r)=>({...n,[r]:t(e[r])}),{})}class Qe{constructor(t,n=r=>r){this.raw=t,this.transformer=n}async value(){return this.transformer(await this.raw.json())}}class yi{constructor(t){this.raw=t}async value(){}}class zu{constructor(t){this.raw=t}async value(){return await this.raw.text()}}function Vg(e){return Ug(e)}function Ug(e,t){return e==null?e:{fieldUsed:k(e,"fieldUsed")?e.fieldUsed:void 0,keyFormat:k(e,"keyFormat")?e.keyFormat:void 0}}function $g(e){return qg(e)}function qg(e,t){return e==null?e:{name:e.name,valuePrefix:k(e,"valuePrefix")?e.valuePrefix:void 0}}function zg(e){return Kg(e)}function Kg(e,t){return e==null?e:{name:e.name}}function Hg(e){return Jg(e)}function Jg(e,t){return e==null?e:{attachmentType:e.attachmentType,query:k(e,"query")?zg(e.query):void 0,header:k(e,"header")?$g(e.header):void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Wg(e){return Qg(e)}function Qg(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,includeFullRecords:k(e,"includeFullRecords")?e.includeFullRecords:void 0}}function Gg(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,includeFullRecords:e.includeFullRecords}}function Xg(e){return Yg(e)}function Yg(e,t){return e==null?e:{url:e.url,method:k(e,"method")?e.method:void 0,successStatusCodes:k(e,"successStatusCodes")?e.successStatusCodes:void 0}}const Ku={ApiKey:"apiKey",Basic:"basic"};function Zg(e){return ey(e)}function ey(e,t){return e}function ty(e){return ny(e)}function ny(e,t){return e==null?e:{days:k(e,"days")?e.days:void 0,fullHistory:k(e,"fullHistory")?e.fullHistory:void 0}}function ry(e){if(e!==void 0)return e===null?null:{days:e.days,fullHistory:e.fullHistory}}function af(e){return iy(e)}function iy(e,t){return e==null?e:{defaultPeriod:ty(e.defaultPeriod)}}function oy(e){if(e!==void 0)return e===null?null:{defaultPeriod:ry(e.defaultPeriod)}}function sy(e){return ay(e)}function ay(e,t){return e==null?e:{days:k(e,"days")?e.days:void 0,fullHistory:k(e,"fullHistory")?e.fullHistory:void 0}}function ly(e){if(e!==void 0)return e===null?null:{days:e.days,fullHistory:e.fullHistory}}function uy(e){return cy(e)}function cy(e,t){return e==null?e:{defaultPeriod:sy(e.defaultPeriod)}}function lf(e){if(e!==void 0)return e===null?null:{defaultPeriod:ly(e.defaultPeriod)}}function dy(e){return fy(e)}function fy(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function uf(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function py(e){return hy(e)}function hy(e,t){return e==null?e:{mappedValue:e.mappedValue,mappedDisplayValue:e.mappedDisplayValue}}function my(e){if(e!==void 0)return e===null?null:{mappedValue:e.mappedValue,mappedDisplayValue:e.mappedDisplayValue}}function gy(e){return yy(e)}function yy(e,t){return e==null?e:{mapToName:e.mapToName,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,prompt:k(e,"prompt")?e.prompt:void 0,mappedValues:k(e,"mappedValues")?e.mappedValues.map(py):void 0,fieldName:k(e,"fieldName")?e.fieldName:void 0}}function cf(e){if(e!==void 0)return e===null?null:{mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,prompt:e.prompt,mappedValues:e.mappedValues===void 0?void 0:e.mappedValues.map(my),fieldName:e.fieldName}}function vy(e){return by(e)}function by(e,t){return e}function wy(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,schedule:e.schedule,disabled:e.disabled,destination:e.destination,selectedFields:e.selectedFields,selectedValueMappings:e.selectedValueMappings,dynamicMappingsInput:e.dynamicMappingsInput===void 0?void 0:e.dynamicMappingsInput.map(cf),selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:e.selectedFieldsAuto,backfill:lf(e.backfill)}}function xy(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,wy)}}function Iy(e){return Cy(e)}function Cy(e,t){return e==null?e:{stringValue:k(e,"stringValue")?e.stringValue:void 0,integerValue:k(e,"integerValue")?e.integerValue:void 0,booleanValue:k(e,"booleanValue")?e.booleanValue:void 0}}function Sy(e){if(e!==void 0)return e===null?null:{stringValue:e.stringValue,integerValue:e.integerValue,booleanValue:e.booleanValue}}const Oy={Always:"always",Never:"never"},Ey={Always:"always",Never:"never"};function _y(e){return Ty(e)}function Ty(e,t){return e==null?e:{default:k(e,"default")?Iy(e.default):void 0,writeOnCreate:k(e,"writeOnCreate")?e.writeOnCreate:void 0,writeOnUpdate:k(e,"writeOnUpdate")?e.writeOnUpdate:void 0}}function df(e){if(e!==void 0)return e===null?null:{default:Sy(e.default),writeOnCreate:e.writeOnCreate,writeOnUpdate:e.writeOnUpdate}}function Ny(e){let t=!0;return t=t&&"value"in e,t}function ky(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function Ay(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Ry(e){let t=!0;return t=t&&"value"in e,t}function Py(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function Fy(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Dy(e){let t=!0;return t=t&&"value"in e,t}function My(e,t){return e==null?e:{value:e.value,applyOnUpdate:k(e,"applyOnUpdate")?e.applyOnUpdate:void 0}}function jy(e){if(e!==void 0)return e===null?null:{value:e.value,applyOnUpdate:e.applyOnUpdate}}function Ly(e){return By(e)}function By(e,t){return e==null?e:{...ky(e),...Py(e),...My(e)}}function ff(e){if(e!==void 0)return e===null?null:Ny(e)?Ay(e):Ry(e)?Fy(e):Dy(e)?jy(e):{}}function Vy(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,selectedValueDefaults:e.selectedValueDefaults===void 0?void 0:nt(e.selectedValueDefaults,ff),selectedFieldSettings:e.selectedFieldSettings===void 0?void 0:nt(e.selectedFieldSettings,df)}}function Uy(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,Vy)}}function $y(e){return qy(e)}function qy(e,t){return e==null?e:{enabled:e.enabled}}function zy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Ky(e){return Hy(e)}function Hy(e,t){return e==null?e:{enabled:e.enabled}}function Jy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Wy(e){return Qy(e)}function Qy(e,t){return e==null?e:{enabled:e.enabled,watchFieldsAuto:k(e,"watchFieldsAuto")?e.watchFieldsAuto:void 0,requiredWatchFields:k(e,"requiredWatchFields")?e.requiredWatchFields:void 0}}function Gy(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,watchFieldsAuto:e.watchFieldsAuto,requiredWatchFields:e.requiredWatchFields}}function Xy(e){return Yy(e)}function Yy(e,t){return e==null?e:{apiKeyAsBasic:k(e,"apiKeyAsBasic")?e.apiKeyAsBasic:void 0,apiKeyAsBasicOpts:k(e,"apiKeyAsBasicOpts")?Vg(e.apiKeyAsBasicOpts):void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Zy(e){if(e!==void 0)return e===null?null:{sourceZipUrl:e.sourceZipUrl,sourceYaml:e.sourceYaml}}function Mo(e){return ev(e)}function ev(e,t){return e==null?e:{supported:e.supported,defaultRecordLimit:k(e,"defaultRecordLimit")?e.defaultRecordLimit:void 0,objectRecordLimits:k(e,"objectRecordLimits")?e.objectRecordLimits:void 0}}function tv(e){return nv(e)}function nv(e,t){return e==null?e:{_delete:Mo(e.delete),create:Mo(e.create),update:Mo(e.update),upsert:Mo(e.upsert)}}function rv(e){return iv(e)}function iv(e,t){return e==null?e:{value:e.value}}function ov(e){return sv(e)}function sv(e,t){return e==null?e:{brandingRemoval:k(e,"brandingRemoval")?rv(e.brandingRemoval):void 0}}function jo(e){return av(e)}function av(e,t){return e==null?e:{id:e.id,name:e.name,appName:e.appName,orgId:k(e,"orgId")?e.orgId:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,entitlements:k(e,"entitlements")?ov(e.entitlements):void 0}}function lv(e){return uv(e)}function uv(e,t){return e==null?e:{insert:e.insert,update:e.update,upsert:e.upsert,_delete:e.delete}}function cv(e){return dv(e)}function dv(e,t){return e==null?e:{objectName:e.objectName,schedule:k(e,"schedule")?e.schedule:void 0,disabled:k(e,"disabled")?e.disabled:void 0,destination:k(e,"destination")?e.destination:void 0,selectedFields:e.selectedFields,selectedValueMappings:k(e,"selectedValueMappings")?e.selectedValueMappings:void 0,dynamicMappingsInput:k(e,"dynamicMappingsInput")?e.dynamicMappingsInput.map(gy):void 0,selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:k(e,"selectedFieldsAuto")?vy(e.selectedFieldsAuto):void 0,backfill:k(e,"backfill")?uy(e.backfill):void 0}}function fv(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,schedule:e.schedule,disabled:e.disabled,destination:e.destination,selectedFields:e.selectedFields,selectedValueMappings:e.selectedValueMappings,dynamicMappingsInput:e.dynamicMappingsInput===void 0?void 0:e.dynamicMappingsInput.map(cf),selectedFieldMappings:e.selectedFieldMappings,selectedFieldsAuto:e.selectedFieldsAuto,backfill:lf(e.backfill)}}function pv(e){return hv(e)}function hv(e,t){return e==null?e:{objects:nt(e.objects,cv)}}function mv(e){if(e!==void 0)return e===null?null:{objects:nt(e.objects,fv)}}function gv(e){return yv(e)}function yv(e,t){return e==null?e:{inheritFieldsAndMappings:e.inheritFieldsAndMappings,objectName:e.objectName,destination:e.destination,createEvent:k(e,"createEvent")?$y(e.createEvent):void 0,updateEvent:k(e,"updateEvent")?Wy(e.updateEvent):void 0,deleteEvent:k(e,"deleteEvent")?Ky(e.deleteEvent):void 0}}function vv(e){if(e!==void 0)return e===null?null:{inheritFieldsAndMappings:e.inheritFieldsAndMappings,objectName:e.objectName,destination:e.destination,createEvent:zy(e.createEvent),updateEvent:Gy(e.updateEvent),deleteEvent:Jy(e.deleteEvent)}}function bv(e){return wv(e)}function wv(e,t){return e==null?e:{objects:nt(e.objects,gv)}}function xv(e){if(e!==void 0)return e===null?null:{objects:nt(e.objects,vv)}}function Iv(e){return Cv(e)}function Cv(e,t){return e==null?e:{objectName:e.objectName,selectedValueDefaults:k(e,"selectedValueDefaults")?nt(e.selectedValueDefaults,Ly):void 0,selectedFieldSettings:k(e,"selectedFieldSettings")?nt(e.selectedFieldSettings,_y):void 0}}function Sv(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,selectedValueDefaults:e.selectedValueDefaults===void 0?void 0:nt(e.selectedValueDefaults,ff),selectedFieldSettings:e.selectedFieldSettings===void 0?void 0:nt(e.selectedFieldSettings,df)}}function Ov(e){return Ev(e)}function Ev(e,t){return e==null?e:{objects:k(e,"objects")?nt(e.objects,Iv):void 0}}function _v(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:nt(e.objects,Sv)}}function Tv(e){return Nv(e)}function Nv(e,t){return e==null?e:{provider:e.provider,read:k(e,"read")?pv(e.read):void 0,write:k(e,"write")?Ov(e.write):void 0,proxy:k(e,"proxy")?dy(e.proxy):void 0,subscribe:k(e,"subscribe")?bv(e.subscribe):void 0}}function kv(e){if(e!==void 0)return e===null?null:{provider:e.provider,read:mv(e.read),write:_v(e.write),proxy:uf(e.proxy),subscribe:xv(e.subscribe)}}function Av(e){return Rv(e)}function Rv(e,t){return e==null?e:{id:e.id,revisionId:e.revisionId,createTime:new Date(e.createTime),createdBy:e.createdBy,content:Tv(e.content)}}function Pv(e){return Fv(e)}function Fv(e,t){return e==null?e:{consumerRef:e.consumerRef,consumerName:e.consumerName,projectId:e.projectId,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function pf(e){return Dv(e)}function Dv(e,t){return e==null?e:{groupRef:e.groupRef,groupName:e.groupName,projectId:e.projectId,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function Mv(e){return jv(e)}function jv(e,t){return e==null?e:{token:e.token,issuedAt:k(e,"issuedAt")?new Date(e.issuedAt):void 0,expiresAt:k(e,"expiresAt")?new Date(e.expiresAt):void 0}}function Lv(e){return Bv(e)}function Bv(e,t){return e==null?e:{token:e.token,issuedAt:k(e,"issuedAt")?new Date(e.issuedAt):void 0,expiresAt:k(e,"expiresAt")?new Date(e.expiresAt):void 0}}function Vv(e){return Uv(e)}function Uv(e,t){return e==null?e:{accessToken:k(e,"accessToken")?Mv(e.accessToken):void 0,refreshToken:k(e,"refreshToken")?Lv(e.refreshToken):void 0,scopes:k(e,"scopes")?e.scopes:void 0}}function Qo(e){return $v(e)}function $v(e,t){return e==null?e:{id:e.id,projectId:e.projectId,externalRef:k(e,"externalRef")?e.externalRef:void 0,provider:e.provider,clientId:e.clientId,scopes:k(e,"scopes")?e.scopes:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0}}function qv(e){return zv(e)}function zv(e,t){return e==null?e:{value:e.value,source:e.source,displayName:k(e,"displayName")?e.displayName:void 0}}function bl(e){if(e!==void 0)return e===null?null:{value:e.value,source:e.source,displayName:e.displayName}}function Hi(e){return Kv(e)}function Kv(e,t){return e==null?e:{id:e.id,projectId:e.projectId,provider:e.provider,providerApp:k(e,"providerApp")?Qo(e.providerApp):void 0,group:pf(e.group),consumer:Pv(e.consumer),providerWorkspaceRef:k(e,"providerWorkspaceRef")?e.providerWorkspaceRef:void 0,providerConsumerRef:k(e,"providerConsumerRef")?e.providerConsumerRef:void 0,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,authScheme:e.authScheme,status:e.status,oauth2AuthorizationCode:k(e,"oauth2AuthorizationCode")?Vv(e.oauth2AuthorizationCode):void 0,apiKey:k(e,"apiKey")?e.apiKey:void 0,providerMetadata:k(e,"providerMetadata")?nt(e.providerMetadata,qv):void 0}}function hf(e){if(e!==void 0)return e===null?null:{username:e.username,password:e.password}}function mf(e){if(e!==void 0)return e===null?null:{clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function gf(e){if(e!==void 0)return e===null?null:{username:e.username,password:e.password,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function Hv(e){if(e!==void 0)return e===null?null:{token:e.token,expiresAt:e.expiresAt===void 0?void 0:e.expiresAt.toISOString(),issuedAt:e.issuedAt===void 0?void 0:e.issuedAt.toISOString()}}function Jv(e){if(e!==void 0)return e===null?null:{token:e.token,expiresAt:e.expiresAt===void 0?void 0:e.expiresAt.toISOString(),issuedAt:e.issuedAt===void 0?void 0:e.issuedAt.toISOString()}}function yf(e){if(e!==void 0)return e===null?null:{accessToken:Hv(e.accessToken),refreshToken:Jv(e.refreshToken),scopes:e.scopes}}function Wv(e){if(e!==void 0)return e===null?null:{providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,bl),groupName:e.groupName,groupRef:e.groupRef,consumerName:e.consumerName,consumerRef:e.consumerRef,provider:e.provider,apiKey:e.apiKey,customAuth:e.customAuth,basicAuth:hf(e.basicAuth),oauth2ClientCredentials:mf(e.oauth2ClientCredentials),oauth2PasswordCredentials:gf(e.oauth2PasswordCredentials),oauth2AuthorizationCode:yf(e.oauth2AuthorizationCode)}}function Qv(e){return Gv(e)}function Gv(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function Xv(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Yv(e){if(e!==void 0)return e===null?null:{revisionId:e.revisionId,createdBy:e.createdBy,content:kv(e.content)}}function Zv(e){if(e!==void 0)return e===null?null:{groupRef:e.groupRef,connectionId:e.connectionId,config:Yv(e.config)}}function eb(e){return tb(e)}function tb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,useModule:k(e,"useModule")?e.useModule:void 0}}function nb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,useModule:e.useModule}}function rb(e){return ib(e)}function ib(e,t){return e==null?e:{mode:k(e,"mode")?e.mode:void 0,pageSize:k(e,"pageSize")?e.pageSize:void 0}}function ob(e){if(e!==void 0)return e===null?null:{mode:e.mode,pageSize:e.pageSize}}function sb(e){let t=!0;return t=t&&"fieldName"in e,t}function ab(e,t){return e==null?e:{fieldName:e.fieldName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0}}function lb(e){if(e!==void 0)return e===null?null:{fieldName:e.fieldName,mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName}}function ub(e){let t=!0;return t=t&&"mapToName"in e,t}function vf(e,t){return e==null?e:{mapToName:e.mapToName,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,_default:k(e,"default")?e.default:void 0,prompt:k(e,"prompt")?e.prompt:void 0}}function cb(e){if(e!==void 0)return e===null?null:{mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,default:e._default,prompt:e.prompt}}function Hu(e){return db(e)}function db(e,t){return e==null?e:{...ab(e),...vf(e)}}function Ju(e){if(e!==void 0)return e===null?null:sb(e)?lb(e):ub(e)?cb(e):{}}function bf(e){return fb(e)}function fb(e,t){return e}function pb(e){return hb(e)}function hb(e,t){return e==null?e:{objectName:e.objectName,destination:e.destination,schedule:e.schedule,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,requiredFields:k(e,"requiredFields")?e.requiredFields.map(Hu):void 0,optionalFields:k(e,"optionalFields")?e.optionalFields.map(Hu):void 0,optionalFieldsAuto:k(e,"optionalFieldsAuto")?bf(e.optionalFieldsAuto):void 0,backfill:k(e,"backfill")?af(e.backfill):void 0,delivery:k(e,"delivery")?rb(e.delivery):void 0,enabled:k(e,"enabled")?e.enabled:void 0}}function mb(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,destination:e.destination,schedule:e.schedule,mapToName:e.mapToName,mapToDisplayName:e.mapToDisplayName,requiredFields:e.requiredFields===void 0?void 0:e.requiredFields.map(Ju),optionalFields:e.optionalFields===void 0?void 0:e.optionalFields.map(Ju),optionalFieldsAuto:e.optionalFieldsAuto,backfill:oy(e.backfill),delivery:ob(e.delivery),enabled:e.enabled}}function gb(e){return yb(e)}function yb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(pb):void 0}}function vb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(mb)}}function bb(e){return wb(e)}function wb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0}}function xb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled}}function Ib(e){return Cb(e)}function Cb(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,watchFieldsAuto:k(e,"watchFieldsAuto")?e.watchFieldsAuto:void 0,requiredWatchFields:k(e,"requiredWatchFields")?e.requiredWatchFields:void 0}}function Sb(e){if(e!==void 0)return e===null?null:{enabled:e.enabled,watchFieldsAuto:e.watchFieldsAuto,requiredWatchFields:e.requiredWatchFields}}function Ob(e){return Eb(e)}function Eb(e,t){return e==null?e:{objectName:e.objectName,destination:e.destination,inheritFieldsAndMapping:k(e,"inheritFieldsAndMapping")?e.inheritFieldsAndMapping:void 0,createEvent:k(e,"createEvent")?Qv(e.createEvent):void 0,updateEvent:k(e,"updateEvent")?Ib(e.updateEvent):void 0,deleteEvent:k(e,"deleteEvent")?bb(e.deleteEvent):void 0,associationChangeEvent:k(e,"associationChangeEvent")?Wg(e.associationChangeEvent):void 0,otherEvents:k(e,"otherEvents")?e.otherEvents:void 0}}function _b(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,destination:e.destination,inheritFieldsAndMapping:e.inheritFieldsAndMapping,createEvent:Xv(e.createEvent),updateEvent:Sb(e.updateEvent),deleteEvent:xb(e.deleteEvent),associationChangeEvent:Gg(e.associationChangeEvent),otherEvents:e.otherEvents}}function Tb(e){return Nb(e)}function Nb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(Ob):void 0}}function kb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(_b)}}function wf(e){return Ab(e)}function Ab(e,t){return e==null?e:{allowAnyFields:k(e,"allowAnyFields")?e.allowAnyFields:void 0}}function Rb(e){if(e!==void 0)return e===null?null:{allowAnyFields:e.allowAnyFields}}function Pb(e){return Fb(e)}function Fb(e,t){return e==null?e:{objectName:e.objectName,inheritMapping:k(e,"inheritMapping")?e.inheritMapping:void 0,valueDefaults:k(e,"valueDefaults")?wf(e.valueDefaults):void 0}}function Db(e){if(e!==void 0)return e===null?null:{objectName:e.objectName,inheritMapping:e.inheritMapping,valueDefaults:Rb(e.valueDefaults)}}function Mb(e){return jb(e)}function jb(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(Pb):void 0}}function Lb(e){if(e!==void 0)return e===null?null:{objects:e.objects===void 0?void 0:e.objects.map(Db)}}function Bb(e){return Vb(e)}function Vb(e,t){return e==null?e:{name:e.name,provider:e.provider,displayName:k(e,"displayName")?e.displayName:void 0,module:k(e,"module")?e.module:void 0,read:k(e,"read")?gb(e.read):void 0,write:k(e,"write")?Mb(e.write):void 0,proxy:k(e,"proxy")?eb(e.proxy):void 0,subscribe:k(e,"subscribe")?Tb(e.subscribe):void 0}}function Ub(e){if(e!==void 0)return e===null?null:{name:e.name,provider:e.provider,displayName:e.displayName,module:e.module,read:vb(e.read),write:Lb(e.write),proxy:nb(e.proxy),subscribe:kb(e.subscribe)}}function $b(e){if(e!==void 0)return e===null?null:{specVersion:e.specVersion,content:Ub(e.content)}}function qb(e){if(e!==void 0)return e===null?null:{name:e.name,provider:e.provider,latestRevision:$b(e.latestRevision)}}function zb(e){if(e!==void 0)return e===null?null:{appName:e.appName,name:e.name,orgId:e.orgId}}function Kb(e){if(e!==void 0)return e===null?null:{externalRef:e.externalRef,provider:e.provider,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function Hb(e){if(e!==void 0)return e===null?null:{sourceZipUrl:e.sourceZipUrl,sourceYaml:e.sourceYaml}}function Jb(e){return Wb(e)}function Wb(e,t){return e==null?e:{name:e.name,valueTemplate:e.valueTemplate}}function Qb(e){return Gb(e)}function Gb(e,t){return e==null?e:{name:e.name,displayName:e.displayName,prompt:k(e,"prompt")?e.prompt:void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0}}function Xb(e){return Yb(e)}function Yb(e,t){return e==null?e:{name:e.name,valueTemplate:e.valueTemplate}}function Zb(e){return ew(e)}function ew(e,t){return e==null?e:{headers:k(e,"headers")?e.headers.map(Jb):void 0,queryParams:k(e,"queryParams")?e.queryParams.map(Xb):void 0,inputs:k(e,"inputs")?e.inputs.map(Qb):void 0}}function tw(e){return nw(e)}function nw(e,t){return e==null?e:{value:e.value,displayValue:e.displayValue}}function rw(e){return iw(e)}function iw(e,t){return e==null?e:{fieldName:e.fieldName,displayName:e.displayName,valueType:k(e,"valueType")?e.valueType:void 0,providerType:k(e,"providerType")?e.providerType:void 0,readOnly:k(e,"readOnly")?e.readOnly:void 0,values:k(e,"values")?e.values.map(tw):void 0}}function ow(e){if(e!==void 0)return e===null?null:{providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,bl),groupName:e.groupName,groupRef:e.groupRef,consumerName:e.consumerName,consumerRef:e.consumerRef,provider:e.provider,apiKey:e.apiKey,customAuth:e.customAuth,basicAuth:hf(e.basicAuth),oauth2ClientCredentials:mf(e.oauth2ClientCredentials),oauth2PasswordCredentials:gf(e.oauth2PasswordCredentials),oauth2AuthorizationCode:yf(e.oauth2AuthorizationCode)}}function sw(e){return aw(e)}function aw(e,t){return e==null?e:{enabled:k(e,"enabled")?e.enabled:void 0,useModule:k(e,"useModule")?e.useModule:void 0}}function lw(e,t){return e==null?e:{fieldName:e.fieldName,displayName:e.displayName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0}}function Hs(e){return uw(e)}function uw(e,t){return e==null?e:{...lw(e),...vf(e)}}function cw(e){return dw(e)}function dw(e,t){return e==null?e:{error:k(e,"error")?e.error:void 0,objectName:e.objectName,displayName:e.displayName,mapToName:k(e,"mapToName")?e.mapToName:void 0,mapToDisplayName:k(e,"mapToDisplayName")?e.mapToDisplayName:void 0,destination:e.destination,schedule:e.schedule,requiredFields:k(e,"requiredFields")?e.requiredFields.map(Hs):void 0,optionalFields:k(e,"optionalFields")?e.optionalFields.map(Hs):void 0,optionalFieldsAuto:k(e,"optionalFieldsAuto")?bf(e.optionalFieldsAuto):void 0,allFieldsMetadata:k(e,"allFieldsMetadata")?nt(e.allFieldsMetadata,rw):void 0,allFields:k(e,"allFields")?e.allFields.map(Hs):void 0,backfill:k(e,"backfill")?af(e.backfill):void 0}}function fw(e){return pw(e)}function pw(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(cw):void 0}}function hw(e){return mw(e)}function mw(e,t){return e==null?e:{objectName:e.objectName,displayName:e.displayName,valueDefaults:k(e,"valueDefaults")?wf(e.valueDefaults):void 0}}function gw(e){return yw(e)}function yw(e,t){return e==null?e:{objects:k(e,"objects")?e.objects.map(hw):void 0}}function vw(e){return bw(e)}function bw(e,t){return e==null?e:{name:e.name,displayName:k(e,"displayName")?e.displayName:void 0,module:k(e,"module")?e.module:void 0,provider:e.provider,read:k(e,"read")?fw(e.read):void 0,write:k(e,"write")?gw(e.write):void 0,proxy:k(e,"proxy")?sw(e.proxy):void 0}}function ww(e){return xw(e)}function xw(e,t){return e==null?e:{id:e.id,specVersion:e.specVersion,createTime:new Date(e.createTime),content:vw(e.content)}}function Ui(e){return Iw(e)}function Iw(e,t){return e==null?e:{id:e.id,projectId:e.projectId,integrationId:e.integrationId,group:k(e,"group")?pf(e.group):void 0,healthStatus:e.healthStatus,connection:Hi(e.connection),createTime:new Date(e.createTime),createdBy:e.createdBy,updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,config:Av(e.config)}}function Cw(e){return Sw(e)}function Sw(e,t){return e==null?e:{id:e.id,specVersion:e.specVersion,createTime:new Date(e.createTime),content:Bb(e.content)}}function Js(e){return Ow(e)}function Ow(e,t){return e==null?e:{id:e.id,projectId:e.projectId,name:e.name,provider:e.provider,createTime:new Date(e.createTime),updateTime:k(e,"updateTime")?new Date(e.updateTime):void 0,latestRevision:Cw(e.latestRevision)}}function Ew(e){return _w(e)}function _w(e,t){return e==null?e:{iconURL:k(e,"iconURL")?e.iconURL:void 0,logoURL:k(e,"logoURL")?e.logoURL:void 0}}function Tw(e){return Nw(e)}function Nw(e,t){return e==null?e:{iconURL:k(e,"iconURL")?e.iconURL:void 0,logoURL:k(e,"logoURL")?e.logoURL:void 0}}function kw(e){return Aw(e)}function Aw(e,t){return e==null?e:{regular:k(e,"regular")?Tw(e.regular):void 0,darkMode:k(e,"darkMode")?Ew(e.darkMode):void 0}}function Rw(e){return Pw(e)}function Pw(e,t){return e==null?e:{name:e.name,displayName:k(e,"displayName")?e.displayName:void 0,prompt:k(e,"prompt")?e.prompt:void 0,defaultValue:k(e,"defaultValue")?e.defaultValue:void 0,docsURL:k(e,"docsURL")?e.docsURL:void 0,moduleDependencies:k(e,"moduleDependencies")?e.moduleDependencies:void 0}}function Fw(e){return Dw(e)}function Dw(e,t){return e==null?e:{name:e.name,moduleDependencies:k(e,"moduleDependencies")?e.moduleDependencies:void 0}}function Mw(e){return jw(e)}function jw(e,t){return e==null?e:{create:k(e,"create")?e.create:void 0,update:k(e,"update")?e.update:void 0,_delete:k(e,"delete")?e.delete:void 0,passThrough:k(e,"passThrough")?e.passThrough:void 0}}function xf(e){return Lw(e)}function Lw(e,t){return e==null?e:{bulkWrite:lv(e.bulkWrite),proxy:e.proxy,read:e.read,subscribe:e.subscribe,write:e.write,subscribeSupport:k(e,"subscribeSupport")?Mw(e.subscribeSupport):void 0,batchWrite:k(e,"batchWrite")?tv(e.batchWrite):void 0}}function Bw(e){return Vw(e)}function Vw(e,t){return e==null?e:{displayName:e.displayName,baseURL:e.baseURL,support:xf(e.support)}}function Uw(e){return $w(e)}function $w(e,t){return e==null?e:{name:e.name,displayName:e.displayName,path:e.path,capture:k(e,"capture")?e.capture:void 0}}function qw(e){return zw(e)}function zw(e,t){return e==null?e:{workspaceRefField:k(e,"workspaceRefField")?e.workspaceRefField:void 0,consumerRefField:k(e,"consumerRefField")?e.consumerRefField:void 0,scopesField:k(e,"scopesField")?e.scopesField:void 0,otherFields:k(e,"otherFields")?e.otherFields.map(Uw):void 0}}const Ws={AuthorizationCode:"authorizationCode",AuthorizationCodePkce:"authorizationCodePKCE",ClientCredentials:"clientCredentials"};function Kw(e){return Hw(e)}function Hw(e,t){return e==null?e:{grantType:e.grantType,authURL:k(e,"authURL")?e.authURL:void 0,tokenURL:e.tokenURL,explicitScopesRequired:e.explicitScopesRequired,explicitWorkspaceRequired:e.explicitWorkspaceRequired,audience:k(e,"audience")?e.audience:void 0,tokenMetadataFields:qw(e.tokenMetadataFields),docsURL:k(e,"docsURL")?e.docsURL:void 0,authURLParams:k(e,"authURLParams")?e.authURLParams:void 0}}function Jw(e){if(e!==void 0)return e===null?null:{projectId:e.projectId,provider:e.provider,groupRef:e.groupRef,groupName:e.groupName,consumerRef:e.consumerRef,consumerName:e.consumerName,providerWorkspaceRef:e.providerWorkspaceRef,providerMetadata:e.providerMetadata===void 0?void 0:nt(e.providerMetadata,bl),providerAppId:e.providerAppId,enableCSRFProtection:e.enableCSRFProtection}}function Ww(e){return Qw(e)}function Qw(e,t){return e==null?e:{input:k(e,"input")?e.input.map(Rw):void 0,postAuthentication:k(e,"postAuthentication")?e.postAuthentication.map(Fw):void 0}}function Gw(e){return Xw(e)}function Xw(e,t){return e==null?e:{subscriptionScope:e.subscriptionScope,targetURLScope:e.targetURLScope,registrationTiming:e.registrationTiming}}function Wu(e){return Yw(e)}function Yw(e,t){return e==null?e:{name:e.name,authType:Zg(e.authType),baseURL:e.baseURL,defaultModule:e.defaultModule,oauth2Opts:k(e,"oauth2Opts")?Kw(e.oauth2Opts):void 0,apiKeyOpts:k(e,"apiKeyOpts")?Hg(e.apiKeyOpts):void 0,basicOpts:k(e,"basicOpts")?Xy(e.basicOpts):void 0,customOpts:k(e,"customOpts")?Zb(e.customOpts):void 0,support:xf(e.support),providerOpts:e.providerOpts,authHealthCheck:k(e,"authHealthCheck")?Xg(e.authHealthCheck):void 0,displayName:k(e,"displayName")?e.displayName:void 0,postAuthInfoNeeded:k(e,"postAuthInfoNeeded")?e.postAuthInfoNeeded:void 0,media:k(e,"media")?kw(e.media):void 0,labels:k(e,"labels")?e.labels:void 0,subscribeOpts:k(e,"subscribeOpts")?Gw(e.subscribeOpts):void 0,modules:k(e,"modules")?nt(e.modules,Bw):void 0,metadata:k(e,"metadata")?Ww(e.metadata):void 0}}function Zw(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,connection:Wv(e.connection)}}function ex(e){if(e!==void 0)return e===null?null:{provider:e.provider,read:xy(e.read),write:Uy(e.write),proxy:uf(e.proxy)}}function tx(e){if(e!==void 0)return e===null?null:{revisionId:e.revisionId,createdBy:e.createdBy,content:ex(e.content)}}function nx(e){if(e!==void 0)return e===null?null:{connectionId:e.connectionId,config:tx(e.config)}}function rx(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,installation:nx(e.installation)}}function ix(e){if(e!==void 0)return e===null?null:{appName:e.appName,name:e.name}}function ox(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,project:ix(e.project)}}function sx(e){if(e!==void 0)return e===null?null:{externalRef:e.externalRef,provider:e.provider,clientId:e.clientId,clientSecret:e.clientSecret,scopes:e.scopes}}function ax(e){if(e!==void 0)return e===null?null:{updateMask:e.updateMask,providerApp:sx(e.providerApp)}}class lx extends _n{async deleteConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling deleteConnection.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"DELETE",headers:i,query:r},n);return new yi(o)}async deleteConnection(t,n){await this.deleteConnectionRaw(t,n)}async generateConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling generateConnection.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections:generate".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:ow(t.generateConnectionParams)},n);return new Qe(o,s=>Hi(s))}async generateConnection(t,n){return await(await this.generateConnectionRaw(t,n)).value()}async getConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling getConnection.");const r={};t.includeCreds!==void 0&&(r.includeCreds=t.includeCreds),t.includeRefreshToken!==void 0&&(r.includeRefreshToken=t.includeRefreshToken),t.refresh!==void 0&&(r.refresh=t.refresh);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Hi(s))}async getConnection(t,n){return await(await this.getConnectionRaw(t,n)).value()}async listConnectionsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listConnections.");const r={};t.provider!==void 0&&(r.provider=t.provider),t.groupRef!==void 0&&(r.groupRef=t.groupRef),t.consumerRef!==void 0&&(r.consumerRef=t.consumerRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Hi))}async listConnections(t,n){return await(await this.listConnectionsRaw(t,n)).value()}async updateConnectionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateConnection.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling updateConnection.");if(t.updateConnectionRequest===null||t.updateConnectionRequest===void 0)throw new fe("updateConnectionRequest","Required parameter requestParameters.updateConnectionRequest was null or undefined when calling updateConnection.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"PATCH",headers:i,query:r,body:Zw(t.updateConnectionRequest)},n);return new Qe(o,s=>Hi(s))}async updateConnection(t,n){return await(await this.updateConnectionRaw(t,n)).value()}}class ux extends _n{async createInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling createInstallation.");if(t.installation===null||t.installation===void 0)throw new fe("installation","Required parameter requestParameters.installation was null or undefined when calling createInstallation.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"POST",headers:i,query:r,body:Zv(t.installation)},n);return new Qe(o,s=>Ui(s))}async createInstallation(t,n){return await(await this.createInstallationRaw(t,n)).value()}async deleteInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling deleteInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling deleteInstallation.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"DELETE",headers:i,query:r},n);return new yi(o)}async deleteInstallation(t,n){await this.deleteInstallationRaw(t,n)}async getInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling getInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling getInstallation.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Ui(s))}async getInstallation(t,n){return await(await this.getInstallationRaw(t,n)).value()}async listInstallationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listInstallations.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling listInstallations.");const r={};t.groupRef!==void 0&&(r.groupRef=t.groupRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Ui))}async listInstallations(t,n){return await(await this.listInstallationsRaw(t,n)).value()}async listInstallationsForProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listInstallationsForProject.");const r={};t.groupRef!==void 0&&(r.groupRef=t.groupRef);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/installations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Ui))}async listInstallationsForProject(t,n){return await(await this.listInstallationsForProjectRaw(t,n)).value()}async updateInstallationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateInstallation.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling updateInstallation.");if(t.installationId===null||t.installationId===void 0)throw new fe("installationId","Required parameter requestParameters.installationId was null or undefined when calling updateInstallation.");if(t.installationUpdate===null||t.installationUpdate===void 0)throw new fe("installationUpdate","Required parameter requestParameters.installationUpdate was null or undefined when calling updateInstallation.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/installations/{installationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{installationId}",encodeURIComponent(String(t.installationId))),method:"PATCH",headers:i,query:r,body:rx(t.installationUpdate)},n);return new Qe(o,s=>Ui(s))}async updateInstallation(t,n){return await(await this.updateInstallationRaw(t,n)).value()}}class cx extends _n{async batchUpsertIntegrationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling batchUpsertIntegrations.");if(t.batchUpsertIntegrationsRequest===null||t.batchUpsertIntegrationsRequest===void 0)throw new fe("batchUpsertIntegrationsRequest","Required parameter requestParameters.batchUpsertIntegrationsRequest was null or undefined when calling batchUpsertIntegrations.");const r={};t.destructive!==void 0&&(r.destructive=t.destructive);const i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations:batch".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"PUT",headers:i,query:r,body:Zy(t.batchUpsertIntegrationsRequest)},n);return new Qe(o,s=>s.map(Js))}async batchUpsertIntegrations(t,n){return await(await this.batchUpsertIntegrationsRaw(t,n)).value()}async createIntegrationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createIntegration.");if(t.integration===null||t.integration===void 0)throw new fe("integration","Required parameter requestParameters.integration was null or undefined when calling createIntegration.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:qb(t.integration)},n);return new yi(o)}async createIntegration(t,n){await this.createIntegrationRaw(t,n)}async deleteIntegrationRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteIntegration.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling deleteIntegration.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"DELETE",headers:i,query:r},n);return new yi(o)}async deleteIntegration(t,n){await this.deleteIntegrationRaw(t,n)}async getIntegrationRaw(t,n){if(t.integrationIdOrName===null||t.integrationIdOrName===void 0)throw new fe("integrationIdOrName","Required parameter requestParameters.integrationIdOrName was null or undefined when calling getIntegration.");if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getIntegration.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationIdOrName}".replace("{integrationIdOrName}",encodeURIComponent(String(t.integrationIdOrName))).replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Js(s))}async getIntegration(t,n){return await(await this.getIntegrationRaw(t,n)).value()}async listIntegrationsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listIntegrations.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Js))}async listIntegrations(t,n){return await(await this.listIntegrationsRaw(t,n)).value()}}class dx extends _n{async oauthConnectRaw(t,n){if(t.connectOAuthParams===null||t.connectOAuthParams===void 0)throw new fe("connectOAuthParams","Required parameter requestParameters.connectOAuthParams was null or undefined when calling oauthConnect.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/oauth-connect",method:"POST",headers:i,query:r,body:Jw(t.connectOAuthParams)},n);return this.isJsonMime(o.headers.get("content-type"))?new Qe(o):new zu(o)}async oauthConnect(t,n){return await(await this.oauthConnectRaw(t,n)).value()}async oauthUpdateRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling oauthUpdate.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling oauthUpdate.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/connections/{connectionId}:oauth-update".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{connectionId}",encodeURIComponent(String(t.connectionId))),method:"PATCH",headers:i,query:r},n);return this.isJsonMime(o.headers.get("content-type"))?new Qe(o):new zu(o)}async oauthUpdate(t,n){return await(await this.oauthUpdateRaw(t,n)).value()}}class fx extends _n{async createProjectRaw(t,n){if(t.project===null||t.project===void 0)throw new fe("project","Required parameter requestParameters.project was null or undefined when calling createProject.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects",method:"POST",headers:i,query:r,body:zb(t.project)},n);return new Qe(o,s=>jo(s))}async createProject(t,n){return await(await this.createProjectRaw(t,n)).value()}async getProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getProject.");const r={};t.includeEntitlements!==void 0&&(r.includeEntitlements=t.includeEntitlements);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>jo(s))}async getProject(t,n){return await(await this.getProjectRaw(t,n)).value()}async listProjectsRaw(t){const n={},r={};if(this.configuration&&this.configuration.apiKey&&(r["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const o=this.configuration.accessToken,s=await o("Bearer",[]);s&&(r.Authorization=`Bearer ${s}`)}const i=await this.request({path:"/projects",method:"GET",headers:r,query:n},t);return new Qe(i,o=>o.map(jo))}async listProjects(t){return await(await this.listProjectsRaw(t)).value()}async updateProjectRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateProject.");if(t.projectUpdate===null||t.projectUpdate===void 0)throw new fe("projectUpdate","Required parameter requestParameters.projectUpdate was null or undefined when calling updateProject.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"PATCH",headers:i,query:r,body:ox(t.projectUpdate)},n);return new Qe(o,s=>jo(s))}async updateProject(t,n){return await(await this.updateProjectRaw(t,n)).value()}}class px extends _n{async getProviderRaw(t,n){if(t.provider===null||t.provider===void 0)throw new fe("provider","Required parameter requestParameters.provider was null or undefined when calling getProvider.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/providers/{provider}".replace("{provider}",encodeURIComponent(String(t.provider))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>Wu(s))}async getProvider(t,n){return await(await this.getProviderRaw(t,n)).value()}async listProvidersRaw(t){const n={},r={};if(this.configuration&&this.configuration.apiKey&&(r["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const o=this.configuration.accessToken,s=await o("Bearer",[]);s&&(r.Authorization=`Bearer ${s}`)}const i=await this.request({path:"/providers",method:"GET",headers:r,query:n},t);return new Qe(i,o=>nt(o,Wu))}async listProviders(t){return await(await this.listProvidersRaw(t)).value()}}class hx extends _n{async createProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createProviderApp.");if(t.providerApp===null||t.providerApp===void 0)throw new fe("providerApp","Required parameter requestParameters.providerApp was null or undefined when calling createProviderApp.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"POST",headers:i,query:r,body:Kb(t.providerApp)},n);return new Qe(o,s=>Qo(s))}async createProviderApp(t,n){return await(await this.createProviderAppRaw(t,n)).value()}async deleteProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling deleteProviderApp.");if(t.providerAppId===null||t.providerAppId===void 0)throw new fe("providerAppId","Required parameter requestParameters.providerAppId was null or undefined when calling deleteProviderApp.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps/{providerAppId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{providerAppId}",encodeURIComponent(String(t.providerAppId))),method:"DELETE",headers:i,query:r},n);return new yi(o)}async deleteProviderApp(t,n){await this.deleteProviderAppRaw(t,n)}async listProviderAppsRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling listProviderApps.");const r={},i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>s.map(Qo))}async listProviderApps(t,n){return await(await this.listProviderAppsRaw(t,n)).value()}async updateProviderAppRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling updateProviderApp.");if(t.providerAppId===null||t.providerAppId===void 0)throw new fe("providerAppId","Required parameter requestParameters.providerAppId was null or undefined when calling updateProviderApp.");if(t.providerAppUpdate===null||t.providerAppUpdate===void 0)throw new fe("providerAppUpdate","Required parameter requestParameters.providerAppUpdate was null or undefined when calling updateProviderApp.");const r={},i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/provider-apps/{providerAppId}".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{providerAppId}",encodeURIComponent(String(t.providerAppId))),method:"PATCH",headers:i,query:r,body:ax(t.providerAppUpdate)},n);return new Qe(o,s=>Qo(s))}async updateProviderApp(t,n){return await(await this.updateProviderAppRaw(t,n)).value()}}class mx extends _n{async createRevisionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling createRevision.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling createRevision.");if(t.revision===null||t.revision===void 0)throw new fe("revision","Required parameter requestParameters.revision was null or undefined when calling createRevision.");const r={};t.destructive!==void 0&&(r.destructive=t.destructive);const i={};if(i["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/revisions".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))),method:"POST",headers:i,query:r,body:Hb(t.revision)},n);return new yi(o)}async createRevision(t,n){await this.createRevisionRaw(t,n)}async getHydratedRevisionRaw(t,n){if(t.projectIdOrName===null||t.projectIdOrName===void 0)throw new fe("projectIdOrName","Required parameter requestParameters.projectIdOrName was null or undefined when calling getHydratedRevision.");if(t.integrationId===null||t.integrationId===void 0)throw new fe("integrationId","Required parameter requestParameters.integrationId was null or undefined when calling getHydratedRevision.");if(t.revisionId===null||t.revisionId===void 0)throw new fe("revisionId","Required parameter requestParameters.revisionId was null or undefined when calling getHydratedRevision.");if(t.connectionId===null||t.connectionId===void 0)throw new fe("connectionId","Required parameter requestParameters.connectionId was null or undefined when calling getHydratedRevision.");const r={};t.connectionId!==void 0&&(r.connectionId=t.connectionId);const i={};if(this.configuration&&this.configuration.apiKey&&(i["X-Api-Key"]=this.configuration.apiKey("X-Api-Key")),this.configuration&&this.configuration.accessToken){const s=this.configuration.accessToken,a=await s("Bearer",[]);a&&(i.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/projects/{projectIdOrName}/integrations/{integrationId}/revisions/{revisionId}:hydrate".replace("{projectIdOrName}",encodeURIComponent(String(t.projectIdOrName))).replace("{integrationId}",encodeURIComponent(String(t.integrationId))).replace("{revisionId}",encodeURIComponent(String(t.revisionId))),method:"GET",headers:i,query:r},n);return new Qe(o,s=>ww(s))}async getHydratedRevision(t,n){return await(await this.getHydratedRevisionRaw(t,n)).value()}}var Ti=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gx={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},In,Tr,Jd,yx=(Jd=class{constructor(){pe(this,In,gx);pe(this,Tr,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&T(this,Tr)&&e!==T(this,In)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:T(this,In),provider:e}),re(this,In,e),process.env.NODE_ENV!=="production"&&re(this,Tr,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&re(this,Tr,!0),T(this,In).setTimeout(e,t)}clearTimeout(e){T(this,In).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&re(this,Tr,!0),T(this,In).setInterval(e,t)}clearInterval(e){T(this,In).clearInterval(e)}},In=new WeakMap,Tr=new WeakMap,Jd),Er=new yx;function vx(e){setTimeout(e,0)}var Br=typeof window>"u"||"Deno"in globalThis;function Pt(){}function bx(e,t){return typeof e=="function"?e(t):e}function Ca(e){return typeof e=="number"&&e>=0&&e!==1/0}function If(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fr(e,t){return typeof e=="function"?e(t):e}function on(e,t){return typeof e=="function"?e(t):e}function Qu(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==wl(s,t.options))return!1}else if(!eo(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function Gu(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Vr(t.options.mutationKey)!==Vr(o))return!1}else if(!eo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function wl(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vr)(e)}function Vr(e){return JSON.stringify(e,(t,n)=>Oa(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function eo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>eo(e[n],t[n])):!1}var wx=Object.prototype.hasOwnProperty;function Sa(e,t){if(e===t)return e;const n=Xu(e)&&Xu(t);if(!n&&!(Oa(e)&&Oa(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,a=n?new Array(s):{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c],d=e[u],h=t[u];if(d===h){a[u]=d,(n?c<i:wx.call(e,u))&&l++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){a[u]=h;continue}const f=Sa(d,h);a[u]=f,f===d&&l++}return i===s&&l===i?e:a}function rs(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Xu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Oa(e){if(!Yu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Yu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Yu(e){return Object.prototype.toString.call(e)==="[object Object]"}function xx(e){return new Promise(t=>{Er.setTimeout(t,e)})}function Ea(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Sa(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Sa(e,t)}return t}function Ix(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Cx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var is=Symbol();function Cf(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===is&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===is?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Sf(e,t){return typeof e=="function"?e(...t):!!e}var Nr,ir,oi,Wd,Sx=(Wd=class extends Ti{constructor(){super();pe(this,Nr);pe(this,ir);pe(this,oi);re(this,oi,t=>{if(!Br&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,ir)||this.setEventListener(T(this,oi))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,ir))==null||t.call(this),re(this,ir,void 0))}setEventListener(t){var n;re(this,oi,t),(n=T(this,ir))==null||n.call(this),re(this,ir,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Nr)!==t&&(re(this,Nr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Nr)=="boolean"?T(this,Nr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Nr=new WeakMap,ir=new WeakMap,oi=new WeakMap,Wd),xl=new Sx;function _a(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Ox=vx;function Ex(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=Ox;const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var dt=Ex(),si,or,ai,Qd,_x=(Qd=class extends Ti{constructor(){super();pe(this,si,!0);pe(this,or);pe(this,ai);re(this,ai,t=>{if(!Br&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,or)||this.setEventListener(T(this,ai))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,or))==null||t.call(this),re(this,or,void 0))}setEventListener(t){var n;re(this,ai,t),(n=T(this,or))==null||n.call(this),re(this,or,t(this.setOnline.bind(this)))}setOnline(t){T(this,si)!==t&&(re(this,si,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,si)}},si=new WeakMap,or=new WeakMap,ai=new WeakMap,Qd),os=new _x;function Tx(e){return Math.min(1e3*2**e,3e4)}function Of(e){return(e??"online")==="online"?os.isOnline():!0}var Ta=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ef(e){let t=!1,n=0,r;const i=_a(),o=()=>i.status!=="pending",s=g=>{var v;if(!o()){const w=new Ta(g);h(w),(v=e.onCancel)==null||v.call(e,w)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>xl.isFocused()&&(e.networkMode==="always"||os.isOnline())&&e.canRun(),u=()=>Of(e.networkMode)&&e.canRun(),d=g=>{o()||(r==null||r(),i.resolve(g))},h=g=>{o()||(r==null||r(),i.reject(g))},f=()=>new Promise(g=>{var v;r=w=>{(o()||c())&&g(w)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;r=void 0,o()||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(o())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var E;if(o())return;const y=e.retry??(Br?0:3),b=e.retryDelay??Tx,x=typeof b=="function"?b(n,w):b,O=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!O){h(w);return}n++,(E=e.onFail)==null||E.call(e,n,w),xx(x).then(()=>c()?void 0:f()).then(()=>{t?h(w):m()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var kr,Gd,_f=(Gd=class{constructor(){pe(this,kr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ca(this.gcTime)&&re(this,kr,Er.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Br?1/0:5*60*1e3))}clearGcTimeout(){T(this,kr)&&(Er.clearTimeout(T(this,kr)),re(this,kr,void 0))}},kr=new WeakMap,Gd),Ar,li,rn,Rr,ht,uo,Pr,hn,Mn,Xd,Nx=(Xd=class extends _f{constructor(t){super();pe(this,hn);pe(this,Ar);pe(this,li);pe(this,rn);pe(this,Rr);pe(this,ht);pe(this,uo);pe(this,Pr);re(this,Pr,!1),re(this,uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,Rr,t.client),re(this,rn,T(this,Rr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,Ar,Zu(this.options)),this.state=t.state??T(this,Ar),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,ht))==null?void 0:t.promise}setOptions(t){if(this.options={...T(this,uo),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Zu(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),re(this,Ar,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,rn).remove(this)}setData(t,n){const r=Ea(this.state.data,t,this.options);return Ce(this,hn,Mn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ce(this,hn,Mn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,ht))==null?void 0:r.promise;return(i=T(this,ht))==null||i.cancel(t),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Ar))}isActive(){return this.observers.some(t=>on(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===is||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!If(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,ht))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,ht))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,ht)&&(T(this,Pr)?T(this,ht).cancel({revert:!0}):T(this,ht).cancelRetry()),this.scheduleGc()),T(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,hn,Mn).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,u,d,h,f,m,g,v,w,y,b;if(this.state.fetchStatus!=="idle"&&((l=T(this,ht))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,ht))return T(this,ht).continueRetry(),T(this,ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(O=>O.options.queryFn);x&&this.setOptions(x.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(re(this,Pr,!0),r.signal)})},o=()=>{const x=Cf(this.options,n),E=(()=>{const F={client:T(this,Rr),queryKey:this.queryKey,meta:this.meta};return i(F),F})();return re(this,Pr,!1),this.options.persister?this.options.persister(x,E,this):x(E)},a=(()=>{const x={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Rr),state:this.state,fetchFn:o};return i(x),x})();(c=this.options.behavior)==null||c.onFetch(a,this),re(this,li,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ce(this,hn,Mn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),re(this,ht,Ef({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:x=>{x instanceof Ta&&x.revert&&this.setState({...T(this,li),fetchStatus:"idle"}),r.abort()},onFail:(x,O)=>{Ce(this,hn,Mn).call(this,{type:"failed",failureCount:x,error:O})},onPause:()=>{Ce(this,hn,Mn).call(this,{type:"pause"})},onContinue:()=>{Ce(this,hn,Mn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const x=await T(this,ht).start();if(x===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(x),(f=(h=T(this,rn).config).onSuccess)==null||f.call(h,x,this),(g=(m=T(this,rn).config).onSettled)==null||g.call(m,x,this.state.error,this),x}catch(x){if(x instanceof Ta){if(x.silent)return T(this,ht).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Ce(this,hn,Mn).call(this,{type:"error",error:x}),(w=(v=T(this,rn).config).onError)==null||w.call(v,x,this),(b=(y=T(this,rn).config).onSettled)==null||b.call(y,this.state.data,x,this),x}finally{this.scheduleGc()}}},Ar=new WeakMap,li=new WeakMap,rn=new WeakMap,Rr=new WeakMap,ht=new WeakMap,uo=new WeakMap,Pr=new WeakMap,hn=new WeakSet,Mn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Tf(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,li,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,rn).notify({query:this,type:"updated",action:t})})},Xd);function Tf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Of(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Zu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jt,Te,co,At,Fr,ui,jn,sr,fo,ci,di,Dr,Mr,ar,fi,je,Ji,Na,ka,Aa,Ra,Pa,Fa,Da,Nf,Yd,kx=(Yd=class extends Ti{constructor(t,n){super();pe(this,je);pe(this,jt);pe(this,Te);pe(this,co);pe(this,At);pe(this,Fr);pe(this,ui);pe(this,jn);pe(this,sr);pe(this,fo);pe(this,ci);pe(this,di);pe(this,Dr);pe(this,Mr);pe(this,ar);pe(this,fi,new Set);this.options=n,re(this,jt,t),re(this,sr,null),re(this,jn,_a()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Te).addObserver(this),ec(T(this,Te),this.options)?Ce(this,je,Ji).call(this):this.updateResult(),Ce(this,je,Ra).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ma(T(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ma(T(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,je,Pa).call(this),Ce(this,je,Fa).call(this),T(this,Te).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,Te);if(this.options=T(this,jt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,T(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,je,Da).call(this),T(this,Te).setOptions(this.options),n._defaulted&&!rs(this.options,n)&&T(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Te),observer:this});const i=this.hasListeners();i&&tc(T(this,Te),r,this.options,n)&&Ce(this,je,Ji).call(this),this.updateResult(),i&&(T(this,Te)!==r||on(this.options.enabled,T(this,Te))!==on(n.enabled,T(this,Te))||fr(this.options.staleTime,T(this,Te))!==fr(n.staleTime,T(this,Te)))&&Ce(this,je,Na).call(this);const o=Ce(this,je,ka).call(this);i&&(T(this,Te)!==r||on(this.options.enabled,T(this,Te))!==on(n.enabled,T(this,Te))||o!==T(this,ar))&&Ce(this,je,Aa).call(this,o)}getOptimisticResult(t){const n=T(this,jt).getQueryCache().build(T(this,jt),t),r=this.createResult(n,t);return Rx(this,r)&&(re(this,At,r),re(this,ui,this.options),re(this,Fr,T(this,Te).state)),r}getCurrentResult(){return T(this,At)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&T(this,jn).status==="pending"&&T(this,jn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){T(this,fi).add(t)}getCurrentQuery(){return T(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,jt).defaultQueryOptions(t),r=T(this,jt).getQueryCache().build(T(this,jt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ce(this,je,Ji).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,At)))}createResult(t,n){var P;const r=T(this,Te),i=this.options,o=T(this,At),s=T(this,Fr),a=T(this,ui),c=t!==r?t.state:T(this,co),{state:u}=t;let d={...u},h=!1,f;if(n._optimisticResults){const A=this.hasListeners(),D=!A&&ec(t,n),M=A&&tc(t,r,n,i);(D||M)&&(d={...d,...Tf(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:v}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let A;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(A=o.data,w=!0):A=typeof n.placeholderData=="function"?n.placeholderData((P=T(this,di))==null?void 0:P.state.data,T(this,di)):n.placeholderData,A!==void 0&&(v="success",f=Ea(o==null?void 0:o.data,A,n),h=!0)}if(n.select&&f!==void 0&&!w)if(o&&f===(s==null?void 0:s.data)&&n.select===T(this,fo))f=T(this,ci);else try{re(this,fo,n.select),f=n.select(f),f=Ea(o==null?void 0:o.data,f,n),re(this,ci,f),re(this,sr,null)}catch(A){re(this,sr,A)}T(this,sr)&&(m=T(this,sr),f=T(this,ci),g=Date.now(),v="error");const y=d.fetchStatus==="fetching",b=v==="pending",x=v==="error",O=b&&y,E=f!==void 0,N={status:v,fetchStatus:d.fetchStatus,isPending:b,isSuccess:v==="success",isError:x,isInitialLoading:O,isLoading:O,data:f,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&E,isStale:Il(t,n),refetch:this.refetch,promise:T(this,jn),isEnabled:on(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=z=>{N.status==="error"?z.reject(N.error):N.data!==void 0&&z.resolve(N.data)},D=()=>{const z=re(this,jn,N.promise=_a());A(z)},M=T(this,jn);switch(M.status){case"pending":t.queryHash===r.queryHash&&A(M);break;case"fulfilled":(N.status==="error"||N.data!==M.value)&&D();break;case"rejected":(N.status!=="error"||N.error!==M.reason)&&D();break}}return N}updateResult(){const t=T(this,At),n=this.createResult(T(this,Te),this.options);if(re(this,Fr,T(this,Te).state),re(this,ui,this.options),T(this,Fr).data!==void 0&&re(this,di,T(this,Te)),rs(n,t))return;re(this,At,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!T(this,fi).size)return!0;const s=new Set(o??T(this,fi));return this.options.throwOnError&&s.add("error"),Object.keys(T(this,At)).some(a=>{const l=a;return T(this,At)[l]!==t[l]&&s.has(l)})};Ce(this,je,Nf).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,je,Ra).call(this)}},jt=new WeakMap,Te=new WeakMap,co=new WeakMap,At=new WeakMap,Fr=new WeakMap,ui=new WeakMap,jn=new WeakMap,sr=new WeakMap,fo=new WeakMap,ci=new WeakMap,di=new WeakMap,Dr=new WeakMap,Mr=new WeakMap,ar=new WeakMap,fi=new WeakMap,je=new WeakSet,Ji=function(t){Ce(this,je,Da).call(this);let n=T(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pt)),n},Na=function(){Ce(this,je,Pa).call(this);const t=fr(this.options.staleTime,T(this,Te));if(Br||T(this,At).isStale||!Ca(t))return;const r=If(T(this,At).dataUpdatedAt,t)+1;re(this,Dr,Er.setTimeout(()=>{T(this,At).isStale||this.updateResult()},r))},ka=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Te)):this.options.refetchInterval)??!1},Aa=function(t){Ce(this,je,Fa).call(this),re(this,ar,t),!(Br||on(this.options.enabled,T(this,Te))===!1||!Ca(T(this,ar))||T(this,ar)===0)&&re(this,Mr,Er.setInterval(()=>{(this.options.refetchIntervalInBackground||xl.isFocused())&&Ce(this,je,Ji).call(this)},T(this,ar)))},Ra=function(){Ce(this,je,Na).call(this),Ce(this,je,Aa).call(this,Ce(this,je,ka).call(this))},Pa=function(){T(this,Dr)&&(Er.clearTimeout(T(this,Dr)),re(this,Dr,void 0))},Fa=function(){T(this,Mr)&&(Er.clearInterval(T(this,Mr)),re(this,Mr,void 0))},Da=function(){const t=T(this,jt).getQueryCache().build(T(this,jt),this.options);if(t===T(this,Te))return;const n=T(this,Te);re(this,Te,t),re(this,co,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Nf=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,At))}),T(this,jt).getQueryCache().notify({query:T(this,Te),type:"observerResultsUpdated"})})},Yd);function Ax(e,t){return on(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ec(e,t){return Ax(e,t)||e.state.data!==void 0&&Ma(e,t,t.refetchOnMount)}function Ma(e,t,n){if(on(t.enabled,e)!==!1&&fr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Il(e,t)}return!1}function tc(e,t,n,r){return(e!==t||on(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Il(e,n)}function Il(e,t){return on(t.enabled,e)!==!1&&e.isStaleByTime(fr(t.staleTime,e))}function Rx(e,t){return!rs(e.getCurrentResult(),t)}function nc(e){return{onFetch:(t,n)=>{var u,d,h,f,m;const r=t.options,i=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Cf(t.options,t.fetchOptions),y=async(b,x,O)=>{if(g)return Promise.reject();if(x==null&&b.pages.length)return Promise.resolve(b);const F=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:x,direction:O?"backward":"forward",meta:t.options.meta};return v(D),D})(),N=await w(F),{maxPages:P}=t.options,A=O?Cx:Ix;return{pages:A(b.pages,N,P),pageParams:A(b.pageParams,x,P)}};if(i&&o.length){const b=i==="backward",x=b?Px:rc,O={pages:o,pageParams:s},E=x(r,O);a=await y(O,E,b)}else{const b=e??o.length;do{const x=l===0?s[0]??r.initialPageParam:rc(r,a);if(l>0&&x==null)break;a=await y(a,x),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function rc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Px(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var po,Cn,Rt,jr,Sn,nr,Zd,Fx=(Zd=class extends _f{constructor(t){super();pe(this,Sn);pe(this,po);pe(this,Cn);pe(this,Rt);pe(this,jr);re(this,po,t.client),this.mutationId=t.mutationId,re(this,Rt,t.mutationCache),re(this,Cn,[]),this.state=t.state||kf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Cn).includes(t)||(T(this,Cn).push(t),this.clearGcTimeout(),T(this,Rt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,Cn,T(this,Cn).filter(n=>n!==t)),this.scheduleGc(),T(this,Rt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Cn).length||(this.state.status==="pending"?this.scheduleGc():T(this,Rt).remove(this))}continue(){var t;return((t=T(this,jr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,c,u,d,h,f,m,g,v,w,y,b,x,O,E,F,N,P;const n=()=>{Ce(this,Sn,nr).call(this,{type:"continue"})},r={client:T(this,po),meta:this.options.meta,mutationKey:this.options.mutationKey};re(this,jr,Ef({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,D)=>{Ce(this,Sn,nr).call(this,{type:"failed",failureCount:A,error:D})},onPause:()=>{Ce(this,Sn,nr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Rt).canRun(this)}));const i=this.state.status==="pending",o=!T(this,jr).canStart();try{if(i)n();else{Ce(this,Sn,nr).call(this,{type:"pending",variables:t,isPaused:o}),await((a=(s=T(this,Rt).config).onMutate)==null?void 0:a.call(s,t,this,r));const D=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));D!==this.state.context&&Ce(this,Sn,nr).call(this,{type:"pending",context:D,variables:t,isPaused:o})}const A=await T(this,jr).start();return await((d=(u=T(this,Rt).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this,r)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,A,t,this.state.context,r)),await((g=(m=T(this,Rt).config).onSettled)==null?void 0:g.call(m,A,null,this.state.variables,this.state.context,this,r)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,A,null,t,this.state.context,r)),Ce(this,Sn,nr).call(this,{type:"success",data:A}),A}catch(A){try{throw await((b=(y=T(this,Rt).config).onError)==null?void 0:b.call(y,A,t,this.state.context,this,r)),await((O=(x=this.options).onError)==null?void 0:O.call(x,A,t,this.state.context,r)),await((F=(E=T(this,Rt).config).onSettled)==null?void 0:F.call(E,void 0,A,this.state.variables,this.state.context,this,r)),await((P=(N=this.options).onSettled)==null?void 0:P.call(N,void 0,A,t,this.state.context,r)),A}finally{Ce(this,Sn,nr).call(this,{type:"error",error:A})}}finally{T(this,Rt).runNext(this)}}},po=new WeakMap,Cn=new WeakMap,Rt=new WeakMap,jr=new WeakMap,Sn=new WeakSet,nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dt.batch(()=>{T(this,Cn).forEach(r=>{r.onMutationUpdate(t)}),T(this,Rt).notify({mutation:this,type:"updated",action:t})})},Zd);function kf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ln,mn,ho,ef,Dx=(ef=class extends Ti{constructor(t={}){super();pe(this,Ln);pe(this,mn);pe(this,ho);this.config=t,re(this,Ln,new Set),re(this,mn,new Map),re(this,ho,0)}build(t,n,r){const i=new Fx({client:t,mutationCache:this,mutationId:++Do(this,ho)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){T(this,Ln).add(t);const n=Lo(t);if(typeof n=="string"){const r=T(this,mn).get(n);r?r.push(t):T(this,mn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,Ln).delete(t)){const n=Lo(t);if(typeof n=="string"){const r=T(this,mn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&T(this,mn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Lo(t);if(typeof n=="string"){const r=T(this,mn).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Lo(t);if(typeof n=="string"){const i=(r=T(this,mn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{T(this,Ln).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,Ln).clear(),T(this,mn).clear()})}getAll(){return Array.from(T(this,Ln))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gu(n,r))}findAll(t={}){return this.getAll().filter(n=>Gu(t,n))}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pt))))}},Ln=new WeakMap,mn=new WeakMap,ho=new WeakMap,ef);function Lo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Bn,lr,Lt,Vn,qn,Go,ja,tf,Mx=(tf=class extends Ti{constructor(n,r){super();pe(this,qn);pe(this,Bn);pe(this,lr);pe(this,Lt);pe(this,Vn);re(this,Bn,n),this.setOptions(r),this.bindMethods(),Ce(this,qn,Go).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=T(this,Bn).defaultMutationOptions(n),rs(this.options,r)||T(this,Bn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Lt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Vr(r.mutationKey)!==Vr(this.options.mutationKey)?this.reset():((i=T(this,Lt))==null?void 0:i.state.status)==="pending"&&T(this,Lt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,Lt))==null||n.removeObserver(this)}onMutationUpdate(n){Ce(this,qn,Go).call(this),Ce(this,qn,ja).call(this,n)}getCurrentResult(){return T(this,lr)}reset(){var n;(n=T(this,Lt))==null||n.removeObserver(this),re(this,Lt,void 0),Ce(this,qn,Go).call(this),Ce(this,qn,ja).call(this)}mutate(n,r){var i;return re(this,Vn,r),(i=T(this,Lt))==null||i.removeObserver(this),re(this,Lt,T(this,Bn).getMutationCache().build(T(this,Bn),this.options)),T(this,Lt).addObserver(this),T(this,Lt).execute(n)}},Bn=new WeakMap,lr=new WeakMap,Lt=new WeakMap,Vn=new WeakMap,qn=new WeakSet,Go=function(){var r;const n=((r=T(this,Lt))==null?void 0:r.state)??kf();re(this,lr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ja=function(n){dt.batch(()=>{var r,i,o,s,a,l,c,u;if(T(this,Vn)&&this.hasListeners()){const d=T(this,lr).variables,h=T(this,lr).context,f={client:T(this,Bn),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((i=(r=T(this,Vn)).onSuccess)==null||i.call(r,n.data,d,h,f),(s=(o=T(this,Vn)).onSettled)==null||s.call(o,n.data,null,d,h,f)):(n==null?void 0:n.type)==="error"&&((l=(a=T(this,Vn)).onError)==null||l.call(a,n.error,d,h,f),(u=(c=T(this,Vn)).onSettled)==null||u.call(c,void 0,n.error,d,h,f))}this.listeners.forEach(d=>{d(T(this,lr))})})},tf),On,nf,jx=(nf=class extends Ti{constructor(t={}){super();pe(this,On);this.config=t,re(this,On,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??wl(i,n);let s=this.get(o);return s||(s=new Nx({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){T(this,On).has(t.queryHash)||(T(this,On).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,On).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,On).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,On).get(t)}getAll(){return[...T(this,On).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Qu(t,r)):n}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},On=new WeakMap,nf),Ze,ur,cr,pi,hi,dr,mi,gi,rf,Lx=(rf=class{constructor(e={}){pe(this,Ze);pe(this,ur);pe(this,cr);pe(this,pi);pe(this,hi);pe(this,dr);pe(this,mi);pe(this,gi);re(this,Ze,e.queryCache||new jx),re(this,ur,e.mutationCache||new Dx),re(this,cr,e.defaultOptions||{}),re(this,pi,new Map),re(this,hi,new Map),re(this,dr,0)}mount(){Do(this,dr)._++,T(this,dr)===1&&(re(this,mi,xl.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ze).onFocus())})),re(this,gi,os.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ze).onOnline())})))}unmount(){var e,t;Do(this,dr)._--,T(this,dr)===0&&((e=T(this,mi))==null||e.call(this),re(this,mi,void 0),(t=T(this,gi))==null||t.call(this),re(this,gi,void 0))}isFetching(e){return T(this,Ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,ur).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Ze).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,Ze).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,Ze).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=T(this,Ze).get(r.queryHash),o=i==null?void 0:i.state.data,s=bx(t,o);if(s!==void 0)return T(this,Ze).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return dt.batch(()=>T(this,Ze).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Ze).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,Ze);dt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,Ze);return dt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dt.batch(()=>T(this,Ze).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return dt.batch(()=>(T(this,Ze).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=dt.batch(()=>T(this,Ze).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,Ze).build(this,t);return n.isStaleByTime(fr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}fetchInfiniteQuery(e){return e.behavior=nc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e.behavior=nc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return os.isOnline()?T(this,ur).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Ze)}getMutationCache(){return T(this,ur)}getDefaultOptions(){return T(this,cr)}setDefaultOptions(e){re(this,cr,e)}setQueryDefaults(e,t){T(this,pi).set(Vr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,pi).values()],n={};return t.forEach(r=>{eo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,hi).set(Vr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,hi).values()],n={};return t.forEach(r=>{eo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,cr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===is&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,cr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Ze).clear(),T(this,ur).clear()}},Ze=new WeakMap,ur=new WeakMap,cr=new WeakMap,pi=new WeakMap,hi=new WeakMap,dr=new WeakMap,mi=new WeakMap,gi=new WeakMap,rf),Af=W.createContext(void 0),st=e=>{const t=W.useContext(Af);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bx=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Af.Provider,{value:e,children:t})),Rf=W.createContext(!1),Vx=()=>W.useContext(Rf);Rf.Provider;function Ux(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $x=W.createContext(Ux()),qx=()=>W.useContext($x),zx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Kx=e=>{W.useEffect(()=>{e.clearReset()},[e])},Hx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Sf(n,[e.error,r])),Jx=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Wx=(e,t)=>e.isLoading&&e.isFetching&&!t,Qx=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ic=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Gx(e,t,n){var d,h,f,m,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Vx(),i=qx(),o=st(),s=o.defaultQueryOptions(e);(h=(d=o.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=r?"isRestoring":"optimistic",Jx(s),zx(s,i),Kx(i);const a=!o.getQueryCache().get(s.queryHash),[l]=W.useState(()=>new t(o,s)),c=l.getOptimisticResult(s),u=!r&&e.subscribed!==!1;if(W.useSyncExternalStore(W.useCallback(v=>{const w=u?l.subscribe(dt.batchCalls(v)):Pt;return l.updateResult(),w},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),W.useEffect(()=>{l.setOptions(s)},[s,l]),Qx(s,c))throw ic(s,l,i);if(Hx({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:o.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((m=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,s,c),s.experimental_prefetchInRender&&!Br&&Wx(c,r)){const v=a?ic(s,l,i):(g=o.getQueryCache().get(s.queryHash))==null?void 0:g.promise;v==null||v.catch(Pt).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Kr(e,t){return Gx(e,kx)}function zn(e,t){const n=st(),[r]=W.useState(()=>new Mx(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);const i=W.useSyncExternalStore(W.useCallback(s=>r.subscribe(dt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=W.useCallback((s,a)=>{r.mutate(s,a).catch(Pt)},[r]);if(i.error&&Sf(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const Pf=C.createContext(null),Xx=Pf.Provider,Ff=()=>C.useContext(Pf);var Ee=(e=>(e.MAPPING="mappingError",e.INTEGRATION_LIST="integrationListError",e.PROJECT="projectError",e.CONNECTION_LIST="connectionListError",e.HYDRATED_REVISION="hydratedRevisionError",e.INSTALLATION_LIST="installationListError",e.INSTALLATION_MUTATION="installationMutationError",e.VALUE_MAPPING="valueMappingError",e))(Ee||{});const Df=C.createContext(void 0);function kn(){const e=C.useContext(Df);if(!e)throw new Error("useErrorState must be used within a ErrorProvider");return e}const Yx=(()=>{const e={};return Object.values(Ee).forEach(t=>{e[t]={}}),e})();function Zx({children:e}){const[t,n]=C.useState(Yx),r=C.useCallback((u,d,h=!0)=>{n(f=>{const m={...f};return m[u]=m[u]||{},m[u][d]=h,m})},[n]),i=C.useCallback((u,d)=>{var h;return!!((h=t[u])!=null&&h[d])},[t]),o=C.useCallback((u,d)=>{var h;return(h=t[u])==null?void 0:h[d]},[t]),s=C.useCallback((u,d)=>{n(h=>{var m;const f={...h};return(m=f[u])==null||delete m[d],f})},[n]),a=C.useCallback(u=>{n(d=>{const h={...d};return h[u]={},h})},[n]),l=C.useCallback((u,d)=>{n(h=>{const f={...h};return f[u]=f[u]||{},d.forEach(m=>{f[u][m]=!0}),f})},[n]),c=C.useMemo(()=>({errorState:t,setErrorState:n,setError:r,isError:i,removeError:s,resetBoundary:a,setErrors:l,getError:o}),[t,n,r,i,s,a,l,o]);return p.jsx(Df.Provider,{value:c,children:e})}new TextEncoder;const La=new TextDecoder;function eI(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function tI(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:La.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=La.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return eI(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class Mf extends Error{constructor(n,r){var i;super(n,r);Vi(this,"code","ERR_JOSE_GENERIC");this.name=this.constructor.name,(i=Error.captureStackTrace)==null||i.call(Error,this,this.constructor)}}Vi(Mf,"code","ERR_JOSE_GENERIC");class rr extends Mf{constructor(){super(...arguments);Vi(this,"code","ERR_JWT_INVALID")}}Vi(rr,"code","ERR_JWT_INVALID");function nI(e){return typeof e=="object"&&e!==null}const rI=e=>{if(!nI(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function iI(e){if(typeof e!="string")throw new rr("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(n===5)throw new rr("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new rr("Invalid JWT");if(!t)throw new rr("JWTs must contain a payload");let r;try{r=tI(t)}catch{throw new rr("Failed to base64url decode the payload")}let i;try{i=JSON.parse(La.decode(r))}catch{throw new rr("Failed to parse the decoded payload as JSON")}if(!rI(i))throw new rr("Invalid JWT Claims Set");return i}const Ba="amp-labs_jwt_",oI=10*60*1e3,oc=(e,t)=>`${e}:${t}`,sc=e=>`${Ba}${e}`,jf=C.createContext(null),sI=e=>{try{const t=iI(e);return t.exp&&typeof t.exp=="number"?t.exp*1e3:null}catch(t){return console.warn("Failed to decode JWT token:",t),null}};function aI({getTokenCallback:e,children:t}){const[n,r]=C.useState(new Map);C.useEffect(()=>{try{const l=new Map,c=Date.now();Object.keys(sessionStorage).forEach(u=>{if(u.startsWith(Ba)){const d=u.replace(Ba,""),h=sessionStorage.getItem(u);if(h)try{const f=JSON.parse(h);f.expiresAt>c?l.set(d,f):sessionStorage.removeItem(u)}catch{sessionStorage.removeItem(u)}}}),l.size>0&&r(l)}catch{console.warn("Failed to load JWT tokens from sessionStorage")}},[]);const i=C.useCallback((l,c)=>{const u=oc(l,c),d=Date.now(),h=n.get(u);if(h&&h.expiresAt>d)return h.token;n.delete(u);const f=sc(u),m=sessionStorage.getItem(f);if(m)try{const g=JSON.parse(m);if(g.expiresAt>d)return r(v=>new Map(v).set(u,g)),g.token;sessionStorage.removeItem(f)}catch{sessionStorage.removeItem(f)}return null},[n]),o=C.useCallback(async(l,c,u)=>{const d=oc(l,c),f=await sI(u)||Date.now()+oI,m={token:u,expiresAt:f};r(g=>new Map(g).set(d,m));try{sessionStorage.setItem(sc(d),JSON.stringify(m))}catch{console.warn("Failed to store JWT token in sessionStorage")}},[]),s=C.useCallback(async({consumerRef:l,groupRef:c})=>{const u=i(l,c);if(u)return u;if(!e)throw new Error("JWT token callback not provided");try{const d=await e({consumerRef:l,groupRef:c});return await o(l,c,d),d}catch(d){throw console.error("Failed to get JWT token:",d),new Error("Failed to get JWT token")}},[e,i,o]),a={getToken:e?s:void 0};return p.jsx(jf.Provider,{value:a,children:t})}const lI=()=>{const e=C.useContext(jf);if(!e)throw new Error("useJwtToken must be used within a JwtTokenProvider");return e},Cl=C.createContext(null);function Xe(){const e=C.useContext(Cl);if(!e)throw new Error(`Cannot call useAmpersandProvider unless your
|
|
2
|
+
component is wrapped with AmpersandProvider`);return e}const uI=new Lx({defaultOptions:{queries:{retry:(e,t)=>{if(t instanceof vl){const n=t.response.status;if(n>=400&&n<500)return!1}return e<3}}}});function cI(e){const{options:{apiKey:t,projectId:n,project:r,getToken:i},children:o}=e,s=r||n;if(n&&r)throw new Error("Use AmpersandProvider either with projectId or project but not both.");if(!s)throw new Error("Cannot use AmpersandProvider without a projectId or name.");if(!t&&!i)throw new Error("Cannot use AmpersandProvider without an apiKey or getToken.");if(t&&i)throw new Error("Cannot use AmpersandProvider with both apiKey and getToken.");const a={options:e.options,projectIdOrName:s};return p.jsx(Bx,{client:uI,children:p.jsx(Cl.Provider,{value:a,children:p.jsx(Zx,{children:p.jsx(aI,{getTokenCallback:i||null,children:p.jsx(Xx,{value:t||null,children:o})})})})})}var Lf=Symbol.for("immer-nothing"),ac=Symbol.for("immer-draftable"),Qt=Symbol.for("immer-state"),dI=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Bt(e,...t){if(process.env.NODE_ENV!=="production"){const n=dI[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var to=Object.getPrototypeOf;function vi(e){return!!e&&!!e[Qt]}function Ur(e){var t;return e?Bf(e)||Array.isArray(e)||!!e[ac]||!!((t=e.constructor)!=null&&t[ac])||mo(e)||Ss(e):!1}var fI=Object.prototype.constructor.toString(),lc=new WeakMap;function Bf(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=lc.get(n);return r===void 0&&(r=Function.toString.call(n),lc.set(n,r)),r===fI}function ss(e,t,n=!0){Cs(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Cs(e){const t=e[Qt];return t?t.type_:Array.isArray(e)?1:mo(e)?2:Ss(e)?3:0}function Va(e,t){return Cs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Vf(e,t,n){const r=Cs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function pI(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mo(e){return e instanceof Map}function Ss(e){return e instanceof Set}function Sr(e){return e.copy_||e.base_}function Ua(e,t){if(mo(e))return new Map(e);if(Ss(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Bf(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Qt];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(to(e),r)}else{const r=to(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Sl(e,t=!1){return Os(e)||vi(e)||!Ur(e)||(Cs(e)>1&&Object.defineProperties(e,{set:Bo,add:Bo,clear:Bo,delete:Bo}),Object.freeze(e),t&&Object.values(e).forEach(n=>Sl(n,!0))),e}function hI(){Bt(2)}var Bo={value:hI};function Os(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var mI={};function $r(e){const t=mI[e];return t||Bt(0,e),t}var no;function Uf(){return no}function gI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function uc(e,t){t&&($r("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $a(e){qa(e),e.drafts_.forEach(yI),e.drafts_=null}function qa(e){e===no&&(no=e.parent_)}function cc(e){return no=gI(no,e)}function yI(e){const t=e[Qt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function dc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Qt].modified_&&($a(t),Bt(4)),Ur(e)&&(e=as(t,e),t.parent_||ls(t,e)),t.patches_&&$r("Patches").generateReplacementPatches_(n[Qt].base_,e,t.patches_,t.inversePatches_)):e=as(t,n,[]),$a(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Lf?e:void 0}function as(e,t,n){if(Os(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Qt];if(!i)return ss(t,(o,s)=>fc(e,i,t,o,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return ls(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let s=o,a=!1;i.type_===3&&(s=new Set(o),o.clear(),a=!0),ss(s,(l,c)=>fc(e,i,o,l,c,n,a),r),ls(e,o,!1),n&&e.patches_&&$r("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function fc(e,t,n,r,i,o,s){if(i==null||typeof i!="object"&&!s)return;const a=Os(i);if(!(a&&!s)){if(process.env.NODE_ENV!=="production"&&i===n&&Bt(5),vi(i)){const l=o&&t&&t.type_!==3&&!Va(t.assigned_,r)?o.concat(r):void 0,c=as(e,i,l);if(Vf(n,r,c),vi(c))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Ur(i)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&a)return;as(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(mo(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&ls(e,i)}}}function ls(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Sl(t,n)}function vI(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Uf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Ol;n&&(i=[r],o=ro);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Ol={get(e,t){if(t===Qt)return e;const n=Sr(e);if(!Va(n,t))return bI(e,n,t);const r=n[t];return e.finalized_||!Ur(r)?r:r===Qs(e.base_,t)?(Gs(e),e.copy_[t]=Ka(r,e)):r},has(e,t){return t in Sr(e)},ownKeys(e){return Reflect.ownKeys(Sr(e))},set(e,t,n){const r=$f(Sr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Qs(Sr(e),t),o=i==null?void 0:i[Qt];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(pI(n,i)&&(n!==void 0||Va(e.base_,t)))return!0;Gs(e),za(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Qs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Gs(e),za(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Sr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Bt(11)},getPrototypeOf(e){return to(e.base_)},setPrototypeOf(){Bt(12)}},ro={};ss(Ol,(e,t)=>{ro[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ro.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Bt(13),ro.set.call(this,e,t,void 0)};ro.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Bt(14),Ol.set.call(this,e[0],t,n,e[0])};function Qs(e,t){const n=e[Qt];return(n?Sr(n):e)[t]}function bI(e,t,n){var i;const r=$f(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function $f(e,t){if(!(t in e))return;let n=to(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=to(n)}}function za(e){e.modified_||(e.modified_=!0,e.parent_&&za(e.parent_))}function Gs(e){e.copy_||(e.copy_=Ua(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Bt(6),r!==void 0&&typeof r!="function"&&Bt(7);let i;if(Ur(t)){const o=cc(this),s=Ka(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?$a(o):qa(o)}return uc(o,r),dc(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Lf&&(i=void 0),this.autoFreeze_&&Sl(i,!0),r){const o=[],s=[];$r("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else Bt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ur(e)||Bt(8),vi(e)&&(e=xI(e));const t=cc(this),n=Ka(e,void 0);return n[Qt].isManual_=!0,qa(t),n}finishDraft(e,t){const n=e&&e[Qt];(!n||!n.isManual_)&&Bt(9);const{scope_:r}=n;return uc(r,t),dc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=$r("Patches").applyPatches_;return vi(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Ka(e,t){const n=mo(e)?$r("MapSet").proxyMap_(e,t):Ss(e)?$r("MapSet").proxySet_(e,t):vI(e,t);return(t?t.scope_:Uf()).drafts_.push(n),n}function xI(e){return vi(e)||Bt(10,e),qf(e)}function qf(e){if(!Ur(e)||Os(e))return e;const t=e[Qt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ua(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ua(e,!0);return ss(n,(i,o)=>{Vf(n,i,qf(o))},r),t&&(t.finalized_=!1),n}var II=new wI,Kt=II.produce,an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ni(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var us={exports:{}};us.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",m="[object GeneratorFunction]",g="[object Map]",v="[object Number]",w="[object Null]",y="[object Object]",b="[object Promise]",x="[object Proxy]",O="[object RegExp]",E="[object Set]",F="[object String]",N="[object Symbol]",P="[object Undefined]",A="[object WeakMap]",D="[object ArrayBuffer]",M="[object DataView]",z="[object Float32Array]",V="[object Float64Array]",Y="[object Int8Array]",se="[object Int16Array]",ce="[object Int32Array]",ge="[object Uint8Array]",be="[object Uint8ClampedArray]",I="[object Uint16Array]",J="[object Uint32Array]",B=/[\\^$.*+?()[\]{}|]/g,S=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,U={};U[z]=U[V]=U[Y]=U[se]=U[ce]=U[ge]=U[be]=U[I]=U[J]=!0,U[a]=U[l]=U[D]=U[u]=U[M]=U[d]=U[h]=U[f]=U[g]=U[v]=U[y]=U[O]=U[E]=U[F]=U[A]=!1;var X=typeof an=="object"&&an&&an.Object===Object&&an,ne=typeof self=="object"&&self&&self.Object===Object&&self,te=X||ne||Function("return this")(),ae=t&&!t.nodeType&&t,Z=ae&&!0&&e&&!e.nodeType&&e,ye=Z&&Z.exports===ae,$=ye&&X.process,we=function(){try{return $&&$.binding&&$.binding("util")}catch{}}(),ee=we&&we.isTypedArray;function Ke(_,R){for(var K=-1,le=_==null?0:_.length,He=0,xe=[];++K<le;){var Ye=_[K];R(Ye,K,_)&&(xe[He++]=Ye)}return xe}function Be(_,R){for(var K=-1,le=R.length,He=_.length;++K<le;)_[He+K]=R[K];return _}function Le(_,R){for(var K=-1,le=_==null?0:_.length;++K<le;)if(R(_[K],K,_))return!0;return!1}function tt(_,R){for(var K=-1,le=Array(_);++K<_;)le[K]=R(K);return le}function at(_){return function(R){return _(R)}}function lt(_,R){return _.has(R)}function Oe(_,R){return _==null?void 0:_[R]}function ft(_){var R=-1,K=Array(_.size);return _.forEach(function(le,He){K[++R]=[He,le]}),K}function _t(_,R){return function(K){return _(R(K))}}function mt(_){var R=-1,K=Array(_.size);return _.forEach(function(le){K[++R]=le}),K}var rt=Array.prototype,L=Function.prototype,H=Object.prototype,j=te["__core-js_shared__"],oe=L.toString,ue=H.hasOwnProperty,Je=function(){var _=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),Tt=H.toString,gt=RegExp("^"+oe.call(ue).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wt=ye?te.Buffer:void 0,Ve=te.Symbol,ke=te.Uint8Array,Nt=H.propertyIsEnumerable,yt=rt.splice,Ft=Ve?Ve.toStringTag:void 0,Wn=Object.getOwnPropertySymbols,Qn=wt?wt.isBuffer:void 0,Gn=_t(Object.keys,Object),bn=Yr(te,"DataView"),cn=Yr(te,"Map"),Xn=Yr(te,"Promise"),We=Yr(te,"Set"),ut=Yr(te,"WeakMap"),he=Yr(Object,"create"),_e=xr(bn),kt=xr(cn),Fn=xr(Xn),ie=xr(We),me=xr(ut),de=Ve?Ve.prototype:void 0,Ne=de?de.valueOf:void 0;function Ue(_){var R=-1,K=_==null?0:_.length;for(this.clear();++R<K;){var le=_[R];this.set(le[0],le[1])}}function Yt(){this.__data__=he?he(null):{},this.size=0}function Zt(_){var R=this.has(_)&&delete this.__data__[_];return this.size-=R?1:0,R}function vt(_){var R=this.__data__;if(he){var K=R[_];return K===r?void 0:K}return ue.call(R,_)?R[_]:void 0}function Dt(_){var R=this.__data__;return he?R[_]!==void 0:ue.call(R,_)}function $e(_,R){var K=this.__data__;return this.size+=this.has(_)?0:1,K[_]=he&&R===void 0?r:R,this}Ue.prototype.clear=Yt,Ue.prototype.delete=Zt,Ue.prototype.get=vt,Ue.prototype.has=Dt,Ue.prototype.set=$e;function xt(_){var R=-1,K=_==null?0:_.length;for(this.clear();++R<K;){var le=_[R];this.set(le[0],le[1])}}function $s(){this.__data__=[],this.size=0}function qs(_){var R=this.__data__,K=ko(R,_);if(K<0)return!1;var le=R.length-1;return K==le?R.pop():yt.call(R,K,1),--this.size,!0}function Eo(_){var R=this.__data__,K=ko(R,_);return K<0?void 0:R[K][1]}function _o(_){return ko(this.__data__,_)>-1}function To(_,R){var K=this.__data__,le=ko(K,_);return le<0?(++this.size,K.push([_,R])):K[le][1]=R,this}xt.prototype.clear=$s,xt.prototype.delete=qs,xt.prototype.get=Eo,xt.prototype.has=_o,xt.prototype.set=To;function wn(_){var R=-1,K=_==null?0:_.length;for(this.clear();++R<K;){var le=_[R];this.set(le[0],le[1])}}function No(){this.size=0,this.__data__={hash:new Ue,map:new(cn||xt),string:new Ue}}function Ae(_){var R=Ao(this,_).delete(_);return this.size-=R?1:0,R}function dn(_){return Ao(this,_).get(_)}function Mi(_){return Ao(this,_).has(_)}function wr(_,R){var K=Ao(this,_),le=K.size;return K.set(_,R),this.size+=K.size==le?0:1,this}wn.prototype.clear=No,wn.prototype.delete=Ae,wn.prototype.get=dn,wn.prototype.has=Mi,wn.prototype.set=wr;function Xr(_){var R=-1,K=_==null?0:_.length;for(this.__data__=new wn;++R<K;)this.add(_[R])}function ji(_){return this.__data__.set(_,r),this}function og(_){return this.__data__.has(_)}Xr.prototype.add=Xr.prototype.push=ji,Xr.prototype.has=og;function Yn(_){var R=this.__data__=new xt(_);this.size=R.size}function sg(){this.__data__=new xt,this.size=0}function ag(_){var R=this.__data__,K=R.delete(_);return this.size=R.size,K}function lg(_){return this.__data__.get(_)}function ug(_){return this.__data__.has(_)}function cg(_,R){var K=this.__data__;if(K instanceof xt){var le=K.__data__;if(!cn||le.length<n-1)return le.push([_,R]),this.size=++K.size,this;K=this.__data__=new wn(le)}return K.set(_,R),this.size=K.size,this}Yn.prototype.clear=sg,Yn.prototype.delete=ag,Yn.prototype.get=lg,Yn.prototype.has=ug,Yn.prototype.set=cg;function dg(_,R){var K=Ro(_),le=!K&&Eg(_),He=!K&&!le&&zs(_),xe=!K&&!le&&!He&&Uu(_),Ye=K||le||He||xe,pt=Ye?tt(_.length,String):[],bt=pt.length;for(var Ge in _)ue.call(_,Ge)&&!(Ye&&(Ge=="length"||He&&(Ge=="offset"||Ge=="parent")||xe&&(Ge=="buffer"||Ge=="byteLength"||Ge=="byteOffset")||xg(Ge,bt)))&&pt.push(Ge);return pt}function ko(_,R){for(var K=_.length;K--;)if(ju(_[K][0],R))return K;return-1}function fg(_,R,K){var le=R(_);return Ro(_)?le:Be(le,K(_))}function Li(_){return _==null?_===void 0?P:w:Ft&&Ft in Object(_)?bg(_):Og(_)}function Pu(_){return Bi(_)&&Li(_)==a}function Fu(_,R,K,le,He){return _===R?!0:_==null||R==null||!Bi(_)&&!Bi(R)?_!==_&&R!==R:pg(_,R,K,le,Fu,He)}function pg(_,R,K,le,He,xe){var Ye=Ro(_),pt=Ro(R),bt=Ye?l:Zn(_),Ge=pt?l:Zn(R);bt=bt==a?y:bt,Ge=Ge==a?y:Ge;var qt=bt==y,fn=Ge==y,It=bt==Ge;if(It&&zs(_)){if(!zs(R))return!1;Ye=!0,qt=!1}if(It&&!qt)return xe||(xe=new Yn),Ye||Uu(_)?Du(_,R,K,le,He,xe):yg(_,R,bt,K,le,He,xe);if(!(K&i)){var en=qt&&ue.call(_,"__wrapped__"),tn=fn&&ue.call(R,"__wrapped__");if(en||tn){var er=en?_.value():_,Dn=tn?R.value():R;return xe||(xe=new Yn),He(er,Dn,K,le,xe)}}return It?(xe||(xe=new Yn),vg(_,R,K,le,He,xe)):!1}function hg(_){if(!Vu(_)||Cg(_))return!1;var R=Lu(_)?gt:S;return R.test(xr(_))}function mg(_){return Bi(_)&&Bu(_.length)&&!!U[Li(_)]}function gg(_){if(!Sg(_))return Gn(_);var R=[];for(var K in Object(_))ue.call(_,K)&&K!="constructor"&&R.push(K);return R}function Du(_,R,K,le,He,xe){var Ye=K&i,pt=_.length,bt=R.length;if(pt!=bt&&!(Ye&&bt>pt))return!1;var Ge=xe.get(_);if(Ge&&xe.get(R))return Ge==R;var qt=-1,fn=!0,It=K&o?new Xr:void 0;for(xe.set(_,R),xe.set(R,_);++qt<pt;){var en=_[qt],tn=R[qt];if(le)var er=Ye?le(tn,en,qt,R,_,xe):le(en,tn,qt,_,R,xe);if(er!==void 0){if(er)continue;fn=!1;break}if(It){if(!Le(R,function(Dn,Ir){if(!lt(It,Ir)&&(en===Dn||He(en,Dn,K,le,xe)))return It.push(Ir)})){fn=!1;break}}else if(!(en===tn||He(en,tn,K,le,xe))){fn=!1;break}}return xe.delete(_),xe.delete(R),fn}function yg(_,R,K,le,He,xe,Ye){switch(K){case M:if(_.byteLength!=R.byteLength||_.byteOffset!=R.byteOffset)return!1;_=_.buffer,R=R.buffer;case D:return!(_.byteLength!=R.byteLength||!xe(new ke(_),new ke(R)));case u:case d:case v:return ju(+_,+R);case h:return _.name==R.name&&_.message==R.message;case O:case F:return _==R+"";case g:var pt=ft;case E:var bt=le&i;if(pt||(pt=mt),_.size!=R.size&&!bt)return!1;var Ge=Ye.get(_);if(Ge)return Ge==R;le|=o,Ye.set(_,R);var qt=Du(pt(_),pt(R),le,He,xe,Ye);return Ye.delete(_),qt;case N:if(Ne)return Ne.call(_)==Ne.call(R)}return!1}function vg(_,R,K,le,He,xe){var Ye=K&i,pt=Mu(_),bt=pt.length,Ge=Mu(R),qt=Ge.length;if(bt!=qt&&!Ye)return!1;for(var fn=bt;fn--;){var It=pt[fn];if(!(Ye?It in R:ue.call(R,It)))return!1}var en=xe.get(_);if(en&&xe.get(R))return en==R;var tn=!0;xe.set(_,R),xe.set(R,_);for(var er=Ye;++fn<bt;){It=pt[fn];var Dn=_[It],Ir=R[It];if(le)var $u=Ye?le(Ir,Dn,It,R,_,xe):le(Dn,Ir,It,_,R,xe);if(!($u===void 0?Dn===Ir||He(Dn,Ir,K,le,xe):$u)){tn=!1;break}er||(er=It=="constructor")}if(tn&&!er){var Po=_.constructor,Fo=R.constructor;Po!=Fo&&"constructor"in _&&"constructor"in R&&!(typeof Po=="function"&&Po instanceof Po&&typeof Fo=="function"&&Fo instanceof Fo)&&(tn=!1)}return xe.delete(_),xe.delete(R),tn}function Mu(_){return fg(_,Ng,wg)}function Ao(_,R){var K=_.__data__;return Ig(R)?K[typeof R=="string"?"string":"hash"]:K.map}function Yr(_,R){var K=Oe(_,R);return hg(K)?K:void 0}function bg(_){var R=ue.call(_,Ft),K=_[Ft];try{_[Ft]=void 0;var le=!0}catch{}var He=Tt.call(_);return le&&(R?_[Ft]=K:delete _[Ft]),He}var wg=Wn?function(_){return _==null?[]:(_=Object(_),Ke(Wn(_),function(R){return Nt.call(_,R)}))}:kg,Zn=Li;(bn&&Zn(new bn(new ArrayBuffer(1)))!=M||cn&&Zn(new cn)!=g||Xn&&Zn(Xn.resolve())!=b||We&&Zn(new We)!=E||ut&&Zn(new ut)!=A)&&(Zn=function(_){var R=Li(_),K=R==y?_.constructor:void 0,le=K?xr(K):"";if(le)switch(le){case _e:return M;case kt:return g;case Fn:return b;case ie:return E;case me:return A}return R});function xg(_,R){return R=R??s,!!R&&(typeof _=="number"||q.test(_))&&_>-1&&_%1==0&&_<R}function Ig(_){var R=typeof _;return R=="string"||R=="number"||R=="symbol"||R=="boolean"?_!=="__proto__":_===null}function Cg(_){return!!Je&&Je in _}function Sg(_){var R=_&&_.constructor,K=typeof R=="function"&&R.prototype||H;return _===K}function Og(_){return Tt.call(_)}function xr(_){if(_!=null){try{return oe.call(_)}catch{}try{return _+""}catch{}}return""}function ju(_,R){return _===R||_!==_&&R!==R}var Eg=Pu(function(){return arguments}())?Pu:function(_){return Bi(_)&&ue.call(_,"callee")&&!Nt.call(_,"callee")},Ro=Array.isArray;function _g(_){return _!=null&&Bu(_.length)&&!Lu(_)}var zs=Qn||Ag;function Tg(_,R){return Fu(_,R)}function Lu(_){if(!Vu(_))return!1;var R=Li(_);return R==f||R==m||R==c||R==x}function Bu(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=s}function Vu(_){var R=typeof _;return _!=null&&(R=="object"||R=="function")}function Bi(_){return _!=null&&typeof _=="object"}var Uu=ee?at(ee):mg;function Ng(_){return _g(_)?dg(_):gg(_)}function kg(){return[]}function Ag(){return!1}e.exports=Tg})(us,us.exports);var CI=us.exports;const zf=Ni(CI),ot=async(e,t)=>{var n;if(e instanceof vl){const{status:r,statusText:i}=e.response;console.error(r===500?"Internal Server Error (500):":r===400?"Bad Request (400):":`Error (${r}):`,i);try{const s=await e.response.clone().json(),a=((n=s==null?void 0:s.causes)==null?void 0:n.join(`
|
|
3
3
|
`))||(s==null?void 0:s.detail);a?(console.error("[Error Message]",a),s!=null&&s.remedy&&console.error("[Remedy]",s.remedy)):console.error("Unexpected error response:",s);const l=`${a} ${s!=null&&s.remedy?`
|
|
4
4
|
|
|
5
|
-
[Remedy] ${s.remedy}`:""}`;t&&t(l)}catch(o){console.error("Error parsing error response body:",o)}}else console.error("Unexpected error:",e.message)};function _s(){const e=Ct(),{projectIdOrName:t}=Ye(),{setError:n,removeError:r}=An(),i=Wr({queryKey:["amp","integrations",t],queryFn:async()=>{if(!t)throw new Error("Project ID or name is required");return(await e()).integrationApi.listIntegrations({projectIdOrName:t})},enabled:!!t});return C.useEffect(()=>{i.isError?(ot(i.error),n(Ee.INTEGRATION_LIST,t)):r(Ee.INTEGRATION_LIST,t)},[i.isError,i.error,t,n,r]),i}const _l=(e,t)=>{var s;const n=Ct(),{projectIdOrName:r}=Ye(),{data:i}=_s(),o=(s=i==null?void 0:i.find(a=>a.name===e))==null?void 0:s.id;return Wr({queryKey:["amp","installations",r,o,t],queryFn:async()=>{if(!r)throw new Error("Project ID is required");if(!o)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await n()).installationApi.listInstallations({projectIdOrName:r,integrationId:o,groupRef:t})},enabled:!!r&&!!o&&!!t&&!!i&&i.length>0})},yr=()=>{var i,o;const{setError:e}=An(),t=Ct(),{projectIdOrName:n}=Ye(),r=Wr({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return C.useEffect(()=>{r.isError&&e(Ee.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:(i=r.data)==null?void 0:i.name,projectId:(o=r.data)==null?void 0:o.id}};function Rn(){const{integrationNameOrId:e,groupRef:t}=vr(),n=_l(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l==null?void 0:l[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}const Qr=e=>{const t=_s(),n=t.data,r=n==null?void 0:n.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r==null?void 0:r.provider}},Tl=()=>{const{groupRef:e,integrationNameOrId:t}=vr(),{provider:n}=Qr(t),r=Al({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c==null?void 0:c[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},Jf=()=>{var d;const e=Ct(),{connection:t,isPending:n,isFetching:r}=Tl(),{projectIdOrName:i}=Ye(),{integrationNameOrId:o}=vr(),{data:s}=Qr(o),a=t==null?void 0:t.id,l=s==null?void 0:s.id,c=(d=s==null?void 0:s.latestRevision)==null?void 0:d.id;return Wr({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function Ts(){var u,d;const e=Jf(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a==null?void 0:a.content,c=C.useMemo(()=>({getReadObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.read)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{object:f,getRequiredFields:()=>f.requiredFields??[],getOptionalFields:()=>f.optionalFields??[]}:(console.error(`Object ${h} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null})},getWriteObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.write)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{object:f}:(console.error(`Object ${h} not found`),{object:null})},getCustomerFieldsForObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.read)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{allFields:f.allFieldsMetadata??{},getField:v=>{var y;const w=(y=f.allFieldsMetadata)==null?void 0:y[v];return w||(console.error(`Field ${v} not found`),null)}}:(console.error(`Object ${h} not found`),{allFields:null,getField:()=>null})}}),[(u=l==null?void 0:l.read)==null?void 0:u.objects,(d=l==null?void 0:l.write)==null?void 0:d.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function CI(e){var f,m,g,v;const[t,n]=C.useState(e),r=C.useRef(void 0),{getReadObject:i,data:o}=Ts(),{installation:s}=Rn(),a=C.useCallback(()=>t,[t]),l=C.useCallback((w,y)=>{var N,M;y.provider=y.provider||((N=o==null?void 0:o.content)==null?void 0:N.provider)||"";const b=y.read||{objects:{}},x=b.objects||{},S=x[w]||{},E=i(w),D={};return(M=E==null?void 0:E.getRequiredFields())==null||M.forEach(R=>{"fieldName"in R&&(D[R.fieldName]=!0)}),S.objectName=S.objectName||w,S.selectedFields=S.selectedFields||D,x[w]=S,b.objects=x,y.read=b,{read:b,objects:x,obj:S}},[i,(f=o==null?void 0:o.content)==null?void 0:f.provider]),c=C.useCallback(w=>{var y,b;return{object:(b=(y=t.read)==null?void 0:y.objects)==null?void 0:b[w],getSelectedField:x=>{var S,E,D,N;return!!((N=(D=(E=(S=t.read)==null?void 0:S.objects)==null?void 0:E[w])==null?void 0:D.selectedFields)!=null&&N[x])},setSelectedField:({fieldName:x,selected:S})=>{n(E=>Kt(E,D=>{const{obj:N}=l(w,D);N.selectedFields=N.selectedFields||{},N.selectedFields[x]=S,N.selectedFields[x]===!1&&delete N.selectedFields[x]}))},getFieldMapping:x=>{var S,E,D,N;return(N=(D=(E=(S=t.read)==null?void 0:S.objects)==null?void 0:E[w])==null?void 0:D.selectedFieldMappings)==null?void 0:N[x]},setFieldMapping:({fieldName:x,mapToName:S})=>{n(E=>Kt(E,D=>{const{obj:N}=l(w,D);N.selectedFieldMappings=N.selectedFieldMappings||{},N.selectedFieldMappings[S]=x}))},deleteFieldMapping:x=>{n(S=>Kt(S,E=>{var N,M,R;const D=(R=(M=(N=E.read)==null?void 0:N.objects)==null?void 0:M[w])==null?void 0:R.selectedFieldMappings;D&&x in D&&delete D[x]}))}}},[(m=t.read)==null?void 0:m.objects,l]),u=C.useCallback(w=>{var E,D;const y=(D=(E=t.write)==null?void 0:E.objects)==null?void 0:D[w],b=N=>{const M=N.write||{},R=M.objects||{},P=R[w]||{objectName:w};return R[w]=P,M.objects=R,N.write=M,{write:M,objects:R,obj:P}},x=(N,M)=>{var R,P;return(P=(R=y==null?void 0:y.selectedFieldSettings)==null?void 0:R[N])==null?void 0:P[M]},S=(N,M,R)=>{n(P=>Kt(P,F=>{var B;const{obj:U}=b(F);U.selectedFieldSettings={...U.selectedFieldSettings,[N]:{...(B=U.selectedFieldSettings)==null?void 0:B[N],[M]:R}}}))};return{object:y,setEnableWrite:()=>{n(N=>Kt(N,M=>{const{obj:R}=b(M);R.objectName=w}))},setDisableWrite:()=>{n(N=>Kt(N,M=>{const{objects:R}=b(M);delete R[w]}))},getWriteObject:()=>{var N,M;return(M=(N=t.write)==null?void 0:N.objects)==null?void 0:M[w]},getSelectedFieldSettings:N=>{var M;return(M=y==null?void 0:y.selectedFieldSettings)==null?void 0:M[N]},setSelectedFieldSettings:({fieldName:N,settings:M})=>{n(R=>Kt(R,P=>{const{obj:F}=b(P),U=F.selectedFieldSettings||{};F.selectedFieldSettings={...U,[N]:M},M===void 0&&delete F.selectedFieldSettings[N]}))},getDefaultValues:N=>x(N,"default"),setDefaultValues:({fieldName:N,value:M})=>S(N,"default",M),getWriteOnCreateSetting:N=>x(N,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:N,value:M})=>S(N,"writeOnCreate",M),getWriteOnUpdateSetting:N=>x(N,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:N,value:M})=>S(N,"writeOnUpdate",M)}},[(g=t.write)==null?void 0:g.objects]),d=C.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(w=>Kt(w,y=>{y.proxy={enabled:!0}}))},setDisableProxy:()=>{n(w=>Kt(w,y=>{y.proxy={enabled:!1}}))},getProxyEnabled:()=>{var w;return((w=t.proxy)==null?void 0:w.enabled)||!1}}),[t.proxy]),h=C.useCallback(()=>{n(w=>Kt(w,y=>{var b;Object.assign(y,(b=s==null?void 0:s.config)==null?void 0:b.content)}))},[(v=s==null?void 0:s.config)==null?void 0:v.content]);return C.useEffect(()=>{s&&(console.debug("Installation found",{installation:s}),r.current?Hf(r.current,s)||(console.debug("Installation changed, resetting config",{previous:r.current,current:s}),h(),r.current=s):(r.current=s,h()))},[s,h]),{draft:t,get:a,reset:h,setDraft:n,readObject:c,writeObject:u,proxy:d}}const Nl=C.createContext(null);function SI({children:e,initialConfig:t}){const n=CI(t);return p.jsx(Nl.Provider,{value:n,children:e})}function OI(){const e=C.useContext(Nl);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function EI(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=C.useContext(Nl);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const Wf=C.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function vr(){const e=C.useContext(Wf);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function kl({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=C.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return p.jsx(Wf.Provider,{value:s,children:p.jsx(SI,{initialConfig:{},children:e})})}class Ja{constructor(t){this.connectionApi=new lx(t),this.installationApi=new ux(t),this.integrationApi=new cx(t),this.oAuthApi=new dx(t),this.projectApi=new fx(t),this.providerApi=new px(t),this.providerAppApi=new hx(t),this.revisionApi=new mx(t)}}const Qf="2.9.12",_I="v1",Uo="https://api.withampersand.com";function Gf(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Uo;case"mock":return"http://127.0.0.1:4010";case"":return Uo;default:return e??Uo}}catch{return Uo}}const TI=(e,t)=>`${e}/${t}`;function NI(){return TI(Gf(),_I)}const Xf=Gf(),Yf=NI(),kI=new vl({basePath:Yf,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Qf}});new Ja(kI);const AI=e=>({header:"X-Api-Key",value:e}),RI=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},hc=(e,t)=>new vl({basePath:Yf,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Qf,[e]:t}});function Ct(){const e=Mf(),{getToken:t}=lI(),{consumerRef:n,groupRef:r}=vr();return C.useCallback(async()=>{if(e){const o=AI(e),s=hc(o.header,o.value);return new Ja(s)}if(t){if(!n||!r)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:n,groupRef:r}),new Error("Unable to create JWT API service without consumerRef or groupRef.");const o=await t({consumerRef:n,groupRef:r}),s=RI(o),a=hc(s.header,s.value);return new Ja(a)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[e,t,n,r])}const Al=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Ye(),r=Ct();return Wr({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function PI({height:e="48",width:t="48"}){return p.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const FI="_box_1p7c5_1",mc={box:FI};function Hn({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${mc.box} ${t}`:mc.box,style:n,children:e})}const DI="_container_1wvzr_1",gc={container:DI};function Ri({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${gc.container} ${t}`:gc.container,style:n,children:e})}const MI="_errorBoxContainer_19655_1",jI="_errorBox_19655_1",LI="_errorIconWrapper_19655_23",BI="_errorText_19655_34",Yo={errorBoxContainer:MI,errorBox:jI,errorIconWrapper:LI,errorText:BI};function Zf({message:e}){return p.jsxs(Hn,{className:Yo.errorBox,children:[p.jsx("div",{className:Yo.errorIconWrapper,children:p.jsx(PI,{width:"20",height:"20"})}),p.jsx("p",{className:Yo.errorText,children:e})]})}function ep({message:e,children:t}){return p.jsxs(Ri,{className:Yo.errorBoxContainer,children:[p.jsx(Zf,{message:e}),t]})}const VI="_loader_6ubm6_1",UI={loader:VI};function $I(){return p.jsx("span",{className:UI.loader})}function io(){return p.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:p.jsx($I,{})})}function tp({children:e}){return p.jsx(Ri,{style:{maxWidth:"55rem"},children:p.jsx(Hn,{children:e})})}function Pi(){return p.jsx(tp,{children:p.jsx(io,{})})}function Vt({message:e,children:t}){return p.jsx(tp,{children:p.jsx(ep,{message:e,children:t})})}function un(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qI(e,t){return(t==null?void 0:t.displayName)??un(e)}const zI=e=>e.split(`
|
|
6
|
-
`).filter(n=>n.trim()!==""),KI=(e,t)=>(t==null?void 0:t.length)===0||!e?null:t.find(n=>n.name===e)??null;function HI(e){return!e||typeof e!="string"?"id_"+Math.random().toString(36).substr(2,9):e.toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^[^a-z]/,"id-").substring(0,50)}const JI=()=>{const[e,t]=C.useState(!1),n=C.useCallback(()=>{t(!0)},[t]),r=C.useCallback(()=>{t(!1)},[t]);return{isIntegrationDeleted:e,setIntegrationDeleted:n,resetIntegrationDeleted:r}},np=C.createContext({integrationId:"",provider:"",integrationObj:void 0,consumerRef:"",consumerName:"",groupRef:"",groupName:"",installation:void 0,setInstallation:()=>{},resetInstallations:()=>{},onInstallSuccess:void 0,onUpdateSuccess:void 0,onUninstallSuccess:void 0,isIntegrationDeleted:!1,setIntegrationDeleted:()=>{},resetComponent:()=>{}});function St(){const e=C.useContext(np);if(!e)throw new Error("useInstallIntegrationProps must be used within an InstallIntegrationProvider");return e}function WI({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,fieldMapping:c,resetComponent:u}){const{data:d}=_s(),{setError:h,isError:f,removeError:m}=An(),{isIntegrationDeleted:g,setIntegrationDeleted:v,resetIntegrationDeleted:w}=JI(),y=C.useMemo(()=>KI(t,d||[]),[t,d]),{data:b,isLoading:x,isError:S,error:E}=_l(t,i),D=(b==null?void 0:b[0])||null;C.useEffect(()=>{w()},[t,n,r,i,o,c]),C.useEffect(()=>{y===null&&(d!=null&&d.length)&&console.error(`Integration "${t}" not found in integration list`)},[t,y,d]),C.useEffect(()=>{S?(h(Ee.INSTALLATION_LIST,(y==null?void 0:y.id)||""),ot(E)):m(Ee.INSTALLATION_LIST,(y==null?void 0:y.id)||"")},[S,y,h,m,E]);const N=st(),M=C.useCallback(()=>{N.invalidateQueries({queryKey:["amp","installations"]})},[N]),R=C.useCallback(U=>{N.setQueryData(["amp","installations"],[U]),N.invalidateQueries({queryKey:["amp","installations"]})},[N]),P=(y==null?void 0:y.id)||"",F=C.useMemo(()=>({integrationId:(y==null?void 0:y.id)||"",provider:(y==null?void 0:y.provider)||"",integrationObj:y,consumerRef:n,consumerName:r,groupRef:i,groupName:o,installation:D||void 0,setInstallation:R,resetInstallations:M,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,isIntegrationDeleted:g,setIntegrationDeleted:v,fieldMapping:c,resetComponent:u}),[y,n,r,i,o,D,R,M,s,a,l,g,v,c,u]);if(x)return p.jsx(Pi,{});if(y===null)return p.jsx(Vt,{message:`Integration "${t}" not found`});if(f(Ee.INSTALLATION_LIST,P)){const U=`Error retrieving installation information for integration "${(y==null?void 0:y.name)||"unknown"}"`;return p.jsx(Vt,{message:U})}return p.jsx(np.Provider,{value:F,children:e})}const rp=C.createContext({connections:null,isConnectionsLoading:!0,selectedConnection:null,setConnections:()=>{},setSelectedConnection:()=>{}}),Pn=()=>{const e=C.useContext(rp);if(!e)throw new Error("useConnections must be used within a ConnectionsProvider");return e};function ip({groupRef:e,provider:t,children:n}){const r=st(),{setError:i,isError:o}=An(),{projectIdOrName:s,isLoading:a}=yr(),{integrationId:l,groupRef:c}=St(),{provider:u}=Qr(l),{data:d,isLoading:h,isError:f,error:m}=Al({groupRef:e||c,provider:u||t}),g=d==null?void 0:d[0],v=C.useCallback(b=>{r.setQueryData(["amp","connections"],()=>b),r.invalidateQueries({queryKey:["amp","connections"]})},[r]),w=C.useCallback(()=>{r.invalidateQueries({queryKey:["amp","connections"]})},[r]);C.useEffect(()=>{f?(i(Ee.CONNECTION_LIST,s,!0),ot(m)):i(Ee.CONNECTION_LIST,s,!1)},[f,i,s,m]);const y=C.useMemo(()=>({connections:d||null,isConnectionsLoading:h,selectedConnection:g||null,setConnections:v,setSelectedConnection:w}),[d,h,g,v,w]);if(h||a)return p.jsx(Pi,{});if(s&&o(Ee.PROJECT,s))return p.jsx(Vt,{message:`Error loading project ${s}`});if(s&&o(Ee.CONNECTION_LIST,s))return p.jsx(Vt,{message:"Error retrieving existing connections"});if(!s)throw new Error("Project ID or Project Name not found. ConnectionsProvider must be used within AmpersandProvider");return p.jsx(rp.Provider,{value:y,children:n})}const op=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...Kn({mutationKey:["createInstallation"],mutationFn:async o=>(await e()).installationApi.createInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error creating installation"),ot(o,r)}}),errorMsg:n}};function QI(e){return typeof e.provider=="string"}function GI(e){return QI(e)?{data:e}:{error:new Error("Config must have a provider field for creation")}}function sp(){const{projectIdOrName:e}=Ye(),{groupRef:t,integrationNameOrId:n}=vr(),{data:r}=Qr(n),{connection:i}=Tl(),{installation:o}=Rn(),s=st(),{mutate:a,isIdle:l,isPending:c,error:u,errorMsg:d}=op();return{createInstallation:({config:f,onSuccess:m,onError:g,onSettled:v})=>{if(o){const b=new Error("Installation already created. Try updating instead.");g==null||g(b),v==null||v();return}if(!r){const b=new Error("No integration found");g==null||g(b),v==null||v();return}const w=GI(f);if(w.error||!w.data){g==null||g(w.error||new Error("Invalid configuration data")),v==null||v();return}const y={projectIdOrName:e,integrationId:r==null?void 0:r.id,installation:{groupRef:t,connectionId:i==null?void 0:i.id,config:{content:w.data}}};return a(y,{onSuccess:b=>{m==null||m(b)},onError:b=>{g==null||g(b)},onSettled:()=>{v==null||v(),s.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:l,isPending:c,error:u,errorMsg:d}}const ap=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...Kn({mutationKey:["updateInstallation"],mutationFn:async o=>(await e()).installationApi.updateInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error updating installation"),ot(o,r)}}),errorMsg:n}};function lp(){const{projectIdOrName:e}=Ye(),{integrationNameOrId:t}=vr(),{data:n}=Qr(t),{installation:r}=Rn(),i=st(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=ap();return{updateInstallation:({config:d,onSuccess:h,onError:f,onSettled:m})=>{var w,y,b,x,S;if(!r){const E=new Error("Installation not created yet. Try creating the installation first.");f==null||f(E),m==null||m();return}if(!n){const E=new Error("No integration found");f==null||f(E),m==null||m();return}const g=[];if((w=d==null?void 0:d.write)!=null&&w.objects){const E=Object.keys(d.write.objects).length,D=Object.keys(((x=(b=(y=r==null?void 0:r.config)==null?void 0:y.content)==null?void 0:b.write)==null?void 0:x.objects)||{}).length;(E>0||E===0&&D>0)&&g.push("config.content.write.objects")}if((S=d==null?void 0:d.read)!=null&&S.objects){const E=Object.keys(d.read.objects);g.push(...E.map(D=>`config.content.read.objects.${D}`))}const v={projectIdOrName:e,integrationId:n==null?void 0:n.id,installationId:r.id,installationUpdate:{updateMask:g,installation:{config:{content:d}}}};return o(v,{onSuccess:E=>{h==null||h(E)},onError:E=>{f==null||f(E)},onSettled:()=>{m==null||m(),i.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}const XI=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...Kn({mutationKey:["deleteInstallation"],mutationFn:async o=>(await e()).installationApi.deleteInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error deleting installation"),ot(o,r)}}),errorMsg:n}};function YI(){const{projectIdOrName:e}=Ye(),{integrationNameOrId:t}=vr(),{data:n}=Qr(t),{installation:r}=Rn(),i=st(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=XI();return{deleteInstallation:({onSuccess:d,onError:h,onSettled:f})=>{if(!r){const m=new Error("Installation not found. Not able to delete installation.");h==null||h(m),f==null||f();return}if(!n){const m=new Error("No integration found");h==null||h(m),f==null||f();return}return o({projectIdOrName:e,integrationId:n==null?void 0:n.id,installationId:r.id},{onSuccess:()=>{d==null||d()},onError:m=>{h==null||h(m)},onSettled:()=>{f==null||f(),i.invalidateQueries({queryKey:["amp","installations"]}),i.invalidateQueries({queryKey:["amp","connections"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}function up(){const[e,t]=C.useState(1);return{seed:e,reset:()=>{t(Math.random())}}}var ds={exports:{}};ds.exports;(function(e,t){var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Map]",a="[object Object]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",d="[object DataView]",h=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,m=typeof an=="object"&&an&&an.Object===Object&&an,g=typeof self=="object"&&self&&self.Object===Object&&self,v=m||g||Function("return this")(),w=t&&!t.nodeType&&t,y=w&&!0&&e&&!e.nodeType&&e,b=y&&y.exports===w;function x(j,oe){return j==null?void 0:j[oe]}function S(j){var oe=!1;if(j!=null&&typeof j.toString!="function")try{oe=!!(j+"")}catch{}return oe}function E(j,oe){return function(ue){return j(oe(ue))}}var D=Function.prototype,N=Object.prototype,M=v["__core-js_shared__"],R=function(){var j=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||"");return j?"Symbol(src)_1."+j:""}(),P=D.toString,F=N.hasOwnProperty,U=N.toString,B=RegExp("^"+P.call(F).replace(h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=b?v.Buffer:void 0,se=N.propertyIsEnumerable,ce=X?X.isBuffer:void 0,ge=E(Object.keys,Object),be=q(v,"DataView"),I=q(v,"Map"),J=q(v,"Promise"),V=q(v,"Set"),O=q(v,"WeakMap"),z=!se.call({valueOf:1},"valueOf"),$=Be(be),Y=Be(I),ne=Be(J),te=Be(V),ae=Be(O);function Z(j){return U.call(j)}function ye(j){if(!rt(j)||ee(j))return!1;var oe=_t(j)||S(j)?B:f;return oe.test(Be(j))}function q(j,oe){var ue=x(j,oe);return ye(ue)?ue:void 0}var we=Z;(be&&we(new be(new ArrayBuffer(1)))!=d||I&&we(new I)!=s||J&&we(J.resolve())!=l||V&&we(new V)!=c||O&&we(new O)!=u)&&(we=function(j){var oe=U.call(j),ue=oe==a?j.constructor:void 0,Je=ue?Be(ue):void 0;if(Je)switch(Je){case $:return d;case Y:return s;case ne:return l;case te:return c;case ae:return u}return oe});function ee(j){return!!R&&R in j}function Ke(j){var oe=j&&j.constructor,ue=typeof oe=="function"&&oe.prototype||N;return j===ue}function Be(j){if(j!=null){try{return P.call(j)}catch{}try{return j+""}catch{}}return""}function Le(j){return lt(j)&&F.call(j,"callee")&&(!se.call(j,"callee")||U.call(j)==r)}var tt=Array.isArray;function at(j){return j!=null&&mt(j.length)&&!_t(j)}function lt(j){return L(j)&&at(j)}var Oe=ce||H;function ft(j){if(at(j)&&(tt(j)||typeof j=="string"||typeof j.splice=="function"||Oe(j)||Le(j)))return!j.length;var oe=we(j);if(oe==s||oe==c)return!j.size;if(z||Ke(j))return!ge(j).length;for(var ue in j)if(F.call(j,ue))return!1;return!0}function _t(j){var oe=rt(j)?U.call(j):"";return oe==i||oe==o}function mt(j){return typeof j=="number"&&j>-1&&j%1==0&&j<=n}function rt(j){var oe=typeof j;return!!j&&(oe=="object"||oe=="function")}function L(j){return!!j&&typeof j=="object"}function H(){return!1}e.exports=ft})(ds,ds.exports);var ZI=ds.exports;const eC=Ai(ZI),xi="other",fs="manage-tab";function br(e){return!e.fieldName}function cp(e,t){var n;return((n=e==null?void 0:e.objects)==null?void 0:n.find(r=>r.objectName===t))||null}function tC(e){var t;return((t=e==null?void 0:e.requiredFields)==null?void 0:t.filter(n=>!br(n)&&!!n.fieldName))||null}function nC(e){var n;return((n=e==null?void 0:e.requiredFields)==null?void 0:n.filter(r=>br(r)&&!!r.mapToName))||[]}function rC(e){var n;return((n=e==null?void 0:e.optionalFields)==null?void 0:n.filter(r=>br(r)&&!!r.mapToName))||[]}function dp(e){var t;return((t=e==null?void 0:e.optionalFields)==null?void 0:t.filter(n=>!br(n)&&!!n.fieldName))||null}const fp=(e,t)=>{var n,r,i;return(i=(r=(n=e==null?void 0:e.content)==null?void 0:n.read)==null?void 0:r.objects)==null?void 0:i[t]};function iC(e){return br(e)?e.mapToName:e.fieldName}const pp=(e,t)=>{var r,i,o;const n=[];return(o=(i=(r=t.content)==null?void 0:r.read)==null?void 0:i.objects)==null||o.forEach(s=>{const a=e?fp(e,s.objectName):void 0;n.push({name:s==null?void 0:s.objectName,displayName:(s==null?void 0:s.mapToDisplayName)||(s==null?void 0:s.displayName)||(s==null?void 0:s.objectName)&&un(s==null?void 0:s.objectName),completed:!!a,disabled:a==null?void 0:a.disabled})}),n},hp=e=>{var n;return{name:xi,completed:e?!!((n=e==null?void 0:e.content)!=null&&n.write):!1}};function oC(e,t){var o;const n=pp(e,t),i=!!((o=t==null?void 0:t.content)!=null&&o.write)?hp(e):void 0;return i&&n.push(i),n}function mp(e,t,n){const r=(e==null?void 0:e.filter(o=>!(t!=null&&t[o==null?void 0:o.mapToName])))||[],i=r.map(o=>o.mapToName);return n(Ee.MAPPING,i),r!=null&&r.length&&console.error("required fields not met",r.map(o=>o.mapToDisplayName)),{errorList:i}}function yc(e,t){return eC(e)?!0:Object.values(e).every(t)}function Rl(e,t,n){const r=yc(e,n),i=yc(t,n);return r&&i?!0:r!==i?!1:Hf(e,t)}function gp(e,t){return Rl(e,t,n=>n===!1||n===void 0)}function yp(e,t){return Rl(e,t,n=>!n||n==="")}function vp(e,t){return Rl(e,t,n=>!n||typeof n!="object"?!0:Object.keys(n).length===0)}function bp(e,t){const n=new Set(Object.values(e).map(i=>i==null?void 0:i.objectName)),r=new Set(Object.values(t).map(i=>i==null?void 0:i.objectName));return n.size===r.size&&[...n].every(i=>r.has(i))}const sC=(e,t,n)=>{var m,g,v,w,y,b;if(!e)return null;const r=cp(e,t),i=r&&tC(r),o=r&&dp(r),s=r&&nC(r),a=r&&rC(r),l=(r==null?void 0:r.allFields)||[],c=(r==null?void 0:r.allFieldsMetadata)||{},u=n==null?void 0:n.content,d=((v=(g=(m=u==null?void 0:u.read)==null?void 0:m.objects)==null?void 0:g[t])==null?void 0:v.selectedValueMappings)||{},h=((b=(y=(w=u==null?void 0:u.read)==null?void 0:w.objects)==null?void 0:y[t])==null?void 0:b.selectedFieldMappings)||{},f=Pl(n,{content:{read:e}},t);return{allFields:l,allFieldsMetadata:c,requiredFields:i,optionalFields:o,requiredMapFields:s,optionalMapFields:a,selectedOptionalFields:f,selectedFieldMappings:h,selectedValueMappings:d}},aC=(e,t)=>{var r,i;if(!e)return null;const n=(i=(r=t==null?void 0:t.content)==null?void 0:r.write)==null?void 0:i.objects;return{writeObjects:(e==null?void 0:e.objects)||[],selectedWriteObjects:n||{}}};function wp(e,t,n){var o,s;const r=(o=e==null?void 0:e.content)==null?void 0:o.read,i=(s=e==null?void 0:e.content)==null?void 0:s.write;return{read:sC(r,t,n),write:aC(i,n)}}const xp=(e,t,n,r)=>{const i=wp(e,n,t);r(n,i)},lC=(e,t,n)=>{const r=oC(t,e),i={};r.forEach(({name:o,completed:s})=>{s&&(i[o]=wp(e,o,t))}),n(i)},Ip=e=>{const{requiredFields:t,selectedOptionalFields:n}=(e==null?void 0:e.read)||{},r=new Set;return t==null||t.forEach(o=>r.add(iC(o))),{...Array.from(r).reduce((o,s)=>({...o,[s]:!0}),{}),...n||{}}},Cp=e=>{const{selectedFieldMappings:t}=(e==null?void 0:e.read)||{},n={};return t&&Object.keys(t).forEach(r=>{t[r]!==void 0?n[r]=t[r]||"":console.warn(`Error undefined when generating selectedRequiredMapFieldsSubmit for key: ${r}`)}),n},Sp=(e,t)=>!t||!t[e]?[]:t[e],Op=e=>{const{selectedValueMappings:t}=(e==null?void 0:e.read)||{};return t},Pl=(e,t,n)=>{var c,u,d,h,f;if(!e||!t)return{};const r=(c=t==null?void 0:t.content)==null?void 0:c.read;if(!r)return{};const i=cp(r,n),o=i&&dp(i),s=new Set((o==null?void 0:o.filter(m=>!br(m)&&!!m.fieldName).map(m=>m.fieldName))||[]),a=((f=(h=(d=(u=e==null?void 0:e.content)==null?void 0:u.read)==null?void 0:d.objects)==null?void 0:h[n])==null?void 0:f.selectedFields)||{};return Object.entries(a).reduce((m,[g,v])=>(s.has(g)&&(m[g]=v),m),{})},Ep=(e,t)=>{var r,i,o,s;return!e||!t?{}:((s=(o=(i=(r=e==null?void 0:e.content)==null?void 0:r.read)==null?void 0:i.objects)==null?void 0:o[t])==null?void 0:s.selectedFieldMappings)||{}};function _p(e,t){return t[e]||void 0}function go(e){var t;return(t=e.content.proxy)==null?void 0:t.enabled}const uC=(e,t)=>{const n=e.content.read,r=n==null?void 0:n.objects;return r==null?void 0:r.find(i=>i.objectName===t)},cC=(e,t,n,r,i)=>{const o=Ip(e),s=Cp(e),a=Sp(t,i),l=Op(e),c=uC(n,t);if(!c)return console.error(`Error when getting object from hydratedRevision for objectName: ${t}`),null;const u={createdBy:`consumer:${r}`,content:{provider:n.content.provider,read:{objects:{[t]:{objectName:t,selectedFields:o,selectedFieldMappings:s,dynamicMappingsInput:a,selectedValueMappings:l||{},backfill:c.backfill}}}}};return go(n)&&(u.content.proxy={enabled:!0}),u},Tp=e=>{var t;return{...(t=e.write)==null?void 0:t.selectedWriteObjects}},dC=e=>{const t=e.content.write;return t==null?void 0:t.objects},fC=(e,t,n)=>{if(!dC(t))return console.error("Error when getting write objects from hydratedRevision"),null;const i=Tp(e),o={createdBy:`consumer:${n}`,content:{provider:t.content.provider,read:{objects:{}},write:{objects:i}}};return go(t)&&(o.content.proxy={enabled:!0}),o};var Np={exports:{}};/*!
|
|
5
|
+
[Remedy] ${s.remedy}`:""}`;t&&t(l)}catch(o){console.error("Error parsing error response body:",o)}}else console.error("Unexpected error:",e.message)};function Es(e,t){const n=Ct(e,t),{projectIdOrName:r}=Xe(),{setError:i,removeError:o}=kn(),s=Kr({queryKey:["amp","integrations",r],queryFn:async()=>{if(!r)throw new Error("Project ID or name is required");return(await n()).integrationApi.listIntegrations({projectIdOrName:r})},enabled:!!r});return C.useEffect(()=>{s.isError?(ot(s.error),i(Ee.INTEGRATION_LIST,r)):o(Ee.INTEGRATION_LIST,r)},[s.isError,s.error,r,i,o]),s}const El=(e,t,n)=>{var u;const r=Ct(t,n),{projectIdOrName:i}=Xe(),{data:o,isError:s,error:a}=Es(t,n),l=(u=o==null?void 0:o.find(d=>d.name===e))==null?void 0:u.id,c=Kr({queryKey:["amp","installations",i,l,t],queryFn:async()=>{if(!i)throw new Error("Project ID is required");if(!l)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await r()).installationApi.listInstallations({projectIdOrName:i,integrationId:l,groupRef:t})},enabled:!s&&!!i&&!!l&&!!t&&!!o&&o.length>0});return{...c,isError:c.isError||s,error:c.error||a}},yr=()=>{var i,o;const{setError:e}=kn(),t=Ct(),{projectIdOrName:n}=Xe(),r=Kr({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return C.useEffect(()=>{r.isError&&e(Ee.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:(i=r.data)==null?void 0:i.name,projectId:(o=r.data)==null?void 0:o.id}};function An(){const{integrationNameOrId:e,groupRef:t}=vr(),n=El(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l==null?void 0:l[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}const Hr=e=>{const t=Es(),n=t.data,r=n==null?void 0:n.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r==null?void 0:r.provider}},_l=()=>{const{groupRef:e,integrationNameOrId:t}=vr(),{provider:n}=Hr(t),r=kl({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c==null?void 0:c[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},Kf=()=>{var d;const e=Ct(),{connection:t,isPending:n,isFetching:r}=_l(),{projectIdOrName:i}=Xe(),{integrationNameOrId:o}=vr(),{data:s}=Hr(o),a=t==null?void 0:t.id,l=s==null?void 0:s.id,c=(d=s==null?void 0:s.latestRevision)==null?void 0:d.id;return Kr({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function _s(){var u,d;const e=Kf(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a==null?void 0:a.content,c=C.useMemo(()=>({getReadObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.read)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{object:f,getRequiredFields:()=>f.requiredFields??[],getOptionalFields:()=>f.optionalFields??[]}:(console.error(`Object ${h} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null})},getWriteObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.write)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{object:f}:(console.error(`Object ${h} not found`),{object:null})},getCustomerFieldsForObject:h=>{var m,g;const f=(g=(m=l==null?void 0:l.read)==null?void 0:m.objects)==null?void 0:g.find(v=>v.objectName===h);return f?{allFields:f.allFieldsMetadata??{},getField:v=>{var y;const w=(y=f.allFieldsMetadata)==null?void 0:y[v];return w||(console.error(`Field ${v} not found`),null)}}:(console.error(`Object ${h} not found`),{allFields:null,getField:()=>null})}}),[(u=l==null?void 0:l.read)==null?void 0:u.objects,(d=l==null?void 0:l.write)==null?void 0:d.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function SI(e){var f,m,g,v;const[t,n]=C.useState(e),r=C.useRef(void 0),{getReadObject:i,data:o}=_s(),{installation:s}=An(),a=C.useCallback(()=>t,[t]),l=C.useCallback((w,y)=>{var N,P;y.provider=y.provider||((N=o==null?void 0:o.content)==null?void 0:N.provider)||"";const b=y.read||{objects:{}},x=b.objects||{},O=x[w]||{},E=i(w),F={};return(P=E==null?void 0:E.getRequiredFields())==null||P.forEach(A=>{"fieldName"in A&&(F[A.fieldName]=!0)}),O.objectName=O.objectName||w,O.selectedFields=O.selectedFields||F,x[w]=O,b.objects=x,y.read=b,{read:b,objects:x,obj:O}},[i,(f=o==null?void 0:o.content)==null?void 0:f.provider]),c=C.useCallback(w=>{var y,b;return{object:(b=(y=t.read)==null?void 0:y.objects)==null?void 0:b[w],getSelectedField:x=>{var O,E,F,N;return!!((N=(F=(E=(O=t.read)==null?void 0:O.objects)==null?void 0:E[w])==null?void 0:F.selectedFields)!=null&&N[x])},setSelectedField:({fieldName:x,selected:O})=>{n(E=>Kt(E,F=>{const{obj:N}=l(w,F);N.selectedFields=N.selectedFields||{},N.selectedFields[x]=O,N.selectedFields[x]===!1&&delete N.selectedFields[x]}))},getFieldMapping:x=>{var O,E,F,N;return(N=(F=(E=(O=t.read)==null?void 0:O.objects)==null?void 0:E[w])==null?void 0:F.selectedFieldMappings)==null?void 0:N[x]},setFieldMapping:({fieldName:x,mapToName:O})=>{n(E=>Kt(E,F=>{const{obj:N}=l(w,F);N.selectedFieldMappings=N.selectedFieldMappings||{},N.selectedFieldMappings[O]=x}))},deleteFieldMapping:x=>{n(O=>Kt(O,E=>{var N,P,A;const F=(A=(P=(N=E.read)==null?void 0:N.objects)==null?void 0:P[w])==null?void 0:A.selectedFieldMappings;F&&x in F&&delete F[x]}))}}},[(m=t.read)==null?void 0:m.objects,l]),u=C.useCallback(w=>{var E,F;const y=(F=(E=t.write)==null?void 0:E.objects)==null?void 0:F[w],b=N=>{const P=N.write||{},A=P.objects||{},D=A[w]||{objectName:w};return A[w]=D,P.objects=A,N.write=P,{write:P,objects:A,obj:D}},x=(N,P)=>{var A,D;return(D=(A=y==null?void 0:y.selectedFieldSettings)==null?void 0:A[N])==null?void 0:D[P]},O=(N,P,A)=>{n(D=>Kt(D,M=>{var V;const{obj:z}=b(M);z.selectedFieldSettings={...z.selectedFieldSettings,[N]:{...(V=z.selectedFieldSettings)==null?void 0:V[N],[P]:A}}}))};return{object:y,setEnableWrite:()=>{n(N=>Kt(N,P=>{const{obj:A}=b(P);A.objectName=w}))},setDisableWrite:()=>{n(N=>Kt(N,P=>{const{objects:A}=b(P);delete A[w]}))},getWriteObject:()=>{var N,P;return(P=(N=t.write)==null?void 0:N.objects)==null?void 0:P[w]},getSelectedFieldSettings:N=>{var P;return(P=y==null?void 0:y.selectedFieldSettings)==null?void 0:P[N]},setSelectedFieldSettings:({fieldName:N,settings:P})=>{n(A=>Kt(A,D=>{const{obj:M}=b(D),z=M.selectedFieldSettings||{};M.selectedFieldSettings={...z,[N]:P},P===void 0&&delete M.selectedFieldSettings[N]}))},getDefaultValues:N=>x(N,"default"),setDefaultValues:({fieldName:N,value:P})=>O(N,"default",P),getWriteOnCreateSetting:N=>x(N,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:N,value:P})=>O(N,"writeOnCreate",P),getWriteOnUpdateSetting:N=>x(N,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:N,value:P})=>O(N,"writeOnUpdate",P)}},[(g=t.write)==null?void 0:g.objects]),d=C.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(w=>Kt(w,y=>{y.proxy={enabled:!0}}))},setDisableProxy:()=>{n(w=>Kt(w,y=>{y.proxy={enabled:!1}}))},getProxyEnabled:()=>{var w;return((w=t.proxy)==null?void 0:w.enabled)||!1}}),[t.proxy]),h=C.useCallback(()=>{n(w=>Kt(w,y=>{var b;Object.assign(y,(b=s==null?void 0:s.config)==null?void 0:b.content)}))},[(v=s==null?void 0:s.config)==null?void 0:v.content]);return C.useEffect(()=>{s&&(console.debug("Installation found",{installation:s}),r.current?zf(r.current,s)||(console.debug("Installation changed, resetting config",{previous:r.current,current:s}),h(),r.current=s):(r.current=s,h()))},[s,h]),{draft:t,get:a,reset:h,setDraft:n,readObject:c,writeObject:u,proxy:d}}const Tl=C.createContext(null);function OI({children:e,initialConfig:t}){const n=SI(t);return p.jsx(Tl.Provider,{value:n,children:e})}function EI(){const e=C.useContext(Tl);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function _I(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=C.useContext(Tl);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const Hf=C.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function vr(){const e=C.useContext(Hf);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function Nl({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=C.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return p.jsx(Hf.Provider,{value:s,children:p.jsx(OI,{initialConfig:{},children:e})})}class Ha{constructor(t){this.connectionApi=new lx(t),this.installationApi=new ux(t),this.integrationApi=new cx(t),this.oAuthApi=new dx(t),this.projectApi=new fx(t),this.providerApi=new px(t),this.providerAppApi=new hx(t),this.revisionApi=new mx(t)}}const Jf="2.10.1",TI="v1",Vo="https://api.withampersand.com";function Wf(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Vo;case"mock":return"http://127.0.0.1:4010";case"":return Vo;default:return e??Vo}}catch{return Vo}}const NI=(e,t)=>`${e}/${t}`;function kI(){return NI(Wf(),TI)}const Qf=Wf(),Gf=kI(),AI=new yl({basePath:Gf,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Jf}});new Ha(AI);const RI=e=>({header:"X-Api-Key",value:e}),PI=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},pc=(e,t)=>new yl({basePath:Gf,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Jf,[e]:t}});function Ct(e,t){const n=Ff(),{getToken:r}=lI(),i=vr(),o=t||i.consumerRef,s=e||i.groupRef;return C.useCallback(async()=>{if(n){const l=RI(n),c=pc(l.header,l.value);return new Ha(c)}if(r){if(!o||!s)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:o,groupRef:s}),new Error("Unable to create JWT API service without consumerRef or groupRef. Provide via InstallationProvider or useAPI parameters.");const l=await r({consumerRef:o,groupRef:s}),c=PI(l),u=pc(c.header,c.value);return new Ha(u)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[n,r,o,s])}const kl=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Xe(),r=Ct();return Kr({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function FI({height:e="48",width:t="48"}){return p.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const DI="_box_1p7c5_1",hc={box:DI};function Kn({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${hc.box} ${t}`:hc.box,style:n,children:e})}const MI="_container_1wvzr_1",mc={container:MI};function ki({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${mc.container} ${t}`:mc.container,style:n,children:e})}const jI="_errorBoxContainer_19655_1",LI="_errorBox_19655_1",BI="_errorIconWrapper_19655_23",VI="_errorText_19655_34",Xo={errorBoxContainer:jI,errorBox:LI,errorIconWrapper:BI,errorText:VI};function Xf({message:e}){return p.jsxs(Kn,{className:Xo.errorBox,children:[p.jsx("div",{className:Xo.errorIconWrapper,children:p.jsx(FI,{width:"20",height:"20"})}),p.jsx("p",{className:Xo.errorText,children:e})]})}function Yf({message:e,children:t}){return p.jsxs(ki,{className:Xo.errorBoxContainer,children:[p.jsx(Xf,{message:e}),t]})}const UI="_loader_6ubm6_1",$I={loader:UI};function qI(){return p.jsx("span",{className:$I.loader})}function io(){return p.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:p.jsx(qI,{})})}function Zf({children:e}){return p.jsx(ki,{style:{maxWidth:"55rem"},children:p.jsx(Kn,{children:e})})}function Ai(){return p.jsx(Zf,{children:p.jsx(io,{})})}function Vt({message:e,children:t}){return p.jsx(Zf,{children:p.jsx(Yf,{message:e,children:t})})}function un(e){return e.charAt(0).toUpperCase()+e.slice(1)}function zI(e,t){return(t==null?void 0:t.displayName)??un(e)}const KI=e=>e.split(`
|
|
6
|
+
`).filter(n=>n.trim()!==""),HI=(e,t)=>(t==null?void 0:t.length)===0||!e?null:t.find(n=>n.name===e)??null;function JI(e){return!e||typeof e!="string"?"id_"+Math.random().toString(36).substr(2,9):e.toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^[^a-z]/,"id-").substring(0,50)}const WI=()=>{const[e,t]=C.useState(!1),n=C.useCallback(()=>{t(!0)},[t]),r=C.useCallback(()=>{t(!1)},[t]);return{isIntegrationDeleted:e,setIntegrationDeleted:n,resetIntegrationDeleted:r}},ep=C.createContext({integrationId:"",provider:"",integrationObj:void 0,consumerRef:"",consumerName:"",groupRef:"",groupName:"",installation:void 0,setInstallation:()=>{},resetInstallations:()=>{},onInstallSuccess:void 0,onUpdateSuccess:void 0,onUninstallSuccess:void 0,isIntegrationDeleted:!1,setIntegrationDeleted:()=>{},resetComponent:()=>{}});function St(){const e=C.useContext(ep);if(!e)throw new Error("useInstallIntegrationProps must be used within an InstallIntegrationProvider");return e}function QI({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,fieldMapping:c,resetComponent:u}){const{data:d}=Es(),{setError:h,isError:f,removeError:m}=kn(),{isIntegrationDeleted:g,setIntegrationDeleted:v,resetIntegrationDeleted:w}=WI(),y=C.useMemo(()=>HI(t,d||[]),[t,d]),{data:b,isLoading:x,isError:O,error:E}=El(t,i),F=(b==null?void 0:b[0])||null;C.useEffect(()=>{w()},[t,n,r,i,o,c]),C.useEffect(()=>{y===null&&(d!=null&&d.length)&&console.error(`Integration "${t}" not found in integration list`)},[t,y,d]),C.useEffect(()=>{O?(h(Ee.INSTALLATION_LIST,(y==null?void 0:y.id)||""),ot(E)):m(Ee.INSTALLATION_LIST,(y==null?void 0:y.id)||"")},[O,y,h,m,E]);const N=st(),P=C.useCallback(()=>{N.invalidateQueries({queryKey:["amp","installations"]})},[N]),A=C.useCallback(z=>{N.setQueryData(["amp","installations"],[z]),N.invalidateQueries({queryKey:["amp","installations"]})},[N]),D=(y==null?void 0:y.id)||"",M=C.useMemo(()=>({integrationId:(y==null?void 0:y.id)||"",provider:(y==null?void 0:y.provider)||"",integrationObj:y,consumerRef:n,consumerName:r,groupRef:i,groupName:o,installation:F||void 0,setInstallation:A,resetInstallations:P,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,isIntegrationDeleted:g,setIntegrationDeleted:v,fieldMapping:c,resetComponent:u}),[y,n,r,i,o,F,A,P,s,a,l,g,v,c,u]);if(x)return p.jsx(Ai,{});if(y===null)return p.jsx(Vt,{message:`Integration "${t}" not found`});if(f(Ee.INSTALLATION_LIST,D)){const z=`Error retrieving installation information for integration "${(y==null?void 0:y.name)||"unknown"}"`;return p.jsx(Vt,{message:z})}return p.jsx(ep.Provider,{value:M,children:e})}const tp=C.createContext({connections:null,isConnectionsLoading:!0,selectedConnection:null,setConnections:()=>{},setSelectedConnection:()=>{}}),Rn=()=>{const e=C.useContext(tp);if(!e)throw new Error("useConnections must be used within a ConnectionsProvider");return e};function np({groupRef:e,provider:t,children:n}){const r=st(),{setError:i,isError:o}=kn(),{projectIdOrName:s,isLoading:a}=yr(),{integrationId:l,groupRef:c}=St(),{provider:u}=Hr(l),{data:d,isLoading:h,isError:f,error:m}=kl({groupRef:e||c,provider:u||t}),g=d==null?void 0:d[0],v=C.useCallback(b=>{r.setQueryData(["amp","connections"],()=>b),r.invalidateQueries({queryKey:["amp","connections"]})},[r]),w=C.useCallback(()=>{r.invalidateQueries({queryKey:["amp","connections"]})},[r]);C.useEffect(()=>{f?(i(Ee.CONNECTION_LIST,s,!0),ot(m)):i(Ee.CONNECTION_LIST,s,!1)},[f,i,s,m]);const y=C.useMemo(()=>({connections:d||null,isConnectionsLoading:h,selectedConnection:g||null,setConnections:v,setSelectedConnection:w}),[d,h,g,v,w]);if(h||a)return p.jsx(Ai,{});if(s&&o(Ee.PROJECT,s))return p.jsx(Vt,{message:`Error loading project ${s}`});if(s&&o(Ee.CONNECTION_LIST,s))return p.jsx(Vt,{message:"Error retrieving existing connections"});if(!s)throw new Error("Project ID or Project Name not found. ConnectionsProvider must be used within AmpersandProvider");return p.jsx(tp.Provider,{value:y,children:n})}const rp=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...zn({mutationKey:["createInstallation"],mutationFn:async o=>(await e()).installationApi.createInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error creating installation"),ot(o,r)}}),errorMsg:n}};function GI(e){return typeof e.provider=="string"}function XI(e){return GI(e)?{data:e}:{error:new Error("Config must have a provider field for creation")}}function ip(){const{projectIdOrName:e}=Xe(),{groupRef:t,integrationNameOrId:n}=vr(),{data:r}=Hr(n),{connection:i}=_l(),{installation:o}=An(),s=st(),{mutate:a,isIdle:l,isPending:c,error:u,errorMsg:d}=rp();return{createInstallation:({config:f,onSuccess:m,onError:g,onSettled:v})=>{if(o){const b=new Error("Installation already created. Try updating instead.");g==null||g(b),v==null||v();return}if(!r){const b=new Error("No integration found");g==null||g(b),v==null||v();return}const w=XI(f);if(w.error||!w.data){g==null||g(w.error||new Error("Invalid configuration data")),v==null||v();return}const y={projectIdOrName:e,integrationId:r==null?void 0:r.id,installation:{groupRef:t,connectionId:i==null?void 0:i.id,config:{content:w.data}}};return a(y,{onSuccess:b=>{m==null||m(b)},onError:b=>{g==null||g(b)},onSettled:()=>{v==null||v(),s.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:l,isPending:c,error:u,errorMsg:d}}const op=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...zn({mutationKey:["updateInstallation"],mutationFn:async o=>(await e()).installationApi.updateInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error updating installation"),ot(o,r)}}),errorMsg:n}};function sp(){const{projectIdOrName:e}=Xe(),{integrationNameOrId:t}=vr(),{data:n}=Hr(t),{installation:r}=An(),i=st(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=op();return{updateInstallation:({config:d,onSuccess:h,onError:f,onSettled:m})=>{var w,y,b,x,O;if(!r){const E=new Error("Installation not created yet. Try creating the installation first.");f==null||f(E),m==null||m();return}if(!n){const E=new Error("No integration found");f==null||f(E),m==null||m();return}const g=[];if((w=d==null?void 0:d.write)!=null&&w.objects){const E=Object.keys(d.write.objects).length,F=Object.keys(((x=(b=(y=r==null?void 0:r.config)==null?void 0:y.content)==null?void 0:b.write)==null?void 0:x.objects)||{}).length;(E>0||E===0&&F>0)&&g.push("config.content.write.objects")}if((O=d==null?void 0:d.read)!=null&&O.objects){const E=Object.keys(d.read.objects);g.push(...E.map(F=>`config.content.read.objects.${F}`))}const v={projectIdOrName:e,integrationId:n==null?void 0:n.id,installationId:r.id,installationUpdate:{updateMask:g,installation:{config:{content:d}}}};return o(v,{onSuccess:E=>{h==null||h(E)},onError:E=>{f==null||f(E)},onSettled:()=>{m==null||m(),i.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}const YI=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...zn({mutationKey:["deleteInstallation"],mutationFn:async o=>(await e()).installationApi.deleteInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error deleting installation"),ot(o,r)}}),errorMsg:n}};function ZI(){const{projectIdOrName:e}=Xe(),{integrationNameOrId:t}=vr(),{data:n}=Hr(t),{installation:r}=An(),i=st(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=YI();return{deleteInstallation:({onSuccess:d,onError:h,onSettled:f})=>{if(!r){const m=new Error("Installation not found. Not able to delete installation.");h==null||h(m),f==null||f();return}if(!n){const m=new Error("No integration found");h==null||h(m),f==null||f();return}return o({projectIdOrName:e,integrationId:n==null?void 0:n.id,installationId:r.id},{onSuccess:()=>{d==null||d()},onError:m=>{h==null||h(m)},onSettled:()=>{f==null||f(),i.invalidateQueries({queryKey:["amp","installations"]}),i.invalidateQueries({queryKey:["amp","connections"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}function ap(){const[e,t]=C.useState(1);return{seed:e,reset:()=>{t(Math.random())}}}var cs={exports:{}};cs.exports;(function(e,t){var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Map]",a="[object Object]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",d="[object DataView]",h=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,m=typeof an=="object"&&an&&an.Object===Object&&an,g=typeof self=="object"&&self&&self.Object===Object&&self,v=m||g||Function("return this")(),w=t&&!t.nodeType&&t,y=w&&!0&&e&&!e.nodeType&&e,b=y&&y.exports===w;function x(j,oe){return j==null?void 0:j[oe]}function O(j){var oe=!1;if(j!=null&&typeof j.toString!="function")try{oe=!!(j+"")}catch{}return oe}function E(j,oe){return function(ue){return j(oe(ue))}}var F=Function.prototype,N=Object.prototype,P=v["__core-js_shared__"],A=function(){var j=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||"");return j?"Symbol(src)_1."+j:""}(),D=F.toString,M=N.hasOwnProperty,z=N.toString,V=RegExp("^"+D.call(M).replace(h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=b?v.Buffer:void 0,se=N.propertyIsEnumerable,ce=Y?Y.isBuffer:void 0,ge=E(Object.keys,Object),be=$(v,"DataView"),I=$(v,"Map"),J=$(v,"Promise"),B=$(v,"Set"),S=$(v,"WeakMap"),q=!se.call({valueOf:1},"valueOf"),U=Be(be),X=Be(I),ne=Be(J),te=Be(B),ae=Be(S);function Z(j){return z.call(j)}function ye(j){if(!rt(j)||ee(j))return!1;var oe=_t(j)||O(j)?V:f;return oe.test(Be(j))}function $(j,oe){var ue=x(j,oe);return ye(ue)?ue:void 0}var we=Z;(be&&we(new be(new ArrayBuffer(1)))!=d||I&&we(new I)!=s||J&&we(J.resolve())!=l||B&&we(new B)!=c||S&&we(new S)!=u)&&(we=function(j){var oe=z.call(j),ue=oe==a?j.constructor:void 0,Je=ue?Be(ue):void 0;if(Je)switch(Je){case U:return d;case X:return s;case ne:return l;case te:return c;case ae:return u}return oe});function ee(j){return!!A&&A in j}function Ke(j){var oe=j&&j.constructor,ue=typeof oe=="function"&&oe.prototype||N;return j===ue}function Be(j){if(j!=null){try{return D.call(j)}catch{}try{return j+""}catch{}}return""}function Le(j){return lt(j)&&M.call(j,"callee")&&(!se.call(j,"callee")||z.call(j)==r)}var tt=Array.isArray;function at(j){return j!=null&&mt(j.length)&&!_t(j)}function lt(j){return L(j)&&at(j)}var Oe=ce||H;function ft(j){if(at(j)&&(tt(j)||typeof j=="string"||typeof j.splice=="function"||Oe(j)||Le(j)))return!j.length;var oe=we(j);if(oe==s||oe==c)return!j.size;if(q||Ke(j))return!ge(j).length;for(var ue in j)if(M.call(j,ue))return!1;return!0}function _t(j){var oe=rt(j)?z.call(j):"";return oe==i||oe==o}function mt(j){return typeof j=="number"&&j>-1&&j%1==0&&j<=n}function rt(j){var oe=typeof j;return!!j&&(oe=="object"||oe=="function")}function L(j){return!!j&&typeof j=="object"}function H(){return!1}e.exports=ft})(cs,cs.exports);var eC=cs.exports;const tC=Ni(eC),bi="other",ds="manage-tab";function Ri(e){return!e.fieldName}function lp(e,t){var n;return((n=e==null?void 0:e.objects)==null?void 0:n.find(r=>r.objectName===t))||null}function nC(e){var n;return((n=e==null?void 0:e.requiredFields)==null?void 0:n.filter(r=>Ri(r)&&!!r.mapToName))||[]}function rC(e){var n;return((n=e==null?void 0:e.optionalFields)==null?void 0:n.filter(r=>Ri(r)&&!!r.mapToName))||[]}function up(e){var t;return((t=e==null?void 0:e.optionalFields)==null?void 0:t.filter(n=>!Ri(n)&&!!n.fieldName))||null}const cp=(e,t)=>{var n,r,i;return(i=(r=(n=e==null?void 0:e.content)==null?void 0:n.read)==null?void 0:r.objects)==null?void 0:i[t]},dp=(e,t)=>{var r,i,o;const n=[];return(o=(i=(r=t.content)==null?void 0:r.read)==null?void 0:i.objects)==null||o.forEach(s=>{const a=e?cp(e,s.objectName):void 0;n.push({name:s==null?void 0:s.objectName,displayName:(s==null?void 0:s.mapToDisplayName)||(s==null?void 0:s.displayName)||(s==null?void 0:s.objectName)&&un(s==null?void 0:s.objectName),completed:!!a,disabled:a==null?void 0:a.disabled})}),n},fp=e=>{var n;return{name:bi,completed:e?!!((n=e==null?void 0:e.content)!=null&&n.write):!1}};function iC(e,t){var o;const n=dp(e,t),i=!!((o=t==null?void 0:t.content)!=null&&o.write)?fp(e):void 0;return i&&n.push(i),n}function pp(e,t,n){const r=(e==null?void 0:e.filter(o=>!(t!=null&&t[o==null?void 0:o.mapToName])))||[],i=r.map(o=>o.mapToName);return n(Ee.MAPPING,i),r!=null&&r.length&&console.error("required fields not met",r.map(o=>o.mapToDisplayName)),{errorList:i}}function gc(e,t){return tC(e)?!0:Object.values(e).every(t)}function Al(e,t,n){const r=gc(e,n),i=gc(t,n);return r&&i?!0:r!==i?!1:zf(e,t)}function hp(e,t){return Al(e,t,n=>n===!1||n===void 0)}function mp(e,t){return Al(e,t,n=>!n||n==="")}function gp(e,t){return Al(e,t,n=>!n||typeof n!="object"?!0:Object.keys(n).length===0)}function yp(e,t){const n=new Set(Object.values(e).map(i=>i==null?void 0:i.objectName)),r=new Set(Object.values(t).map(i=>i==null?void 0:i.objectName));return n.size===r.size&&[...n].every(i=>r.has(i))}const oC=(e,t,n)=>{var f,m,g,v,w,y;if(!e)return null;const r=lp(e,t),i=r&&up(r),o=r&&nC(r),s=r&&rC(r),a=(r==null?void 0:r.allFields)||[],l=(r==null?void 0:r.allFieldsMetadata)||{},c=n==null?void 0:n.content,u=((g=(m=(f=c==null?void 0:c.read)==null?void 0:f.objects)==null?void 0:m[t])==null?void 0:g.selectedValueMappings)||{},d=((y=(w=(v=c==null?void 0:c.read)==null?void 0:v.objects)==null?void 0:w[t])==null?void 0:y.selectedFieldMappings)||{},h=Rl(n,{content:{read:e}},t);return{allFields:a,allFieldsMetadata:l,optionalFields:i,requiredMapFields:o,optionalMapFields:s,selectedOptionalFields:h,selectedFieldMappings:d,selectedValueMappings:u}},sC=(e,t)=>{var r,i;if(!e)return null;const n=(i=(r=t==null?void 0:t.content)==null?void 0:r.write)==null?void 0:i.objects;return{writeObjects:(e==null?void 0:e.objects)||[],selectedWriteObjects:n||{}}};function vp(e,t,n){var o,s;const r=(o=e==null?void 0:e.content)==null?void 0:o.read,i=(s=e==null?void 0:e.content)==null?void 0:s.write;return{read:oC(r,t,n),write:sC(i,n)}}const bp=(e,t,n,r)=>{const i=vp(e,n,t);r(n,i)},aC=(e,t,n)=>{const r=iC(t,e),i={};r.forEach(({name:o,completed:s})=>{s&&(i[o]=vp(e,o,t))}),n(i)},wp=e=>{const{selectedOptionalFields:t}=(e==null?void 0:e.read)||{};return t||{}},xp=e=>{const{selectedFieldMappings:t}=(e==null?void 0:e.read)||{},n={};return t&&Object.keys(t).forEach(r=>{t[r]!==void 0?n[r]=t[r]||"":console.warn(`Error undefined when generating selectedRequiredMapFieldsSubmit for key: ${r}`)}),n},Ip=(e,t)=>!t||!t[e]?[]:t[e],Cp=e=>{const{selectedValueMappings:t}=(e==null?void 0:e.read)||{};return t},Rl=(e,t,n)=>{var c,u,d,h,f;if(!e||!t)return{};const r=(c=t==null?void 0:t.content)==null?void 0:c.read;if(!r)return{};const i=lp(r,n),o=i&&up(i),s=new Set((o==null?void 0:o.filter(m=>!Ri(m)&&!!m.fieldName).map(m=>m.fieldName))||[]),a=((f=(h=(d=(u=e==null?void 0:e.content)==null?void 0:u.read)==null?void 0:d.objects)==null?void 0:h[n])==null?void 0:f.selectedFields)||{};return Object.entries(a).reduce((m,[g,v])=>(s.has(g)&&(m[g]=v),m),{})},Sp=(e,t)=>{var r,i,o,s;return!e||!t?{}:((s=(o=(i=(r=e==null?void 0:e.content)==null?void 0:r.read)==null?void 0:i.objects)==null?void 0:o[t])==null?void 0:s.selectedFieldMappings)||{}};function Op(e,t){return t[e]||void 0}const lC=(e,t,n,r,i)=>{const o=wp(e),s=xp(e),a=Ip(t,i),l=Cp(e);return{createdBy:`consumer:${r}`,content:{provider:n.content.provider,read:{objects:{[t]:{objectName:t,selectedFields:o,selectedFieldMappings:s,dynamicMappingsInput:a,selectedValueMappings:l||{}}}}}}};function Ep(e){var t;return(t=e.content.proxy)==null?void 0:t.enabled}const _p=e=>{var t;return{...(t=e.write)==null?void 0:t.selectedWriteObjects}},uC=e=>{const t=e.content.write;return t==null?void 0:t.objects},cC=(e,t,n)=>{if(!uC(t))return console.error("Error when getting write objects from hydratedRevision"),null;const i=_p(e),o={createdBy:`consumer:${n}`,content:{provider:t.content.provider,read:{objects:{}},write:{objects:i}}};return Ep(t)&&(o.content.proxy={enabled:!0}),o};var Tp={exports:{}};/*!
|
|
7
7
|
Copyright (c) 2018 Jed Watson.
|
|
8
8
|
Licensed under the MIT License (MIT), see
|
|
9
9
|
http://jedwatson.github.io/classnames
|
|
10
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Np);var pC=Np.exports;const ln=Ai(pC),hC="_button_kwfiu_1",mC="_danger_kwfiu_42",gC="_ghost_kwfiu_47",Ys={button:hC,danger:mC,ghost:gC};function Xe({className:e,style:t,type:n,children:r,variant:i,...o}){const s=ln(Ys.button,{[Ys.danger]:i==="danger",[Ys.ghost]:i==="ghost",[e||""]:!!e});return p.jsx("button",{type:n,className:s,style:t,...o,children:r})}const yC={backgroundColor:"var(--amp-colors-status-critical-muted)",borderColor:"var(--amp-colors-status-critical-muted)",color:"var(--amp-colors-status-critical-dark)",padding:".5rem 1rem"};function yo({children:e,style:t}){return p.jsx(Hn,{style:{...yC,...t},children:e})}const kp=e=>{const t=Ct(),{provider:n}=St(),r=e||n;return Wr({queryKey:["amp","providerInfo",r],queryFn:async()=>{if(!r)throw new Error("Provider not found");return(await t()).providerApi.getProvider({provider:r})},enabled:!!r})},Ot=e=>{const t=kp(e),{data:n}=t,{provider:r}=St(),i=n&&qI(n==null?void 0:n.name,n);return{...t,providerName:i,selectedProvider:e||r}};function Fn({error:e}){return e?p.jsx(yo,{style:{marginTop:"2em"},children:e}):null}const vC="_input_1ymb7_1",bC="_inputError_1ymb7_27",Zs={input:vC,inputError:bC};function Ap({id:e,type:t,className:n,isError:r=!1,...i}){const o=r?ln(Zs.inputError,Zs.input):Zs.input;return p.jsx("input",{id:e,type:t,className:ln(o,n),...i})}function wC(){return p.jsx("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsxs("g",{opacity:"0.5",children:[p.jsx("path",{d:"M14.2821 11.0004C14.2821 12.8154 12.8154 14.2821 11.0004 14.2821C9.18542 14.2821 7.71875 12.8154 7.71875 11.0004C7.71875 9.18542 9.18542 7.71875 11.0004 7.71875C12.8154 7.71875 14.2821 9.18542 14.2821 11.0004Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M10.9999 18.581C14.2357 18.581 17.2515 16.6743 19.3507 13.3743C20.1757 12.0818 20.1757 9.90932 19.3507 8.61682C17.2515 5.31682 14.2357 3.41016 10.9999 3.41016C7.76402 3.41016 4.74819 5.31682 2.64902 8.61682C1.82402 9.90932 1.82402 12.0818 2.64902 13.3743C4.74819 16.6743 7.76402 18.581 10.9999 18.581Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function xC(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[p.jsx("path",{d:"M13.3187 8.68036L8.68036 13.3187C8.06528 12.7036 7.71973 11.8694 7.71973 10.9995C7.71973 10.5688 7.80456 10.1423 7.96939 9.7444C8.13421 9.34648 8.3758 8.98491 8.68036 8.68036C8.98491 8.3758 9.34648 8.13421 9.7444 7.96939C10.1423 7.80456 10.5688 7.71973 10.9995 7.71973C11.8694 7.71973 12.7036 8.06528 13.3187 8.68036Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M16.3349 5.28895C14.7307 4.07895 12.8974 3.41895 10.9999 3.41895C7.76402 3.41895 4.74819 5.32561 2.64902 8.62561C1.82402 9.91811 1.82402 12.0906 2.64902 13.3831C3.37319 14.5198 4.21652 15.5006 5.13319 16.2889M7.71819 17.9023C8.76319 18.3423 9.87236 18.5806 10.9999 18.5806C14.2357 18.5806 17.2515 16.6739 19.3507 13.3739C20.1757 12.0814 20.1757 9.90895 19.3507 8.61645C19.0482 8.13978 18.7182 7.69061 18.379 7.26895",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M14.2172 11.6413C14.093 12.2808 13.7806 12.8685 13.32 13.3291C12.8594 13.7897 12.2716 14.1022 11.6322 14.2263M8.68051 13.3188L1.83301 20.1663M20.1663 1.83301L13.3188 8.68051",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IC({id:e,name:t,placeholder:n="Password",onChange:r,value:i,className:o,isError:s}){const[a,l]=C.useState(!1),c=()=>l(u=>!u);return p.jsxs("div",{style:{display:"flex",gap:".5rem"},children:[p.jsx(_n.Input,{id:e,name:t,type:a?"text":"password",placeholder:n,onChange:r,value:i,className:o,isError:s}),p.jsx(Xe,{type:"button","aria-label":a?"Hide password":"Show password",style:{height:"2.5rem",width:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"},onClick:c,variant:"ghost",children:p.jsx("span",{style:{height:"1.5rem",width:"1.5rem"},children:a?p.jsx(xC,{}):p.jsx(wC,{})})})]})}const CC="_textarea_18zl4_1",SC="_textareaError_18zl4_14",ea={textarea:CC,textareaError:SC};function OC({className:e,isError:t=!1,...n}){const r=t?ln(ea.textareaError,ea.textarea):ea.textarea;return p.jsx("textarea",{className:ln(e,r),...n})}const _n={Input:Ap,Textarea:OC,PasswordInput:IC},EC=()=>{const{projectIdOrName:e}=Ye(),t=Ct();return Wr({queryKey:["project",e,"entitlements"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return(await t()).projectApi.getProject({projectIdOrName:e,includeEntitlements:!0})},enabled:!!e})};function Rp(){var n,r;const{data:e}=EC();return((r=(n=e==null?void 0:e.entitlements)==null?void 0:n.brandingRemoval)==null?void 0:r.value)===!0?null:p.jsxs("footer",{style:{backgroundColor:"light-dark(#EFEFEF, #646266)",padding:"1em",fontSize:"0.8em",color:"gray",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"0 0 4px 4px",gap:"0.4em"},children:[p.jsx("p",{style:{color:"light-dark(gray, #EFEFEF)"},children:"Secured by"}),p.jsx("a",{href:"https://www.withampersand.com/",target:"_blank","aria-label":"Go to Ampersand",rel:"noreferrer noopener",children:p.jsx("img",{style:{height:".8em"},src:"https://res.cloudinary.com/dycvts6vp/image/upload/v1723671980/ampersand-logo-black.svg",alt:"Ampersand"})})]})}function wr({children:e}){return p.jsx(Ri,{children:p.jsxs(Hn,{children:[p.jsx("div",{style:{padding:"3rem 2rem"},children:e}),p.jsx(Rp,{})]})})}function xr({children:e}){return p.jsx("h1",{style:{fontWeight:600,lineHeight:1.2,fontSize:"1.2em"},children:e})}function _C({children:e}){return p.jsx("p",{style:{padding:".5em 0"},children:e})}const TC="_link_oo2kv_1",NC={link:TC};function Fl({href:e,className:t,style:n,label:r,children:i,newTab:o=!1}){return p.jsx("a",{className:ln(NC.link,t),style:n,href:e,"aria-label":r||void 0,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,children:i})}function kC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PC={};function vc(e,t){return(PC.jsx?RC:AC).test(e)}const FC=/[ \t\n\f\r]/g;function DC(e){return typeof e=="object"?e.type==="text"?bc(e.value):!1:bc(e)}function bc(e){return e.replace(FC,"")===""}class vo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vo.prototype.normal={};vo.prototype.property={};vo.prototype.space=void 0;function Pp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vo(n,r,t)}function Wa(e){return e.toLowerCase()}class $t{constructor(t,n){this.attribute=n,this.property=t}}$t.prototype.attribute="";$t.prototype.booleanish=!1;$t.prototype.boolean=!1;$t.prototype.commaOrSpaceSeparated=!1;$t.prototype.commaSeparated=!1;$t.prototype.defined=!1;$t.prototype.mustUseProperty=!1;$t.prototype.number=!1;$t.prototype.overloadedBoolean=!1;$t.prototype.property="";$t.prototype.spaceSeparated=!1;$t.prototype.space=void 0;let MC=0;const Ie=Gr(),it=Gr(),Qa=Gr(),Q=Gr(),qe=Gr(),ri=Gr(),zt=Gr();function Gr(){return 2**++MC}const Ga=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:it,commaOrSpaceSeparated:zt,commaSeparated:ri,number:Q,overloadedBoolean:Qa,spaceSeparated:qe},Symbol.toStringTag,{value:"Module"})),ta=Object.keys(Ga);class Dl extends $t{constructor(t,n,r,i){let o=-1;if(super(t,n),wc(this,"space",i),typeof r=="number")for(;++o<ta.length;){const s=ta[o];wc(this,ta[o],(r&Ga[s])===Ga[s])}}}Dl.prototype.defined=!0;function wc(e,t,n){n&&(e[t]=n)}function Fi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Dl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Wa(r)]=r,n[Wa(o.attribute)]=r}return new vo(t,n,e.space)}const Fp=Fi({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:qe,ariaCurrent:null,ariaDescribedBy:qe,ariaDetails:null,ariaDisabled:it,ariaDropEffect:qe,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:qe,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qe,ariaLevel:Q,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:qe,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:qe,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:it,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Dp(e,t){return t in e?e[t]:t}function Mp(e,t){return Dp(e,t.toLowerCase())}const jC=Fi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ri,acceptCharset:qe,accessKey:qe,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:qe,autoFocus:Ie,autoPlay:Ie,blocking:qe,capture:null,charSet:null,checked:Ie,cite:null,className:qe,cols:Q,colSpan:null,content:null,contentEditable:it,controls:Ie,controlsList:qe,coords:Q|ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Qa,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:qe,height:Q,hidden:Qa,high:Q,href:null,hrefLang:null,htmlFor:qe,httpEquiv:qe,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:qe,itemRef:qe,itemScope:Ie,itemType:qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Q,pattern:null,ping:qe,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:qe,required:Ie,reversed:Ie,rows:Q,rowSpan:Q,sandbox:qe,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:it,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qe,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:Mp}),LC=Fi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zt,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:qe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ri,g2:ri,glyphName:ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:zt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:zt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zt,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dp}),jp=Fi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Lp=Fi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mp}),Bp=Fi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},VC=/[A-Z]/g,xc=/-[a-z]/g,UC=/^data[-\w.:]+$/i;function $C(e,t){const n=Wa(t);let r=t,i=$t;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&UC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(xc,zC);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!xc.test(o)){let s=o.replace(VC,qC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Dl}return new i(r,t)}function qC(e){return"-"+e.toLowerCase()}function zC(e){return e.charAt(1).toUpperCase()}const KC=Pp([Fp,jC,jp,Lp,Bp],"html"),Ml=Pp([Fp,LC,jp,Lp,Bp],"svg");function HC(e){return e.join(" ").trim()}var jl={},Ic=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,JC=/\n/g,WC=/^\s*/,QC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GC=/^:\s*/,XC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YC=/^[;\s]*/,ZC=/^\s+|\s+$/g,e0=`
|
|
11
|
-
`,Cc="/",Sc="*",Tr="",t0="comment",n0="declaration";function r0(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match(JC);g&&(n+=g.length);var v=m.lastIndexOf(e0);r=~v?m.length-v:r+m.length}function o(){var m={line:n,column:r};return function(g){return g.position=new s(m),c(),g}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var v=g[0];return i(v),e=e.slice(v.length),g}}function c(){l(WC)}function u(m){var g;for(m=m||[];g=d();)g!==!1&&m.push(g);return m}function d(){var m=o();if(!(Cc!=e.charAt(0)||Sc!=e.charAt(1))){for(var g=2;Tr!=e.charAt(g)&&(Sc!=e.charAt(g)||Cc!=e.charAt(g+1));)++g;if(g+=2,Tr===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,i(v),e=e.slice(g),r+=2,m({type:t0,comment:v})}}function h(){var m=o(),g=l(QC);if(g){if(d(),!l(GC))return a("property missing ':'");var v=l(XC),w=m({type:n0,property:Oc(g[0].replace(Ic,Tr)),value:v?Oc(v[0].replace(Ic,Tr)):Tr});return l(YC),w}}function f(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),f()}function Oc(e){return e?e.replace(ZC,Tr):Tr}var i0=r0,o0=an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jl,"__esModule",{value:!0});jl.default=a0;const s0=o0(i0);function a0(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,s0.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.camelCase=void 0;var l0=/^--[a-zA-Z0-9_-]+$/,u0=/-([a-z])/g,c0=/^[^-]+$/,d0=/^-(webkit|moz|ms|o|khtml)-/,f0=/^-(ms)-/,p0=function(e){return!e||c0.test(e)||l0.test(e)},h0=function(e,t){return t.toUpperCase()},Ec=function(e,t){return"".concat(t,"-")},m0=function(e,t){return t===void 0&&(t={}),p0(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(f0,Ec):e=e.replace(d0,Ec),e.replace(u0,h0))};Ns.camelCase=m0;var g0=an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},y0=g0(jl),v0=Ns;function Xa(e,t){var n={};return!e||typeof e!="string"||(0,y0.default)(e,function(r,i){r&&i&&(n[(0,v0.camelCase)(r,t)]=i)}),n}Xa.default=Xa;var b0=Xa;const w0=Ai(b0),Vp=Up("end"),Ll=Up("start");function Up(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function x0(e){const t=Ll(e),n=Vp(e);if(t&&n)return{start:t,end:n}}function Qi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_c(e.position):"start"in e||"end"in e?_c(e):"line"in e||"column"in e?Ya(e):""}function Ya(e){return Tc(e&&e.line)+":"+Tc(e&&e.column)}function _c(e){return Ya(e&&e.start)+"-"+Ya(e&&e.end)}function Tc(e){return e&&typeof e=="number"?e:1}class Et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Qi(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0;const Bl={}.hasOwnProperty,I0=new Map,C0=/[A-Z]/g,S0=new Set(["table","tbody","thead","tfoot","tr"]),O0=new Set(["td","th"]),$p="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function E0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=F0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=P0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ml:KC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qp(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function qp(e,t,n){if(t.type==="element")return _0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return T0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return k0(e,t,n);if(t.type==="mdxjsEsm")return N0(e,t);if(t.type==="root")return A0(e,t,n);if(t.type==="text")return R0(e,t)}function _0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ml,e.schema=i),e.ancestors.push(t);const o=Kp(e,t.tagName,!1),s=D0(e,t);let a=Ul(e,t);return S0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!DC(l):!0})),zp(e,s,o,t),Vl(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function T0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}oo(e,t.position)}function N0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oo(e,t.position)}function k0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ml,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Kp(e,t.name,!0),s=M0(e,t),a=Ul(e,t);return zp(e,s,o,t),Vl(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function A0(e,t,n){const r={};return Vl(r,Ul(e,t)),e.create(t,e.Fragment,r,n)}function R0(e,t){return t.value}function zp(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Vl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function P0(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function F0(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ll(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function D0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Bl.call(t.properties,i)){const o=j0(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&O0.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function M0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else oo(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else oo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ul(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:I0;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=qp(e,o,s);a!==void 0&&n.push(a)}return n}function j0(e,t,n){const r=$C(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kC(n):HC(n)),r.property==="style"){let i=typeof n=="object"?n:L0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=B0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?BC[r.property]||r.property:r.attribute,n]}}function L0(e,t){try{return w0(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=$p+"#cannot-parse-style-attribute",i}}function Kp(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=vc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=vc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Bl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);oo(e)}function oo(e,t){const n=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$p+"#cannot-handle-mdx-estrees-without-createevaluater",n}function B0(e){const t={};let n;for(n in e)Bl.call(e,n)&&(t[V0(n)]=e[n]);return t}function V0(e){let t=e.replace(C0,U0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function U0(e){return"-"+e.toLowerCase()}const na={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},$0={};function q0(e,t){const n=$0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hp(e,r,i)}function Hp(e,t,n){if(z0(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Nc(e.children,t,n)}return Array.isArray(e)?Nc(e,t,n):""}function Nc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Hp(e[i],t,n);return r.join("")}function z0(e){return!!(e&&typeof e=="object")}const kc=document.createElement("i");function $l(e){const t="&"+e+";";kc.innerHTML=t;const n=kc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Nn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function sn(e,t){return e.length>0?(Nn(e,e.length,0,t),e):t}const Ac={}.hasOwnProperty;function K0(e){const t={};let n=-1;for(;++n<e.length;)H0(t,e[n]);return t}function H0(e,t){let n;for(n in t){const i=(Ac.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Ac.call(i,s)||(i[s]=[]);const a=o[s];J0(i[s],Array.isArray(a)?a:a?[a]:[])}}}function J0(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Nn(e,0,0,r)}function Jp(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const En=Ir(/[A-Za-z]/),Jt=Ir(/[\dA-Za-z]/),W0=Ir(/[#-'*+\--9=?A-Z^-~]/);function Za(e){return e!==null&&(e<32||e===127)}const el=Ir(/\d/),Q0=Ir(/[\dA-Fa-f]/),G0=Ir(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Ut(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const X0=Ir(new RegExp("\\p{P}|\\p{S}","u")),Y0=Ir(/\s/);function Ir(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Di(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ze(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Re(l)?(e.enter(n),a(l)):t(l)}function a(l){return Re(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const Z0={tokenize:eS};function eS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ze(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ve(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const tS={tokenize:nS},Rc={tokenize:rS};function nS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const x=n[r];return t.containerState=x[1],e.attempt(x[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const x=t.events.length;let S=x,E;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){E=t.events[S][1].end;break}w(r);let D=x;for(;D<t.events.length;)t.events[D][1].end={...E},D++;return Nn(t.events,S+1,0,t.events.slice(x)),t.events.length=D,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rc,u,d)(b)}function u(b){return i&&y(),w(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(Rc,f,m)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&y(),w(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),g(b)}function g(b){if(b===null){v(e.exit("chunkFlow"),!0),w(0),e.consume(b);return}return ve(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),g)}function v(b,x){const S=t.sliceStream(b);if(x&&S.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(S),t.parser.lazy[b.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const D=t.events.length;let N=D,M,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(M){R=t.events[N][1].end;break}M=!0}for(w(r),E=D;E<t.events.length;)t.events[E][1].end={...R},E++;Nn(t.events,N+1,0,t.events.slice(D)),t.events.length=E}}function w(b){let x=n.length;for(;x-- >b;){const S=n[x];t.containerState=S[1],S[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rS(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pc(e){if(e===null||Ut(e)||Y0(e))return 1;if(X0(e))return 2}function ql(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const tl={name:"attention",resolveAll:iS,tokenize:oS};function iS(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Fc(d,-l),Fc(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=sn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=sn(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=sn(c,ql(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=sn(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=sn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Nn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function oS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Pc(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Pc(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function Fc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sS={name:"autolink",tokenize:aS};function aS(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return En(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||Jt(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||Jt(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Za(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):W0(f)?(e.consume(f),c):n(f)}function u(f){return Jt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Jt(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const ks={partial:!0,tokenize:lS};function lS(e,t,n){return r;function r(o){return Re(o)?ze(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ve(o)?t(o):n(o)}}const Wp={continuation:{tokenize:cS},exit:dS,name:"blockQuote",tokenize:uS};function uS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Re(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function cS(e,t,n){const r=this;return i;function i(s){return Re(s)?ze(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Wp,t,n)(s)}}function dS(e){e.exit("blockQuote")}const Qp={name:"characterEscape",tokenize:fS};function fS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return G0(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Gp={name:"characterReference",tokenize:pS};function pS(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Jt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Q0,u):(e.enter("characterReferenceValue"),o=7,s=el,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===Jt&&!$l(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Dc={partial:!0,tokenize:mS},Mc={concrete:!0,name:"codeFenced",tokenize:hS};function hS(e,t,n){const r=this,i={partial:!0,tokenize:S};let o=0,s=0,a;return l;function l(E){return c(E)}function c(E){const D=r.events[r.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Re(E)?ze(e,d,"whitespace")(E):d(E))}function d(E){return E===null||ve(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Dc,g,x)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Re(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,f,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function f(E){return E===null||ve(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?n(E):(e.consume(E),m)}function g(E){return e.attempt(i,x,v)(E)}function v(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),w}function w(E){return o>0&&Re(E)?ze(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ve(E)?e.check(Dc,g,x)(E):(e.enter("codeFlowValue"),b(E))}function b(E){return E===null||ve(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),b)}function x(E){return e.exit("codeFenced"),t(E)}function S(E,D,N){let M=0;return R;function R(X){return E.enter("lineEnding"),E.consume(X),E.exit("lineEnding"),P}function P(X){return E.enter("codeFencedFence"),Re(X)?ze(E,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===a?(E.enter("codeFencedFenceSequence"),U(X)):N(X)}function U(X){return X===a?(M++,E.consume(X),U):M>=s?(E.exit("codeFencedFenceSequence"),Re(X)?ze(E,B,"whitespace")(X):B(X)):N(X)}function B(X){return X===null||ve(X)?(E.exit("codeFencedFence"),D(X)):N(X)}}}function mS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ra={name:"codeIndented",tokenize:yS},gS={partial:!0,tokenize:vS};function yS(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ze(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):ve(c)?e.attempt(gS,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ve(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function vS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ze(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ve(s)?i(s):n(s)}}const bS={name:"codeText",previous:xS,resolve:wS,tokenize:IS};function wS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IS(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):ve(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ve(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class CS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qi(this.left,n.reverse())}}}function qi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xp(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new CS(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,SS(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return Nn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function SS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,f=n,m=0,g=0;const v=[g];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,v.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const w=a.slice(v[h],v[h+1]),y=o.pop();l.push([y,y+w.length-1]),e.splice(y,2,w)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const OS={resolve:_S,tokenize:TS},ES={partial:!0,tokenize:NS};function _S(e){return Xp(e),e}function TS(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ve(a)?e.check(ES,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function NS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ze(e,o,"linePrefix")}function o(s){if(s===null||ve(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Yp(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),h):w===null||w===32||w===41||Za(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(w))}function h(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||ve(w)?n(w):(e.consume(w),w===92?m:f)}function m(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function g(w){return!u&&(w===null||w===41||Ut(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):u<c&&w===40?(e.consume(w),u++,g):w===41?(e.consume(w),u--,g):w===null||w===32||w===40||Za(w)?n(w):(e.consume(w),w===92?v:g)}function v(w){return w===40||w===41||w===92?(e.consume(w),g):g(w)}}function Zp(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ve(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ve(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Re(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function eh(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ve(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ze(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||ve(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function Gi(e,t){let n;return r;function r(i){return ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Re(i)?ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const kS={name:"definition",tokenize:RS},AS={partial:!0,tokenize:PS};function RS(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return Zp.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return Ut(f)?Gi(e,c)(f):c(f)}function c(f){return Yp(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(AS,d,d)(f)}function d(f){return Re(f)?ze(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ve(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function PS(e,t,n){return r;function r(a){return Ut(a)?Gi(e,i)(a):n(a)}function i(a){return eh(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Re(a)?ze(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ve(a)?t(a):n(a)}}const FS={name:"hardBreakEscape",tokenize:DS};function DS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const MS={name:"headingAtx",resolve:jS,tokenize:LS};function jS(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Nn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function LS(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Ut(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ve(u)?(e.exit("atxHeading"),t(u)):Re(u)?ze(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Ut(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const BS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],jc=["pre","script","style","textarea"],VS={concrete:!0,name:"htmlFlow",resolveTo:qS,tokenize:zS},US={partial:!0,tokenize:HS},$S={partial:!0,tokenize:KS};function qS(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zS(e,t,n){const r=this;let i,o,s,a,l;return c;function c(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),h):O===47?(e.consume(O),o=!0,g):O===63?(e.consume(O),i=3,r.interrupt?t:I):En(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function h(O){return O===45?(e.consume(O),i=2,f):O===91?(e.consume(O),i=5,a=0,m):En(O)?(e.consume(O),i=4,r.interrupt?t:I):n(O)}function f(O){return O===45?(e.consume(O),r.interrupt?t:I):n(O)}function m(O){const z="CDATA[";return O===z.charCodeAt(a++)?(e.consume(O),a===z.length?r.interrupt?t:F:m):n(O)}function g(O){return En(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function v(O){if(O===null||O===47||O===62||Ut(O)){const z=O===47,$=s.toLowerCase();return!z&&!o&&jc.includes($)?(i=1,r.interrupt?t(O):F(O)):BS.includes(s.toLowerCase())?(i=6,z?(e.consume(O),w):r.interrupt?t(O):F(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?y(O):b(O))}return O===45||Jt(O)?(e.consume(O),s+=String.fromCharCode(O),v):n(O)}function w(O){return O===62?(e.consume(O),r.interrupt?t:F):n(O)}function y(O){return Re(O)?(e.consume(O),y):R(O)}function b(O){return O===47?(e.consume(O),R):O===58||O===95||En(O)?(e.consume(O),x):Re(O)?(e.consume(O),b):R(O)}function x(O){return O===45||O===46||O===58||O===95||Jt(O)?(e.consume(O),x):S(O)}function S(O){return O===61?(e.consume(O),E):Re(O)?(e.consume(O),S):b(O)}function E(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,D):Re(O)?(e.consume(O),E):N(O)}function D(O){return O===l?(e.consume(O),l=null,M):O===null||ve(O)?n(O):(e.consume(O),D)}function N(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Ut(O)?S(O):(e.consume(O),N)}function M(O){return O===47||O===62||Re(O)?b(O):n(O)}function R(O){return O===62?(e.consume(O),P):n(O)}function P(O){return O===null||ve(O)?F(O):Re(O)?(e.consume(O),P):n(O)}function F(O){return O===45&&i===2?(e.consume(O),se):O===60&&i===1?(e.consume(O),ce):O===62&&i===4?(e.consume(O),J):O===63&&i===3?(e.consume(O),I):O===93&&i===5?(e.consume(O),be):ve(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(US,V,U)(O)):O===null||ve(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),F)}function U(O){return e.check($S,B,V)(O)}function B(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),X}function X(O){return O===null||ve(O)?U(O):(e.enter("htmlFlowData"),F(O))}function se(O){return O===45?(e.consume(O),I):F(O)}function ce(O){return O===47?(e.consume(O),s="",ge):F(O)}function ge(O){if(O===62){const z=s.toLowerCase();return jc.includes(z)?(e.consume(O),J):F(O)}return En(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),ge):F(O)}function be(O){return O===93?(e.consume(O),I):F(O)}function I(O){return O===62?(e.consume(O),J):O===45&&i===2?(e.consume(O),I):F(O)}function J(O){return O===null||ve(O)?(e.exit("htmlFlowData"),V(O)):(e.consume(O),J)}function V(O){return e.exit("htmlFlow"),t(O)}}function KS(e,t,n){const r=this;return i;function i(s){return ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function HS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ks,t,n)}}const JS={name:"htmlText",tokenize:WS};function WS(e,t,n){const r=this;let i,o,s;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),l}function l(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),S):I===63?(e.consume(I),b):En(I)?(e.consume(I),N):n(I)}function c(I){return I===45?(e.consume(I),u):I===91?(e.consume(I),o=0,m):En(I)?(e.consume(I),y):n(I)}function u(I){return I===45?(e.consume(I),f):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),h):ve(I)?(s=d,ce(I)):(e.consume(I),d)}function h(I){return I===45?(e.consume(I),f):d(I)}function f(I){return I===62?se(I):I===45?h(I):d(I)}function m(I){const J="CDATA[";return I===J.charCodeAt(o++)?(e.consume(I),o===J.length?g:m):n(I)}function g(I){return I===null?n(I):I===93?(e.consume(I),v):ve(I)?(s=g,ce(I)):(e.consume(I),g)}function v(I){return I===93?(e.consume(I),w):g(I)}function w(I){return I===62?se(I):I===93?(e.consume(I),w):g(I)}function y(I){return I===null||I===62?se(I):ve(I)?(s=y,ce(I)):(e.consume(I),y)}function b(I){return I===null?n(I):I===63?(e.consume(I),x):ve(I)?(s=b,ce(I)):(e.consume(I),b)}function x(I){return I===62?se(I):b(I)}function S(I){return En(I)?(e.consume(I),E):n(I)}function E(I){return I===45||Jt(I)?(e.consume(I),E):D(I)}function D(I){return ve(I)?(s=D,ce(I)):Re(I)?(e.consume(I),D):se(I)}function N(I){return I===45||Jt(I)?(e.consume(I),N):I===47||I===62||Ut(I)?M(I):n(I)}function M(I){return I===47?(e.consume(I),se):I===58||I===95||En(I)?(e.consume(I),R):ve(I)?(s=M,ce(I)):Re(I)?(e.consume(I),M):se(I)}function R(I){return I===45||I===46||I===58||I===95||Jt(I)?(e.consume(I),R):P(I)}function P(I){return I===61?(e.consume(I),F):ve(I)?(s=P,ce(I)):Re(I)?(e.consume(I),P):M(I)}function F(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,U):ve(I)?(s=F,ce(I)):Re(I)?(e.consume(I),F):(e.consume(I),B)}function U(I){return I===i?(e.consume(I),i=void 0,X):I===null?n(I):ve(I)?(s=U,ce(I)):(e.consume(I),U)}function B(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ut(I)?M(I):(e.consume(I),B)}function X(I){return I===47||I===62||Ut(I)?M(I):n(I)}function se(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function ce(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),ge}function ge(I){return Re(I)?ze(e,be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):be(I)}function be(I){return e.enter("htmlTextData"),s(I)}}const zl={name:"labelEnd",resolveAll:YS,resolveTo:ZS,tokenize:eO},QS={tokenize:tO},GS={tokenize:nO},XS={tokenize:rO};function YS(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Nn(e,0,e.length,n),e}function ZS(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=sn(a,e.slice(o+1,o+r+3)),a=sn(a,[["enter",u,t]]),a=sn(a,ql(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=sn(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=sn(a,e.slice(s+1)),a=sn(a,[["exit",l,t]]),Nn(e,o,e.length,a),e}function eO(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?d(h):(s=r.parser.defined.includes(ii(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(QS,u,s?u:d)(h):h===91?e.attempt(GS,u,s?c:d)(h):s?u(h):d(h)}function c(h){return e.attempt(XS,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function tO(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Ut(d)?Gi(e,o)(d):o(d)}function o(d){return d===41?u(d):Yp(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Ut(d)?Gi(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?eh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ut(d)?Gi(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function nO(e,t,n){const r=this;return i;function i(a){return Zp.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function rO(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const iO={name:"labelStartImage",resolveAll:zl.resolveAll,tokenize:oO};function oO(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const sO={name:"labelStartLink",resolveAll:zl.resolveAll,tokenize:aO};function aO(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ia={name:"lineEnding",tokenize:lO};function lO(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const Zo={name:"thematicBreak",tokenize:uO};function uO(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ve(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Re(c)?ze(e,a,"whitespace")(c):a(c))}}const Mt={continuation:{tokenize:pO},exit:mO,name:"list",tokenize:fO},cO={partial:!0,tokenize:gO},dO={partial:!0,tokenize:hO};function fO(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:el(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Zo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return el(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(ks,r.interrupt?n:u,e.attempt(cO,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Re(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function pO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ks,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Re(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dO,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(Mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hO(e,t,n){const r=this;return ze(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function mO(e){e.exit(this.containerState.type)}function gO(e,t,n){const r=this;return ze(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Re(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Lc={name:"setextUnderline",resolveTo:yO,tokenize:vO};function yO(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function vO(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Re(c)?ze(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ve(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const bO={tokenize:wO};function wO(e){const t=this,n=e.attempt(ks,r,e.attempt(this.parser.constructs.flowInitial,i,ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(OS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xO={resolveAll:nh()},IO=th("string"),CO=th("text");function th(e){return{resolveAll:nh(e==="text"?SO:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function nh(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function SO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const OO={42:Mt,43:Mt,45:Mt,48:Mt,49:Mt,50:Mt,51:Mt,52:Mt,53:Mt,54:Mt,55:Mt,56:Mt,57:Mt,62:Wp},EO={91:kS},_O={[-2]:ra,[-1]:ra,32:ra},TO={35:MS,42:Zo,45:[Lc,Zo],60:VS,61:Lc,95:Zo,96:Mc,126:Mc},NO={38:Gp,92:Qp},kO={[-5]:ia,[-4]:ia,[-3]:ia,33:iO,38:Gp,42:tl,60:[sS,JS],91:sO,92:[FS,Qp],93:zl,95:tl,96:bS},AO={null:[tl,xO]},RO={null:[42,95]},PO={null:[]},FO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RO,contentInitial:EO,disable:PO,document:OO,flow:TO,flowInitial:_O,insideSpan:AO,string:NO,text:kO},Symbol.toStringTag,{value:"Module"}));function DO(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:D(S),check:D(E),consume:y,enter:b,exit:x,interrupt:D(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(P){return s=sn(s,P),v(),s[s.length-1]!==null?[]:(N(t,0),c.events=ql(o,c.events,c),c.events)}function h(P,F){return jO(f(P),F)}function f(P){return MO(s,P)}function m(){const{_bufferIndex:P,_index:F,line:U,column:B,offset:X}=r;return{_bufferIndex:P,_index:F,line:U,column:B,offset:X}}function g(P){i[P.line]=P.column,R()}function v(){let P;for(;r._index<s.length;){const F=s[r._index];if(typeof F=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<F.length;)w(F.charCodeAt(r._bufferIndex));else w(F)}}function w(P){u=u(P)}function y(P){ve(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,R()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function b(P,F){const U=F||{};return U.type=P,U.start=m(),c.events.push(["enter",U,c]),a.push(U),U}function x(P){const F=a.pop();return F.end=m(),c.events.push(["exit",F,c]),F}function S(P,F){N(P,F.from)}function E(P,F){F.restore()}function D(P,F){return U;function U(B,X,se){let ce,ge,be,I;return Array.isArray(B)?V(B):"tokenize"in B?V([B]):J(B);function J(Y){return ne;function ne(te){const ae=te!==null&&Y[te],Z=te!==null&&Y.null,ye=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return V(ye)(te)}}function V(Y){return ce=Y,ge=0,Y.length===0?se:O(Y[ge])}function O(Y){return ne;function ne(te){return I=M(),be=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?$():Y.tokenize.call(F?Object.assign(Object.create(c),F):c,l,z,$)(te)}}function z(Y){return P(be,I),X}function $(Y){return I.restore(),++ge<ce.length?O(ce[ge]):se}}}function N(P,F){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&Nn(c.events,F,c.events.length-F,P.resolve(c.events.slice(F),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function M(){const P=m(),F=c.previous,U=c.currentConstruct,B=c.events.length,X=Array.from(a);return{from:B,restore:se};function se(){r=P,c.previous=F,c.currentConstruct=U,c.events.length=B,a=X,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function MO(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function jO(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
10
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tp);var dC=Tp.exports;const ln=Ni(dC),fC="_button_kwfiu_1",pC="_danger_kwfiu_42",hC="_ghost_kwfiu_47",Xs={button:fC,danger:pC,ghost:hC};function et({className:e,style:t,type:n,children:r,variant:i,...o}){const s=ln(Xs.button,{[Xs.danger]:i==="danger",[Xs.ghost]:i==="ghost",[e||""]:!!e});return p.jsx("button",{type:n,className:s,style:t,...o,children:r})}const mC={backgroundColor:"var(--amp-colors-status-critical-muted)",borderColor:"var(--amp-colors-status-critical-muted)",color:"var(--amp-colors-status-critical-dark)",padding:".5rem 1rem"};function go({children:e,style:t}){return p.jsx(Kn,{style:{...mC,...t},children:e})}const Np=e=>{const t=Ct(),{provider:n}=St(),r=e||n;return Kr({queryKey:["amp","providerInfo",r],queryFn:async()=>{if(!r)throw new Error("Provider not found");return(await t()).providerApi.getProvider({provider:r})},enabled:!!r})},Ot=e=>{const t=Np(e),{data:n}=t,{provider:r}=St(),i=n&&zI(n==null?void 0:n.name,n);return{...t,providerName:i,selectedProvider:e||r}};function Hn({error:e}){return e?p.jsx(go,{style:{marginTop:"2em"},children:e}):null}const gC="_input_1ymb7_1",yC="_inputError_1ymb7_27",Ys={input:gC,inputError:yC};function kp({id:e,type:t,className:n,isError:r=!1,...i}){const o=r?ln(Ys.inputError,Ys.input):Ys.input;return p.jsx("input",{id:e,type:t,className:ln(o,n),...i})}function vC(){return p.jsx("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsxs("g",{opacity:"0.5",children:[p.jsx("path",{d:"M14.2821 11.0004C14.2821 12.8154 12.8154 14.2821 11.0004 14.2821C9.18542 14.2821 7.71875 12.8154 7.71875 11.0004C7.71875 9.18542 9.18542 7.71875 11.0004 7.71875C12.8154 7.71875 14.2821 9.18542 14.2821 11.0004Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M10.9999 18.581C14.2357 18.581 17.2515 16.6743 19.3507 13.3743C20.1757 12.0818 20.1757 9.90932 19.3507 8.61682C17.2515 5.31682 14.2357 3.41016 10.9999 3.41016C7.76402 3.41016 4.74819 5.31682 2.64902 8.61682C1.82402 9.90932 1.82402 12.0818 2.64902 13.3743C4.74819 16.6743 7.76402 18.581 10.9999 18.581Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function bC(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[p.jsx("path",{d:"M13.3187 8.68036L8.68036 13.3187C8.06528 12.7036 7.71973 11.8694 7.71973 10.9995C7.71973 10.5688 7.80456 10.1423 7.96939 9.7444C8.13421 9.34648 8.3758 8.98491 8.68036 8.68036C8.98491 8.3758 9.34648 8.13421 9.7444 7.96939C10.1423 7.80456 10.5688 7.71973 10.9995 7.71973C11.8694 7.71973 12.7036 8.06528 13.3187 8.68036Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M16.3349 5.28895C14.7307 4.07895 12.8974 3.41895 10.9999 3.41895C7.76402 3.41895 4.74819 5.32561 2.64902 8.62561C1.82402 9.91811 1.82402 12.0906 2.64902 13.3831C3.37319 14.5198 4.21652 15.5006 5.13319 16.2889M7.71819 17.9023C8.76319 18.3423 9.87236 18.5806 10.9999 18.5806C14.2357 18.5806 17.2515 16.6739 19.3507 13.3739C20.1757 12.0814 20.1757 9.90895 19.3507 8.61645C19.0482 8.13978 18.7182 7.69061 18.379 7.26895",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M14.2172 11.6413C14.093 12.2808 13.7806 12.8685 13.32 13.3291C12.8594 13.7897 12.2716 14.1022 11.6322 14.2263M8.68051 13.3188L1.83301 20.1663M20.1663 1.83301L13.3188 8.68051",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function wC({id:e,name:t,placeholder:n="Password",onChange:r,value:i,className:o,isError:s}){const[a,l]=C.useState(!1),c=()=>l(u=>!u);return p.jsxs("div",{style:{display:"flex",gap:".5rem"},children:[p.jsx($n.Input,{id:e,name:t,type:a?"text":"password",placeholder:n,onChange:r,value:i,className:o,isError:s}),p.jsx(et,{type:"button","aria-label":a?"Hide password":"Show password",style:{height:"2.5rem",width:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"},onClick:c,variant:"ghost",children:p.jsx("span",{style:{height:"1.5rem",width:"1.5rem"},children:a?p.jsx(bC,{}):p.jsx(vC,{})})})]})}const xC="_textarea_18zl4_1",IC="_textareaError_18zl4_14",Zs={textarea:xC,textareaError:IC};function CC({className:e,isError:t=!1,...n}){const r=t?ln(Zs.textareaError,Zs.textarea):Zs.textarea;return p.jsx("textarea",{className:ln(e,r),...n})}const $n={Input:kp,Textarea:CC,PasswordInput:wC},SC=()=>{const{projectIdOrName:e}=Xe(),t=Ct();return Kr({queryKey:["project",e,"entitlements"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return(await t()).projectApi.getProject({projectIdOrName:e,includeEntitlements:!0})},enabled:!!e})};function Ap(){var n,r;const{data:e}=SC();return((r=(n=e==null?void 0:e.entitlements)==null?void 0:n.brandingRemoval)==null?void 0:r.value)===!0?null:p.jsxs("footer",{style:{backgroundColor:"light-dark(#EFEFEF, #646266)",padding:"1em",fontSize:"0.8em",color:"gray",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"0 0 4px 4px",gap:"0.4em"},children:[p.jsx("p",{style:{color:"light-dark(gray, #EFEFEF)"},children:"Secured by"}),p.jsx("a",{href:"https://www.withampersand.com/",target:"_blank","aria-label":"Go to Ampersand",rel:"noreferrer noopener",children:p.jsx("img",{style:{height:".8em"},src:"https://res.cloudinary.com/dycvts6vp/image/upload/v1723671980/ampersand-logo-black.svg",alt:"Ampersand"})})]})}function Jr({children:e}){return p.jsx(ki,{children:p.jsxs(Kn,{children:[p.jsx("div",{style:{padding:"3rem 2rem"},children:e}),p.jsx(Ap,{})]})})}function Wr({children:e}){return p.jsx("h1",{style:{fontWeight:600,lineHeight:1.2,fontSize:"1.2em"},children:e})}function OC({children:e}){return p.jsx("p",{style:{padding:".5em 0"},children:e})}const EC="_link_oo2kv_1",_C={link:EC};function Rp({href:e,className:t,style:n,label:r,children:i,newTab:o=!1}){return p.jsx("a",{className:ln(_C.link,t),style:n,href:e,"aria-label":r||void 0,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,children:i})}function TC(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const NC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AC={};function yc(e,t){return(AC.jsx?kC:NC).test(e)}const RC=/[ \t\n\f\r]/g;function PC(e){return typeof e=="object"?e.type==="text"?vc(e.value):!1:vc(e)}function vc(e){return e.replace(RC,"")===""}class yo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yo.prototype.normal={};yo.prototype.property={};yo.prototype.space=void 0;function Pp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yo(n,r,t)}function Ja(e){return e.toLowerCase()}class $t{constructor(t,n){this.attribute=n,this.property=t}}$t.prototype.attribute="";$t.prototype.booleanish=!1;$t.prototype.boolean=!1;$t.prototype.commaOrSpaceSeparated=!1;$t.prototype.commaSeparated=!1;$t.prototype.defined=!1;$t.prototype.mustUseProperty=!1;$t.prototype.number=!1;$t.prototype.overloadedBoolean=!1;$t.prototype.property="";$t.prototype.spaceSeparated=!1;$t.prototype.space=void 0;let FC=0;const Ie=Qr(),it=Qr(),Wa=Qr(),Q=Qr(),qe=Qr(),ni=Qr(),zt=Qr();function Qr(){return 2**++FC}const Qa=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:it,commaOrSpaceSeparated:zt,commaSeparated:ni,number:Q,overloadedBoolean:Wa,spaceSeparated:qe},Symbol.toStringTag,{value:"Module"})),ea=Object.keys(Qa);class Pl extends $t{constructor(t,n,r,i){let o=-1;if(super(t,n),bc(this,"space",i),typeof r=="number")for(;++o<ea.length;){const s=ea[o];bc(this,ea[o],(r&Qa[s])===Qa[s])}}}Pl.prototype.defined=!0;function bc(e,t,n){n&&(e[t]=n)}function Pi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Pl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ja(r)]=r,n[Ja(o.attribute)]=r}return new yo(t,n,e.space)}const Fp=Pi({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:qe,ariaCurrent:null,ariaDescribedBy:qe,ariaDetails:null,ariaDisabled:it,ariaDropEffect:qe,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:qe,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qe,ariaLevel:Q,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:qe,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:qe,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:it,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Dp(e,t){return t in e?e[t]:t}function Mp(e,t){return Dp(e,t.toLowerCase())}const DC=Pi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ni,acceptCharset:qe,accessKey:qe,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:qe,autoFocus:Ie,autoPlay:Ie,blocking:qe,capture:null,charSet:null,checked:Ie,cite:null,className:qe,cols:Q,colSpan:null,content:null,contentEditable:it,controls:Ie,controlsList:qe,coords:Q|ni,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Wa,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:qe,height:Q,hidden:Wa,high:Q,href:null,hrefLang:null,htmlFor:qe,httpEquiv:qe,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:qe,itemRef:qe,itemScope:Ie,itemType:qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Q,pattern:null,ping:qe,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:qe,required:Ie,reversed:Ie,rows:Q,rowSpan:Q,sandbox:qe,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:it,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qe,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:Mp}),MC=Pi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zt,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:qe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ni,g2:ni,glyphName:ni,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:zt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zt,rev:zt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zt,requiredFeatures:zt,requiredFonts:zt,requiredFormats:zt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:zt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zt,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dp}),jp=Pi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Lp=Pi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mp}),Bp=Pi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},LC=/[A-Z]/g,wc=/-[a-z]/g,BC=/^data[-\w.:]+$/i;function VC(e,t){const n=Ja(t);let r=t,i=$t;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&BC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(wc,$C);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!wc.test(o)){let s=o.replace(LC,UC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Pl}return new i(r,t)}function UC(e){return"-"+e.toLowerCase()}function $C(e){return e.charAt(1).toUpperCase()}const qC=Pp([Fp,DC,jp,Lp,Bp],"html"),Fl=Pp([Fp,MC,jp,Lp,Bp],"svg");function zC(e){return e.join(" ").trim()}var Dl={},xc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,KC=/\n/g,HC=/^\s*/,JC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,WC=/^:\s*/,QC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,GC=/^[;\s]*/,XC=/^\s+|\s+$/g,YC=`
|
|
11
|
+
`,Ic="/",Cc="*",Or="",ZC="comment",e0="declaration";function t0(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match(KC);g&&(n+=g.length);var v=m.lastIndexOf(YC);r=~v?m.length-v:r+m.length}function o(){var m={line:n,column:r};return function(g){return g.position=new s(m),c(),g}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var v=g[0];return i(v),e=e.slice(v.length),g}}function c(){l(HC)}function u(m){var g;for(m=m||[];g=d();)g!==!1&&m.push(g);return m}function d(){var m=o();if(!(Ic!=e.charAt(0)||Cc!=e.charAt(1))){for(var g=2;Or!=e.charAt(g)&&(Cc!=e.charAt(g)||Ic!=e.charAt(g+1));)++g;if(g+=2,Or===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,i(v),e=e.slice(g),r+=2,m({type:ZC,comment:v})}}function h(){var m=o(),g=l(JC);if(g){if(d(),!l(WC))return a("property missing ':'");var v=l(QC),w=m({type:e0,property:Sc(g[0].replace(xc,Or)),value:v?Sc(v[0].replace(xc,Or)):Or});return l(GC),w}}function f(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),f()}function Sc(e){return e?e.replace(XC,Or):Or}var n0=t0,r0=an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.default=o0;const i0=r0(n0);function o0(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,i0.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.camelCase=void 0;var s0=/^--[a-zA-Z0-9_-]+$/,a0=/-([a-z])/g,l0=/^[^-]+$/,u0=/^-(webkit|moz|ms|o|khtml)-/,c0=/^-(ms)-/,d0=function(e){return!e||l0.test(e)||s0.test(e)},f0=function(e,t){return t.toUpperCase()},Oc=function(e,t){return"".concat(t,"-")},p0=function(e,t){return t===void 0&&(t={}),d0(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(c0,Oc):e=e.replace(u0,Oc),e.replace(a0,f0))};Ts.camelCase=p0;var h0=an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},m0=h0(Dl),g0=Ts;function Ga(e,t){var n={};return!e||typeof e!="string"||(0,m0.default)(e,function(r,i){r&&i&&(n[(0,g0.camelCase)(r,t)]=i)}),n}Ga.default=Ga;var y0=Ga;const v0=Ni(y0),Vp=Up("end"),Ml=Up("start");function Up(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function b0(e){const t=Ml(e),n=Vp(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ec(e.position):"start"in e||"end"in e?Ec(e):"line"in e||"column"in e?Xa(e):""}function Xa(e){return _c(e&&e.line)+":"+_c(e&&e.column)}function Ec(e){return Xa(e&&e.start)+"-"+Xa(e&&e.end)}function _c(e){return e&&typeof e=="number"?e:1}class Et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Wi(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0;const jl={}.hasOwnProperty,w0=new Map,x0=/[A-Z]/g,I0=new Set(["table","tbody","thead","tfoot","tr"]),C0=new Set(["td","th"]),$p="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=R0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=A0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Fl:qC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qp(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function qp(e,t,n){if(t.type==="element")return O0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return E0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return T0(e,t,n);if(t.type==="mdxjsEsm")return _0(e,t);if(t.type==="root")return N0(e,t,n);if(t.type==="text")return k0(e,t)}function O0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Fl,e.schema=i),e.ancestors.push(t);const o=Kp(e,t.tagName,!1),s=P0(e,t);let a=Bl(e,t);return I0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!PC(l):!0})),zp(e,s,o,t),Ll(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function E0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}oo(e,t.position)}function _0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oo(e,t.position)}function T0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Fl,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Kp(e,t.name,!0),s=F0(e,t),a=Bl(e,t);return zp(e,s,o,t),Ll(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function N0(e,t,n){const r={};return Ll(r,Bl(e,t)),e.create(t,e.Fragment,r,n)}function k0(e,t){return t.value}function zp(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ll(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function A0(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function R0(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ml(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function P0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&jl.call(t.properties,i)){const o=D0(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&C0.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function F0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else oo(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else oo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Bl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:w0;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=qp(e,o,s);a!==void 0&&n.push(a)}return n}function D0(e,t,n){const r=VC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?TC(n):zC(n)),r.property==="style"){let i=typeof n=="object"?n:M0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=j0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?jC[r.property]||r.property:r.attribute,n]}}function M0(e,t){try{return v0(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=$p+"#cannot-parse-style-attribute",i}}function Kp(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=yc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=yc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return jl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);oo(e)}function oo(e,t){const n=new Et("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$p+"#cannot-handle-mdx-estrees-without-createevaluater",n}function j0(e){const t={};let n;for(n in e)jl.call(e,n)&&(t[L0(n)]=e[n]);return t}function L0(e){let t=e.replace(x0,B0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function B0(e){return"-"+e.toLowerCase()}const ta={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},V0={};function U0(e,t){const n=V0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hp(e,r,i)}function Hp(e,t,n){if($0(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tc(e.children,t,n)}return Array.isArray(e)?Tc(e,t,n):""}function Tc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Hp(e[i],t,n);return r.join("")}function $0(e){return!!(e&&typeof e=="object")}const Nc=document.createElement("i");function Vl(e){const t="&"+e+";";Nc.innerHTML=t;const n=Nc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function sn(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const kc={}.hasOwnProperty;function q0(e){const t={};let n=-1;for(;++n<e.length;)z0(t,e[n]);return t}function z0(e,t){let n;for(n in t){const i=(kc.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){kc.call(i,s)||(i[s]=[]);const a=o[s];K0(i[s],Array.isArray(a)?a:a?[a]:[])}}}function K0(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tn(e,0,0,r)}function Jp(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ri(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const En=br(/[A-Za-z]/),Jt=br(/[\dA-Za-z]/),H0=br(/[#-'*+\--9=?A-Z^-~]/);function Ya(e){return e!==null&&(e<32||e===127)}const Za=br(/\d/),J0=br(/[\dA-Fa-f]/),W0=br(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Ut(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const Q0=br(new RegExp("\\p{P}|\\p{S}","u")),G0=br(/\s/);function br(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ze(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Re(l)?(e.enter(n),a(l)):t(l)}function a(l){return Re(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const X0={tokenize:Y0};function Y0(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ze(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ve(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Z0={tokenize:eS},Ac={tokenize:tS};function eS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const x=n[r];return t.containerState=x[1],e.attempt(x[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const x=t.events.length;let O=x,E;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){E=t.events[O][1].end;break}w(r);let F=x;for(;F<t.events.length;)t.events[F][1].end={...E},F++;return Tn(t.events,O+1,0,t.events.slice(x)),t.events.length=F,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ac,u,d)(b)}function u(b){return i&&y(),w(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(Ac,f,m)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&y(),w(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),g(b)}function g(b){if(b===null){v(e.exit("chunkFlow"),!0),w(0),e.consume(b);return}return ve(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),g)}function v(b,x){const O=t.sliceStream(b);if(x&&O.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(O),t.parser.lazy[b.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const F=t.events.length;let N=F,P,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(P){A=t.events[N][1].end;break}P=!0}for(w(r),E=F;E<t.events.length;)t.events[E][1].end={...A},E++;Tn(t.events,N+1,0,t.events.slice(F)),t.events.length=E}}function w(b){let x=n.length;for(;x-- >b;){const O=n[x];t.containerState=O[1],O[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tS(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rc(e){if(e===null||Ut(e)||G0(e))return 1;if(Q0(e))return 2}function Ul(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const el={name:"attention",resolveAll:nS,tokenize:rS};function nS(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Pc(d,-l),Pc(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=sn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=sn(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=sn(c,Ul(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=sn(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=sn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Tn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function rS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Rc(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Rc(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function Pc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const iS={name:"autolink",tokenize:oS};function oS(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return En(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||Jt(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||Jt(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Ya(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):H0(f)?(e.consume(f),c):n(f)}function u(f){return Jt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Jt(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const Ns={partial:!0,tokenize:sS};function sS(e,t,n){return r;function r(o){return Re(o)?ze(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ve(o)?t(o):n(o)}}const Wp={continuation:{tokenize:lS},exit:uS,name:"blockQuote",tokenize:aS};function aS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Re(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function lS(e,t,n){const r=this;return i;function i(s){return Re(s)?ze(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Wp,t,n)(s)}}function uS(e){e.exit("blockQuote")}const Qp={name:"characterEscape",tokenize:cS};function cS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return W0(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Gp={name:"characterReference",tokenize:dS};function dS(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Jt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=J0,u):(e.enter("characterReferenceValue"),o=7,s=Za,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===Jt&&!Vl(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const Fc={partial:!0,tokenize:pS},Dc={concrete:!0,name:"codeFenced",tokenize:fS};function fS(e,t,n){const r=this,i={partial:!0,tokenize:O};let o=0,s=0,a;return l;function l(E){return c(E)}function c(E){const F=r.events[r.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Re(E)?ze(e,d,"whitespace")(E):d(E))}function d(E){return E===null||ve(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Fc,g,x)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Re(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,f,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function f(E){return E===null||ve(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?n(E):(e.consume(E),m)}function g(E){return e.attempt(i,x,v)(E)}function v(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),w}function w(E){return o>0&&Re(E)?ze(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ve(E)?e.check(Fc,g,x)(E):(e.enter("codeFlowValue"),b(E))}function b(E){return E===null||ve(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),b)}function x(E){return e.exit("codeFenced"),t(E)}function O(E,F,N){let P=0;return A;function A(Y){return E.enter("lineEnding"),E.consume(Y),E.exit("lineEnding"),D}function D(Y){return E.enter("codeFencedFence"),Re(Y)?ze(E,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):M(Y)}function M(Y){return Y===a?(E.enter("codeFencedFenceSequence"),z(Y)):N(Y)}function z(Y){return Y===a?(P++,E.consume(Y),z):P>=s?(E.exit("codeFencedFenceSequence"),Re(Y)?ze(E,V,"whitespace")(Y):V(Y)):N(Y)}function V(Y){return Y===null||ve(Y)?(E.exit("codeFencedFence"),F(Y)):N(Y)}}}function pS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const na={name:"codeIndented",tokenize:mS},hS={partial:!0,tokenize:gS};function mS(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ze(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):ve(c)?e.attempt(hS,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ve(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function gS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ze(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ve(s)?i(s):n(s)}}const yS={name:"codeText",previous:bS,resolve:vS,tokenize:wS};function vS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function bS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wS(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):ve(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ve(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class xS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$i(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$i(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$i(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$i(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$i(this.left,n.reverse())}}}function $i(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xp(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new xS(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,IS(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return Tn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function IS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,f=n,m=0,g=0;const v=[g];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,v.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const w=a.slice(v[h],v[h+1]),y=o.pop();l.push([y,y+w.length-1]),e.splice(y,2,w)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const CS={resolve:OS,tokenize:ES},SS={partial:!0,tokenize:_S};function OS(e){return Xp(e),e}function ES(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ve(a)?e.check(SS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function _S(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ze(e,o,"linePrefix")}function o(s){if(s===null||ve(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Yp(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),h):w===null||w===32||w===41||Ya(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(w))}function h(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||ve(w)?n(w):(e.consume(w),w===92?m:f)}function m(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function g(w){return!u&&(w===null||w===41||Ut(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):u<c&&w===40?(e.consume(w),u++,g):w===41?(e.consume(w),u--,g):w===null||w===32||w===40||Ya(w)?n(w):(e.consume(w),w===92?v:g)}function v(w){return w===40||w===41||w===92?(e.consume(w),g):g(w)}}function Zp(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ve(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ve(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Re(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function eh(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ve(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ze(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||ve(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function Qi(e,t){let n;return r;function r(i){return ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Re(i)?ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const TS={name:"definition",tokenize:kS},NS={partial:!0,tokenize:AS};function kS(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return Zp.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ri(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return Ut(f)?Qi(e,c)(f):c(f)}function c(f){return Yp(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(NS,d,d)(f)}function d(f){return Re(f)?ze(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ve(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function AS(e,t,n){return r;function r(a){return Ut(a)?Qi(e,i)(a):n(a)}function i(a){return eh(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Re(a)?ze(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ve(a)?t(a):n(a)}}const RS={name:"hardBreakEscape",tokenize:PS};function PS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const FS={name:"headingAtx",resolve:DS,tokenize:MS};function DS(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function MS(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Ut(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ve(u)?(e.exit("atxHeading"),t(u)):Re(u)?ze(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Ut(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const jS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mc=["pre","script","style","textarea"],LS={concrete:!0,name:"htmlFlow",resolveTo:US,tokenize:$S},BS={partial:!0,tokenize:zS},VS={partial:!0,tokenize:qS};function US(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $S(e,t,n){const r=this;let i,o,s,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,g):S===63?(e.consume(S),i=3,r.interrupt?t:I):En(S)?(e.consume(S),s=String.fromCharCode(S),v):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,m):En(S)?(e.consume(S),i=4,r.interrupt?t:I):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:I):n(S)}function m(S){const q="CDATA[";return S===q.charCodeAt(a++)?(e.consume(S),a===q.length?r.interrupt?t:M:m):n(S)}function g(S){return En(S)?(e.consume(S),s=String.fromCharCode(S),v):n(S)}function v(S){if(S===null||S===47||S===62||Ut(S)){const q=S===47,U=s.toLowerCase();return!q&&!o&&Mc.includes(U)?(i=1,r.interrupt?t(S):M(S)):jS.includes(s.toLowerCase())?(i=6,q?(e.consume(S),w):r.interrupt?t(S):M(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):b(S))}return S===45||Jt(S)?(e.consume(S),s+=String.fromCharCode(S),v):n(S)}function w(S){return S===62?(e.consume(S),r.interrupt?t:M):n(S)}function y(S){return Re(S)?(e.consume(S),y):A(S)}function b(S){return S===47?(e.consume(S),A):S===58||S===95||En(S)?(e.consume(S),x):Re(S)?(e.consume(S),b):A(S)}function x(S){return S===45||S===46||S===58||S===95||Jt(S)?(e.consume(S),x):O(S)}function O(S){return S===61?(e.consume(S),E):Re(S)?(e.consume(S),O):b(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,F):Re(S)?(e.consume(S),E):N(S)}function F(S){return S===l?(e.consume(S),l=null,P):S===null||ve(S)?n(S):(e.consume(S),F)}function N(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Ut(S)?O(S):(e.consume(S),N)}function P(S){return S===47||S===62||Re(S)?b(S):n(S)}function A(S){return S===62?(e.consume(S),D):n(S)}function D(S){return S===null||ve(S)?M(S):Re(S)?(e.consume(S),D):n(S)}function M(S){return S===45&&i===2?(e.consume(S),se):S===60&&i===1?(e.consume(S),ce):S===62&&i===4?(e.consume(S),J):S===63&&i===3?(e.consume(S),I):S===93&&i===5?(e.consume(S),be):ve(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(BS,B,z)(S)):S===null||ve(S)?(e.exit("htmlFlowData"),z(S)):(e.consume(S),M)}function z(S){return e.check(VS,V,B)(S)}function V(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),Y}function Y(S){return S===null||ve(S)?z(S):(e.enter("htmlFlowData"),M(S))}function se(S){return S===45?(e.consume(S),I):M(S)}function ce(S){return S===47?(e.consume(S),s="",ge):M(S)}function ge(S){if(S===62){const q=s.toLowerCase();return Mc.includes(q)?(e.consume(S),J):M(S)}return En(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),ge):M(S)}function be(S){return S===93?(e.consume(S),I):M(S)}function I(S){return S===62?(e.consume(S),J):S===45&&i===2?(e.consume(S),I):M(S)}function J(S){return S===null||ve(S)?(e.exit("htmlFlowData"),B(S)):(e.consume(S),J)}function B(S){return e.exit("htmlFlow"),t(S)}}function qS(e,t,n){const r=this;return i;function i(s){return ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function zS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ns,t,n)}}const KS={name:"htmlText",tokenize:HS};function HS(e,t,n){const r=this;let i,o,s;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),l}function l(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),O):I===63?(e.consume(I),b):En(I)?(e.consume(I),N):n(I)}function c(I){return I===45?(e.consume(I),u):I===91?(e.consume(I),o=0,m):En(I)?(e.consume(I),y):n(I)}function u(I){return I===45?(e.consume(I),f):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),h):ve(I)?(s=d,ce(I)):(e.consume(I),d)}function h(I){return I===45?(e.consume(I),f):d(I)}function f(I){return I===62?se(I):I===45?h(I):d(I)}function m(I){const J="CDATA[";return I===J.charCodeAt(o++)?(e.consume(I),o===J.length?g:m):n(I)}function g(I){return I===null?n(I):I===93?(e.consume(I),v):ve(I)?(s=g,ce(I)):(e.consume(I),g)}function v(I){return I===93?(e.consume(I),w):g(I)}function w(I){return I===62?se(I):I===93?(e.consume(I),w):g(I)}function y(I){return I===null||I===62?se(I):ve(I)?(s=y,ce(I)):(e.consume(I),y)}function b(I){return I===null?n(I):I===63?(e.consume(I),x):ve(I)?(s=b,ce(I)):(e.consume(I),b)}function x(I){return I===62?se(I):b(I)}function O(I){return En(I)?(e.consume(I),E):n(I)}function E(I){return I===45||Jt(I)?(e.consume(I),E):F(I)}function F(I){return ve(I)?(s=F,ce(I)):Re(I)?(e.consume(I),F):se(I)}function N(I){return I===45||Jt(I)?(e.consume(I),N):I===47||I===62||Ut(I)?P(I):n(I)}function P(I){return I===47?(e.consume(I),se):I===58||I===95||En(I)?(e.consume(I),A):ve(I)?(s=P,ce(I)):Re(I)?(e.consume(I),P):se(I)}function A(I){return I===45||I===46||I===58||I===95||Jt(I)?(e.consume(I),A):D(I)}function D(I){return I===61?(e.consume(I),M):ve(I)?(s=D,ce(I)):Re(I)?(e.consume(I),D):P(I)}function M(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,z):ve(I)?(s=M,ce(I)):Re(I)?(e.consume(I),M):(e.consume(I),V)}function z(I){return I===i?(e.consume(I),i=void 0,Y):I===null?n(I):ve(I)?(s=z,ce(I)):(e.consume(I),z)}function V(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ut(I)?P(I):(e.consume(I),V)}function Y(I){return I===47||I===62||Ut(I)?P(I):n(I)}function se(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function ce(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),ge}function ge(I){return Re(I)?ze(e,be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):be(I)}function be(I){return e.enter("htmlTextData"),s(I)}}const $l={name:"labelEnd",resolveAll:GS,resolveTo:XS,tokenize:YS},JS={tokenize:ZS},WS={tokenize:eO},QS={tokenize:tO};function GS(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Tn(e,0,e.length,n),e}function XS(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=sn(a,e.slice(o+1,o+r+3)),a=sn(a,[["enter",u,t]]),a=sn(a,Ul(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=sn(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=sn(a,e.slice(s+1)),a=sn(a,[["exit",l,t]]),Tn(e,o,e.length,a),e}function YS(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?d(h):(s=r.parser.defined.includes(ri(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(JS,u,s?u:d)(h):h===91?e.attempt(WS,u,s?c:d)(h):s?u(h):d(h)}function c(h){return e.attempt(QS,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function ZS(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Ut(d)?Qi(e,o)(d):o(d)}function o(d){return d===41?u(d):Yp(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Ut(d)?Qi(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?eh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ut(d)?Qi(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function eO(e,t,n){const r=this;return i;function i(a){return Zp.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ri(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function tO(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const nO={name:"labelStartImage",resolveAll:$l.resolveAll,tokenize:rO};function rO(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const iO={name:"labelStartLink",resolveAll:$l.resolveAll,tokenize:oO};function oO(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ra={name:"lineEnding",tokenize:sO};function sO(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const Yo={name:"thematicBreak",tokenize:aO};function aO(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ve(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Re(c)?ze(e,a,"whitespace")(c):a(c))}}const Mt={continuation:{tokenize:dO},exit:pO,name:"list",tokenize:cO},lO={partial:!0,tokenize:hO},uO={partial:!0,tokenize:fO};function cO(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Za(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Yo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Za(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Ns,r.interrupt?n:u,e.attempt(lO,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Re(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function dO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ns,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Re(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uO,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(Mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fO(e,t,n){const r=this;return ze(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function pO(e){e.exit(this.containerState.type)}function hO(e,t,n){const r=this;return ze(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Re(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const jc={name:"setextUnderline",resolveTo:mO,tokenize:gO};function mO(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function gO(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Re(c)?ze(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ve(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const yO={tokenize:vO};function vO(e){const t=this,n=e.attempt(Ns,r,e.attempt(this.parser.constructs.flowInitial,i,ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(CS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const bO={resolveAll:nh()},wO=th("string"),xO=th("text");function th(e){return{resolveAll:nh(e==="text"?IO:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function nh(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function IO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const CO={42:Mt,43:Mt,45:Mt,48:Mt,49:Mt,50:Mt,51:Mt,52:Mt,53:Mt,54:Mt,55:Mt,56:Mt,57:Mt,62:Wp},SO={91:TS},OO={[-2]:na,[-1]:na,32:na},EO={35:FS,42:Yo,45:[jc,Yo],60:LS,61:jc,95:Yo,96:Dc,126:Dc},_O={38:Gp,92:Qp},TO={[-5]:ra,[-4]:ra,[-3]:ra,33:nO,38:Gp,42:el,60:[iS,KS],91:iO,92:[RS,Qp],93:$l,95:el,96:yS},NO={null:[el,bO]},kO={null:[42,95]},AO={null:[]},RO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kO,contentInitial:SO,disable:AO,document:CO,flow:EO,flowInitial:OO,insideSpan:NO,string:_O,text:TO},Symbol.toStringTag,{value:"Module"}));function PO(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:F(O),check:F(E),consume:y,enter:b,exit:x,interrupt:F(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(D){return s=sn(s,D),v(),s[s.length-1]!==null?[]:(N(t,0),c.events=Ul(o,c.events,c),c.events)}function h(D,M){return DO(f(D),M)}function f(D){return FO(s,D)}function m(){const{_bufferIndex:D,_index:M,line:z,column:V,offset:Y}=r;return{_bufferIndex:D,_index:M,line:z,column:V,offset:Y}}function g(D){i[D.line]=D.column,A()}function v(){let D;for(;r._index<s.length;){const M=s[r._index];if(typeof M=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<M.length;)w(M.charCodeAt(r._bufferIndex));else w(M)}}function w(D){u=u(D)}function y(D){ve(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,A()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function b(D,M){const z=M||{};return z.type=D,z.start=m(),c.events.push(["enter",z,c]),a.push(z),z}function x(D){const M=a.pop();return M.end=m(),c.events.push(["exit",M,c]),M}function O(D,M){N(D,M.from)}function E(D,M){M.restore()}function F(D,M){return z;function z(V,Y,se){let ce,ge,be,I;return Array.isArray(V)?B(V):"tokenize"in V?B([V]):J(V);function J(X){return ne;function ne(te){const ae=te!==null&&X[te],Z=te!==null&&X.null,ye=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return B(ye)(te)}}function B(X){return ce=X,ge=0,X.length===0?se:S(X[ge])}function S(X){return ne;function ne(te){return I=P(),be=X,X.partial||(c.currentConstruct=X),X.name&&c.parser.constructs.disable.null.includes(X.name)?U():X.tokenize.call(M?Object.assign(Object.create(c),M):c,l,q,U)(te)}}function q(X){return D(be,I),Y}function U(X){return I.restore(),++ge<ce.length?S(ce[ge]):se}}}function N(D,M){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&Tn(c.events,M,c.events.length-M,D.resolve(c.events.slice(M),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function P(){const D=m(),M=c.previous,z=c.currentConstruct,V=c.events.length,Y=Array.from(a);return{from:V,restore:se};function se(){r=D,c.previous=M,c.currentConstruct=z,c.events.length=V,a=Y,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function FO(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function DO(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
12
12
|
`;break}case-3:{s=`\r
|
|
13
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function LO(e){const r={constructs:K0([FO,...(e||{}).extensions||[]]),content:i(Z0),defined:[],document:i(tS),flow:i(bO),lazy:{},string:i(IO),text:i(CO)};return r;function i(o){return s;function s(a){return DO(r,o,a)}}}function BO(e){for(;!Xp(e););return e}const Bc=/[\0\t\n\r]/g;function VO(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Bc.lastIndex=d,c=Bc.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const UO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $O(e){return e.replace(UO,qO)}function qO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Jp(n.slice(o?2:1),o?16:10)}return $l(n)||e}const rh={}.hasOwnProperty;function zO(e,t,n){return typeof t!="string"&&(n=t,t=void 0),KO(n)(BO(LO(n).document().write(VO()(e,t,!0))))}function KO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(at),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(Ke),blockQuote:o(Z),characterEscape:M,characterReference:M,codeFenced:o(ye),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ye,s),codeText:o(q,s),codeTextData:M,data:M,codeFlowValue:M,definition:o(we),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ee),hardBreakEscape:o(Be),hardBreakTrailing:o(Be),htmlFlow:o(Le,s),htmlFlowData:M,htmlText:o(Le,s),htmlTextData:M,image:o(tt),label:s,link:o(at),listItem:o(Oe),listItemValue:h,listOrdered:o(lt,d),listUnordered:o(lt),paragraph:o(ft),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ke),strong:o(_t),thematicBreak:o(rt)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ae,autolinkProtocol:te,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:$,characterReferenceMarkerNumeric:$,characterReferenceValue:Y,characterReference:ne,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(w),codeText:l(X),codeTextData:R,data:R,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(F),hardBreakTrailing:l(F),htmlFlow:l(U),htmlFlowData:R,htmlText:l(B),htmlTextData:R,image:l(ce),label:be,labelText:ge,lineEnding:P,link:l(se),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:z,resourceDestinationString:I,resourceTitleString:J,resource:V,setextHeading:l(N),setextHeadingLineSequence:D,setextHeadingText:E,strong:l(),thematicBreak:l()}};ih(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let H={type:"root",children:[]};const j={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},oe=[];let ue=-1;for(;++ue<L.length;)if(L[ue][1].type==="listOrdered"||L[ue][1].type==="listUnordered")if(L[ue][0]==="enter")oe.push(ue);else{const Je=oe.pop();ue=i(L,Je,ue)}for(ue=-1;++ue<L.length;){const Je=t[L[ue][0]];rh.call(Je,L[ue][1].type)&&Je[L[ue][1].type].call(Object.assign({sliceSerialize:L[ue][2].sliceSerialize},j),L[ue][1])}if(j.tokenStack.length>0){const Je=j.tokenStack[j.tokenStack.length-1];(Je[1]||Vc).call(j,void 0,Je[0])}for(H.position={start:tr(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:tr(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)H=t.transforms[ue](H)||H;return H}function i(L,H,j){let oe=H-1,ue=-1,Je=!1,Tt,gt,wt,Ve;for(;++oe<=j;){const ke=L[oe];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?ue++:ue--,Ve=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(Tt&&!Ve&&!ue&&!wt&&(wt=oe),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!ue&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||ue===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(Tt){let Nt=oe;for(gt=void 0;Nt--;){const yt=L[Nt];if(yt[1].type==="lineEnding"||yt[1].type==="lineEndingBlank"){if(yt[0]==="exit")continue;gt&&(L[gt][1].type="lineEndingBlank",Je=!0),yt[1].type="lineEnding",gt=Nt}else if(!(yt[1].type==="linePrefix"||yt[1].type==="blockQuotePrefix"||yt[1].type==="blockQuotePrefixWhitespace"||yt[1].type==="blockQuoteMarker"||yt[1].type==="listItemIndent"))break}wt&&(!gt||wt<gt)&&(Tt._spread=!0),Tt.end=Object.assign({},gt?L[gt][1].start:ke[1].end),L.splice(gt||oe,0,["exit",Tt,ke[2]]),oe++,j++}if(ke[1].type==="listItemPrefix"){const Nt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};Tt=Nt,L.splice(oe,0,["enter",Nt,ke[2]]),oe++,j++,wt=void 0,Ve=!0}}}return L[H][1]._spread=Je,j}function o(L,H){return j;function j(oe){a.call(this,L(oe),oe),H&&H.call(this,oe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(L,H,j){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([H,j||void 0]),L.position={start:tr(H.start),end:void 0}}function l(L){return H;function H(j){L&&L.call(this,j),c.call(this,j)}}function c(L,H){const j=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==L.type&&(H?H.call(this,L,oe[0]):(oe[1]||Vc).call(this,L,oe[0]));else throw new Error("Cannot close `"+L.type+"` ("+Qi({start:L.start,end:L.end})+"): it’s not open");j.position.end=tr(L.end)}function u(){return q0(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function f(){const L=this.resume(),H=this.stack[this.stack.length-1];H.lang=L}function m(){const L=this.resume(),H=this.stack[this.stack.length-1];H.meta=L}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L.replace(/(\r?\n|\r)$/g,"")}function y(L){const H=this.resume(),j=this.stack[this.stack.length-1];j.label=H,j.identifier=ii(this.sliceSerialize(L)).toLowerCase()}function b(){const L=this.resume(),H=this.stack[this.stack.length-1];H.title=L}function x(){const L=this.resume(),H=this.stack[this.stack.length-1];H.url=L}function S(L){const H=this.stack[this.stack.length-1];if(!H.depth){const j=this.sliceSerialize(L).length;H.depth=j}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function D(L){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function M(L){const j=this.stack[this.stack.length-1].children;let oe=j[j.length-1];(!oe||oe.type!=="text")&&(oe=mt(),oe.position={start:tr(L.start),end:void 0},j.push(oe)),this.stack.push(oe)}function R(L){const H=this.stack.pop();H.value+=this.sliceSerialize(L),H.position.end=tr(L.end)}function P(L){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const j=H.children[H.children.length-1];j.position.end=tr(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(M.call(this,L),R.call(this,L))}function F(){this.data.atHardBreak=!0}function U(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function B(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function X(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function se(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=H,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ce(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=H,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ge(L){const H=this.sliceSerialize(L),j=this.stack[this.stack.length-2];j.label=$O(H),j.identifier=ii(H).toLowerCase()}function be(){const L=this.stack[this.stack.length-1],H=this.resume(),j=this.stack[this.stack.length-1];if(this.data.inReference=!0,j.type==="link"){const oe=L.children;j.children=oe}else j.alt=H}function I(){const L=this.resume(),H=this.stack[this.stack.length-1];H.url=L}function J(){const L=this.resume(),H=this.stack[this.stack.length-1];H.title=L}function V(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function z(L){const H=this.resume(),j=this.stack[this.stack.length-1];j.label=H,j.identifier=ii(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function $(L){this.data.characterReferenceType=L.type}function Y(L){const H=this.sliceSerialize(L),j=this.data.characterReferenceType;let oe;j?(oe=Jp(H,j==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=$l(H);const ue=this.stack[this.stack.length-1];ue.value+=oe}function ne(L){const H=this.stack.pop();H.position.end=tr(L.end)}function te(L){R.call(this,L);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(L)}function ae(L){R.call(this,L);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(L)}function Z(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ee(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function Le(){return{type:"html",value:""}}function tt(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function lt(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function Oe(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function _t(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function rt(){return{type:"thematicBreak"}}}function tr(e){return{line:e.line,column:e.column,offset:e.offset}}function ih(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ih(e,r):HO(e,r)}}function HO(e,t){let n;for(n in t)if(rh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Vc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qi({start:t.start,end:t.end})+") is still open")}function JO(e){const t=this;t.parser=n;function n(r){return zO(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function QO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
14
|
-
`}]}function
|
|
15
|
-
`:"",r={}
|
|
13
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function MO(e){const r={constructs:q0([RO,...(e||{}).extensions||[]]),content:i(X0),defined:[],document:i(Z0),flow:i(yO),lazy:{},string:i(wO),text:i(xO)};return r;function i(o){return s;function s(a){return PO(r,o,a)}}}function jO(e){for(;!Xp(e););return e}const Lc=/[\0\t\n\r]/g;function LO(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Lc.lastIndex=d,c=Lc.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const BO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VO(e){return e.replace(BO,UO)}function UO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Jp(n.slice(o?2:1),o?16:10)}return Vl(n)||e}const rh={}.hasOwnProperty;function $O(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qO(n)(jO(MO(n).document().write(LO()(e,t,!0))))}function qO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(at),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Ke),blockQuote:o(Z),characterEscape:P,characterReference:P,codeFenced:o(ye),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ye,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(we),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ee),hardBreakEscape:o(Be),hardBreakTrailing:o(Be),htmlFlow:o(Le,s),htmlFlowData:P,htmlText:o(Le,s),htmlTextData:P,image:o(tt),label:s,link:o(at),listItem:o(Oe),listItemValue:h,listOrdered:o(lt,d),listUnordered:o(lt),paragraph:o(ft),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ke),strong:o(_t),thematicBreak:o(rt)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:ae,autolinkProtocol:te,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:U,characterReferenceMarkerNumeric:U,characterReferenceValue:X,characterReference:ne,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:A,codeIndented:l(w),codeText:l(Y),codeTextData:A,data:A,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(M),hardBreakTrailing:l(M),htmlFlow:l(z),htmlFlowData:A,htmlText:l(V),htmlTextData:A,image:l(ce),label:be,labelText:ge,lineEnding:D,link:l(se),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:q,resourceDestinationString:I,resourceTitleString:J,resource:B,setextHeading:l(N),setextHeadingLineSequence:F,setextHeadingText:E,strong:l(),thematicBreak:l()}};ih(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let H={type:"root",children:[]};const j={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},oe=[];let ue=-1;for(;++ue<L.length;)if(L[ue][1].type==="listOrdered"||L[ue][1].type==="listUnordered")if(L[ue][0]==="enter")oe.push(ue);else{const Je=oe.pop();ue=i(L,Je,ue)}for(ue=-1;++ue<L.length;){const Je=t[L[ue][0]];rh.call(Je,L[ue][1].type)&&Je[L[ue][1].type].call(Object.assign({sliceSerialize:L[ue][2].sliceSerialize},j),L[ue][1])}if(j.tokenStack.length>0){const Je=j.tokenStack[j.tokenStack.length-1];(Je[1]||Bc).call(j,void 0,Je[0])}for(H.position={start:tr(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:tr(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)H=t.transforms[ue](H)||H;return H}function i(L,H,j){let oe=H-1,ue=-1,Je=!1,Tt,gt,wt,Ve;for(;++oe<=j;){const ke=L[oe];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?ue++:ue--,Ve=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(Tt&&!Ve&&!ue&&!wt&&(wt=oe),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!ue&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||ue===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(Tt){let Nt=oe;for(gt=void 0;Nt--;){const yt=L[Nt];if(yt[1].type==="lineEnding"||yt[1].type==="lineEndingBlank"){if(yt[0]==="exit")continue;gt&&(L[gt][1].type="lineEndingBlank",Je=!0),yt[1].type="lineEnding",gt=Nt}else if(!(yt[1].type==="linePrefix"||yt[1].type==="blockQuotePrefix"||yt[1].type==="blockQuotePrefixWhitespace"||yt[1].type==="blockQuoteMarker"||yt[1].type==="listItemIndent"))break}wt&&(!gt||wt<gt)&&(Tt._spread=!0),Tt.end=Object.assign({},gt?L[gt][1].start:ke[1].end),L.splice(gt||oe,0,["exit",Tt,ke[2]]),oe++,j++}if(ke[1].type==="listItemPrefix"){const Nt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};Tt=Nt,L.splice(oe,0,["enter",Nt,ke[2]]),oe++,j++,wt=void 0,Ve=!0}}}return L[H][1]._spread=Je,j}function o(L,H){return j;function j(oe){a.call(this,L(oe),oe),H&&H.call(this,oe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(L,H,j){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([H,j||void 0]),L.position={start:tr(H.start),end:void 0}}function l(L){return H;function H(j){L&&L.call(this,j),c.call(this,j)}}function c(L,H){const j=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==L.type&&(H?H.call(this,L,oe[0]):(oe[1]||Bc).call(this,L,oe[0]));else throw new Error("Cannot close `"+L.type+"` ("+Wi({start:L.start,end:L.end})+"): it’s not open");j.position.end=tr(L.end)}function u(){return U0(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function f(){const L=this.resume(),H=this.stack[this.stack.length-1];H.lang=L}function m(){const L=this.resume(),H=this.stack[this.stack.length-1];H.meta=L}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L.replace(/(\r?\n|\r)$/g,"")}function y(L){const H=this.resume(),j=this.stack[this.stack.length-1];j.label=H,j.identifier=ri(this.sliceSerialize(L)).toLowerCase()}function b(){const L=this.resume(),H=this.stack[this.stack.length-1];H.title=L}function x(){const L=this.resume(),H=this.stack[this.stack.length-1];H.url=L}function O(L){const H=this.stack[this.stack.length-1];if(!H.depth){const j=this.sliceSerialize(L).length;H.depth=j}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function F(L){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function P(L){const j=this.stack[this.stack.length-1].children;let oe=j[j.length-1];(!oe||oe.type!=="text")&&(oe=mt(),oe.position={start:tr(L.start),end:void 0},j.push(oe)),this.stack.push(oe)}function A(L){const H=this.stack.pop();H.value+=this.sliceSerialize(L),H.position.end=tr(L.end)}function D(L){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const j=H.children[H.children.length-1];j.position.end=tr(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(P.call(this,L),A.call(this,L))}function M(){this.data.atHardBreak=!0}function z(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function V(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function Y(){const L=this.resume(),H=this.stack[this.stack.length-1];H.value=L}function se(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=H,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ce(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=H,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ge(L){const H=this.sliceSerialize(L),j=this.stack[this.stack.length-2];j.label=VO(H),j.identifier=ri(H).toLowerCase()}function be(){const L=this.stack[this.stack.length-1],H=this.resume(),j=this.stack[this.stack.length-1];if(this.data.inReference=!0,j.type==="link"){const oe=L.children;j.children=oe}else j.alt=H}function I(){const L=this.resume(),H=this.stack[this.stack.length-1];H.url=L}function J(){const L=this.resume(),H=this.stack[this.stack.length-1];H.title=L}function B(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function q(L){const H=this.resume(),j=this.stack[this.stack.length-1];j.label=H,j.identifier=ri(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function U(L){this.data.characterReferenceType=L.type}function X(L){const H=this.sliceSerialize(L),j=this.data.characterReferenceType;let oe;j?(oe=Jp(H,j==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Vl(H);const ue=this.stack[this.stack.length-1];ue.value+=oe}function ne(L){const H=this.stack.pop();H.position.end=tr(L.end)}function te(L){A.call(this,L);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(L)}function ae(L){A.call(this,L);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(L)}function Z(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ee(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function Le(){return{type:"html",value:""}}function tt(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function lt(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function Oe(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function _t(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function rt(){return{type:"thematicBreak"}}}function tr(e){return{line:e.line,column:e.column,offset:e.offset}}function ih(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ih(e,r):zO(e,r)}}function zO(e,t){let n;for(n in t)if(rh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Bc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function KO(e){const t=this;t.parser=n;function n(r){return $O(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function JO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
14
|
+
`}]}function WO(e,t){const n=t.value?t.value+`
|
|
15
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function QO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Fi(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function YO(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function oh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function eE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oh(e,t);const i={src:Fi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function tE(e,t){const n={src:Fi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function nE(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function rE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oh(e,t);const i={href:Fi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function iE(e,t){const n={href:Fi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oE(e,t,n){const r=e.all(t),i=n?sE(n):sh(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
16
16
|
`}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
17
|
-
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function
|
|
17
|
+
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function sE(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=sh(n[r])}return t}function sh(e){const t=e.spread;return t??e.children.length>1}function aE(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function lE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function cE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ml(t.children[1]),l=Vp(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function fE(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},f=s?s[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function pE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Vc=9,Uc=32;function hE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push($c(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push($c(t.slice(i),i>0,!1)),o.join("")}function $c(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Vc||o===Uc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Vc||o===Uc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function mE(e,t){const n={type:"text",value:hE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yE={blockquote:HO,break:JO,code:WO,delete:QO,emphasis:GO,footnoteReference:XO,heading:YO,html:ZO,imageReference:eE,image:tE,inlineCode:nE,linkReference:rE,link:iE,listItem:oE,list:aE,paragraph:lE,root:uE,strong:cE,table:dE,tableCell:pE,tableRow:fE,text:mE,thematicBreak:gE,toml:Uo,yaml:Uo,definition:Uo,footnoteDefinition:Uo};function Uo(){}const ah=-1,ks=0,Gi=1,fs=2,ql=3,zl=4,Kl=5,Hl=6,lh=7,uh=8,qc=typeof self=="object"?self:globalThis,vE=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case ks:case ah:return n(s,i);case Gi:{const a=n([],i);for(const l of s)a.push(r(l));return a}case fs:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case ql:return n(new Date(s),i);case zl:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Kl:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case Hl:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case lh:{const{name:a,message:l}=s;return n(new qc[a](l),i)}case uh:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new qc[o](s),i)};return r},zc=e=>vE(new Map,e)(0),Zr="",{toString:bE}={},{keys:wE}=Object,qi=e=>{const t=typeof e;if(t!=="object"||!e)return[ks,t];const n=bE.call(e).slice(8,-1);switch(n){case"Array":return[Gi,Zr];case"Object":return[fs,Zr];case"Date":return[ql,Zr];case"RegExp":return[zl,Zr];case"Map":return[Kl,Zr];case"Set":return[Hl,Zr];case"DataView":return[Gi,n]}return n.includes("Array")?[Gi,n]:n.includes("Error")?[lh,n]:[fs,n]},$o=([e,t])=>e===ks&&(t==="function"||t==="symbol"),xE=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=qi(s);switch(a){case ks:{let u=s;switch(l){case"bigint":a=uh,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([ah],s)}return i([a,u],s)}case Gi:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const u=[],d=i([a,u],s);for(const h of s)u.push(o(h));return d}case fs:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const h of wE(s))(e||!$o(qi(s[h])))&&u.push([o(h),o(s[h])]);return d}case ql:return i([a,s.toISOString()],s);case zl:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case Kl:{const u=[],d=i([a,u],s);for(const[h,f]of s)(e||!($o(qi(h))||$o(qi(f))))&&u.push([o(h),o(f)]);return d}case Hl:{const u=[],d=i([a,u],s);for(const h of s)(e||!$o(qi(h)))&&u.push(o(h));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},Kc=(e,{json:t,lossy:n}={})=>{const r=[];return xE(!(t||n),!!t,new Map,r)(e),r},ps=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zc(Kc(e,t)):structuredClone(e):(e,t)=>zc(Kc(e,t));function IE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function CE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function SE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||IE,r=e.options.footnoteBackLabel||CE,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Fi(d.toLowerCase());let f=0;const m=[],g=e.footnoteCounts.get(d);for(;g!==void 0&&++f<=g;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,f);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ps(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
18
18
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
19
|
-
`}]}}const ch=function(e){if(e==null)return
|
|
19
|
+
`}]}}const ch=function(e){if(e==null)return TE;if(typeof e=="function")return As(e);if(typeof e=="object")return Array.isArray(e)?OE(e):EE(e);if(typeof e=="string")return _E(e);throw new Error("Expected function, string, or object as test")};function OE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ch(e[n]);return As(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function EE(e){const t=e;return As(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function _E(e){return As(t);function t(n){return n&&n.type===e}}function As(e){return t;function t(n,r,i){return!!(NE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function TE(){return!0}function NE(e){return e!==null&&typeof e=="object"&&"type"in e}const dh=[],kE=!0,Hc=!1,AE="skip";function RE(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=ch(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=dh,m,g,v;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=PE(n(l,u)),f[0]===Hc))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==AE)for(g=(r?w.children.length:-1)+s,v=u.concat(w);g>-1&&g<w.children.length;){const y=w.children[g];if(m=a(y,g,v)(),m[0]===Hc)return m;g=typeof m[1]=="number"?m[1]:g+s}}return f}}}function PE(e){return Array.isArray(e)?e:typeof e=="number"?[kE,e]:e==null?dh:[e]}function fh(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),RE(e,o,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const tl={}.hasOwnProperty,FE={};function DE(e,t){const n=t||FE,r=new Map,i=new Map,o=new Map,s={...yE,...n.handlers},a={all:c,applyData:jE,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:ME,wrap:BE};return fh(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(tl.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...v}=u,w=ps(v);return w.children=a.all(u),w}return ps(u)}return(a.options.unknownHandler||LE)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=a.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Jc(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=Jc(g.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function ME(e,t){e.position&&(t.position=b0(e))}function jE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,ps(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function LE(e,t){const n=t.data||{},r="value"in t&&!(tl.call(n,"hProperties")||tl.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
20
20
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
21
21
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
22
|
-
`}),n}function
|
|
23
|
-
`},i),o}function $E(e,t){return e&&"run"in e?async function(n,r){const i=Qc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Qc(n,{file:r,...e||t})}}function Gc(e){if(e)throw e}var es=Object.prototype.hasOwnProperty,ph=Object.prototype.toString,Xc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,Zc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ph.call(t)==="[object Array]"},ed=function(t){if(!t||ph.call(t)!=="[object Object]")return!1;var n=es.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&es.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||es.call(t,i)},td=function(t,n){Xc&&n.name==="__proto__"?Xc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},nd=function(t,n){if(n==="__proto__")if(es.call(t,n)){if(Yc)return Yc(t,n).value}else return;return t[n]},qE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=nd(a,n),i=nd(t,n),a!==i&&(u&&i&&(ed(i)||(o=Zc(i)))?(o?(o=!1,s=r&&Zc(r)?r:[]):s=r&&ed(r)?r:{},td(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&td(a,{name:n,newValue:i}));return a};const oa=Ai(qE);function rl(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zE(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?KE(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function KE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const xn={basename:HE,dirname:JE,extname:WE,join:QE,sep:"/"};function HE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function JE(e){if(bo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WE(e){bo(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function QE(...e){let t=-1,n;for(;++t<e.length;)bo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":GE(n)}function GE(e){bo(e);const t=e.codePointAt(0)===47;let n=XE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const YE={cwd:ZE};function ZE(){return"/"}function il(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function e1(e){if(typeof e=="string")e=new URL(e);else if(!il(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return t1(e)}function t1(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const sa=["history","path","basename","stem","extname","dirname"];class hh{constructor(t){let n;t?il(t)?n={path:t}:typeof t=="string"||n1(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":YE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sa.length;){const o=sa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)sa.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?xn.basename(this.path):void 0}set basename(t){la(t,"basename"),aa(t,"basename"),this.path=xn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?xn.dirname(this.path):void 0}set dirname(t){rd(this.basename,"dirname"),this.path=xn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?xn.extname(this.path):void 0}set extname(t){if(aa(t,"extname"),rd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){il(t)&&(t=e1(t)),la(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?xn.basename(this.path,this.extname):void 0}set stem(t){la(t,"stem"),aa(t,"stem"),this.path=xn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Et(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function aa(e,t){if(e&&e.includes(xn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+xn.sep+"`")}function la(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function n1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const r1=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},i1={}.hasOwnProperty;class Ql extends r1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zE()}copy(){const t=new Ql;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(oa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(da("data",this.frozen),this.namespace[t]=n,this):i1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(da("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zo(t),r=this.parser||this.Parser;return ua("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ua("process",this.parser||this.Parser),ca("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=zo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);a1(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ua("processSync",this.parser||this.Parser),ca("processSync",this.compiler||this.Compiler),this.process(t,i),od("processSync","process",n),r;function i(o,s){n=!0,Gc(o),r=s}}run(t,n,r){id(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=zo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):s?s(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),od("runSync","run",r),i;function o(s,a){Gc(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=zo(n),i=this.compiler||this.Compiler;return ca("stringify",i),id(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(da("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=oa(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const g=r[h][1];rl(g)&&rl(f)&&(f=oa(!0,g,f)),r[h]=[c,f,...m]}}}}const o1=new Ql().freeze();function ua(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ca(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function da(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function id(e){if(!rl(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function od(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zo(e){return s1(e)?e:new hh(e)}function s1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function a1(e){return typeof e=="string"||l1(e)}function l1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sd=[],ad={allowDangerousHtml:!0},c1=/^(https?|ircs?|mailto|xmpp)$/i,d1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function f1(e){const t=p1(e),n=h1(e);return m1(t.runSync(t.parse(n),n),e)}function p1(e){const t=e.rehypePlugins||sd,n=e.remarkPlugins||sd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ad}:ad;return o1().use(JO).use(n).use($E,r).use(t)}function h1(e){const t=e.children||"",n=new hh;return typeof t=="string"&&(n.value=t),n}function m1(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||g1;for(const u of d1)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+u1+u.id,void 0);return fh(e,c),E0(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in na)if(Object.hasOwn(na,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],g=na[f];(g===null||g.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function g1(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||c1.test(e.slice(0,t))?e:""}const y1="_container_r1dnc_1",v1="_code_r1dnc_9",ld={container:y1,code:v1};function b1({prompt:e}){return p.jsx("div",{className:ld.container,children:p.jsx(f1,{components:{p:({children:t})=>p.jsx(p.Fragment,{children:t}),code:({children:t})=>p.jsx("code",{className:ld.code,children:t})},children:e})})}function Gl({url:e,providerDisplayName:t,credentialName:n,prompt:r}){return p.jsxs("div",{style:{marginBottom:"0.5rem"},children:[p.jsxs("p",{style:{color:"var(--amp-colors-text-muted)",marginBottom:r?"0.25rem":"0rem",lineHeight:"1.5"},children:[p.jsx(Fl,{href:e,newTab:!0,children:p.jsx("span",{style:{textDecoration:"underline"},children:"Learn more"})})," ","about where to find your ",t," ",n,"."]}),r&&p.jsx(b1,{prompt:r})]})}const Ii=Math.min,Ur=Math.max,ms=Math.round,Ko=Math.floor,mr=e=>({x:e,y:e}),w1={left:"right",right:"left",bottom:"top",top:"bottom"},x1={start:"end",end:"start"};function ol(e,t,n){return Ur(e,Ii(t,n))}function wo(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function xo(e){return e.split("-")[1]}function mh(e){return e==="x"?"y":"x"}function Xl(e){return e==="y"?"height":"width"}function Ci(e){return["top","bottom"].includes(Hr(e))?"y":"x"}function Yl(e){return mh(Ci(e))}function I1(e,t,n){n===void 0&&(n=!1);const r=xo(e),i=Yl(e),o=Xl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=gs(s)),[s,gs(s)]}function C1(e){const t=gs(e);return[sl(e),t,sl(t)]}function sl(e){return e.replace(/start|end/g,t=>x1[t])}function S1(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function O1(e,t,n,r){const i=xo(e);let o=S1(Hr(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(sl)))),o}function gs(e){return e.replace(/left|right|bottom|top/g,t=>w1[t])}function E1(e){return{top:0,right:0,bottom:0,left:0,...e}}function gh(e){return typeof e!="number"?E1(e):{top:e,right:e,bottom:e,left:e}}function ys(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ud(e,t,n){let{reference:r,floating:i}=e;const o=Ci(t),s=Yl(t),a=Xl(s),l=Hr(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xo(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1);break}return f}const _1=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ud(c,r,l),h=r,f={},m=0;for(let g=0;g<a.length;g++){const{name:v,fn:w}=a[g],{x:y,y:b,data:x,reset:S}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,d=b??d,f={...f,[v]:{...f[v],...x}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:d}=ud(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function yh(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=wo(t,e),m=gh(f),v=a[h?d==="floating"?"reference":"floating":d],w=ys(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),x=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},S=ys(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(w.top-S.top+m.top)/x.y,bottom:(S.bottom-w.bottom+m.bottom)/x.y,left:(w.left-S.left+m.left)/x.x,right:(S.right-w.right+m.right)/x.x}}const T1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=wo(e,t)||{};if(c==null)return{};const d=gh(u),h={x:n,y:r},f=Yl(i),m=Xl(f),g=await s.getDimensions(c),v=f==="y",w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=o.reference[m]+o.reference[f]-h[f]-o.floating[m],S=h[f]-o.reference[f],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let D=E?E[b]:0;(!D||!await(s.isElement==null?void 0:s.isElement(E)))&&(D=a.floating[b]||o.floating[m]);const N=x/2-S/2,M=D/2-g[m]/2-1,R=Ii(d[w],M),P=Ii(d[y],M),F=R,U=D-g[m]-P,B=D/2-g[m]/2+N,X=ol(F,B,U),se=!l.arrow&&xo(i)!=null&&B!==X&&o.reference[m]/2-(B<F?R:P)-g[m]/2<0,ce=se?B<F?B-F:B-U:0;return{[f]:h[f]+ce,data:{[f]:X,centerOffset:B-X-ce,...se&&{alignmentOffset:ce}},reset:se}}}),N1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=wo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=Hr(i),y=Ci(a),b=Hr(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(b||!g?[gs(a)]:C1(a)),E=m!=="none";!h&&E&&S.push(...O1(a,g,m,x));const D=[a,...S],N=await yh(t,v),M=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&M.push(N[w]),d){const B=I1(i,s,x);M.push(N[B[0]],N[B[1]])}if(R=[...R,{placement:i,overflows:M}],!M.every(B=>B<=0)){var P,F;const B=(((P=o.flip)==null?void 0:P.index)||0)+1,X=D[B];if(X)return{data:{index:B,overflows:R},reset:{placement:X}};let se=(F=R.filter(ce=>ce.overflows[0]<=0).sort((ce,ge)=>ce.overflows[1]-ge.overflows[1])[0])==null?void 0:F.placement;if(!se)switch(f){case"bestFit":{var U;const ce=(U=R.filter(ge=>{if(E){const be=Ci(ge.placement);return be===y||be==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(be=>be>0).reduce((be,I)=>be+I,0)]).sort((ge,be)=>ge[1]-be[1])[0])==null?void 0:U[0];ce&&(se=ce);break}case"initialPlacement":se=a;break}if(i!==se)return{reset:{placement:se}}}return{}}}};async function k1(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Hr(n),a=xo(n),l=Ci(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,d=wo(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const A1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await k1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},R1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:w,y}=v;return{x:w,y}}},...l}=wo(e,t),c={x:n,y:r},u=await yh(t,l),d=Ci(Hr(i)),h=mh(d);let f=c[h],m=c[d];if(o){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=f+u[v],b=f-u[w];f=ol(y,f,b)}if(s){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=m+u[v],b=m-u[w];m=ol(y,m,b)}const g=a.fn({...t,[h]:f,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:o,[d]:s}}}}}};function Ps(){return typeof window<"u"}function Mi(e){return vh(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dn(e){var t;return(t=(vh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vh(e){return Ps()?e instanceof Node||e instanceof Wt(e).Node:!1}function yn(e){return Ps()?e instanceof Element||e instanceof Wt(e).Element:!1}function kn(e){return Ps()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:!1}function cd(e){return!Ps()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}function Io(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function P1(e){return["table","td","th"].includes(Mi(e))}function Fs(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zl(e){const t=eu(),n=yn(e)?vn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function F1(e){let t=gr(e);for(;kn(t)&&!Si(t);){if(Zl(t))return t;if(Fs(t))return null;t=gr(t)}return null}function eu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Si(e){return["html","body","#document"].includes(Mi(e))}function vn(e){return Wt(e).getComputedStyle(e)}function Ds(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gr(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cd(e)&&e.host||Dn(e);return cd(t)?t.host:t}function bh(e){const t=gr(e);return Si(t)?e.ownerDocument?e.ownerDocument.body:e.body:kn(t)&&Io(t)?t:bh(t)}function so(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=bh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Wt(i);if(o){const a=al(s);return t.concat(s,s.visualViewport||[],Io(i)?i:[],a&&n?so(a):[])}return t.concat(i,so(i,[],n))}function al(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wh(e){const t=vn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=kn(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ms(n)!==o||ms(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function tu(e){return yn(e)?e:e.contextElement}function oi(e){const t=tu(e);if(!kn(t))return mr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=wh(t);let s=(o?ms(n.width):n.width)/r,a=(o?ms(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const D1=mr(0);function xh(e){const t=Wt(e);return!eu()||!t.visualViewport?D1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wt(e)?!1:t}function Jr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=tu(e);let s=mr(1);t&&(r?yn(r)&&(s=oi(r)):s=oi(e));const a=M1(o,n,r)?xh(o):mr(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const h=Wt(o),f=r&&yn(r)?Wt(r):r;let m=h,g=al(m);for(;g&&r&&f!==m;){const v=oi(g),w=g.getBoundingClientRect(),y=vn(g),b=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,x=w.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=b,c+=x,m=Wt(g),g=al(m)}}return ys({width:u,height:d,x:l,y:c})}function j1(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Dn(r),a=t?Fs(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=mr(1);const u=mr(0),d=kn(r);if((d||!d&&!o)&&((Mi(r)!=="body"||Io(s))&&(l=Ds(r)),kn(r))){const h=Jr(r);c=oi(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function L1(e){return Array.from(e.getClientRects())}function ll(e,t){const n=Ds(e).scrollLeft;return t?t.left+n:Jr(Dn(e)).left+n}function B1(e){const t=Dn(e),n=Ds(e),r=e.ownerDocument.body,i=Ur(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ur(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ll(e);const a=-n.scrollTop;return vn(r).direction==="rtl"&&(s+=Ur(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function V1(e,t){const n=Wt(e),r=Dn(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=eu();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function U1(e,t){const n=Jr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=kn(e)?oi(e):mr(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function dd(e,t,n){let r;if(t==="viewport")r=V1(e,n);else if(t==="document")r=B1(Dn(e));else if(yn(t))r=U1(t,n);else{const i=xh(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ys(r)}function Ih(e,t){const n=gr(e);return n===t||!yn(n)||Si(n)?!1:vn(n).position==="fixed"||Ih(n,t)}function $1(e,t){const n=t.get(e);if(n)return n;let r=so(e,[],!1).filter(a=>yn(a)&&Mi(a)!=="body"),i=null;const o=vn(e).position==="fixed";let s=o?gr(e):e;for(;yn(s)&&!Si(s);){const a=vn(s),l=Zl(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Io(s)&&!l&&Ih(e,s))?r=r.filter(u=>u!==s):i=a,s=gr(s)}return t.set(e,r),r}function q1(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Fs(t)?[]:$1(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=dd(t,u,i);return c.top=Ur(d.top,c.top),c.right=Ii(d.right,c.right),c.bottom=Ii(d.bottom,c.bottom),c.left=Ur(d.left,c.left),c},dd(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function z1(e){const{width:t,height:n}=wh(e);return{width:t,height:n}}function K1(e,t,n){const r=kn(t),i=Dn(t),o=n==="fixed",s=Jr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=mr(0);if(r||!r&&!o)if((Mi(t)!=="body"||Io(i))&&(a=Ds(t)),r){const f=Jr(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=ll(i));let c=0,u=0;if(i&&!r&&!o){const f=i.getBoundingClientRect();u=f.top+a.scrollTop,c=f.left+a.scrollLeft-ll(i,f)}const d=s.left+a.scrollLeft-l.x-c,h=s.top+a.scrollTop-l.y-u;return{x:d,y:h,width:s.width,height:s.height}}function fa(e){return vn(e).position==="static"}function fd(e,t){if(!kn(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dn(e)===n&&(n=n.ownerDocument.body),n}function Ch(e,t){const n=Wt(e);if(Fs(e))return n;if(!kn(e)){let i=gr(e);for(;i&&!Si(i);){if(yn(i)&&!fa(i))return i;i=gr(i)}return n}let r=fd(e,t);for(;r&&P1(r)&&fa(r);)r=fd(r,t);return r&&Si(r)&&fa(r)&&!Zl(r)?n:r||F1(e)||n}const H1=async function(e){const t=this.getOffsetParent||Ch,n=this.getDimensions,r=await n(e.floating);return{reference:K1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function J1(e){return vn(e).direction==="rtl"}const W1={convertOffsetParentRelativeRectToViewportRelativeRect:j1,getDocumentElement:Dn,getClippingRect:q1,getOffsetParent:Ch,getElementRects:H1,getClientRects:L1,getDimensions:z1,getScale:oi,isElement:yn,isRTL:J1};function Q1(e,t){let n=null,r;const i=Dn(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Ko(u),m=Ko(i.clientWidth-(c+d)),g=Ko(i.clientHeight-(u+h)),v=Ko(c),y={rootMargin:-f+"px "+-m+"px "+-g+"px "+-v+"px",threshold:Ur(0,Ii(1,l))||1};let b=!0;function x(S){const E=S[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return s(!0),o}function G1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=tu(e),u=i||o?[...c?so(c):[],...so(t)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=c&&a?Q1(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let m,g=l?Jr(e):null;l&&v();function v(){const w=Jr(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,m=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),d==null||d(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const X1=A1,Y1=R1,Z1=N1,e_=T1,pd=(e,t,n)=>{const r=new Map,i={platform:W1,...n},o={...i.platform,_c:r};return _1(e,t,{...i,platform:o})};/*
|
|
22
|
+
`}),n}function Jc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wc(e,t){const n=DE(e,t),r=n.one(e,void 0),i=SE(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
23
|
+
`},i),o}function VE(e,t){return e&&"run"in e?async function(n,r){const i=Wc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wc(n,{file:r,...e||t})}}function Qc(e){if(e)throw e}var Zo=Object.prototype.hasOwnProperty,ph=Object.prototype.toString,Gc=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,Yc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ph.call(t)==="[object Array]"},Zc=function(t){if(!t||ph.call(t)!=="[object Object]")return!1;var n=Zo.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Zo.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Zo.call(t,i)},ed=function(t,n){Gc&&n.name==="__proto__"?Gc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},td=function(t,n){if(n==="__proto__")if(Zo.call(t,n)){if(Xc)return Xc(t,n).value}else return;return t[n]},UE=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=td(a,n),i=td(t,n),a!==i&&(u&&i&&(Zc(i)||(o=Yc(i)))?(o?(o=!1,s=r&&Yc(r)?r:[]):s=r&&Zc(r)?r:{},ed(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&ed(a,{name:n,newValue:i}));return a};const ia=Ni(UE);function nl(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $E(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?qE(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function qE(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const xn={basename:zE,dirname:KE,extname:HE,join:JE,sep:"/"};function zE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function KE(e){if(vo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function HE(e){vo(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function JE(...e){let t=-1,n;for(;++t<e.length;)vo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":WE(n)}function WE(e){vo(e);const t=e.codePointAt(0)===47;let n=QE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function QE(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function vo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GE={cwd:XE};function XE(){return"/"}function rl(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YE(e){if(typeof e=="string")e=new URL(e);else if(!rl(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ZE(e)}function ZE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const oa=["history","path","basename","stem","extname","dirname"];class hh{constructor(t){let n;t?rl(t)?n={path:t}:typeof t=="string"||e1(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<oa.length;){const o=oa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)oa.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?xn.basename(this.path):void 0}set basename(t){aa(t,"basename"),sa(t,"basename"),this.path=xn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?xn.dirname(this.path):void 0}set dirname(t){nd(this.basename,"dirname"),this.path=xn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?xn.extname(this.path):void 0}set extname(t){if(sa(t,"extname"),nd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rl(t)&&(t=YE(t)),aa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?xn.basename(this.path,this.extname):void 0}set stem(t){aa(t,"stem"),sa(t,"stem"),this.path=xn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Et(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sa(e,t){if(e&&e.includes(xn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+xn.sep+"`")}function aa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function e1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t1=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},n1={}.hasOwnProperty;class Jl extends t1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$E()}copy(){const t=new Jl;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ia(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ca("data",this.frozen),this.namespace[t]=n,this):n1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ca("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=qo(t),r=this.parser||this.Parser;return la("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),la("process",this.parser||this.Parser),ua("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=qo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);o1(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),la("processSync",this.parser||this.Parser),ua("processSync",this.compiler||this.Compiler),this.process(t,i),id("processSync","process",n),r;function i(o,s){n=!0,Qc(o),r=s}}run(t,n,r){rd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=qo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):s?s(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),id("runSync","run",r),i;function o(s,a){Qc(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=qo(n),i=this.compiler||this.Compiler;return ua("stringify",i),rd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ca("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=ia(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const g=r[h][1];nl(g)&&nl(f)&&(f=ia(!0,g,f)),r[h]=[c,f,...m]}}}}const r1=new Jl().freeze();function la(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ua(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ca(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rd(e){if(!nl(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function id(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qo(e){return i1(e)?e:new hh(e)}function i1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function o1(e){return typeof e=="string"||s1(e)}function s1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",od=[],sd={allowDangerousHtml:!0},l1=/^(https?|ircs?|mailto|xmpp)$/i,u1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function c1(e){const t=d1(e),n=f1(e);return p1(t.runSync(t.parse(n),n),e)}function d1(e){const t=e.rehypePlugins||od,n=e.remarkPlugins||od,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sd}:sd;return r1().use(KO).use(n).use(VE,r).use(t)}function f1(e){const t=e.children||"",n=new hh;return typeof t=="string"&&(n.value=t),n}function p1(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||h1;for(const u of u1)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+a1+u.id,void 0);return fh(e,c),S0(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in ta)if(Object.hasOwn(ta,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],g=ta[f];(g===null||g.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function h1(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||l1.test(e.slice(0,t))?e:""}const m1="_container_r1dnc_1",g1="_code_r1dnc_9",ad={container:m1,code:g1};function y1({prompt:e}){return p.jsx("div",{className:ad.container,children:p.jsx(c1,{components:{p:({children:t})=>p.jsx(p.Fragment,{children:t}),code:({children:t})=>p.jsx("code",{className:ad.code,children:t})},children:e})})}function Wl({url:e,providerDisplayName:t,credentialName:n,prompt:r}){return p.jsxs("div",{style:{marginBottom:"0.5rem"},children:[p.jsxs("p",{style:{color:"var(--amp-colors-text-muted)",marginBottom:r?"0.25rem":"0rem",lineHeight:"1.5"},children:[p.jsx(Rp,{href:e,newTab:!0,children:p.jsx("span",{style:{textDecoration:"underline"},children:"Learn more"})})," ","about where to find your ",t," ",n,"."]}),r&&p.jsx(y1,{prompt:r})]})}const wi=Math.min,Lr=Math.max,hs=Math.round,zo=Math.floor,mr=e=>({x:e,y:e}),v1={left:"right",right:"left",bottom:"top",top:"bottom"},b1={start:"end",end:"start"};function il(e,t,n){return Lr(e,wi(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function qr(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function mh(e){return e==="x"?"y":"x"}function Ql(e){return e==="y"?"height":"width"}function xi(e){return["top","bottom"].includes(qr(e))?"y":"x"}function Gl(e){return mh(xi(e))}function w1(e,t,n){n===void 0&&(n=!1);const r=wo(e),i=Gl(e),o=Ql(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=ms(s)),[s,ms(s)]}function x1(e){const t=ms(e);return[ol(e),t,ol(t)]}function ol(e){return e.replace(/start|end/g,t=>b1[t])}function I1(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function C1(e,t,n,r){const i=wo(e);let o=I1(qr(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(ol)))),o}function ms(e){return e.replace(/left|right|bottom|top/g,t=>v1[t])}function S1(e){return{top:0,right:0,bottom:0,left:0,...e}}function gh(e){return typeof e!="number"?S1(e):{top:e,right:e,bottom:e,left:e}}function gs(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ld(e,t,n){let{reference:r,floating:i}=e;const o=xi(t),s=Gl(t),a=Ql(s),l=qr(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(wo(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1);break}return f}const O1=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ld(c,r,l),h=r,f={},m=0;for(let g=0;g<a.length;g++){const{name:v,fn:w}=a[g],{x:y,y:b,data:x,reset:O}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,d=b??d,f={...f,[v]:{...f[v],...x}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:u,y:d}=ld(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function yh(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=bo(t,e),m=gh(f),v=a[h?d==="floating"?"reference":"floating":d],w=gs(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),x=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},O=gs(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:b,strategy:l}):y);return{top:(w.top-O.top+m.top)/x.y,bottom:(O.bottom-w.bottom+m.bottom)/x.y,left:(w.left-O.left+m.left)/x.x,right:(O.right-w.right+m.right)/x.x}}const E1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=bo(e,t)||{};if(c==null)return{};const d=gh(u),h={x:n,y:r},f=Gl(i),m=Ql(f),g=await s.getDimensions(c),v=f==="y",w=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=o.reference[m]+o.reference[f]-h[f]-o.floating[m],O=h[f]-o.reference[f],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let F=E?E[b]:0;(!F||!await(s.isElement==null?void 0:s.isElement(E)))&&(F=a.floating[b]||o.floating[m]);const N=x/2-O/2,P=F/2-g[m]/2-1,A=wi(d[w],P),D=wi(d[y],P),M=A,z=F-g[m]-D,V=F/2-g[m]/2+N,Y=il(M,V,z),se=!l.arrow&&wo(i)!=null&&V!==Y&&o.reference[m]/2-(V<M?A:D)-g[m]/2<0,ce=se?V<M?V-M:V-z:0;return{[f]:h[f]+ce,data:{[f]:Y,centerOffset:V-Y-ce,...se&&{alignmentOffset:ce}},reset:se}}}),_1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=bo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=qr(i),y=xi(a),b=qr(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=h||(b||!g?[ms(a)]:x1(a)),E=m!=="none";!h&&E&&O.push(...C1(a,g,m,x));const F=[a,...O],N=await yh(t,v),P=[];let A=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(N[w]),d){const V=w1(i,s,x);P.push(N[V[0]],N[V[1]])}if(A=[...A,{placement:i,overflows:P}],!P.every(V=>V<=0)){var D,M;const V=(((D=o.flip)==null?void 0:D.index)||0)+1,Y=F[V];if(Y)return{data:{index:V,overflows:A},reset:{placement:Y}};let se=(M=A.filter(ce=>ce.overflows[0]<=0).sort((ce,ge)=>ce.overflows[1]-ge.overflows[1])[0])==null?void 0:M.placement;if(!se)switch(f){case"bestFit":{var z;const ce=(z=A.filter(ge=>{if(E){const be=xi(ge.placement);return be===y||be==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(be=>be>0).reduce((be,I)=>be+I,0)]).sort((ge,be)=>ge[1]-be[1])[0])==null?void 0:z[0];ce&&(se=ce);break}case"initialPlacement":se=a;break}if(i!==se)return{reset:{placement:se}}}return{}}}};async function T1(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=qr(n),a=wo(n),l=xi(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,d=bo(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const N1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await T1(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},k1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:w,y}=v;return{x:w,y}}},...l}=bo(e,t),c={x:n,y:r},u=await yh(t,l),d=xi(qr(i)),h=mh(d);let f=c[h],m=c[d];if(o){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",y=f+u[v],b=f-u[w];f=il(y,f,b)}if(s){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=m+u[v],b=m-u[w];m=il(y,m,b)}const g=a.fn({...t,[h]:f,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:o,[d]:s}}}}}};function Rs(){return typeof window<"u"}function Di(e){return vh(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pn(e){var t;return(t=(vh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vh(e){return Rs()?e instanceof Node||e instanceof Wt(e).Node:!1}function yn(e){return Rs()?e instanceof Element||e instanceof Wt(e).Element:!1}function Nn(e){return Rs()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:!1}function ud(e){return!Rs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}function xo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function A1(e){return["table","td","th"].includes(Di(e))}function Ps(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Xl(e){const t=Yl(),n=yn(e)?vn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function R1(e){let t=gr(e);for(;Nn(t)&&!Ii(t);){if(Xl(t))return t;if(Ps(t))return null;t=gr(t)}return null}function Yl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ii(e){return["html","body","#document"].includes(Di(e))}function vn(e){return Wt(e).getComputedStyle(e)}function Fs(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gr(e){if(Di(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ud(e)&&e.host||Pn(e);return ud(t)?t.host:t}function bh(e){const t=gr(e);return Ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nn(t)&&xo(t)?t:bh(t)}function so(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=bh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Wt(i);if(o){const a=sl(s);return t.concat(s,s.visualViewport||[],xo(i)?i:[],a&&n?so(a):[])}return t.concat(i,so(i,[],n))}function sl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wh(e){const t=vn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Nn(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=hs(n)!==o||hs(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Zl(e){return yn(e)?e:e.contextElement}function ii(e){const t=Zl(e);if(!Nn(t))return mr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=wh(t);let s=(o?hs(n.width):n.width)/r,a=(o?hs(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const P1=mr(0);function xh(e){const t=Wt(e);return!Yl()||!t.visualViewport?P1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wt(e)?!1:t}function zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Zl(e);let s=mr(1);t&&(r?yn(r)&&(s=ii(r)):s=ii(e));const a=F1(o,n,r)?xh(o):mr(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const h=Wt(o),f=r&&yn(r)?Wt(r):r;let m=h,g=sl(m);for(;g&&r&&f!==m;){const v=ii(g),w=g.getBoundingClientRect(),y=vn(g),b=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,x=w.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=b,c+=x,m=Wt(g),g=sl(m)}}return gs({width:u,height:d,x:l,y:c})}function D1(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Pn(r),a=t?Ps(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=mr(1);const u=mr(0),d=Nn(r);if((d||!d&&!o)&&((Di(r)!=="body"||xo(s))&&(l=Fs(r)),Nn(r))){const h=zr(r);c=ii(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function M1(e){return Array.from(e.getClientRects())}function al(e,t){const n=Fs(e).scrollLeft;return t?t.left+n:zr(Pn(e)).left+n}function j1(e){const t=Pn(e),n=Fs(e),r=e.ownerDocument.body,i=Lr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Lr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+al(e);const a=-n.scrollTop;return vn(r).direction==="rtl"&&(s+=Lr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function L1(e,t){const n=Wt(e),r=Pn(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Yl();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function B1(e,t){const n=zr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Nn(e)?ii(e):mr(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function cd(e,t,n){let r;if(t==="viewport")r=L1(e,n);else if(t==="document")r=j1(Pn(e));else if(yn(t))r=B1(t,n);else{const i=xh(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return gs(r)}function Ih(e,t){const n=gr(e);return n===t||!yn(n)||Ii(n)?!1:vn(n).position==="fixed"||Ih(n,t)}function V1(e,t){const n=t.get(e);if(n)return n;let r=so(e,[],!1).filter(a=>yn(a)&&Di(a)!=="body"),i=null;const o=vn(e).position==="fixed";let s=o?gr(e):e;for(;yn(s)&&!Ii(s);){const a=vn(s),l=Xl(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||xo(s)&&!l&&Ih(e,s))?r=r.filter(u=>u!==s):i=a,s=gr(s)}return t.set(e,r),r}function U1(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Ps(t)?[]:V1(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=cd(t,u,i);return c.top=Lr(d.top,c.top),c.right=wi(d.right,c.right),c.bottom=wi(d.bottom,c.bottom),c.left=Lr(d.left,c.left),c},cd(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $1(e){const{width:t,height:n}=wh(e);return{width:t,height:n}}function q1(e,t,n){const r=Nn(t),i=Pn(t),o=n==="fixed",s=zr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=mr(0);if(r||!r&&!o)if((Di(t)!=="body"||xo(i))&&(a=Fs(t)),r){const f=zr(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=al(i));let c=0,u=0;if(i&&!r&&!o){const f=i.getBoundingClientRect();u=f.top+a.scrollTop,c=f.left+a.scrollLeft-al(i,f)}const d=s.left+a.scrollLeft-l.x-c,h=s.top+a.scrollTop-l.y-u;return{x:d,y:h,width:s.width,height:s.height}}function da(e){return vn(e).position==="static"}function dd(e,t){if(!Nn(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pn(e)===n&&(n=n.ownerDocument.body),n}function Ch(e,t){const n=Wt(e);if(Ps(e))return n;if(!Nn(e)){let i=gr(e);for(;i&&!Ii(i);){if(yn(i)&&!da(i))return i;i=gr(i)}return n}let r=dd(e,t);for(;r&&A1(r)&&da(r);)r=dd(r,t);return r&&Ii(r)&&da(r)&&!Xl(r)?n:r||R1(e)||n}const z1=async function(e){const t=this.getOffsetParent||Ch,n=this.getDimensions,r=await n(e.floating);return{reference:q1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function K1(e){return vn(e).direction==="rtl"}const H1={convertOffsetParentRelativeRectToViewportRelativeRect:D1,getDocumentElement:Pn,getClippingRect:U1,getOffsetParent:Ch,getElementRects:z1,getClientRects:M1,getDimensions:$1,getScale:ii,isElement:yn,isRTL:K1};function J1(e,t){let n=null,r;const i=Pn(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=zo(u),m=zo(i.clientWidth-(c+d)),g=zo(i.clientHeight-(u+h)),v=zo(c),y={rootMargin:-f+"px "+-m+"px "+-g+"px "+-v+"px",threshold:Lr(0,wi(1,l))||1};let b=!0;function x(O){const E=O[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return s(!0),o}function W1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Zl(e),u=i||o?[...c?so(c):[],...so(t)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=c&&a?J1(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let m,g=l?zr(e):null;l&&v();function v(){const w=zr(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,m=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),d==null||d(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const Q1=N1,G1=k1,X1=_1,Y1=E1,fd=(e,t,n)=>{const r=new Map,i={platform:H1,...n},o={...i.platform,_c:r};return O1(e,t,{...i,platform:o})};/*
|
|
24
24
|
* React Tooltip
|
|
25
25
|
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
26
26
|
* @copyright ReactTooltip Team
|
|
27
27
|
* @license MIT
|
|
28
|
-
*/const t_="react-tooltip-core-styles",n_="react-tooltip-base-styles",hd={core:!1,base:!1};function md({css:e,id:t=n_,type:n="base",ref:r}){var i,o;if(!e||typeof document>"u"||hd[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((o=process==null?void 0:process.env)===null||o===void 0)&&o.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=t_),r||(r={});const{insertAt:s}=r;if(document.getElementById(t))return;const a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.id=t,l.type="text/css",s==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e)),hd[n]=!0}const gd=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:o="absolute",middlewares:s=[X1(Number(i)),Z1({fallbackAxisSideDirection:"start"}),Y1({padding:5})],border:a,arrowSize:l=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const c=s;return n?(c.push(e_({element:n,padding:5})),pd(e,t,{placement:r,strategy:o,middleware:c}).then(({x:u,y:d,placement:h,middlewareData:f})=>{var m,g;const v={left:`${u}px`,top:`${d}px`,border:a},{x:w,y}=(m=f.arrow)!==null&&m!==void 0?m:{x:0,y:0},b=(g={top:"bottom",right:"left",bottom:"top",left:"right"}[h.split("-")[0]])!==null&&g!==void 0?g:"bottom",x=a&&{borderBottom:a,borderRight:a};let S=0;if(a){const E=`${a}`.match(/(\d+)px/);S=E!=null&&E[1]?Number(E[1]):1}return{tooltipStyles:v,tooltipArrowStyles:{left:w!=null?`${w}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",...x,[b]:`-${l/2+S}px`},place:h}})):pd(e,t,{placement:"bottom",strategy:o,middleware:c}).then(({x:u,y:d,placement:h})=>({tooltipStyles:{left:`${u}px`,top:`${d}px`},tooltipArrowStyles:{},place:h}))},yd=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),vd=(e,t,n)=>{let r=null;const i=function(...o){const s=()=>{r=null};!r&&(e.apply(this,o),r=setTimeout(s,t))};return i.cancel=()=>{r&&(clearTimeout(r),r=null)},i},bd=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",ul=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((i,o)=>ul(i,t[o]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!bd(e)||!bd(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(i=>ul(e[i],t[i]))},r_=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},wd=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(r_(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},i_=typeof window<"u"?C.useLayoutEffect:C.useEffect,nn=e=>{e.current&&(clearTimeout(e.current),e.current=null)},o_="DEFAULT_TOOLTIP_ID",s_={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},a_=C.createContext({getTooltipData:()=>s_});function Sh(e=o_){return C.useContext(a_).getTooltipData(e)}var ti={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},pa={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const l_=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:i="dark",anchorId:o,anchorSelect:s,place:a="top",offset:l=10,events:c=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:h,wrapper:f,delayShow:m=0,delayHide:g=0,float:v=!1,hidden:w=!1,noArrow:y=!1,clickable:b=!1,closeOnEsc:x=!1,closeOnScroll:S=!1,closeOnResize:E=!1,openEvents:D,closeEvents:N,globalCloseEvents:M,imperativeModeOnly:R,style:P,position:F,afterShow:U,afterHide:B,disableTooltip:X,content:se,contentWrapperRef:ce,isOpen:ge,defaultIsOpen:be=!1,setIsOpen:I,previousActiveAnchor:J,activeAnchor:V,setActiveAnchor:O,border:z,opacity:$,arrowColor:Y,arrowSize:ne=8,role:te="tooltip"})=>{var ae;const Z=C.useRef(null),ye=C.useRef(null),q=C.useRef(null),we=C.useRef(null),ee=C.useRef(null),[Ke,Be]=C.useState({tooltipStyles:{},tooltipArrowStyles:{},place:a}),[Le,tt]=C.useState(!1),[at,lt]=C.useState(!1),[Oe,ft]=C.useState(null),_t=C.useRef(!1),mt=C.useRef(null),{anchorRefs:rt,setActiveAnchor:L}=Sh(t),H=C.useRef(!1),[j,oe]=C.useState([]),ue=C.useRef(!1),Je=u||c.includes("click"),Tt=Je||(D==null?void 0:D.click)||(D==null?void 0:D.dblclick)||(D==null?void 0:D.mousedown),gt=D?{...D}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!D&&Je&&Object.assign(gt,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const wt=N?{...N}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!N&&Je&&Object.assign(wt,{mouseleave:!1,blur:!1,mouseout:!1});const Ve=M?{...M}:{escape:x||!1,scroll:S||!1,resize:E||!1,clickOutsideAnchor:Tt||!1};R&&(Object.assign(gt,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(wt,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ve,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),i_(()=>(ue.current=!0,()=>{ue.current=!1}),[]);const ke=ie=>{ue.current&&(ie&<(!0),setTimeout(()=>{ue.current&&(I==null||I(ie),ge===void 0&&tt(ie))},10))};C.useEffect(()=>{if(t){if(Le){me(J);const de=ie(V),Ne=[...new Set([...de,t])].filter(Boolean).join(" ");V==null||V.setAttribute("aria-describedby",Ne)}else me(V);return()=>{me(V),me(J)}}function ie(de){var Ne;return((Ne=de==null?void 0:de.getAttribute("aria-describedby"))===null||Ne===void 0?void 0:Ne.split(" "))||[]}function me(de){const Ne=ie(de).filter(Ue=>Ue!==t);Ne.length?de==null||de.setAttribute("aria-describedby",Ne.join(" ")):de==null||de.removeAttribute("aria-describedby")}},[V,Le,t,J]),C.useEffect(()=>{if(ge===void 0)return()=>null;ge&<(!0);const ie=setTimeout(()=>{tt(ge)},10);return()=>{clearTimeout(ie)}},[ge]),C.useEffect(()=>{if(Le!==_t.current)if(nn(ee),_t.current=Le,Le)U==null||U();else{const ie=(me=>{const de=me.match(/^([\d.]+)(ms|s)$/);if(!de)return 0;const[,Ne,Ue]=de;return Number(Ne)*(Ue==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ee.current=setTimeout(()=>{lt(!1),ft(null),B==null||B()},ie+25)}},[Le]);const Nt=ie=>{Be(me=>ul(me,ie)?me:ie)},yt=(ie=m)=>{nn(q),at?ke(!0):q.current=setTimeout(()=>{ke(!0)},ie)},Ft=(ie=g)=>{nn(we),we.current=setTimeout(()=>{H.current||ke(!1)},ie)},Wn=ie=>{var me;if(!ie)return;const de=(me=ie.currentTarget)!==null&&me!==void 0?me:ie.target;if(!(de!=null&&de.isConnected))return O(null),void L({current:null});m?yt():ke(!0),O(de),L({current:de}),nn(we)},Qn=()=>{b?Ft(g||100):g?Ft():ke(!1),nn(q)},Gn=({x:ie,y:me})=>{var de;const Ne={getBoundingClientRect:()=>({x:ie,y:me,width:0,height:0,top:me,left:ie,right:ie,bottom:me})};gd({place:(de=Oe==null?void 0:Oe.place)!==null&&de!==void 0?de:a,offset:l,elementReference:Ne,tooltipReference:Z.current,tooltipArrowReference:ye.current,strategy:d,middlewares:h,border:z,arrowSize:ne}).then(Ue=>{Nt(Ue)})},bn=ie=>{if(!ie)return;const me=ie,de={x:me.clientX,y:me.clientY};Gn(de),mt.current=de},cn=ie=>{var me;if(!Le)return;const de=ie.target;de.isConnected&&(!((me=Z.current)===null||me===void 0)&&me.contains(de)||[document.querySelector(`[id='${o}']`),...j].some(Ne=>Ne==null?void 0:Ne.contains(de))||(ke(!1),nn(q)))},Xn=vd(Wn,50),We=vd(Qn,50),ut=ie=>{We.cancel(),Xn(ie)},he=()=>{Xn.cancel(),We()},_e=C.useCallback(()=>{var ie,me;const de=(ie=Oe==null?void 0:Oe.position)!==null&&ie!==void 0?ie:F;de?Gn(de):v?mt.current&&Gn(mt.current):V!=null&&V.isConnected&&gd({place:(me=Oe==null?void 0:Oe.place)!==null&&me!==void 0?me:a,offset:l,elementReference:V,tooltipReference:Z.current,tooltipArrowReference:ye.current,strategy:d,middlewares:h,border:z,arrowSize:ne}).then(Ne=>{ue.current&&Nt(Ne)})},[Le,V,se,P,a,Oe==null?void 0:Oe.place,l,d,F,Oe==null?void 0:Oe.position,v,ne]);C.useEffect(()=>{var ie,me;const de=new Set(rt);j.forEach(Ae=>{X!=null&&X(Ae)||de.add({current:Ae})});const Ne=document.querySelector(`[id='${o}']`);Ne&&!(X!=null&&X(Ne))&&de.add({current:Ne});const Ue=()=>{ke(!1)},Yt=wd(V),Zt=wd(Z.current);Ve.scroll&&(window.addEventListener("scroll",Ue),Yt==null||Yt.addEventListener("scroll",Ue),Zt==null||Zt.addEventListener("scroll",Ue));let vt=null;Ve.resize?window.addEventListener("resize",Ue):V&&Z.current&&(vt=G1(V,Z.current,_e,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const Dt=Ae=>{Ae.key==="Escape"&&ke(!1)};Ve.escape&&window.addEventListener("keydown",Dt),Ve.clickOutsideAnchor&&window.addEventListener("click",cn);const $e=[],xt=Ae=>!!(Ae!=null&&Ae.target&&(V!=null&&V.contains(Ae.target))),qs=Ae=>{Le&&xt(Ae)||Wn(Ae)},zs=Ae=>{Le&&xt(Ae)&&Qn()},_o=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],To=["click","dblclick","mousedown","mouseup"];Object.entries(gt).forEach(([Ae,dn])=>{dn&&(_o.includes(Ae)?$e.push({event:Ae,listener:ut}):To.includes(Ae)&&$e.push({event:Ae,listener:qs}))}),Object.entries(wt).forEach(([Ae,dn])=>{dn&&(_o.includes(Ae)?$e.push({event:Ae,listener:he}):To.includes(Ae)&&$e.push({event:Ae,listener:zs}))}),v&&$e.push({event:"pointermove",listener:bn});const No=()=>{H.current=!0},wn=()=>{H.current=!1,Qn()},ko=b&&(wt.mouseout||wt.mouseleave);return ko&&((ie=Z.current)===null||ie===void 0||ie.addEventListener("mouseover",No),(me=Z.current)===null||me===void 0||me.addEventListener("mouseout",wn)),$e.forEach(({event:Ae,listener:dn})=>{de.forEach(ji=>{var Cr;(Cr=ji.current)===null||Cr===void 0||Cr.addEventListener(Ae,dn)})}),()=>{var Ae,dn;Ve.scroll&&(window.removeEventListener("scroll",Ue),Yt==null||Yt.removeEventListener("scroll",Ue),Zt==null||Zt.removeEventListener("scroll",Ue)),Ve.resize?window.removeEventListener("resize",Ue):vt==null||vt(),Ve.clickOutsideAnchor&&window.removeEventListener("click",cn),Ve.escape&&window.removeEventListener("keydown",Dt),ko&&((Ae=Z.current)===null||Ae===void 0||Ae.removeEventListener("mouseover",No),(dn=Z.current)===null||dn===void 0||dn.removeEventListener("mouseout",wn)),$e.forEach(({event:ji,listener:Cr})=>{de.forEach(Yr=>{var Li;(Li=Yr.current)===null||Li===void 0||Li.removeEventListener(ji,Cr)})})}},[V,_e,at,rt,j,D,N,M,Je,m,g]),C.useEffect(()=>{var ie,me;let de=(me=(ie=Oe==null?void 0:Oe.anchorSelect)!==null&&ie!==void 0?ie:s)!==null&&me!==void 0?me:"";!de&&t&&(de=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const Ne=new MutationObserver(Ue=>{const Yt=[],Zt=[];Ue.forEach(vt=>{if(vt.type==="attributes"&&vt.attributeName==="data-tooltip-id"&&(vt.target.getAttribute("data-tooltip-id")===t?Yt.push(vt.target):vt.oldValue===t&&Zt.push(vt.target)),vt.type==="childList"){if(V){const Dt=[...vt.removedNodes].filter($e=>$e.nodeType===1);if(de)try{Zt.push(...Dt.filter($e=>$e.matches(de))),Zt.push(...Dt.flatMap($e=>[...$e.querySelectorAll(de)]))}catch{}Dt.some($e=>{var xt;return!!(!((xt=$e==null?void 0:$e.contains)===null||xt===void 0)&&xt.call($e,V))&&(lt(!1),ke(!1),O(null),nn(q),nn(we),!0)})}if(de)try{const Dt=[...vt.addedNodes].filter($e=>$e.nodeType===1);Yt.push(...Dt.filter($e=>$e.matches(de))),Yt.push(...Dt.flatMap($e=>[...$e.querySelectorAll(de)]))}catch{}}}),(Yt.length||Zt.length)&&oe(vt=>[...vt.filter(Dt=>!Zt.includes(Dt)),...Yt])});return Ne.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{Ne.disconnect()}},[t,s,Oe==null?void 0:Oe.anchorSelect,V]),C.useEffect(()=>{_e()},[_e]),C.useEffect(()=>{if(!(ce!=null&&ce.current))return()=>null;const ie=new ResizeObserver(()=>{setTimeout(()=>_e())});return ie.observe(ce.current),()=>{ie.disconnect()}},[se,ce==null?void 0:ce.current]),C.useEffect(()=>{var ie;const me=document.querySelector(`[id='${o}']`),de=[...j,me];V&&de.includes(V)||O((ie=j[0])!==null&&ie!==void 0?ie:me)},[o,j,V]),C.useEffect(()=>(be&&ke(!0),()=>{nn(q),nn(we)}),[]),C.useEffect(()=>{var ie;let me=(ie=Oe==null?void 0:Oe.anchorSelect)!==null&&ie!==void 0?ie:s;if(!me&&t&&(me=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),me)try{const de=Array.from(document.querySelectorAll(me));oe(de)}catch{oe([])}},[t,s,Oe==null?void 0:Oe.anchorSelect]),C.useEffect(()=>{q.current&&(nn(q),yt(m))},[m]);const kt=(ae=Oe==null?void 0:Oe.content)!==null&&ae!==void 0?ae:se,Mn=Le&&Object.keys(Ke.tooltipStyles).length>0;return C.useImperativeHandle(e,()=>({open:ie=>{if(ie!=null&&ie.anchorSelect)try{document.querySelector(ie.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${ie.anchorSelect}" is not a valid CSS selector`)}ft(ie??null),ie!=null&&ie.delay?yt(ie.delay):ke(!0)},close:ie=>{ie!=null&&ie.delay?Ft(ie.delay):ke(!1)},activeAnchor:V,place:Ke.place,isOpen:!!(at&&!w&&kt&&Mn)})),at&&!w&&kt?C.createElement(f,{id:t,role:te,className:ln("react-tooltip",ti.tooltip,pa.tooltip,pa[i],n,`react-tooltip__place-${Ke.place}`,ti[Mn?"show":"closing"],Mn?"react-tooltip__show":"react-tooltip__closing",d==="fixed"&&ti.fixed,b&&ti.clickable),onTransitionEnd:ie=>{nn(ee),Le||ie.propertyName!=="opacity"||(lt(!1),ft(null),B==null||B())},style:{...P,...Ke.tooltipStyles,opacity:$!==void 0&&Mn?$:void 0},ref:Z},kt,C.createElement(f,{className:ln("react-tooltip-arrow",ti.arrow,pa.arrow,r,y&&ti.noArrow),style:{...Ke.tooltipArrowStyles,background:Y?`linear-gradient(to right bottom, transparent 50%, ${Y} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ye})):null},u_=({content:e})=>C.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),c_=C.forwardRef(({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:o,className:s,classNameArrow:a,variant:l="dark",place:c="top",offset:u=10,wrapper:d="div",children:h=null,events:f=["hover"],openOnClick:m=!1,positionStrategy:g="absolute",middlewares:v,delayShow:w=0,delayHide:y=0,float:b=!1,hidden:x=!1,noArrow:S=!1,clickable:E=!1,closeOnEsc:D=!1,closeOnScroll:N=!1,closeOnResize:M=!1,openEvents:R,closeEvents:P,globalCloseEvents:F,imperativeModeOnly:U=!1,style:B,position:X,isOpen:se,defaultIsOpen:ce=!1,disableStyleInjection:ge=!1,border:be,opacity:I,arrowColor:J,arrowSize:V,setIsOpen:O,afterShow:z,afterHide:$,disableTooltip:Y,role:ne="tooltip"},te)=>{const[ae,Z]=C.useState(r),[ye,q]=C.useState(i),[we,ee]=C.useState(c),[Ke,Be]=C.useState(l),[Le,tt]=C.useState(u),[at,lt]=C.useState(w),[Oe,ft]=C.useState(y),[_t,mt]=C.useState(b),[rt,L]=C.useState(x),[H,j]=C.useState(d),[oe,ue]=C.useState(f),[Je,Tt]=C.useState(g),[gt,wt]=C.useState(null),[Ve,ke]=C.useState(null),Nt=C.useRef(null),yt=C.useRef(ge),{anchorRefs:Ft,activeAnchor:Wn}=Sh(e),Qn=We=>We==null?void 0:We.getAttributeNames().reduce((ut,he)=>{var _e;return he.startsWith("data-tooltip-")&&(ut[he.replace(/^data-tooltip-/,"")]=(_e=We==null?void 0:We.getAttribute(he))!==null&&_e!==void 0?_e:null),ut},{}),Gn=We=>{const ut={place:he=>{var _e;ee((_e=he)!==null&&_e!==void 0?_e:c)},content:he=>{Z(he??r)},html:he=>{q(he??i)},variant:he=>{var _e;Be((_e=he)!==null&&_e!==void 0?_e:l)},offset:he=>{tt(he===null?u:Number(he))},wrapper:he=>{var _e;j((_e=he)!==null&&_e!==void 0?_e:d)},events:he=>{const _e=he==null?void 0:he.split(" ");ue(_e??f)},"position-strategy":he=>{var _e;Tt((_e=he)!==null&&_e!==void 0?_e:g)},"delay-show":he=>{lt(he===null?w:Number(he))},"delay-hide":he=>{ft(he===null?y:Number(he))},float:he=>{mt(he===null?b:he==="true")},hidden:he=>{L(he===null?x:he==="true")},"class-name":he=>{wt(he)}};Object.values(ut).forEach(he=>he(null)),Object.entries(We).forEach(([he,_e])=>{var kt;(kt=ut[he])===null||kt===void 0||kt.call(ut,_e)})};C.useEffect(()=>{Z(r)},[r]),C.useEffect(()=>{q(i)},[i]),C.useEffect(()=>{ee(c)},[c]),C.useEffect(()=>{Be(l)},[l]),C.useEffect(()=>{tt(u)},[u]),C.useEffect(()=>{lt(w)},[w]),C.useEffect(()=>{ft(y)},[y]),C.useEffect(()=>{mt(b)},[b]),C.useEffect(()=>{L(x)},[x]),C.useEffect(()=>{Tt(g)},[g]),C.useEffect(()=>{yt.current!==ge&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[ge]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:ge==="core",disableBase:ge}}))},[]),C.useEffect(()=>{var We;const ut=new Set(Ft);let he=n;if(!he&&e&&(he=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),he)try{document.querySelectorAll(he).forEach(me=>{ut.add({current:me})})}catch{console.warn(`[react-tooltip] "${he}" is not a valid CSS selector`)}const _e=document.querySelector(`[id='${t}']`);if(_e&&ut.add({current:_e}),!ut.size)return()=>null;const kt=(We=Ve??_e)!==null&&We!==void 0?We:Wn.current,Mn=new MutationObserver(me=>{me.forEach(de=>{var Ne;if(!kt||de.type!=="attributes"||!(!((Ne=de.attributeName)===null||Ne===void 0)&&Ne.startsWith("data-tooltip-")))return;const Ue=Qn(kt);Gn(Ue)})}),ie={attributes:!0,childList:!1,subtree:!1};if(kt){const me=Qn(kt);Gn(me),Mn.observe(kt,ie)}return()=>{Mn.disconnect()}},[Ft,Wn,Ve,t,n]),C.useEffect(()=>{B!=null&&B.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),be&&!yd("border",`${be}`)&&console.warn(`[react-tooltip] "${be}" is not a valid \`border\`.`),B!=null&&B.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),I&&!yd("opacity",`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`opacity\`.`)},[]);let bn=h;const cn=C.useRef(null);if(o){const We=o({content:(Ve==null?void 0:Ve.getAttribute("data-tooltip-content"))||ae||null,activeAnchor:Ve});bn=We?C.createElement("div",{ref:cn,className:"react-tooltip-content-wrapper"},We):null}else ae&&(bn=ae);ye&&(bn=C.createElement(u_,{content:ye}));const Xn={forwardRef:te,id:e,anchorId:t,anchorSelect:n,className:ln(s,gt),classNameArrow:a,content:bn,contentWrapperRef:cn,place:we,variant:Ke,offset:Le,wrapper:H,events:oe,openOnClick:m,positionStrategy:Je,middlewares:v,delayShow:at,delayHide:Oe,float:_t,hidden:rt,noArrow:S,clickable:E,closeOnEsc:D,closeOnScroll:N,closeOnResize:M,openEvents:R,closeEvents:P,globalCloseEvents:F,imperativeModeOnly:U,style:B,position:X,isOpen:se,defaultIsOpen:ce,border:be,opacity:I,arrowColor:J,arrowSize:V,setIsOpen:O,afterShow:z,afterHide:$,disableTooltip:Y,activeAnchor:Ve,previousActiveAnchor:Nt.current,setActiveAnchor:We=>{ke(ut=>(We!=null&&We.isSameNode(ut)||(Nt.current=ut),We))},role:ne};return C.createElement(l_,{...Xn})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||md({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||md({css:`
|
|
29
|
-
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});function d_(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:[p.jsxs("g",{clipPath:"url(#clip0_2896_16290)",children:[p.jsx("path",{d:"M8.00032 11.167L8.00032 7.83366M8.00032 1.83366C4.33366 1.83366 1.33366 4.83366 1.33366 8.50033C1.33366 12.167 4.33366 15.167 8.00033 15.167C11.667 15.167 14.667 12.167 14.667 8.50033C14.667 4.83366 11.667 1.83366 8.00032 1.83366Z",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M8.00293 5.83301L7.99768 5.83301",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2896_16290",children:p.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(16 16.5) rotate(180)"})})})]})}function Oh({id:e,tooltipText:t}){return p.jsxs(p.Fragment,{children:[p.jsx("span",{"data-tooltip-id":e,style:{maxWidth:"20rem"},children:d_()}),p.jsx(c_,{id:e,place:"top",content:t,style:{maxWidth:"30rem"}})]})}function Eh({url:e,prompt:t,inputName:n}){return p.jsx("p",{style:{color:"var(--amp-colors-text-muted)",display:"flex",justifyContent:"space-between"},children:p.jsxs("span",{children:[e?p.jsx(Fl,{href:e,newTab:!0,children:p.jsx("span",{style:{textDecoration:"underline"},children:n})}):p.jsx("span",{children:n})," ",t&&p.jsx(Oh,{id:`docs-helper-text-${HI(n||(t==null?void 0:t.slice(0,50)))}`,tooltipText:t})]})})}const f_="_metadataInputWrapper_1266b_1",p_={metadataInputWrapper:f_};function Co({metadata:e,onChange:t,providerName:n,variant:r="standard"}){return p.jsxs("div",{className:p_.metadataInputWrapper,children:[e.docsURL&&r==="standard"&&p.jsx(Gl,{url:e.docsURL,providerDisplayName:n||"",credentialName:e.displayName||un(e.name.toLowerCase()),prompt:e.prompt}),r==="header"&&p.jsx(Eh,{url:e.docsURL,prompt:e.prompt,inputName:e.displayName||e.name}),p.jsx(_n.Input,{id:e.name,name:e.name,type:"text",placeholder:e.displayName||e.name,onChange:t})]})}function Ms(e,t){const n={},r=[];if(e.forEach(i=>{const o=t[i.name];!o||o.trim()===""?r.push(i.displayName||i.name):n[i.name]={value:o,source:"input"}}),r.length>0)throw new Error(`Please fill in the following required fields: ${r.join(", ")}.`);return n}function Oi(e,t){return e.every(n=>{const r=t[n.name];return r&&r.trim()!==""})}function h_(e,t){const n=t==null?void 0:t.modules;if(!(n&&Object.keys(n).length>0))return{module:"",error:null};const i=e||t.defaultModule;return i?{module:i,error:null}:{module:"",error:`Could not determine module for provider ${t==null?void 0:t.name}`}}function m_(e,t){if(t==="")return e;const n=t.toLowerCase();return e.filter(r=>r.moduleDependencies?Object.keys(r.moduleDependencies).some(i=>i.toLowerCase()===n):!0)}function _h({provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:r,buttonVariant:i,submitButtonType:o,metadataInputs:s}){var w;const[a,l]=C.useState({apiKey:""}),c=y=>{const{name:b,value:x}=y.currentTarget;l(S=>({...S,[b]:x.trim()}))},{apiKey:u}=a,{providerName:d}=Ot(e),h=u.length>0,f=Oi(s,a),m=r||!h||!f,g=(w=t.apiKeyOpts)==null?void 0:w.docsURL,v=()=>{const y=Ms(s,a);n({apiKey:u,providerMetadata:y})};return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[g&&p.jsx(Gl,{url:g,providerDisplayName:d||un(e),credentialName:"API key"}),p.jsx(_n.PasswordInput,{id:"apiKey",name:"apiKey",placeholder:"API Key",onChange:c}),s.map(y=>p.jsx(Co,{metadata:y,onChange:c,providerName:d||un(e)},y.name)),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:m,type:o||"submit",onClick:v,variant:i,children:"Next"})]})}function g_({provider:e,providerInfo:t,handleSubmit:n,error:r,isButtonDisabled:i,metadataInputs:o}){const{providerName:s}=Ot(e);return p.jsxs(wr,{children:[p.jsx(xr,{children:`Set up ${s} integration`}),p.jsx(Fn,{error:r}),p.jsx(_h,{provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:i||!!r,metadataInputs:o})]})}function y_({...e}){return p.jsx(g_,{...e})}const v_={backgroundColor:"var(--amp-colors-status-success-muted)",borderColor:"var(--amp-colors-status-success-muted)",color:"var(--amp-colors-status-success-dark)",padding:".5rem 1rem"};function So({children:e,style:t}){return p.jsx(Hn,{style:{...v_,...t},children:e})}const nu=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...Kn({mutationKey:["updateConnection"],mutationFn:async o=>(await e()).connectionApi.updateConnection(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]}),r(null)}}),errorMsg:n}},b_="_divider_1kmoj_1",xd={divider:b_};function js({className:e,style:t}){return p.jsx("hr",{className:e?`${xd.divider} ${e}`:xd.divider,style:t})}function Gt({string:e}){return p.jsxs("div",{style:{display:"flex",position:"relative",paddingTop:"1rem",paddingBottom:".5rem"},children:[p.jsx("h3",{style:{color:"var(--amp-colors-text-muted)",fontSize:"1rem",fontWeight:"400"},children:e}),p.jsx("div",{style:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"},children:p.jsx(js,{style:{width:"100%",marginLeft:"1rem"}})})]})}function w_({provider:e}){const{projectIdOrName:t}=Ye(),{providerName:n,data:r}=Ot(e),{selectedConnection:i,isConnectionsLoading:o}=Pn(),{mutateAsync:s,isPending:a,error:l}=nu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>h(!1),m=()=>{h(!0),u(null)},g=(l==null?void 0:l.message)||c||null,v=async w=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(i==null?void 0:i.id)||"",updateConnectionRequest:{updateMask:["apiKey"],connection:{apiKey:w.apiKey}}},{onError:y=>{console.error("Update connection error:",y),ot(y,u)},onSuccess:()=>{m()}})}catch(y){console.error("Update connection caught error:",y),ot(y,u)}};return r?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Update ${n} API Key`}),d&&p.jsx(So,{children:"Connection updated successfully"}),g&&p.jsx(yo,{children:`Error updating connection ${g}`}),p.jsx(_h,{provider:r==null?void 0:r.name,providerInfo:r,handleSubmit:v,isButtonDisabled:a||o,buttonVariant:"ghost",submitButtonType:"button",metadataInputs:[]})]})]}):null}function Th({provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:r,buttonVariant:i,metadataInputs:o}){var v;const[s,a]=C.useState({username:"",password:""}),{username:l,password:c}=s,{providerName:u}=Ot(e),d=w=>{const{name:y,value:b}=w.currentTarget;a(x=>({...x,[y]:b.trim()}))},h=Oi(o,s),f=r||!h,m=()=>{const w=Ms(o,s);n({user:l,pass:c,providerMetadata:w})},g=(v=t.basicOpts)==null?void 0:v.docsURL;return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[g&&p.jsx(Gl,{url:g,providerDisplayName:u||un(e),credentialName:"credentials"}),p.jsx(_n.Input,{id:"username",name:"username",type:"text",placeholder:"Username",onChange:d}),p.jsx(_n.PasswordInput,{id:"password",name:"password",placeholder:"Password",onChange:d}),o.map(w=>p.jsx(Co,{metadata:w,onChange:d,providerName:u||un(e)},w.name)),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:f,type:"button",onClick:m,variant:i,children:"Next"})]})}function x_({provider:e,providerInfo:t,handleSubmit:n,error:r,isButtonDisabled:i,metadataInputs:o}){const{providerName:s}=Ot(e);return p.jsxs(wr,{children:[p.jsx(xr,{children:`Set up ${s} integration`}),p.jsx(Fn,{error:r}),p.jsx(Th,{provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:i||!!r,metadataInputs:o})]})}function I_({...e}){return p.jsx(x_,{...e})}function C_({provider:e}){const{projectIdOrName:t}=Ye(),{providerName:n,data:r}=Ot(e),{selectedConnection:i,isConnectionsLoading:o}=Pn(),{mutateAsync:s,isPending:a,error:l}=nu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>h(!1),m=()=>{h(!0),u(null)},g=(l==null?void 0:l.message)||c||null,v=async w=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(i==null?void 0:i.id)||"",updateConnectionRequest:{updateMask:["basicAuth"],connection:{basicAuth:{username:w.user,password:w.pass}}}},{onError:y=>{console.error(y),ot(y,u)},onSuccess:()=>{m()}})}catch(y){console.error(y),ot(y,u)}};return r?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Update ${n} credentials`}),d&&p.jsx(So,{children:"Connection updated successfully"}),g&&p.jsx(yo,{children:`Error updating connection: ${g}`}),p.jsx(Th,{provider:r==null?void 0:r.name,providerInfo:r,handleSubmit:v,isButtonDisabled:a||o,buttonVariant:"ghost",metadataInputs:[]})]})]}):null}function Nh({handleSubmit:e,isButtonDisabled:t,explicitScopesRequired:n,buttonVariant:r,metadataInputs:i,providerName:o}){const[s,a]=C.useState({clientSecret:"",clientId:"",scopes:""}),[l,c]=C.useState(null),u=b=>{const{name:x,value:S}=b.currentTarget;a(E=>({...E,[x]:S.trim()})),c(null)},{clientSecret:d,clientId:h,scopes:f}=s,m=d.length>0,g=h.length>0,v=Oi(i,s),w=t||!m||!g||!v,y=()=>{const b=Ms(i,s),x={clientId:h,clientSecret:d,providerMetadata:b};n&&f.length>0&&(x.scopes=zI(f)),e(x)};return p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[p.jsx(_n.Input,{id:"clientId",name:"clientId",type:"text",placeholder:"Client ID",onChange:u}),p.jsx(_n.PasswordInput,{id:"clientSecret",name:"clientSecret",placeholder:"Client Secret",onChange:u}),n&&p.jsx(_n.Textarea,{name:"scopes",placeholder:"Scopes separated by new line",onChange:u}),i.map(b=>p.jsx(Co,{metadata:b,onChange:u,providerName:o},b.name))]}),p.jsx(Fn,{error:l}),p.jsx("br",{}),p.jsx(Xe,{style:{width:"100%"},disabled:w,type:"button",onClick:y,variant:r,children:"Next"})]})}function S_({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r,explicitScopesRequired:i,metadataInputs:o}){return p.jsxs(wr,{children:[p.jsx(xr,{children:`Set up ${r} integration`}),p.jsx(Fn,{error:t}),p.jsx("br",{}),p.jsx(Nh,{handleSubmit:e,isButtonDisabled:n||!!t,explicitScopesRequired:i,metadataInputs:o,providerName:r})]})}function O_({provider:e}){var y;const{projectIdOrName:t}=Ye(),{selectedConnection:n,isConnectionsLoading:r}=Pn(),{providerName:i,data:o}=Ot(e),{mutateAsync:s,isPending:a,error:l}=nu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>{h(!1)},m=()=>{h(!0),u(null)},g=(y=o==null?void 0:o.oauth2Opts)==null?void 0:y.explicitScopesRequired,v=(l==null?void 0:l.message)||c||null,w=async b=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(n==null?void 0:n.id)||"",updateConnectionRequest:{updateMask:["oauth2ClientCredentials"],connection:{oauth2ClientCredentials:{clientId:b.clientId,clientSecret:b.clientSecret,scopes:b.scopes}}}}),m()}catch(x){ot(x,u)}};return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Re-authenticate to ${i}`}),d&&p.jsx(So,{children:"Connection updated successfully"}),v&&p.jsx(yo,{children:`Error updating connection ${v}`}),p.jsx(Nh,{handleSubmit:w,isButtonDisabled:a||r,explicitScopesRequired:g,buttonVariant:"ghost",metadataInputs:[]})]})]})}const Id=600,Cd=600,E_="AUTHORIZATION_SUCCEEDED",__="AUTHORIZATION_FAILED";function T_(e,t,n,r){return C.useCallback(()=>{if(!r)return;const i=window.screenX+(window.outerWidth-Id)/2,o=window.screenY+(window.outerHeight-Cd)/2.5,s=`width=${Id},height=${Cd},left=${i},top=${o}`,a=window.open(r,e,s);t(a),window.addEventListener("message",n,!1)},[r,e,t,n])}function N_(e,t,n,r){const i=st();return C.useCallback(o=>{var s,a;if(o.origin===Xf){if(o.data.eventType===E_){const l=(s=o.data.data)==null?void 0:s.connection;l?(e(l),i.setQueriesData({queryKey:["amp","connections"]},()=>[l]),t==null||t.close(),r==null||r(),i.invalidateQueries({queryKey:["amp","connections"]})):console.error("Connection ID not found in event data: ",{event:o})}o.data.eventType===__&&(console.error("OAuth failed: ",{event:o}),n==null||n(((a=o==null?void 0:o.data)==null?void 0:a.message)??"Something went wrong, try refreshing this page, and then try again."))}},[t,n,i,e,r])}function k_({children:e,oauthUrl:t,windowTitle:n="Connect to Provider",onError:r,error:i,onSuccessConnect:o,isSuccessConnect:s,onWindowClose:a}){const[l,c]=C.useState(null),[u,d]=C.useState(null),h=st(),f=C.useRef(null),m=N_(c,u,r,o),g=T_(n,d,m,t);C.useEffect(()=>{t&&!u&&!l&&!i&&!s&&(r==null||r(null),g())},[t,u,g,l,i,s,r]);const v=C.useCallback(()=>{h.invalidateQueries({queryKey:["amp","connections"]}),d(null),!l&&!i?console.error("Window closed and no connection was found. Please try again."):l&&(r==null||r(null)),a==null||a()},[l,i,r,a,h]);return C.useEffect(()=>{if(u)return f.current=setInterval(()=>{u!=null&&u.closed&&(f.current&&clearInterval(f.current),f.current=null,v())},500),()=>{f.current&&(clearInterval(f.current),f.current=null),window.removeEventListener("message",m)}},[v,u,m]),p.jsx("div",{children:e})}const A_=()=>{const e=Ct(),t=st();return Kn({mutationKey:["updateOauthConnection"],mutationFn:async n=>!n.projectIdOrName||!n.connectionId?Promise.reject(new Error("Project ID and connection ID are required")):(await e()).oAuthApi.oauthUpdate(n),onSuccess:()=>{t.invalidateQueries({queryKey:["connections"]})}})};function R_({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r}){return p.jsxs("div",{style:{padding:"1rem 0"},children:[p.jsx("p",{children:`Re-authenticate to ${r}`}),p.jsx(Fn,{error:t}),p.jsx(Xe,{variant:"ghost",style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:"Next"})]})}function P_({provider:e}){const{selectedConnection:t,isConnectionsLoading:n}=Pn(),r=t==null?void 0:t.id,i=t==null?void 0:t.projectId,{providerName:o}=Ot(e),{mutateAsync:s,isPending:a,error:l}=A_(),[c,u]=C.useState(null),[d,h]=C.useState(!1),[f,m]=C.useState(null),g=()=>{h(!1)},v=()=>{h(!0),u(null),m(null)},w=(l==null?void 0:l.message)||c||null,y=async()=>{g(),u(null);try{const x=await s({projectIdOrName:i||"",connectionId:r||""});m(x)}catch(x){ot(x,u)}},b=C.useCallback(x=>{u(x)},[]);return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),d&&p.jsx(So,{children:"Connection updated successfully"}),p.jsx(k_,{windowTitle:`Connect to ${o}`,oauthUrl:f||null,onError:b,error:w,isSuccessConnect:d,onSuccessConnect:v,children:p.jsx(R_,{handleSubmit:y,error:w,providerName:o,isButtonDisabled:a||n||d})})]})}function ru({provider:e}){var r;const{data:t}=kp(e);if((t==null?void 0:t.authType)===Ju.Basic)return p.jsx(C_,{provider:e});if((t==null?void 0:t.authType)===Ju.ApiKey)return p.jsx(w_,{provider:e});const n=(r=t==null?void 0:t.oauth2Opts)==null?void 0:r.grantType;if(n){if(n===Qs.AuthorizationCode||n===Qs.AuthorizationCodePkce)return p.jsx(P_,{provider:e});if(n===Qs.ClientCredentials)return p.jsx(O_,{provider:e})}return null}const F_=()=>{const e=Ct(),t=st();return Kn({mutationFn:async({projectIdOrName:n,integrationId:r,installationId:i})=>(await e()).installationApi.deleteInstallation({projectIdOrName:n,integrationId:r,installationId:i}),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]})},onError:n=>{console.error("Error uninstalling installation."),ot(n)}})};function iu({buttonText:e,buttonVariant:t="secondary",buttonStyle:n={}}){const{projectIdOrName:r}=Ye(),{integrationId:i,installation:o,setIntegrationDeleted:s,onUninstallSuccess:a}=St(),[l,c]=C.useState(!1),u=!r||!i||!(o!=null&&o.id)||l,d=F_(),h=async()=>{u||(c(!0),console.warn("uninstalling installation",{projectIdOrName:r,integrationId:i,installationId:o.id}),d.mutate({projectIdOrName:r,integrationId:i,installationId:o.id},{onSuccess:()=>{console.warn("successfully uninstalled installation:",o.id),a==null||a(o==null?void 0:o.id),s()},onSettled:()=>c(!1)}))},f=l?"Uninstalling...":e,m=p.jsx(Xe,{type:"button",onClick:h,disabled:u,variant:t,style:n,children:f});return o!=null&&o.id?m:null}const D_=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...Kn({mutationKey:["deleteConnection"],mutationFn:async o=>(await e()).connectionApi.deleteConnection(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]}),r(null)},onError:o=>{console.error("Error deleting connection"),ot(o,r)}}),errorMsg:n}};function kh({buttonText:e,buttonVariant:t="secondary",buttonStyle:n={},onDisconnectSuccess:r,resetComponent:i,onDisconnectError:o}){const{projectIdOrName:s}=Ye(),{selectedConnection:a}=Pn(),{mutate:l,isPending:c}=D_(),u=!s||!a||!a.id||c,d=async()=>{u||(console.warn("deleting connection",{projectIdOrName:s,connectionId:a==null?void 0:a.id}),l({projectIdOrName:s,connectionId:a==null?void 0:a.id},{onSuccess:()=>{console.warn("successfully deleted connection:",a==null?void 0:a.id),r==null||r(a),i()},onError:m=>{ot(m,o)}}))},h=c?"Pending...":e;return p.jsx(Xe,{type:"button",onClick:d,disabled:u,variant:t,style:n,children:h})}const Ah=C.createContext({hydratedRevision:null,loading:!1,readAction:void 0,writeObjects:[]}),Xr=()=>{const e=C.useContext(Ah);if(!e)throw new Error("useHydratedRevision must be used within a HydratedRevisionProvider");return e};function M_({children:e,resetComponent:t}){const{integrationId:n,integrationObj:r,installation:i}=St(),{isError:o,removeError:s,setError:a}=An(),l=(r==null?void 0:r.name)||n,[c,u]=C.useState(null),[d,h]=C.useState(null),{data:f,isLoading:m,isError:g,error:v,isSuccess:w}=Ts();C.useEffect(()=>{!w&&!g||(g?(a(Ee.HYDRATED_REVISION,l),v&&ot(v,u)):(s(Ee.HYDRATED_REVISION,l),u(null),h(null)))},[g,w,l,a,s,v,u]);const y=C.useMemo(()=>{var S,E,D;return{hydratedRevision:f||null,loading:m,readAction:(S=f==null?void 0:f.content)==null?void 0:S.read,writeObjects:((D=(E=f==null?void 0:f.content)==null?void 0:E.write)==null?void 0:D.objects)||[]}},[f,m]),b=(r==null?void 0:r.provider)||"provider",x=(r==null?void 0:r.name)||n||"unknown integration";if(o(Ee.HYDRATED_REVISION,l)){const S=`${c?un(c):`Error retrieving objects from ${b} or integration details for ${x}`}`;return p.jsx(Vt,{message:S,children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",paddingTop:"1rem",width:"100%"},children:[p.jsx(ru,{provider:b}),i?p.jsx("p",{children:"If authentication is failing, please try reauthenticating using the section above before uninstalling the integration."}):p.jsx("p",{children:"If authentication is failing, please try reauthenticating using the section above before deleting and recreating the connection."}),d&&p.jsx(Zf,{message:d}),i?p.jsx(iu,{buttonText:"Uninstall",buttonVariant:"danger"}):p.jsx(kh,{buttonText:"Delete Connection",resetComponent:t,buttonVariant:"danger",onDisconnectError:E=>h(E)})]})})}return m?p.jsx(Pi,{}):p.jsx(Ah.Provider,{value:y,children:e})}const Rh=C.createContext(null);function ou(){const e=C.useContext(Rh);if(e===null)throw new Error("useSelectedNavObjectName must be used within a SelectedNavObjectNameProvider");return{selectedObjectName:e}}const Ph=C.createContext(()=>{});function j_(){const e=C.useContext(Ph);if(!e)throw new Error("useSetNextTabIndex must be used within a NextTabIndexProvider");return{onNextIncompleteTab:e}}const Fh=C.createContext(void 0),L_={};function su(){const e=C.useContext(Fh);if(!e)throw new Error("useObjectsConfigureState must be used within a ConfigurationProvider");return e}function B_({children:e}){const{installation:t}=St(),{hydratedRevision:n,loading:r}=Xr(),[i,o]=C.useState(L_),s=t==null?void 0:t.config;C.useEffect(()=>{n!=null&&n.content&&!r&&s&&!(Object.entries(i).length>0)&&lC(n,s,o)},[n,r,s,i]);const a=C.useCallback((u,d)=>{o(h=>Kt(h,f=>{f[u]=Kt(f[u],d)}))},[o]),l=C.useCallback((u,d)=>{o(h=>Kt(h,f=>{f[u]=d}))},[o]),c=C.useMemo(()=>({objectConfigurationsState:i,setObjectConfigurationsState:o,setConfigureState:a,resetConfigureState:l}),[i,l,a]);return p.jsx(Fh.Provider,{value:c,children:e})}const Xt=()=>{const{appName:e}=yr(),{objectConfigurationsState:t,setConfigureState:n}=su(),{selectedObjectName:r}=ou(),i=_p(r||"",t);return{appName:e,configureState:i,setConfigureState:n,selectedObjectName:r}},Dh=()=>{var i,o,s;const{hydratedRevision:e}=Xr(),{selectedObjectName:t}=ou(),n=(s=(o=(i=e==null?void 0:e.content)==null?void 0:i.read)==null?void 0:o.objects)==null?void 0:s.find(a=>a.objectName===t),r=(n==null?void 0:n.displayName)||t&&un(t);return{selectedObject:n,displayName:r}};function Mh(){const{projectIdOrName:e}=Ye(),{integrationNameOrId:t}=vr(),{data:n}=Qr(t),{installation:r}=Rn(),{mutate:i,isIdle:o,isPending:s,error:a,errorMsg:l}=ap();return{toggleReadingObject:({objectName:u,disabled:d,onSuccess:h,onError:f,onSettled:m})=>{var w,y,b,x;if(!r){const S=new Error("Installation not created yet. Try creating the installation first.");f==null||f(S),m==null||m();return}if(!n){const S=new Error("No integration found");f==null||f(S),m==null||m();return}if(!((x=(b=(y=(w=r==null?void 0:r.config)==null?void 0:w.content)==null?void 0:y.read)==null?void 0:b.objects)!=null&&x[u])){const S=new Error(`Object "${u}" not found in installation read configuration`);f==null||f(S),m==null||m();return}const g=[`config.content.read.objects.${u}.disabled`],v={projectIdOrName:e,integrationId:n.id,installationId:r.id,installationUpdate:{updateMask:g,installation:{config:{content:{read:{objects:{[u]:{disabled:d}}}}}}}};return i(v,{onSuccess:S=>{h==null||h(S)},onError:S=>{f==null||f(S)},onSettled:()=>{m==null||m()}})},isIdle:o,isPending:s,error:a,errorMsg:l}}function V_(){var u,d,h,f;const{installation:e}=Rn(),[t,n]=C.useState(!1),{selectedObjectName:r}=Xt(),{displayName:i}=Dh(),{toggleReadingObject:o,isPending:s}=Mh(),a=r?(f=(h=(d=(u=e==null?void 0:e.config)==null?void 0:u.content)==null?void 0:d.read)==null?void 0:h.objects)==null?void 0:f[r]:void 0;if(!a||a.disabled)return null;const c=()=>{r&&o({objectName:r,disabled:!0,onSuccess:()=>{n(!1)},onError:m=>{console.error("Error stopping read from object:",m)}})};return t?p.jsxs(p.Fragment,{children:[p.jsxs("p",{style:{padding:"1rem 0",color:"var(--amp-colors-text-muted)",fontSize:"0.875rem"},children:["Are you sure you want to stop reading from"," ",p.jsx("b",{children:i}),"?"]}),p.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[p.jsx(Xe,{type:"button",variant:"ghost",style:{flex:1},onClick:()=>n(!1),children:"Cancel"}),p.jsx(Xe,{type:"button",variant:"danger",style:{flex:1},onClick:c,disabled:s,children:s?"Stopping...":"Stop reading"})]})]}):p.jsxs("button",{type:"button",onClick:()=>n(!0),style:{background:"none",border:"none",cursor:"pointer",textDecoration:"underline",paddingTop:"1rem",margin:0,fontFamily:"inherit",color:"var(--amp-colors-text-muted)"},children:["Stop reading from ",p.jsx("b",{children:i})]})}function qn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(null,arguments)}function cl(e,t){return cl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},cl(e,t)}function U_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cl(e,t)}var dl={exports:{}},Ho={exports:{}},Pe={};/** @license React v16.13.1
|
|
28
|
+
*/const Z1="react-tooltip-core-styles",e_="react-tooltip-base-styles",pd={core:!1,base:!1};function hd({css:e,id:t=e_,type:n="base",ref:r}){var i,o;if(!e||typeof document>"u"||pd[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((o=process==null?void 0:process.env)===null||o===void 0)&&o.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=Z1),r||(r={});const{insertAt:s}=r;if(document.getElementById(t))return;const a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.id=t,l.type="text/css",s==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e)),pd[n]=!0}const md=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:o="absolute",middlewares:s=[Q1(Number(i)),X1({fallbackAxisSideDirection:"start"}),G1({padding:5})],border:a,arrowSize:l=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const c=s;return n?(c.push(Y1({element:n,padding:5})),fd(e,t,{placement:r,strategy:o,middleware:c}).then(({x:u,y:d,placement:h,middlewareData:f})=>{var m,g;const v={left:`${u}px`,top:`${d}px`,border:a},{x:w,y}=(m=f.arrow)!==null&&m!==void 0?m:{x:0,y:0},b=(g={top:"bottom",right:"left",bottom:"top",left:"right"}[h.split("-")[0]])!==null&&g!==void 0?g:"bottom",x=a&&{borderBottom:a,borderRight:a};let O=0;if(a){const E=`${a}`.match(/(\d+)px/);O=E!=null&&E[1]?Number(E[1]):1}return{tooltipStyles:v,tooltipArrowStyles:{left:w!=null?`${w}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",...x,[b]:`-${l/2+O}px`},place:h}})):fd(e,t,{placement:"bottom",strategy:o,middleware:c}).then(({x:u,y:d,placement:h})=>({tooltipStyles:{left:`${u}px`,top:`${d}px`},tooltipArrowStyles:{},place:h}))},gd=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),yd=(e,t,n)=>{let r=null;const i=function(...o){const s=()=>{r=null};!r&&(e.apply(this,o),r=setTimeout(s,t))};return i.cancel=()=>{r&&(clearTimeout(r),r=null)},i},vd=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",ll=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((i,o)=>ll(i,t[o]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!vd(e)||!vd(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(i=>ll(e[i],t[i]))},t_=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},bd=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(t_(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},n_=typeof window<"u"?C.useLayoutEffect:C.useEffect,nn=e=>{e.current&&(clearTimeout(e.current),e.current=null)},r_="DEFAULT_TOOLTIP_ID",i_={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},o_=C.createContext({getTooltipData:()=>i_});function Sh(e=r_){return C.useContext(o_).getTooltipData(e)}var ei={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},fa={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const s_=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:i="dark",anchorId:o,anchorSelect:s,place:a="top",offset:l=10,events:c=["hover"],openOnClick:u=!1,positionStrategy:d="absolute",middlewares:h,wrapper:f,delayShow:m=0,delayHide:g=0,float:v=!1,hidden:w=!1,noArrow:y=!1,clickable:b=!1,closeOnEsc:x=!1,closeOnScroll:O=!1,closeOnResize:E=!1,openEvents:F,closeEvents:N,globalCloseEvents:P,imperativeModeOnly:A,style:D,position:M,afterShow:z,afterHide:V,disableTooltip:Y,content:se,contentWrapperRef:ce,isOpen:ge,defaultIsOpen:be=!1,setIsOpen:I,previousActiveAnchor:J,activeAnchor:B,setActiveAnchor:S,border:q,opacity:U,arrowColor:X,arrowSize:ne=8,role:te="tooltip"})=>{var ae;const Z=C.useRef(null),ye=C.useRef(null),$=C.useRef(null),we=C.useRef(null),ee=C.useRef(null),[Ke,Be]=C.useState({tooltipStyles:{},tooltipArrowStyles:{},place:a}),[Le,tt]=C.useState(!1),[at,lt]=C.useState(!1),[Oe,ft]=C.useState(null),_t=C.useRef(!1),mt=C.useRef(null),{anchorRefs:rt,setActiveAnchor:L}=Sh(t),H=C.useRef(!1),[j,oe]=C.useState([]),ue=C.useRef(!1),Je=u||c.includes("click"),Tt=Je||(F==null?void 0:F.click)||(F==null?void 0:F.dblclick)||(F==null?void 0:F.mousedown),gt=F?{...F}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!F&&Je&&Object.assign(gt,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const wt=N?{...N}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!N&&Je&&Object.assign(wt,{mouseleave:!1,blur:!1,mouseout:!1});const Ve=P?{...P}:{escape:x||!1,scroll:O||!1,resize:E||!1,clickOutsideAnchor:Tt||!1};A&&(Object.assign(gt,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(wt,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ve,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),n_(()=>(ue.current=!0,()=>{ue.current=!1}),[]);const ke=ie=>{ue.current&&(ie&<(!0),setTimeout(()=>{ue.current&&(I==null||I(ie),ge===void 0&&tt(ie))},10))};C.useEffect(()=>{if(t){if(Le){me(J);const de=ie(B),Ne=[...new Set([...de,t])].filter(Boolean).join(" ");B==null||B.setAttribute("aria-describedby",Ne)}else me(B);return()=>{me(B),me(J)}}function ie(de){var Ne;return((Ne=de==null?void 0:de.getAttribute("aria-describedby"))===null||Ne===void 0?void 0:Ne.split(" "))||[]}function me(de){const Ne=ie(de).filter(Ue=>Ue!==t);Ne.length?de==null||de.setAttribute("aria-describedby",Ne.join(" ")):de==null||de.removeAttribute("aria-describedby")}},[B,Le,t,J]),C.useEffect(()=>{if(ge===void 0)return()=>null;ge&<(!0);const ie=setTimeout(()=>{tt(ge)},10);return()=>{clearTimeout(ie)}},[ge]),C.useEffect(()=>{if(Le!==_t.current)if(nn(ee),_t.current=Le,Le)z==null||z();else{const ie=(me=>{const de=me.match(/^([\d.]+)(ms|s)$/);if(!de)return 0;const[,Ne,Ue]=de;return Number(Ne)*(Ue==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ee.current=setTimeout(()=>{lt(!1),ft(null),V==null||V()},ie+25)}},[Le]);const Nt=ie=>{Be(me=>ll(me,ie)?me:ie)},yt=(ie=m)=>{nn($),at?ke(!0):$.current=setTimeout(()=>{ke(!0)},ie)},Ft=(ie=g)=>{nn(we),we.current=setTimeout(()=>{H.current||ke(!1)},ie)},Wn=ie=>{var me;if(!ie)return;const de=(me=ie.currentTarget)!==null&&me!==void 0?me:ie.target;if(!(de!=null&&de.isConnected))return S(null),void L({current:null});m?yt():ke(!0),S(de),L({current:de}),nn(we)},Qn=()=>{b?Ft(g||100):g?Ft():ke(!1),nn($)},Gn=({x:ie,y:me})=>{var de;const Ne={getBoundingClientRect:()=>({x:ie,y:me,width:0,height:0,top:me,left:ie,right:ie,bottom:me})};md({place:(de=Oe==null?void 0:Oe.place)!==null&&de!==void 0?de:a,offset:l,elementReference:Ne,tooltipReference:Z.current,tooltipArrowReference:ye.current,strategy:d,middlewares:h,border:q,arrowSize:ne}).then(Ue=>{Nt(Ue)})},bn=ie=>{if(!ie)return;const me=ie,de={x:me.clientX,y:me.clientY};Gn(de),mt.current=de},cn=ie=>{var me;if(!Le)return;const de=ie.target;de.isConnected&&(!((me=Z.current)===null||me===void 0)&&me.contains(de)||[document.querySelector(`[id='${o}']`),...j].some(Ne=>Ne==null?void 0:Ne.contains(de))||(ke(!1),nn($)))},Xn=yd(Wn,50),We=yd(Qn,50),ut=ie=>{We.cancel(),Xn(ie)},he=()=>{Xn.cancel(),We()},_e=C.useCallback(()=>{var ie,me;const de=(ie=Oe==null?void 0:Oe.position)!==null&&ie!==void 0?ie:M;de?Gn(de):v?mt.current&&Gn(mt.current):B!=null&&B.isConnected&&md({place:(me=Oe==null?void 0:Oe.place)!==null&&me!==void 0?me:a,offset:l,elementReference:B,tooltipReference:Z.current,tooltipArrowReference:ye.current,strategy:d,middlewares:h,border:q,arrowSize:ne}).then(Ne=>{ue.current&&Nt(Ne)})},[Le,B,se,D,a,Oe==null?void 0:Oe.place,l,d,M,Oe==null?void 0:Oe.position,v,ne]);C.useEffect(()=>{var ie,me;const de=new Set(rt);j.forEach(Ae=>{Y!=null&&Y(Ae)||de.add({current:Ae})});const Ne=document.querySelector(`[id='${o}']`);Ne&&!(Y!=null&&Y(Ne))&&de.add({current:Ne});const Ue=()=>{ke(!1)},Yt=bd(B),Zt=bd(Z.current);Ve.scroll&&(window.addEventListener("scroll",Ue),Yt==null||Yt.addEventListener("scroll",Ue),Zt==null||Zt.addEventListener("scroll",Ue));let vt=null;Ve.resize?window.addEventListener("resize",Ue):B&&Z.current&&(vt=W1(B,Z.current,_e,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const Dt=Ae=>{Ae.key==="Escape"&&ke(!1)};Ve.escape&&window.addEventListener("keydown",Dt),Ve.clickOutsideAnchor&&window.addEventListener("click",cn);const $e=[],xt=Ae=>!!(Ae!=null&&Ae.target&&(B!=null&&B.contains(Ae.target))),$s=Ae=>{Le&&xt(Ae)||Wn(Ae)},qs=Ae=>{Le&&xt(Ae)&&Qn()},Eo=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],_o=["click","dblclick","mousedown","mouseup"];Object.entries(gt).forEach(([Ae,dn])=>{dn&&(Eo.includes(Ae)?$e.push({event:Ae,listener:ut}):_o.includes(Ae)&&$e.push({event:Ae,listener:$s}))}),Object.entries(wt).forEach(([Ae,dn])=>{dn&&(Eo.includes(Ae)?$e.push({event:Ae,listener:he}):_o.includes(Ae)&&$e.push({event:Ae,listener:qs}))}),v&&$e.push({event:"pointermove",listener:bn});const To=()=>{H.current=!0},wn=()=>{H.current=!1,Qn()},No=b&&(wt.mouseout||wt.mouseleave);return No&&((ie=Z.current)===null||ie===void 0||ie.addEventListener("mouseover",To),(me=Z.current)===null||me===void 0||me.addEventListener("mouseout",wn)),$e.forEach(({event:Ae,listener:dn})=>{de.forEach(Mi=>{var wr;(wr=Mi.current)===null||wr===void 0||wr.addEventListener(Ae,dn)})}),()=>{var Ae,dn;Ve.scroll&&(window.removeEventListener("scroll",Ue),Yt==null||Yt.removeEventListener("scroll",Ue),Zt==null||Zt.removeEventListener("scroll",Ue)),Ve.resize?window.removeEventListener("resize",Ue):vt==null||vt(),Ve.clickOutsideAnchor&&window.removeEventListener("click",cn),Ve.escape&&window.removeEventListener("keydown",Dt),No&&((Ae=Z.current)===null||Ae===void 0||Ae.removeEventListener("mouseover",To),(dn=Z.current)===null||dn===void 0||dn.removeEventListener("mouseout",wn)),$e.forEach(({event:Mi,listener:wr})=>{de.forEach(Xr=>{var ji;(ji=Xr.current)===null||ji===void 0||ji.removeEventListener(Mi,wr)})})}},[B,_e,at,rt,j,F,N,P,Je,m,g]),C.useEffect(()=>{var ie,me;let de=(me=(ie=Oe==null?void 0:Oe.anchorSelect)!==null&&ie!==void 0?ie:s)!==null&&me!==void 0?me:"";!de&&t&&(de=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const Ne=new MutationObserver(Ue=>{const Yt=[],Zt=[];Ue.forEach(vt=>{if(vt.type==="attributes"&&vt.attributeName==="data-tooltip-id"&&(vt.target.getAttribute("data-tooltip-id")===t?Yt.push(vt.target):vt.oldValue===t&&Zt.push(vt.target)),vt.type==="childList"){if(B){const Dt=[...vt.removedNodes].filter($e=>$e.nodeType===1);if(de)try{Zt.push(...Dt.filter($e=>$e.matches(de))),Zt.push(...Dt.flatMap($e=>[...$e.querySelectorAll(de)]))}catch{}Dt.some($e=>{var xt;return!!(!((xt=$e==null?void 0:$e.contains)===null||xt===void 0)&&xt.call($e,B))&&(lt(!1),ke(!1),S(null),nn($),nn(we),!0)})}if(de)try{const Dt=[...vt.addedNodes].filter($e=>$e.nodeType===1);Yt.push(...Dt.filter($e=>$e.matches(de))),Yt.push(...Dt.flatMap($e=>[...$e.querySelectorAll(de)]))}catch{}}}),(Yt.length||Zt.length)&&oe(vt=>[...vt.filter(Dt=>!Zt.includes(Dt)),...Yt])});return Ne.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{Ne.disconnect()}},[t,s,Oe==null?void 0:Oe.anchorSelect,B]),C.useEffect(()=>{_e()},[_e]),C.useEffect(()=>{if(!(ce!=null&&ce.current))return()=>null;const ie=new ResizeObserver(()=>{setTimeout(()=>_e())});return ie.observe(ce.current),()=>{ie.disconnect()}},[se,ce==null?void 0:ce.current]),C.useEffect(()=>{var ie;const me=document.querySelector(`[id='${o}']`),de=[...j,me];B&&de.includes(B)||S((ie=j[0])!==null&&ie!==void 0?ie:me)},[o,j,B]),C.useEffect(()=>(be&&ke(!0),()=>{nn($),nn(we)}),[]),C.useEffect(()=>{var ie;let me=(ie=Oe==null?void 0:Oe.anchorSelect)!==null&&ie!==void 0?ie:s;if(!me&&t&&(me=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),me)try{const de=Array.from(document.querySelectorAll(me));oe(de)}catch{oe([])}},[t,s,Oe==null?void 0:Oe.anchorSelect]),C.useEffect(()=>{$.current&&(nn($),yt(m))},[m]);const kt=(ae=Oe==null?void 0:Oe.content)!==null&&ae!==void 0?ae:se,Fn=Le&&Object.keys(Ke.tooltipStyles).length>0;return C.useImperativeHandle(e,()=>({open:ie=>{if(ie!=null&&ie.anchorSelect)try{document.querySelector(ie.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${ie.anchorSelect}" is not a valid CSS selector`)}ft(ie??null),ie!=null&&ie.delay?yt(ie.delay):ke(!0)},close:ie=>{ie!=null&&ie.delay?Ft(ie.delay):ke(!1)},activeAnchor:B,place:Ke.place,isOpen:!!(at&&!w&&kt&&Fn)})),at&&!w&&kt?C.createElement(f,{id:t,role:te,className:ln("react-tooltip",ei.tooltip,fa.tooltip,fa[i],n,`react-tooltip__place-${Ke.place}`,ei[Fn?"show":"closing"],Fn?"react-tooltip__show":"react-tooltip__closing",d==="fixed"&&ei.fixed,b&&ei.clickable),onTransitionEnd:ie=>{nn(ee),Le||ie.propertyName!=="opacity"||(lt(!1),ft(null),V==null||V())},style:{...D,...Ke.tooltipStyles,opacity:U!==void 0&&Fn?U:void 0},ref:Z},kt,C.createElement(f,{className:ln("react-tooltip-arrow",ei.arrow,fa.arrow,r,y&&ei.noArrow),style:{...Ke.tooltipArrowStyles,background:X?`linear-gradient(to right bottom, transparent 50%, ${X} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ye})):null},a_=({content:e})=>C.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),l_=C.forwardRef(({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:o,className:s,classNameArrow:a,variant:l="dark",place:c="top",offset:u=10,wrapper:d="div",children:h=null,events:f=["hover"],openOnClick:m=!1,positionStrategy:g="absolute",middlewares:v,delayShow:w=0,delayHide:y=0,float:b=!1,hidden:x=!1,noArrow:O=!1,clickable:E=!1,closeOnEsc:F=!1,closeOnScroll:N=!1,closeOnResize:P=!1,openEvents:A,closeEvents:D,globalCloseEvents:M,imperativeModeOnly:z=!1,style:V,position:Y,isOpen:se,defaultIsOpen:ce=!1,disableStyleInjection:ge=!1,border:be,opacity:I,arrowColor:J,arrowSize:B,setIsOpen:S,afterShow:q,afterHide:U,disableTooltip:X,role:ne="tooltip"},te)=>{const[ae,Z]=C.useState(r),[ye,$]=C.useState(i),[we,ee]=C.useState(c),[Ke,Be]=C.useState(l),[Le,tt]=C.useState(u),[at,lt]=C.useState(w),[Oe,ft]=C.useState(y),[_t,mt]=C.useState(b),[rt,L]=C.useState(x),[H,j]=C.useState(d),[oe,ue]=C.useState(f),[Je,Tt]=C.useState(g),[gt,wt]=C.useState(null),[Ve,ke]=C.useState(null),Nt=C.useRef(null),yt=C.useRef(ge),{anchorRefs:Ft,activeAnchor:Wn}=Sh(e),Qn=We=>We==null?void 0:We.getAttributeNames().reduce((ut,he)=>{var _e;return he.startsWith("data-tooltip-")&&(ut[he.replace(/^data-tooltip-/,"")]=(_e=We==null?void 0:We.getAttribute(he))!==null&&_e!==void 0?_e:null),ut},{}),Gn=We=>{const ut={place:he=>{var _e;ee((_e=he)!==null&&_e!==void 0?_e:c)},content:he=>{Z(he??r)},html:he=>{$(he??i)},variant:he=>{var _e;Be((_e=he)!==null&&_e!==void 0?_e:l)},offset:he=>{tt(he===null?u:Number(he))},wrapper:he=>{var _e;j((_e=he)!==null&&_e!==void 0?_e:d)},events:he=>{const _e=he==null?void 0:he.split(" ");ue(_e??f)},"position-strategy":he=>{var _e;Tt((_e=he)!==null&&_e!==void 0?_e:g)},"delay-show":he=>{lt(he===null?w:Number(he))},"delay-hide":he=>{ft(he===null?y:Number(he))},float:he=>{mt(he===null?b:he==="true")},hidden:he=>{L(he===null?x:he==="true")},"class-name":he=>{wt(he)}};Object.values(ut).forEach(he=>he(null)),Object.entries(We).forEach(([he,_e])=>{var kt;(kt=ut[he])===null||kt===void 0||kt.call(ut,_e)})};C.useEffect(()=>{Z(r)},[r]),C.useEffect(()=>{$(i)},[i]),C.useEffect(()=>{ee(c)},[c]),C.useEffect(()=>{Be(l)},[l]),C.useEffect(()=>{tt(u)},[u]),C.useEffect(()=>{lt(w)},[w]),C.useEffect(()=>{ft(y)},[y]),C.useEffect(()=>{mt(b)},[b]),C.useEffect(()=>{L(x)},[x]),C.useEffect(()=>{Tt(g)},[g]),C.useEffect(()=>{yt.current!==ge&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[ge]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:ge==="core",disableBase:ge}}))},[]),C.useEffect(()=>{var We;const ut=new Set(Ft);let he=n;if(!he&&e&&(he=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),he)try{document.querySelectorAll(he).forEach(me=>{ut.add({current:me})})}catch{console.warn(`[react-tooltip] "${he}" is not a valid CSS selector`)}const _e=document.querySelector(`[id='${t}']`);if(_e&&ut.add({current:_e}),!ut.size)return()=>null;const kt=(We=Ve??_e)!==null&&We!==void 0?We:Wn.current,Fn=new MutationObserver(me=>{me.forEach(de=>{var Ne;if(!kt||de.type!=="attributes"||!(!((Ne=de.attributeName)===null||Ne===void 0)&&Ne.startsWith("data-tooltip-")))return;const Ue=Qn(kt);Gn(Ue)})}),ie={attributes:!0,childList:!1,subtree:!1};if(kt){const me=Qn(kt);Gn(me),Fn.observe(kt,ie)}return()=>{Fn.disconnect()}},[Ft,Wn,Ve,t,n]),C.useEffect(()=>{V!=null&&V.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),be&&!gd("border",`${be}`)&&console.warn(`[react-tooltip] "${be}" is not a valid \`border\`.`),V!=null&&V.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),I&&!gd("opacity",`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`opacity\`.`)},[]);let bn=h;const cn=C.useRef(null);if(o){const We=o({content:(Ve==null?void 0:Ve.getAttribute("data-tooltip-content"))||ae||null,activeAnchor:Ve});bn=We?C.createElement("div",{ref:cn,className:"react-tooltip-content-wrapper"},We):null}else ae&&(bn=ae);ye&&(bn=C.createElement(a_,{content:ye}));const Xn={forwardRef:te,id:e,anchorId:t,anchorSelect:n,className:ln(s,gt),classNameArrow:a,content:bn,contentWrapperRef:cn,place:we,variant:Ke,offset:Le,wrapper:H,events:oe,openOnClick:m,positionStrategy:Je,middlewares:v,delayShow:at,delayHide:Oe,float:_t,hidden:rt,noArrow:O,clickable:E,closeOnEsc:F,closeOnScroll:N,closeOnResize:P,openEvents:A,closeEvents:D,globalCloseEvents:M,imperativeModeOnly:z,style:V,position:Y,isOpen:se,defaultIsOpen:ce,border:be,opacity:I,arrowColor:J,arrowSize:B,setIsOpen:S,afterShow:q,afterHide:U,disableTooltip:X,activeAnchor:Ve,previousActiveAnchor:Nt.current,setActiveAnchor:We=>{ke(ut=>(We!=null&&We.isSameNode(ut)||(Nt.current=ut),We))},role:ne};return C.createElement(s_,{...Xn})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||hd({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||hd({css:`
|
|
29
|
+
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});function u_(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:[p.jsxs("g",{clipPath:"url(#clip0_2896_16290)",children:[p.jsx("path",{d:"M8.00032 11.167L8.00032 7.83366M8.00032 1.83366C4.33366 1.83366 1.33366 4.83366 1.33366 8.50033C1.33366 12.167 4.33366 15.167 8.00033 15.167C11.667 15.167 14.667 12.167 14.667 8.50033C14.667 4.83366 11.667 1.83366 8.00032 1.83366Z",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M8.00293 5.83301L7.99768 5.83301",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2896_16290",children:p.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(16 16.5) rotate(180)"})})})]})}function Oh({id:e,tooltipText:t}){return p.jsxs(p.Fragment,{children:[p.jsx("span",{"data-tooltip-id":e,style:{maxWidth:"20rem"},children:u_()}),p.jsx(l_,{id:e,place:"top",content:t,style:{maxWidth:"30rem"}})]})}function Eh({url:e,prompt:t,inputName:n}){return p.jsx("p",{style:{color:"var(--amp-colors-text-muted)",display:"flex",justifyContent:"space-between"},children:p.jsxs("span",{children:[e?p.jsx(Rp,{href:e,newTab:!0,children:p.jsx("span",{style:{textDecoration:"underline"},children:n})}):p.jsx("span",{children:n})," ",t&&p.jsx(Oh,{id:`docs-helper-text-${JI(n||(t==null?void 0:t.slice(0,50)))}`,tooltipText:t})]})})}const c_="_metadataInputWrapper_1266b_1",d_={metadataInputWrapper:c_};function Io({metadata:e,onChange:t,providerName:n,variant:r="standard"}){return p.jsxs("div",{className:d_.metadataInputWrapper,children:[e.docsURL&&r==="standard"&&p.jsx(Wl,{url:e.docsURL,providerDisplayName:n||"",credentialName:e.displayName||un(e.name.toLowerCase()),prompt:e.prompt}),r==="header"&&p.jsx(Eh,{url:e.docsURL,prompt:e.prompt,inputName:e.displayName||e.name}),p.jsx($n.Input,{id:e.name,name:e.name,type:"text",placeholder:e.displayName||e.name,onChange:t})]})}function Ds(e,t){const n={},r=[];if(e.forEach(i=>{const o=t[i.name];!o||o.trim()===""?r.push(i.displayName||i.name):n[i.name]={value:o,source:"input"}}),r.length>0)throw new Error(`Please fill in the following required fields: ${r.join(", ")}.`);return n}function Ci(e,t){return e.every(n=>{const r=t[n.name];return r&&r.trim()!==""})}function f_(e,t){const n=t==null?void 0:t.modules;if(!(n&&Object.keys(n).length>0))return{module:"",error:null};const i=e||t.defaultModule;return i?{module:i,error:null}:{module:"",error:`Could not determine module for provider ${t==null?void 0:t.name}`}}function p_(e,t){if(t==="")return e;const n=t.toLowerCase();return e.filter(r=>r.moduleDependencies?Object.keys(r.moduleDependencies).some(i=>i.toLowerCase()===n):!0)}function _h({provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:r,buttonVariant:i,submitButtonType:o,metadataInputs:s}){var w;const[a,l]=C.useState({apiKey:""}),c=y=>{const{name:b,value:x}=y.currentTarget;l(O=>({...O,[b]:x.trim()}))},{apiKey:u}=a,{providerName:d}=Ot(e),h=u.length>0,f=Ci(s,a),m=r||!h||!f,g=(w=t.apiKeyOpts)==null?void 0:w.docsURL,v=()=>{const y=Ds(s,a);n({apiKey:u,providerMetadata:y})};return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[g&&p.jsx(Wl,{url:g,providerDisplayName:d||un(e),credentialName:"API key"}),p.jsx($n.PasswordInput,{id:"apiKey",name:"apiKey",placeholder:"API Key",onChange:c}),s.map(y=>p.jsx(Io,{metadata:y,onChange:c,providerName:d||un(e)},y.name)),p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:m,type:o||"submit",onClick:v,variant:i,children:"Next"})]})}function h_({provider:e,providerInfo:t,handleSubmit:n,error:r,isButtonDisabled:i,metadataInputs:o}){const{providerName:s}=Ot(e);return p.jsxs(Jr,{children:[p.jsx(Wr,{children:`Set up ${s} integration`}),p.jsx(Hn,{error:r}),p.jsx(_h,{provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:i||!!r,metadataInputs:o})]})}function m_({...e}){return p.jsx(h_,{...e})}const g_={backgroundColor:"var(--amp-colors-status-success-muted)",borderColor:"var(--amp-colors-status-success-muted)",color:"var(--amp-colors-status-success-dark)",padding:".5rem 1rem"};function Co({children:e,style:t}){return p.jsx(Kn,{style:{...g_,...t},children:e})}const eu=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...zn({mutationKey:["updateConnection"],mutationFn:async o=>(await e()).connectionApi.updateConnection(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]}),r(null)}}),errorMsg:n}},y_="_divider_1kmoj_1",wd={divider:y_};function Ms({className:e,style:t}){return p.jsx("hr",{className:e?`${wd.divider} ${e}`:wd.divider,style:t})}function Gt({string:e}){return p.jsxs("div",{style:{display:"flex",position:"relative",paddingTop:"1rem",paddingBottom:".5rem"},children:[p.jsx("h3",{style:{color:"var(--amp-colors-text-muted)",fontSize:"1rem",fontWeight:"400"},children:e}),p.jsx("div",{style:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"},children:p.jsx(Ms,{style:{width:"100%",marginLeft:"1rem"}})})]})}function v_({provider:e}){const{projectIdOrName:t}=Xe(),{providerName:n,data:r}=Ot(e),{selectedConnection:i,isConnectionsLoading:o}=Rn(),{mutateAsync:s,isPending:a,error:l}=eu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>h(!1),m=()=>{h(!0),u(null)},g=(l==null?void 0:l.message)||c||null,v=async w=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(i==null?void 0:i.id)||"",updateConnectionRequest:{updateMask:["apiKey"],connection:{apiKey:w.apiKey}}},{onError:y=>{console.error("Update connection error:",y),ot(y,u)},onSuccess:()=>{m()}})}catch(y){console.error("Update connection caught error:",y),ot(y,u)}};return r?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Update ${n} API Key`}),d&&p.jsx(Co,{children:"Connection updated successfully"}),g&&p.jsx(go,{children:`Error updating connection ${g}`}),p.jsx(_h,{provider:r==null?void 0:r.name,providerInfo:r,handleSubmit:v,isButtonDisabled:a||o,buttonVariant:"ghost",submitButtonType:"button",metadataInputs:[]})]})]}):null}function Th({provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:r,buttonVariant:i,metadataInputs:o}){var v;const[s,a]=C.useState({username:"",password:""}),{username:l,password:c}=s,{providerName:u}=Ot(e),d=w=>{const{name:y,value:b}=w.currentTarget;a(x=>({...x,[y]:b.trim()}))},h=Ci(o,s),f=r||!h,m=()=>{const w=Ds(o,s);n({user:l,pass:c,providerMetadata:w})},g=(v=t.basicOpts)==null?void 0:v.docsURL;return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[g&&p.jsx(Wl,{url:g,providerDisplayName:u||un(e),credentialName:"credentials"}),p.jsx($n.Input,{id:"username",name:"username",type:"text",placeholder:"Username",onChange:d}),p.jsx($n.PasswordInput,{id:"password",name:"password",placeholder:"Password",onChange:d}),o.map(w=>p.jsx(Io,{metadata:w,onChange:d,providerName:u||un(e)},w.name)),p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:f,type:"button",onClick:m,variant:i,children:"Next"})]})}function b_({provider:e,providerInfo:t,handleSubmit:n,error:r,isButtonDisabled:i,metadataInputs:o}){const{providerName:s}=Ot(e);return p.jsxs(Jr,{children:[p.jsx(Wr,{children:`Set up ${s} integration`}),p.jsx(Hn,{error:r}),p.jsx(Th,{provider:e,providerInfo:t,handleSubmit:n,isButtonDisabled:i||!!r,metadataInputs:o})]})}function w_({...e}){return p.jsx(b_,{...e})}function x_({provider:e}){const{projectIdOrName:t}=Xe(),{providerName:n,data:r}=Ot(e),{selectedConnection:i,isConnectionsLoading:o}=Rn(),{mutateAsync:s,isPending:a,error:l}=eu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>h(!1),m=()=>{h(!0),u(null)},g=(l==null?void 0:l.message)||c||null,v=async w=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(i==null?void 0:i.id)||"",updateConnectionRequest:{updateMask:["basicAuth"],connection:{basicAuth:{username:w.user,password:w.pass}}}},{onError:y=>{console.error(y),ot(y,u)},onSuccess:()=>{m()}})}catch(y){console.error(y),ot(y,u)}};return r?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Update ${n} credentials`}),d&&p.jsx(Co,{children:"Connection updated successfully"}),g&&p.jsx(go,{children:`Error updating connection: ${g}`}),p.jsx(Th,{provider:r==null?void 0:r.name,providerInfo:r,handleSubmit:v,isButtonDisabled:a||o,buttonVariant:"ghost",metadataInputs:[]})]})]}):null}function Nh({handleSubmit:e,isButtonDisabled:t,explicitScopesRequired:n,buttonVariant:r,metadataInputs:i,providerName:o}){const[s,a]=C.useState({clientSecret:"",clientId:"",scopes:""}),[l,c]=C.useState(null),u=b=>{const{name:x,value:O}=b.currentTarget;a(E=>({...E,[x]:O.trim()})),c(null)},{clientSecret:d,clientId:h,scopes:f}=s,m=d.length>0,g=h.length>0,v=Ci(i,s),w=t||!m||!g||!v,y=()=>{const b=Ds(i,s),x={clientId:h,clientSecret:d,providerMetadata:b};n&&f.length>0&&(x.scopes=KI(f)),e(x)};return p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[p.jsx($n.Input,{id:"clientId",name:"clientId",type:"text",placeholder:"Client ID",onChange:u}),p.jsx($n.PasswordInput,{id:"clientSecret",name:"clientSecret",placeholder:"Client Secret",onChange:u}),n&&p.jsx($n.Textarea,{name:"scopes",placeholder:"Scopes separated by new line",onChange:u}),i.map(b=>p.jsx(Io,{metadata:b,onChange:u,providerName:o},b.name))]}),p.jsx(Hn,{error:l}),p.jsx("br",{}),p.jsx(et,{style:{width:"100%"},disabled:w,type:"button",onClick:y,variant:r,children:"Next"})]})}function I_({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r,explicitScopesRequired:i,metadataInputs:o}){return p.jsxs(Jr,{children:[p.jsx(Wr,{children:`Set up ${r} integration`}),p.jsx(Hn,{error:t}),p.jsx("br",{}),p.jsx(Nh,{handleSubmit:e,isButtonDisabled:n||!!t,explicitScopesRequired:i,metadataInputs:o,providerName:r})]})}function C_({provider:e}){var y;const{projectIdOrName:t}=Xe(),{selectedConnection:n,isConnectionsLoading:r}=Rn(),{providerName:i,data:o}=Ot(e),{mutateAsync:s,isPending:a,error:l}=eu(),[c,u]=C.useState(null),[d,h]=C.useState(!1),f=()=>{h(!1)},m=()=>{h(!0),u(null)},g=(y=o==null?void 0:o.oauth2Opts)==null?void 0:y.explicitScopesRequired,v=(l==null?void 0:l.message)||c||null,w=async b=>{f(),u(null);try{await s({projectIdOrName:t||"",connectionId:(n==null?void 0:n.id)||"",updateConnectionRequest:{updateMask:["oauth2ClientCredentials"],connection:{oauth2ClientCredentials:{clientId:b.clientId,clientSecret:b.clientSecret,scopes:b.scopes}}}}),m()}catch(x){ot(x,u)}};return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),p.jsxs("div",{style:{padding:"1rem 0",display:"flex",flexDirection:"column",gap:".5rem"},children:[p.jsx("p",{children:`Re-authenticate to ${i}`}),d&&p.jsx(Co,{children:"Connection updated successfully"}),v&&p.jsx(go,{children:`Error updating connection ${v}`}),p.jsx(Nh,{handleSubmit:w,isButtonDisabled:a||r,explicitScopesRequired:g,buttonVariant:"ghost",metadataInputs:[]})]})]})}const xd=600,Id=600,S_="AUTHORIZATION_SUCCEEDED",O_="AUTHORIZATION_FAILED";function E_(e,t,n,r){return C.useCallback(()=>{if(!r)return;const i=window.screenX+(window.outerWidth-xd)/2,o=window.screenY+(window.outerHeight-Id)/2.5,s=`width=${xd},height=${Id},left=${i},top=${o}`,a=window.open(r,e,s);t(a),window.addEventListener("message",n,!1)},[r,e,t,n])}function __(e,t,n,r){const i=st();return C.useCallback(o=>{var s,a;if(o.origin===Qf){if(o.data.eventType===S_){const l=(s=o.data.data)==null?void 0:s.connection;l?(e(l),i.setQueriesData({queryKey:["amp","connections"]},()=>[l]),t==null||t.close(),r==null||r(),i.invalidateQueries({queryKey:["amp","connections"]})):console.error("Connection ID not found in event data: ",{event:o})}o.data.eventType===O_&&(console.error("OAuth failed: ",{event:o}),n==null||n(((a=o==null?void 0:o.data)==null?void 0:a.message)??"Something went wrong, try refreshing this page, and then try again."))}},[t,n,i,e,r])}function T_({children:e,oauthUrl:t,windowTitle:n="Connect to Provider",onError:r,error:i,onSuccessConnect:o,isSuccessConnect:s,onWindowClose:a}){const[l,c]=C.useState(null),[u,d]=C.useState(null),h=st(),f=C.useRef(null),m=__(c,u,r,o),g=E_(n,d,m,t);C.useEffect(()=>{t&&!u&&!l&&!i&&!s&&(r==null||r(null),g())},[t,u,g,l,i,s,r]);const v=C.useCallback(()=>{h.invalidateQueries({queryKey:["amp","connections"]}),d(null),!l&&!i?console.error("Window closed and no connection was found. Please try again."):l&&(r==null||r(null)),a==null||a()},[l,i,r,a,h]);return C.useEffect(()=>{if(u)return f.current=setInterval(()=>{u!=null&&u.closed&&(f.current&&clearInterval(f.current),f.current=null,v())},500),()=>{f.current&&(clearInterval(f.current),f.current=null),window.removeEventListener("message",m)}},[v,u,m]),p.jsx("div",{children:e})}const N_=()=>{const e=Ct(),t=st();return zn({mutationKey:["updateOauthConnection"],mutationFn:async n=>!n.projectIdOrName||!n.connectionId?Promise.reject(new Error("Project ID and connection ID are required")):(await e()).oAuthApi.oauthUpdate(n),onSuccess:()=>{t.invalidateQueries({queryKey:["connections"]})}})};function k_({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r}){return p.jsxs("div",{style:{padding:"1rem 0"},children:[p.jsx("p",{children:`Re-authenticate to ${r}`}),p.jsx(Hn,{error:t}),p.jsx(et,{variant:"ghost",style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:"Next"})]})}function A_({provider:e}){const{selectedConnection:t,isConnectionsLoading:n}=Rn(),r=t==null?void 0:t.id,i=t==null?void 0:t.projectId,{providerName:o}=Ot(e),{mutateAsync:s,isPending:a,error:l}=N_(),[c,u]=C.useState(null),[d,h]=C.useState(!1),[f,m]=C.useState(null),g=()=>{h(!1)},v=()=>{h(!0),u(null),m(null)},w=(l==null?void 0:l.message)||c||null,y=async()=>{g(),u(null);try{const x=await s({projectIdOrName:i||"",connectionId:r||""});m(x)}catch(x){ot(x,u)}},b=C.useCallback(x=>{u(x)},[]);return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Update connection"}),d&&p.jsx(Co,{children:"Connection updated successfully"}),p.jsx(T_,{windowTitle:`Connect to ${o}`,oauthUrl:f||null,onError:b,error:w,isSuccessConnect:d,onSuccessConnect:v,children:p.jsx(k_,{handleSubmit:y,error:w,providerName:o,isButtonDisabled:a||n||d})})]})}function tu({provider:e}){var r;const{data:t}=Np(e);if((t==null?void 0:t.authType)===Ku.Basic)return p.jsx(x_,{provider:e});if((t==null?void 0:t.authType)===Ku.ApiKey)return p.jsx(v_,{provider:e});const n=(r=t==null?void 0:t.oauth2Opts)==null?void 0:r.grantType;if(n){if(n===Ws.AuthorizationCode||n===Ws.AuthorizationCodePkce)return p.jsx(A_,{provider:e});if(n===Ws.ClientCredentials)return p.jsx(C_,{provider:e})}return null}const R_=()=>{const e=Ct(),t=st();return zn({mutationFn:async({projectIdOrName:n,integrationId:r,installationId:i})=>(await e()).installationApi.deleteInstallation({projectIdOrName:n,integrationId:r,installationId:i}),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]})},onError:n=>{console.error("Error uninstalling installation."),ot(n)}})};function nu({buttonText:e,buttonVariant:t="secondary",buttonStyle:n={}}){const{projectIdOrName:r}=Xe(),{integrationId:i,installation:o,setIntegrationDeleted:s,onUninstallSuccess:a}=St(),[l,c]=C.useState(!1),u=!r||!i||!(o!=null&&o.id)||l,d=R_(),h=async()=>{u||(c(!0),console.warn("uninstalling installation",{projectIdOrName:r,integrationId:i,installationId:o.id}),d.mutate({projectIdOrName:r,integrationId:i,installationId:o.id},{onSuccess:()=>{console.warn("successfully uninstalled installation:",o.id),a==null||a(o==null?void 0:o.id),s()},onSettled:()=>c(!1)}))},f=l?"Uninstalling...":e,m=p.jsx(et,{type:"button",onClick:h,disabled:u,variant:t,style:n,children:f});return o!=null&&o.id?m:null}const P_=()=>{const e=Ct(),t=st(),[n,r]=C.useState(null);return{...zn({mutationKey:["deleteConnection"],mutationFn:async o=>(await e()).connectionApi.deleteConnection(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]}),r(null)},onError:o=>{console.error("Error deleting connection"),ot(o,r)}}),errorMsg:n}};function kh({buttonText:e,buttonVariant:t="secondary",buttonStyle:n={},onDisconnectSuccess:r,resetComponent:i,onDisconnectError:o}){const{projectIdOrName:s}=Xe(),{selectedConnection:a}=Rn(),{mutate:l,isPending:c}=P_(),u=!s||!a||!a.id||c,d=async()=>{u||(console.warn("deleting connection",{projectIdOrName:s,connectionId:a==null?void 0:a.id}),l({projectIdOrName:s,connectionId:a==null?void 0:a.id},{onSuccess:()=>{console.warn("successfully deleted connection:",a==null?void 0:a.id),r==null||r(a),i()},onError:m=>{ot(m,o)}}))},h=c?"Pending...":e;return p.jsx(et,{type:"button",onClick:d,disabled:u,variant:t,style:n,children:h})}const Ah=C.createContext({hydratedRevision:null,loading:!1,readAction:void 0,writeObjects:[]}),Gr=()=>{const e=C.useContext(Ah);if(!e)throw new Error("useHydratedRevision must be used within a HydratedRevisionProvider");return e};function F_({children:e,resetComponent:t}){const{integrationId:n,integrationObj:r,installation:i}=St(),{isError:o,removeError:s,setError:a}=kn(),l=(r==null?void 0:r.name)||n,[c,u]=C.useState(null),[d,h]=C.useState(null),{data:f,isLoading:m,isError:g,error:v,isSuccess:w}=_s();C.useEffect(()=>{!w&&!g||(g?(a(Ee.HYDRATED_REVISION,l),v&&ot(v,u)):(s(Ee.HYDRATED_REVISION,l),u(null),h(null)))},[g,w,l,a,s,v,u]);const y=C.useMemo(()=>{var O,E,F;return{hydratedRevision:f||null,loading:m,readAction:(O=f==null?void 0:f.content)==null?void 0:O.read,writeObjects:((F=(E=f==null?void 0:f.content)==null?void 0:E.write)==null?void 0:F.objects)||[]}},[f,m]),b=(r==null?void 0:r.provider)||"provider",x=(r==null?void 0:r.name)||n||"unknown integration";if(o(Ee.HYDRATED_REVISION,l)){const O=`${c?un(c):`Error retrieving objects from ${b} or integration details for ${x}`}`;return p.jsx(Vt,{message:O,children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",paddingTop:"1rem",width:"100%"},children:[p.jsx(tu,{provider:b}),i?p.jsx("p",{children:"If authentication is failing, please try reauthenticating using the section above before uninstalling the integration."}):p.jsx("p",{children:"If authentication is failing, please try reauthenticating using the section above before deleting and recreating the connection."}),d&&p.jsx(Xf,{message:d}),i?p.jsx(nu,{buttonText:"Uninstall",buttonVariant:"danger"}):p.jsx(kh,{buttonText:"Delete Connection",resetComponent:t,buttonVariant:"danger",onDisconnectError:E=>h(E)})]})})}return m?p.jsx(Ai,{}):p.jsx(Ah.Provider,{value:y,children:e})}const Rh=C.createContext(null);function ru(){const e=C.useContext(Rh);if(e===null)throw new Error("useSelectedNavObjectName must be used within a SelectedNavObjectNameProvider");return{selectedObjectName:e}}const Ph=C.createContext(()=>{});function D_(){const e=C.useContext(Ph);if(!e)throw new Error("useSetNextTabIndex must be used within a NextTabIndexProvider");return{onNextIncompleteTab:e}}const Fh=C.createContext(void 0),M_={};function iu(){const e=C.useContext(Fh);if(!e)throw new Error("useObjectsConfigureState must be used within a ConfigurationProvider");return e}function j_({children:e}){const{installation:t}=St(),{hydratedRevision:n,loading:r}=Gr(),[i,o]=C.useState(M_),s=t==null?void 0:t.config;C.useEffect(()=>{n!=null&&n.content&&!r&&s&&!(Object.entries(i).length>0)&&aC(n,s,o)},[n,r,s,i]);const a=C.useCallback((u,d)=>{o(h=>Kt(h,f=>{f[u]=Kt(f[u],d)}))},[o]),l=C.useCallback((u,d)=>{o(h=>Kt(h,f=>{f[u]=d}))},[o]),c=C.useMemo(()=>({objectConfigurationsState:i,setObjectConfigurationsState:o,setConfigureState:a,resetConfigureState:l}),[i,l,a]);return p.jsx(Fh.Provider,{value:c,children:e})}const Xt=()=>{const{appName:e}=yr(),{objectConfigurationsState:t,setConfigureState:n}=iu(),{selectedObjectName:r}=ru(),i=Op(r||"",t);return{appName:e,configureState:i,setConfigureState:n,selectedObjectName:r}},Dh=()=>{var i,o,s;const{hydratedRevision:e}=Gr(),{selectedObjectName:t}=ru(),n=(s=(o=(i=e==null?void 0:e.content)==null?void 0:i.read)==null?void 0:o.objects)==null?void 0:s.find(a=>a.objectName===t),r=(n==null?void 0:n.displayName)||t&&un(t);return{selectedObject:n,displayName:r}};function Mh(){const{projectIdOrName:e}=Xe(),{integrationNameOrId:t}=vr(),{data:n}=Hr(t),{installation:r}=An(),{mutate:i,isIdle:o,isPending:s,error:a,errorMsg:l}=op();return{toggleReadingObject:({objectName:u,disabled:d,onSuccess:h,onError:f,onSettled:m})=>{var w,y,b,x;if(!r){const O=new Error("Installation not created yet. Try creating the installation first.");f==null||f(O),m==null||m();return}if(!n){const O=new Error("No integration found");f==null||f(O),m==null||m();return}if(!((x=(b=(y=(w=r==null?void 0:r.config)==null?void 0:w.content)==null?void 0:y.read)==null?void 0:b.objects)!=null&&x[u])){const O=new Error(`Object "${u}" not found in installation read configuration`);f==null||f(O),m==null||m();return}const g=[`config.content.read.objects.${u}.disabled`],v={projectIdOrName:e,integrationId:n.id,installationId:r.id,installationUpdate:{updateMask:g,installation:{config:{content:{read:{objects:{[u]:{disabled:d}}}}}}}};return i(v,{onSuccess:O=>{h==null||h(O)},onError:O=>{f==null||f(O)},onSettled:()=>{m==null||m()}})},isIdle:o,isPending:s,error:a,errorMsg:l}}function L_(){var u,d,h,f;const{installation:e}=An(),[t,n]=C.useState(!1),{selectedObjectName:r}=Xt(),{displayName:i}=Dh(),{toggleReadingObject:o,isPending:s}=Mh(),a=r?(f=(h=(d=(u=e==null?void 0:e.config)==null?void 0:u.content)==null?void 0:d.read)==null?void 0:h.objects)==null?void 0:f[r]:void 0;if(!a||a.disabled)return null;const c=()=>{r&&o({objectName:r,disabled:!0,onSuccess:()=>{n(!1)},onError:m=>{console.error("Error stopping read from object:",m)}})};return t?p.jsxs(p.Fragment,{children:[p.jsxs("p",{style:{padding:"1rem 0",color:"var(--amp-colors-text-muted)",fontSize:"0.875rem"},children:["Are you sure you want to stop reading from"," ",p.jsx("b",{children:i}),"?"]}),p.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[p.jsx(et,{type:"button",variant:"ghost",style:{flex:1},onClick:()=>n(!1),children:"Cancel"}),p.jsx(et,{type:"button",variant:"danger",style:{flex:1},onClick:c,disabled:s,children:s?"Stopping...":"Stop reading"})]})]}):p.jsxs("button",{type:"button",onClick:()=>n(!0),style:{background:"none",border:"none",cursor:"pointer",textDecoration:"underline",paddingTop:"1rem",margin:0,fontFamily:"inherit",color:"var(--amp-colors-text-muted)"},children:["Stop reading from ",p.jsx("b",{children:i})]})}function Un(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(null,arguments)}function ul(e,t){return ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ul(e,t)}function B_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ul(e,t)}var cl={exports:{}},Ko={exports:{}},Pe={};/** @license React v16.13.1
|
|
30
30
|
* react-is.production.min.js
|
|
31
31
|
*
|
|
32
32
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var
|
|
36
|
+
*/var Cd;function V_(){if(Cd)return Pe;Cd=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(O){if(typeof O=="object"&&O!==null){var E=O.$$typeof;switch(E){case t:switch(O=O.type,O){case l:case c:case r:case o:case i:case d:return O;default:switch(O=O&&O.$$typeof,O){case a:case u:case m:case f:case s:return O;default:return E}}case n:return E}}}function x(O){return b(O)===c}return Pe.AsyncMode=l,Pe.ConcurrentMode=c,Pe.ContextConsumer=a,Pe.ContextProvider=s,Pe.Element=t,Pe.ForwardRef=u,Pe.Fragment=r,Pe.Lazy=m,Pe.Memo=f,Pe.Portal=n,Pe.Profiler=o,Pe.StrictMode=i,Pe.Suspense=d,Pe.isAsyncMode=function(O){return x(O)||b(O)===l},Pe.isConcurrentMode=x,Pe.isContextConsumer=function(O){return b(O)===a},Pe.isContextProvider=function(O){return b(O)===s},Pe.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===t},Pe.isForwardRef=function(O){return b(O)===u},Pe.isFragment=function(O){return b(O)===r},Pe.isLazy=function(O){return b(O)===m},Pe.isMemo=function(O){return b(O)===f},Pe.isPortal=function(O){return b(O)===n},Pe.isProfiler=function(O){return b(O)===o},Pe.isStrictMode=function(O){return b(O)===i},Pe.isSuspense=function(O){return b(O)===d},Pe.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===r||O===c||O===o||O===i||O===d||O===h||typeof O=="object"&&O!==null&&(O.$$typeof===m||O.$$typeof===f||O.$$typeof===s||O.$$typeof===a||O.$$typeof===u||O.$$typeof===v||O.$$typeof===w||O.$$typeof===y||O.$$typeof===g)},Pe.typeOf=b,Pe}var Fe={};/** @license React v16.13.1
|
|
37
37
|
* react-is.development.js
|
|
38
38
|
*
|
|
39
39
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var
|
|
43
|
+
*/var Sd;function U_(){return Sd||(Sd=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b($){return typeof $=="string"||typeof $=="function"||$===r||$===c||$===o||$===i||$===d||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===f||$.$$typeof===s||$.$$typeof===a||$.$$typeof===u||$.$$typeof===v||$.$$typeof===w||$.$$typeof===y||$.$$typeof===g)}function x($){if(typeof $=="object"&&$!==null){var we=$.$$typeof;switch(we){case t:var ee=$.type;switch(ee){case l:case c:case r:case o:case i:case d:return ee;default:var Ke=ee&&ee.$$typeof;switch(Ke){case a:case u:case m:case f:case s:return Ke;default:return we}}case n:return we}}}var O=l,E=c,F=a,N=s,P=t,A=u,D=r,M=m,z=f,V=n,Y=o,se=i,ce=d,ge=!1;function be($){return ge||(ge=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),I($)||x($)===l}function I($){return x($)===c}function J($){return x($)===a}function B($){return x($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function q($){return x($)===u}function U($){return x($)===r}function X($){return x($)===m}function ne($){return x($)===f}function te($){return x($)===n}function ae($){return x($)===o}function Z($){return x($)===i}function ye($){return x($)===d}Fe.AsyncMode=O,Fe.ConcurrentMode=E,Fe.ContextConsumer=F,Fe.ContextProvider=N,Fe.Element=P,Fe.ForwardRef=A,Fe.Fragment=D,Fe.Lazy=M,Fe.Memo=z,Fe.Portal=V,Fe.Profiler=Y,Fe.StrictMode=se,Fe.Suspense=ce,Fe.isAsyncMode=be,Fe.isConcurrentMode=I,Fe.isContextConsumer=J,Fe.isContextProvider=B,Fe.isElement=S,Fe.isForwardRef=q,Fe.isFragment=U,Fe.isLazy=X,Fe.isMemo=ne,Fe.isPortal=te,Fe.isProfiler=ae,Fe.isStrictMode=Z,Fe.isSuspense=ye,Fe.isValidElementType=b,Fe.typeOf=x}()),Fe}var Od;function jh(){return Od||(Od=1,process.env.NODE_ENV==="production"?Ko.exports=V_():Ko.exports=U_()),Ko.exports}/*
|
|
44
44
|
object-assign
|
|
45
45
|
(c) Sindre Sorhus
|
|
46
46
|
@license MIT
|
|
47
|
-
*/var
|
|
48
|
-
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var
|
|
47
|
+
*/var pa,Ed;function $_(){if(Ed)return pa;Ed=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pa=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},pa}var ha,_d;function ou(){if(_d)return ha;_d=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ha=e,ha}var ma,Td;function Lh(){return Td||(Td=1,ma=Function.call.bind(Object.prototype.hasOwnProperty)),ma}var ga,Nd;function q_(){if(Nd)return ga;Nd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ou(),n={},r=Lh();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=o[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";e("Failed "+a+" type: "+d.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ga=i,ga}var ya,kd;function z_(){if(kd)return ya;kd=1;var e=jh(),t=$_(),n=ou(),r=Lh(),i=q_(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return ya=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(I){var J=I&&(c&&I[c]||I[u]);if(typeof J=="function")return J}var h="<<anonymous>>",f={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:y(),arrayOf:b,element:x(),elementType:O(),instanceOf:E,node:A(),objectOf:N,oneOf:F,oneOfType:P,shape:M,exact:z};function m(I,J){return I===J?I!==0||1/I===1/J:I!==I&&J!==J}function g(I,J){this.message=I,this.data=J&&typeof J=="object"?J:{},this.stack=""}g.prototype=Error.prototype;function v(I){if(process.env.NODE_ENV!=="production")var J={},B=0;function S(U,X,ne,te,ae,Z,ye){if(te=te||h,Z=Z||ne,ye!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var we=te+":"+ne;!J[we]&&B<3&&(o("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+te+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),J[we]=!0,B++)}}return X[ne]==null?U?X[ne]===null?new g("The "+ae+" `"+Z+"` is marked as required "+("in `"+te+"`, but its value is `null`.")):new g("The "+ae+" `"+Z+"` is marked as required in "+("`"+te+"`, but its value is `undefined`.")):null:I(X,ne,te,ae,Z)}var q=S.bind(null,!1);return q.isRequired=S.bind(null,!0),q}function w(I){function J(B,S,q,U,X,ne){var te=B[S],ae=se(te);if(ae!==I){var Z=ce(te);return new g("Invalid "+U+" `"+X+"` of type "+("`"+Z+"` supplied to `"+q+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return v(J)}function y(){return v(s)}function b(I){function J(B,S,q,U,X){if(typeof I!="function")return new g("Property `"+X+"` of component `"+q+"` has invalid PropType notation inside arrayOf.");var ne=B[S];if(!Array.isArray(ne)){var te=se(ne);return new g("Invalid "+U+" `"+X+"` of type "+("`"+te+"` supplied to `"+q+"`, expected an array."))}for(var ae=0;ae<ne.length;ae++){var Z=I(ne,ae,q,U,X+"["+ae+"]",n);if(Z instanceof Error)return Z}return null}return v(J)}function x(){function I(J,B,S,q,U){var X=J[B];if(!a(X)){var ne=se(X);return new g("Invalid "+q+" `"+U+"` of type "+("`"+ne+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return v(I)}function O(){function I(J,B,S,q,U){var X=J[B];if(!e.isValidElementType(X)){var ne=se(X);return new g("Invalid "+q+" `"+U+"` of type "+("`"+ne+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return v(I)}function E(I){function J(B,S,q,U,X){if(!(B[S]instanceof I)){var ne=I.name||h,te=be(B[S]);return new g("Invalid "+U+" `"+X+"` of type "+("`"+te+"` supplied to `"+q+"`, expected ")+("instance of `"+ne+"`."))}return null}return v(J)}function F(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function J(B,S,q,U,X){for(var ne=B[S],te=0;te<I.length;te++)if(m(ne,I[te]))return null;var ae=JSON.stringify(I,function(ye,$){var we=ce($);return we==="symbol"?String($):$});return new g("Invalid "+U+" `"+X+"` of value `"+String(ne)+"` "+("supplied to `"+q+"`, expected one of "+ae+"."))}return v(J)}function N(I){function J(B,S,q,U,X){if(typeof I!="function")return new g("Property `"+X+"` of component `"+q+"` has invalid PropType notation inside objectOf.");var ne=B[S],te=se(ne);if(te!=="object")return new g("Invalid "+U+" `"+X+"` of type "+("`"+te+"` supplied to `"+q+"`, expected an object."));for(var ae in ne)if(r(ne,ae)){var Z=I(ne,ae,q,U,X+"."+ae,n);if(Z instanceof Error)return Z}return null}return v(J)}function P(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var J=0;J<I.length;J++){var B=I[J];if(typeof B!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ge(B)+" at index "+J+"."),s}function S(q,U,X,ne,te){for(var ae=[],Z=0;Z<I.length;Z++){var ye=I[Z],$=ye(q,U,X,ne,te,n);if($==null)return null;$.data&&r($.data,"expectedType")&&ae.push($.data.expectedType)}var we=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new g("Invalid "+ne+" `"+te+"` supplied to "+("`"+X+"`"+we+"."))}return v(S)}function A(){function I(J,B,S,q,U){return V(J[B])?null:new g("Invalid "+q+" `"+U+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return v(I)}function D(I,J,B,S,q){return new g((I||"React class")+": "+J+" type `"+B+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+q+"`.")}function M(I){function J(B,S,q,U,X){var ne=B[S],te=se(ne);if(te!=="object")return new g("Invalid "+U+" `"+X+"` of type `"+te+"` "+("supplied to `"+q+"`, expected `object`."));for(var ae in I){var Z=I[ae];if(typeof Z!="function")return D(q,U,X,ae,ce(Z));var ye=Z(ne,ae,q,U,X+"."+ae,n);if(ye)return ye}return null}return v(J)}function z(I){function J(B,S,q,U,X){var ne=B[S],te=se(ne);if(te!=="object")return new g("Invalid "+U+" `"+X+"` of type `"+te+"` "+("supplied to `"+q+"`, expected `object`."));var ae=t({},B[S],I);for(var Z in ae){var ye=I[Z];if(r(I,Z)&&typeof ye!="function")return D(q,U,X,Z,ce(ye));if(!ye)return new g("Invalid "+U+" `"+X+"` key `"+Z+"` supplied to `"+q+"`.\nBad object: "+JSON.stringify(B[S],null," ")+`
|
|
48
|
+
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var $=ye(ne,Z,q,U,X+"."+Z,n);if($)return $}return null}return v(J)}function V(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(V);if(I===null||a(I))return!0;var J=d(I);if(J){var B=J.call(I),S;if(J!==I.entries){for(;!(S=B.next()).done;)if(!V(S.value))return!1}else for(;!(S=B.next()).done;){var q=S.value;if(q&&!V(q[1]))return!1}}else return!1;return!0;default:return!1}}function Y(I,J){return I==="symbol"?!0:J?J["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&J instanceof Symbol:!1}function se(I){var J=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":Y(J,I)?"symbol":J}function ce(I){if(typeof I>"u"||I===null)return""+I;var J=se(I);if(J==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return J}function ge(I){var J=ce(I);switch(J){case"array":case"object":return"an "+J;case"boolean":case"date":case"regexp":return"a "+J;default:return J}}function be(I){return!I.constructor||!I.constructor.name?h:I.constructor.name}return f.checkPropTypes=i,f.resetWarningCache=i.resetWarningCache,f.PropTypes=f,f},ya}var va,Ad;function K_(){if(Ad)return va;Ad=1;var e=ou();function t(){}function n(){}return n.resetWarningCache=t,va=function(){function r(s,a,l,c,u,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},va}if(process.env.NODE_ENV!=="production"){var H_=jh(),J_=!0;cl.exports=z_()(H_.isElement,J_)}else cl.exports=K_()();var W_=cl.exports;const G=Ni(W_);var dl={exports:{}},De={};/**
|
|
49
49
|
* @license React
|
|
50
50
|
* react-is.production.min.js
|
|
51
51
|
*
|
|
@@ -53,7 +53,7 @@ Valid keys: `+JSON.stringify(Object.keys(I),null," "));var q=ye(ne,Z,z,$,Y+"."+
|
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the MIT license found in the
|
|
55
55
|
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var
|
|
56
|
+
*/var Rd;function Q_(){if(Rd)return De;Rd=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(v){if(typeof v=="object"&&v!==null){var w=v.$$typeof;switch(w){case e:switch(v=v.type,v){case n:case i:case r:case c:case u:return v;default:switch(v=v&&v.$$typeof,v){case a:case s:case l:case h:case d:case o:return v;default:return w}}case t:return w}}}return De.ContextConsumer=s,De.ContextProvider=o,De.Element=e,De.ForwardRef=l,De.Fragment=n,De.Lazy=h,De.Memo=d,De.Portal=t,De.Profiler=i,De.StrictMode=r,De.Suspense=c,De.SuspenseList=u,De.isAsyncMode=function(){return!1},De.isConcurrentMode=function(){return!1},De.isContextConsumer=function(v){return g(v)===s},De.isContextProvider=function(v){return g(v)===o},De.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},De.isForwardRef=function(v){return g(v)===l},De.isFragment=function(v){return g(v)===n},De.isLazy=function(v){return g(v)===h},De.isMemo=function(v){return g(v)===d},De.isPortal=function(v){return g(v)===t},De.isProfiler=function(v){return g(v)===i},De.isStrictMode=function(v){return g(v)===r},De.isSuspense=function(v){return g(v)===c},De.isSuspenseList=function(v){return g(v)===u},De.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===i||v===r||v===c||v===u||v===f||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===d||v.$$typeof===o||v.$$typeof===s||v.$$typeof===l||v.$$typeof===m||v.getModuleId!==void 0)},De.typeOf=g,De}var Me={};/**
|
|
57
57
|
* @license React
|
|
58
58
|
* react-is.development.js
|
|
59
59
|
*
|
|
@@ -61,5 +61,5 @@ Valid keys: `+JSON.stringify(Object.keys(I),null," "));var q=ye(ne,Z,z,$,Y+"."+
|
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the MIT license found in the
|
|
63
63
|
* LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/var Fd;function Y_(){return Fd||(Fd=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),m=!1,g=!1,v=!1,w=!1,y=!1,b;b=Symbol.for("react.module.reference");function x(ee){return!!(typeof ee=="string"||typeof ee=="function"||ee===n||ee===i||y||ee===r||ee===c||ee===u||w||ee===f||m||g||v||typeof ee=="object"&&ee!==null&&(ee.$$typeof===h||ee.$$typeof===d||ee.$$typeof===o||ee.$$typeof===s||ee.$$typeof===l||ee.$$typeof===b||ee.getModuleId!==void 0))}function S(ee){if(typeof ee=="object"&&ee!==null){var Ke=ee.$$typeof;switch(Ke){case e:var Be=ee.type;switch(Be){case n:case i:case r:case c:case u:return Be;default:var Le=Be&&Be.$$typeof;switch(Le){case a:case s:case l:case h:case d:case o:return Le;default:return Ke}}case t:return Ke}}}var E=s,D=o,N=e,M=l,R=n,P=h,F=d,U=t,B=i,X=r,se=c,ce=u,ge=!1,be=!1;function I(ee){return ge||(ge=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function J(ee){return be||(be=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function V(ee){return S(ee)===s}function O(ee){return S(ee)===o}function z(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===e}function $(ee){return S(ee)===l}function Y(ee){return S(ee)===n}function ne(ee){return S(ee)===h}function te(ee){return S(ee)===d}function ae(ee){return S(ee)===t}function Z(ee){return S(ee)===i}function ye(ee){return S(ee)===r}function q(ee){return S(ee)===c}function we(ee){return S(ee)===u}Me.ContextConsumer=E,Me.ContextProvider=D,Me.Element=N,Me.ForwardRef=M,Me.Fragment=R,Me.Lazy=P,Me.Memo=F,Me.Portal=U,Me.Profiler=B,Me.StrictMode=X,Me.Suspense=se,Me.SuspenseList=ce,Me.isAsyncMode=I,Me.isConcurrentMode=J,Me.isContextConsumer=V,Me.isContextProvider=O,Me.isElement=z,Me.isForwardRef=$,Me.isFragment=Y,Me.isLazy=ne,Me.isMemo=te,Me.isPortal=ae,Me.isProfiler=Z,Me.isStrictMode=ye,Me.isSuspense=q,Me.isSuspenseList=we,Me.isValidElementType=x,Me.typeOf=S}()),Me}process.env.NODE_ENV==="production"?fl.exports=X_():fl.exports=Y_();var Dd=fl.exports;const Md=e=>typeof e=="object"&&e!=null&&e.nodeType===1,jd=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",wa=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return jd(n.overflowY,t)||jd(n.overflowX,t)||(r=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},Jo=(e,t,n,r,i,o,s,a)=>o<e&&s>t||o>e&&s<t?0:o<=e&&a<=n||s>=t&&a>=n?o-e-r:s>t&&a<n||o<e&&a>n?s-t+i:0,Z_=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},eT=(e,t)=>{var n,r,i,o;if(typeof document>"u")return[];const{inline:s,boundary:a,skipOverflowHiddenElements:l}=t,c=typeof a=="function"?a:U=>U!==a;if(!Md(e))throw new TypeError("Invalid target");const u=document.scrollingElement||document.documentElement,d=[];let h=e;for(;Md(h)&&c(h);){if(h=Z_(h),h===u){d.push(h);break}h!=null&&h===document.body&&wa(h)&&!wa(document.documentElement)||h!=null&&wa(h,l)&&d.push(h)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,m=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:g,scrollY:v}=window,{height:w,width:y,top:b,right:x,bottom:S,left:E}=e.getBoundingClientRect(),{top:D,right:N,left:M}=(U=>{const B=window.getComputedStyle(U);return{top:parseFloat(B.scrollMarginTop)||0,right:parseFloat(B.scrollMarginRight)||0,bottom:parseFloat(B.scrollMarginBottom)||0,left:parseFloat(B.scrollMarginLeft)||0}})(e);let R=b-D,P=s==="center"?E+y/2-M+N:s==="end"?x+N:E-M;const F=[];for(let U=0;U<d.length;U++){const B=d[U],{height:X,width:se,top:ce,right:ge,bottom:be,left:I}=B.getBoundingClientRect();if(b>=0&&E>=0&&S<=m&&x<=f&&b>=ce&&S<=be&&E>=I&&x<=ge)return F;const J=getComputedStyle(B),V=parseInt(J.borderLeftWidth,10),O=parseInt(J.borderTopWidth,10),z=parseInt(J.borderRightWidth,10),$=parseInt(J.borderBottomWidth,10);let Y=0,ne=0;const te="offsetWidth"in B?B.offsetWidth-B.clientWidth-V-z:0,ae="offsetHeight"in B?B.offsetHeight-B.clientHeight-O-$:0,Z="offsetWidth"in B?B.offsetWidth===0?0:se/B.offsetWidth:0,ye="offsetHeight"in B?B.offsetHeight===0?0:X/B.offsetHeight:0;if(u===B)Y=Jo(v,v+m,m,O,$,v+R,v+R+w,w),ne=s==="start"?P:s==="center"?P-f/2:s==="end"?P-f:Jo(g,g+f,f,V,z,g+P,g+P+y,y),Y=Math.max(0,Y+v),ne=Math.max(0,ne+g);else{Y=Jo(ce,be,X,O,$+ae,R,R+w,w),ne=s==="start"?P-I-V:s==="center"?P-(I+se/2)+te/2:s==="end"?P-ge+z+te:Jo(I,ge,se,V,z+te,P,P+y,y);const{scrollLeft:q,scrollTop:we}=B;Y=ye===0?0:Math.max(0,Math.min(we+Y/ye,B.scrollHeight-X/ye+ae)),ne=Z===0?0:Math.max(0,Math.min(q+ne/Z,B.scrollWidth-se/Z+te)),R+=we-Y,P+=q-ne}F.push({el:B,top:Y,left:ne})}return F};var Ei=function(){return Ei=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ei.apply(this,arguments)};var tT=0;function Ld(e){return typeof e=="function"?e:Ht}function Ht(){}function Bh(e,t){if(e){var n=eT(e,{boundary:t});n.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scrollTop=o,i.scrollLeft=s})}}function Bd(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function lu(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,s)},t)}return i.cancel=r,i}function ct(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return a&&a.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ni(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function Vh(){return String(tT++)}function nT(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Vd(e,t){return e=Array.isArray(e)?e[0]:e,!e&&t?t:e}function Uh(e){return typeof e.type=="string"}function $h(e){return e.props}function rT(e,t){console.error('The property "'+t+'" is required in "'+e+'"')}var iT=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Wo(e){e===void 0&&(e={});var t={};return iT.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function vs(e,t){return!e||!t?e:Object.keys(e).reduce(function(n,r){return n[r]=bs(t,r)?t[r]:e[r],n},{})}function bs(e,t){return e[t]!==void 0}function pl(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function oT(e){return Object.prototype.toString.call(e)==="[object Object]"}function kr(e,t,n,r,i){var o=n.length;if(o===0)return-1;var s=o-1;(typeof e!="number"||e<0||e>s)&&(e=t>0?-1:s+1);var a=e+t;a<0?a=s:a>s&&(a=0);var l=_i(a,t<0,n,r,i);return l===-1?e>=o?-1:e:l}function _i(e,t,n,r,i){i===void 0&&(i=!1);var o=n.length;if(t){for(var s=e;s>=0;s--)if(!r(n[s],s))return s}else for(var a=e;a<o;a++)if(!r(n[a],a))return a;return i?_i(t?o-1:0,t,n,r):-1}function ws(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(i){return i&&(Bd(i,e,n)||r&&Bd(i,n.document.activeElement,n))})}var uu=Ht;process.env.NODE_ENV!=="production"&&(uu=function(t,n,r){var i="This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";Object.keys(t).forEach(function(o){n[o]!==void 0&&r[o]===void 0?console.error('downshift: A component has changed the controlled prop "'+o+'" to be uncontrolled. '+i):n[o]===void 0&&r[o]!==void 0&&console.error('downshift: A component has changed the uncontrolled prop "'+o+'" to be controlled. '+i)})});var sT=lu(function(e){qh(e).textContent=""},500);function qh(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function zh(e,t){if(!(!e||!t)){var n=qh(t);n.textContent=e,sT(t)}}function aT(e){var t=e==null?void 0:e.getElementById("a11y-status-message");t&&t.remove()}var Kh=process.env.NODE_ENV!=="production"?"__autocomplete_unknown__":0,Hh=process.env.NODE_ENV!=="production"?"__autocomplete_mouseup__":1,Jh=process.env.NODE_ENV!=="production"?"__autocomplete_item_mouseenter__":2,ts=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_up__":3,ns=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_down__":4,Wh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_escape__":5,Qh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_enter__":6,Gh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_home__":7,Xh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_end__":8,Yh=process.env.NODE_ENV!=="production"?"__autocomplete_click_item__":9,Zh=process.env.NODE_ENV!=="production"?"__autocomplete_blur_input__":10,em=process.env.NODE_ENV!=="production"?"__autocomplete_change_input__":11,tm=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_space_button__":12,hl=process.env.NODE_ENV!=="production"?"__autocomplete_click_button__":13,nm=process.env.NODE_ENV!=="production"?"__autocomplete_blur_button__":14,rm=process.env.NODE_ENV!=="production"?"__autocomplete_controlled_prop_updated_selected_item__":15,im=process.env.NODE_ENV!=="production"?"__autocomplete_touchend__":16,lT=Object.freeze({__proto__:null,blurButton:nm,blurInput:Zh,changeInput:em,clickButton:hl,clickItem:Yh,controlledPropUpdatedSelectedItem:rm,itemMouseEnter:Jh,keyDownArrowDown:ns,keyDownArrowUp:ts,keyDownEnd:Xh,keyDownEnter:Qh,keyDownEscape:Wh,keyDownHome:Gh,keyDownSpaceButton:tm,mouseUp:Hh,touchEnd:im,unknown:Kh}),uT=["refKey","ref"],cT=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],dT=["onKeyDown","onBlur","onChange","onInput","onChangeText"],fT=["refKey","ref"],pT=["onMouseMove","onMouseDown","onClick","onPress","index","item"],hT=function(){var e=function(t){function n(i){var o;o=t.call(this,i)||this,o.id=o.props.id||"downshift-"+Vh(),o.menuId=o.props.menuId||o.id+"-menu",o.labelId=o.props.labelId||o.id+"-label",o.inputId=o.props.inputId||o.id+"-input",o.getItemId=o.props.getItemId||function(y){return o.id+"-item-"+y},o.items=[],o.itemCount=null,o.previousResultCount=0,o.timeoutIds=[],o.internalSetTimeout=function(y,b){var x=setTimeout(function(){o.timeoutIds=o.timeoutIds.filter(function(S){return S!==x}),y()},b);o.timeoutIds.push(x)},o.setItemCount=function(y){o.itemCount=y},o.unsetItemCount=function(){o.itemCount=null},o.isItemDisabled=function(y,b){var x=o.getItemNodeFromIndex(b);return x&&x.hasAttribute("disabled")},o.setHighlightedIndex=function(y,b){y===void 0&&(y=o.props.defaultHighlightedIndex),b===void 0&&(b={}),b=Wo(b),o.internalSetState(Se({highlightedIndex:y},b))},o.clearSelection=function(y){o.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:o.props.defaultHighlightedIndex,isOpen:o.props.defaultIsOpen},y)},o.selectItem=function(y,b,x){b=Wo(b),o.internalSetState(Se({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,selectedItem:y,inputValue:o.props.itemToString(y)},b),x)},o.selectItemAtIndex=function(y,b,x){var S=o.items[y];S!=null&&o.selectItem(S,b,x)},o.selectHighlightedItem=function(y,b){return o.selectItemAtIndex(o.getState().highlightedIndex,y,b)},o.internalSetState=function(y,b){var x,S,E={},D=typeof y=="function";return!D&&y.hasOwnProperty("inputValue")&&o.props.onInputValueChange(y.inputValue,Se({},o.getStateAndHelpers(),y)),o.setState(function(N){var M;N=o.getState(N);var R=D?y(N):y;R=o.props.stateReducer(N,R),x=R.hasOwnProperty("selectedItem");var P={};return x&&R.selectedItem!==N.selectedItem&&(S=R.selectedItem),(M=R).type||(M.type=Kh),Object.keys(R).forEach(function(F){N[F]!==R[F]&&(E[F]=R[F]),F!=="type"&&(R[F],bs(o.props,F)||(P[F]=R[F]))}),D&&R.hasOwnProperty("inputValue")&&o.props.onInputValueChange(R.inputValue,Se({},o.getStateAndHelpers(),R)),P},function(){Ld(b)();var N=Object.keys(E).length>1;N&&o.props.onStateChange(E,o.getStateAndHelpers()),x&&o.props.onSelect(y.selectedItem,o.getStateAndHelpers()),S!==void 0&&o.props.onChange(S,o.getStateAndHelpers()),o.props.onUserAction(E,o.getStateAndHelpers())})},o.rootRef=function(y){return o._rootNode=y},o.getRootProps=function(y,b){var x,S=y===void 0?{}:y,E=S.refKey,D=E===void 0?"ref":E,N=S.ref,M=qn(S,uT),R=b===void 0?{}:b,P=R.suppressRefError,F=P===void 0?!1:P;o.getRootProps.called=!0,o.getRootProps.refKey=D,o.getRootProps.suppressRefError=F;var U=o.getState(),B=U.isOpen;return Se((x={},x[D]=ni(N,o.rootRef),x.role="combobox",x["aria-expanded"]=B,x["aria-haspopup"]="listbox",x["aria-owns"]=B?o.menuId:void 0,x["aria-labelledby"]=o.labelId,x),M)},o.keyDownHandlers={ArrowDown:function(b){var x=this;if(b.preventDefault(),this.getState().isOpen){var S=b.shiftKey?5:1;this.moveHighlightedIndex(S,{type:ns})}else this.internalSetState({isOpen:!0,type:ns},function(){var E=x.getItemCount();if(E>0){var D=x.getState(),N=D.highlightedIndex,M=kr(N,1,{length:E},x.isItemDisabled,!0);x.setHighlightedIndex(M,{type:ns})}})},ArrowUp:function(b){var x=this;if(b.preventDefault(),this.getState().isOpen){var S=b.shiftKey?-5:-1;this.moveHighlightedIndex(S,{type:ts})}else this.internalSetState({isOpen:!0,type:ts},function(){var E=x.getItemCount();if(E>0){var D=x.getState(),N=D.highlightedIndex,M=kr(N,-1,{length:E},x.isItemDisabled,!0);x.setHighlightedIndex(M,{type:ts})}})},Enter:function(b){if(b.which!==229){var x=this.getState(),S=x.isOpen,E=x.highlightedIndex;if(S&&E!=null){b.preventDefault();var D=this.items[E],N=this.getItemNodeFromIndex(E);if(D==null||N&&N.hasAttribute("disabled"))return;this.selectHighlightedItem({type:Qh})}}},Escape:function(b){b.preventDefault(),this.reset(Se({type:Wh},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},o.buttonKeyDownHandlers=Se({},o.keyDownHandlers,{" ":function(b){b.preventDefault(),this.toggleMenu({type:tm})}}),o.inputKeyDownHandlers=Se({},o.keyDownHandlers,{Home:function(b){var x=this.getState(),S=x.isOpen;if(S){b.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var D=_i(0,!1,{length:E},this.isItemDisabled);this.setHighlightedIndex(D,{type:Gh})}}},End:function(b){var x=this.getState(),S=x.isOpen;if(S){b.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var D=_i(E-1,!0,{length:E},this.isItemDisabled);this.setHighlightedIndex(D,{type:Xh})}}}}),o.getToggleButtonProps=function(y){var b=y===void 0?{}:y,x=b.onClick;b.onPress;var S=b.onKeyDown,E=b.onKeyUp,D=b.onBlur,N=qn(b,cT),M=o.getState(),R=M.isOpen,P={onClick:ct(x,o.buttonHandleClick),onKeyDown:ct(S,o.buttonHandleKeyDown),onKeyUp:ct(E,o.buttonHandleKeyUp),onBlur:ct(D,o.buttonHandleBlur)},F=N.disabled?{}:P;return Se({type:"button",role:"button","aria-label":R?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},F,N)},o.buttonHandleKeyUp=function(y){y.preventDefault()},o.buttonHandleKeyDown=function(y){var b=pl(y);o.buttonKeyDownHandlers[b]&&o.buttonKeyDownHandlers[b].call(o,y)},o.buttonHandleClick=function(y){if(y.preventDefault(),o.props.environment){var b=o.props.environment.document,x=b.body,S=b.activeElement;x&&x===S&&y.target.focus()}process.env.NODE_ENV==="test"?o.toggleMenu({type:hl}):o.internalSetTimeout(function(){return o.toggleMenu({type:hl})})},o.buttonHandleBlur=function(y){var b=y.target;o.internalSetTimeout(function(){if(!(o.isMouseDown||!o.props.environment)){var x=o.props.environment.document.activeElement;(x==null||x.id!==o.inputId)&&x!==b&&o.reset({type:nm})}})},o.getLabelProps=function(y){return Se({htmlFor:o.inputId,id:o.labelId},y)},o.getInputProps=function(y){var b=y===void 0?{}:y,x=b.onKeyDown,S=b.onBlur,E=b.onChange,D=b.onInput;b.onChangeText;var N=qn(b,dT),M,R={};M="onChange";var P=o.getState(),F=P.inputValue,U=P.isOpen,B=P.highlightedIndex;if(!N.disabled){var X;R=(X={},X[M]=ct(E,D,o.inputHandleChange),X.onKeyDown=ct(x,o.inputHandleKeyDown),X.onBlur=ct(S,o.inputHandleBlur),X)}return Se({"aria-autocomplete":"list","aria-activedescendant":U&&typeof B=="number"&&B>=0?o.getItemId(B):void 0,"aria-controls":U?o.menuId:void 0,"aria-labelledby":N&&N["aria-label"]?void 0:o.labelId,autoComplete:"off",value:F,id:o.inputId},R,N)},o.inputHandleKeyDown=function(y){var b=pl(y);b&&o.inputKeyDownHandlers[b]&&o.inputKeyDownHandlers[b].call(o,y)},o.inputHandleChange=function(y){o.internalSetState({type:em,isOpen:!0,inputValue:y.target.value,highlightedIndex:o.props.defaultHighlightedIndex})},o.inputHandleBlur=function(){o.internalSetTimeout(function(){var y;if(!(o.isMouseDown||!o.props.environment)){var b=o.props.environment.document.activeElement,x=(b==null||(y=b.dataset)==null?void 0:y.toggle)&&o._rootNode&&o._rootNode.contains(b);x||o.reset({type:Zh})}})},o.menuRef=function(y){o._menuNode=y},o.getMenuProps=function(y,b){var x,S=y===void 0?{}:y,E=S.refKey,D=E===void 0?"ref":E,N=S.ref,M=qn(S,fT),R=b===void 0?{}:b,P=R.suppressRefError,F=P===void 0?!1:P;return o.getMenuProps.called=!0,o.getMenuProps.refKey=D,o.getMenuProps.suppressRefError=F,Se((x={},x[D]=ni(N,o.menuRef),x.role="listbox",x["aria-labelledby"]=M&&M["aria-label"]?void 0:o.labelId,x.id=o.menuId,x),M)},o.getItemProps=function(y){var b,x=y===void 0?{}:y,S=x.onMouseMove,E=x.onMouseDown,D=x.onClick;x.onPress;var N=x.index,M=x.item,R=M===void 0?process.env.NODE_ENV==="production"?void 0:rT("getItemProps","item"):M,P=qn(x,pT);N===void 0?(o.items.push(R),N=o.items.indexOf(R)):o.items[N]=R;var F="onClick",U=D,B=(b={onMouseMove:ct(S,function(){N!==o.getState().highlightedIndex&&(o.setHighlightedIndex(N,{type:Jh}),o.avoidScrolling=!0,o.internalSetTimeout(function(){return o.avoidScrolling=!1},250))}),onMouseDown:ct(E,function(se){se.preventDefault()})},b[F]=ct(U,function(){o.selectItemAtIndex(N,{type:Yh})}),b),X=P.disabled?{onMouseDown:B.onMouseDown}:B;return Se({id:o.getItemId(N),role:"option","aria-selected":o.getState().highlightedIndex===N},X,P)},o.clearItems=function(){o.items=[]},o.reset=function(y,b){y===void 0&&(y={}),y=Wo(y),o.internalSetState(function(x){var S=x.selectedItem;return Se({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,inputValue:o.props.itemToString(S)},y)},b)},o.toggleMenu=function(y,b){y===void 0&&(y={}),y=Wo(y),o.internalSetState(function(x){var S=x.isOpen;return Se({isOpen:!S},S&&{highlightedIndex:o.props.defaultHighlightedIndex},y)},function(){var x=o.getState(),S=x.isOpen,E=x.highlightedIndex;S&&o.getItemCount()>0&&typeof E=="number"&&o.setHighlightedIndex(E,y),Ld(b)()})},o.openMenu=function(y){o.internalSetState({isOpen:!0},y)},o.closeMenu=function(y){o.internalSetState({isOpen:!1},y)},o.updateStatus=lu(function(){var y;if((y=o.props)!=null&&(y=y.environment)!=null&&y.document){var b=o.getState(),x=o.items[b.highlightedIndex],S=o.getItemCount(),E=o.props.getA11yStatusMessage(Se({itemToString:o.props.itemToString,previousResultCount:o.previousResultCount,resultCount:S,highlightedItem:x},b));o.previousResultCount=S,zh(E,o.props.environment.document)}},200);var s=o.props,a=s.defaultHighlightedIndex,l=s.initialHighlightedIndex,c=l===void 0?a:l,u=s.defaultIsOpen,d=s.initialIsOpen,h=d===void 0?u:d,f=s.initialInputValue,m=f===void 0?"":f,g=s.initialSelectedItem,v=g===void 0?null:g,w=o.getState({highlightedIndex:c,isOpen:h,inputValue:m,selectedItem:v});return w.selectedItem!=null&&o.props.initialInputValue===void 0&&(w.inputValue=o.props.itemToString(w.selectedItem)),o.state=w,o}U_(n,t);var r=n.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach(function(o){clearTimeout(o)}),this.timeoutIds=[]},r.getState=function(o){return o===void 0&&(o=this.state),vs(o,this.props)},r.getItemCount=function(){var o=this.items.length;return this.itemCount!=null?o=this.itemCount:this.props.itemCount!==void 0&&(o=this.props.itemCount),o},r.getItemNodeFromIndex=function(o){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(o)):null},r.scrollHighlightedItemIntoView=function(){{var o=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(o,this._menuNode)}},r.moveHighlightedIndex=function(o,s){var a=this.getItemCount(),l=this.getState(),c=l.highlightedIndex;if(a>0){var u=kr(c,o,{length:a},this.isItemDisabled,!0);this.setHighlightedIndex(u,s)}},r.getStateAndHelpers=function(){var o=this.getState(),s=o.highlightedIndex,a=o.inputValue,l=o.selectedItem,c=o.isOpen,u=this.props.itemToString,d=this.id,h=this.getRootProps,f=this.getToggleButtonProps,m=this.getLabelProps,g=this.getMenuProps,v=this.getInputProps,w=this.getItemProps,y=this.openMenu,b=this.closeMenu,x=this.toggleMenu,S=this.selectItem,E=this.selectItemAtIndex,D=this.selectHighlightedItem,N=this.setHighlightedIndex,M=this.clearSelection,R=this.clearItems,P=this.reset,F=this.setItemCount,U=this.unsetItemCount,B=this.internalSetState;return{getRootProps:h,getToggleButtonProps:f,getLabelProps:m,getMenuProps:g,getInputProps:v,getItemProps:w,reset:P,openMenu:y,closeMenu:b,toggleMenu:x,selectItem:S,selectItemAtIndex:E,selectHighlightedItem:D,setHighlightedIndex:N,clearSelection:M,clearItems:R,setItemCount:F,unsetItemCount:U,setState:B,itemToString:u,id:d,highlightedIndex:s,inputValue:a,isOpen:c,selectedItem:l}},r.componentDidMount=function(){var o=this;if(process.env.NODE_ENV!=="production"&&this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&Ud(this._menuNode,this.getMenuProps),!this.props.environment)this.cleanup=function(){o.internalClearTimeouts()};else{var s=function(){o.isMouseDown=!0},a=function(f){o.isMouseDown=!1;var m=ws(f.target,[o._rootNode,o._menuNode],o.props.environment);!m&&o.getState().isOpen&&o.reset({type:Hh},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},l=function(){o.isTouchMove=!1},c=function(){o.isTouchMove=!0},u=function(f){var m=ws(f.target,[o._rootNode,o._menuNode],o.props.environment,!1);!o.isTouchMove&&!m&&o.getState().isOpen&&o.reset({type:im},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},d=this.props.environment;d.addEventListener("mousedown",s),d.addEventListener("mouseup",a),d.addEventListener("touchstart",l),d.addEventListener("touchmove",c),d.addEventListener("touchend",u),this.cleanup=function(){o.internalClearTimeouts(),o.updateStatus.cancel(),d.removeEventListener("mousedown",s),d.removeEventListener("mouseup",a),d.removeEventListener("touchstart",l),d.removeEventListener("touchmove",c),d.removeEventListener("touchend",u)}}},r.shouldScroll=function(o,s){var a=this.props.highlightedIndex===void 0?this.getState():this.props,l=a.highlightedIndex,c=s.highlightedIndex===void 0?o:s,u=c.highlightedIndex,d=l&&this.getState().isOpen&&!o.isOpen,h=l!==u;return d||h},r.componentDidUpdate=function(o,s){process.env.NODE_ENV!=="production"&&(uu(this.state,o,this.props),this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&Ud(this._menuNode,this.getMenuProps)),bs(this.props,"selectedItem")&&this.props.selectedItemChanged(o.selectedItem,this.props.selectedItem)&&this.internalSetState({type:rm,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(s,o)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var o=Vd(this.props.children,Ht);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var s=Vd(o(this.getStateAndHelpers()));if(!s)return null;if(this.getRootProps.called||this.props.suppressRefError)return process.env.NODE_ENV!=="production"&&!this.getRootProps.suppressRefError&&!this.props.suppressRefError&&mT(s,this.getRootProps),s;if(Uh(s))return C.cloneElement(s,this.getRootProps($h(s)));if(process.env.NODE_ENV!=="production")throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function")},n}(C.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:nT,itemToString:function(n){return n==null?"":(process.env.NODE_ENV!=="production"&&oT(n)&&!n.hasOwnProperty("toString")&&console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.","The object that was passed:",n),String(n))},onStateChange:Ht,onInputValueChange:Ht,onUserAction:Ht,onChange:Ht,onSelect:Ht,onOuterClick:Ht,selectedItemChanged:function(n,r){return n!==r},environment:typeof window>"u"?void 0:window,stateReducer:function(n,r){return r},suppressRefError:!1,scrollIntoView:Bh},e.stateChangeTypes=lT,e}();process.env.NODE_ENV!=="production"&&(hT.propTypes={children:G.func,defaultHighlightedIndex:G.number,defaultIsOpen:G.bool,initialHighlightedIndex:G.number,initialSelectedItem:G.any,initialInputValue:G.string,initialIsOpen:G.bool,getA11yStatusMessage:G.func,itemToString:G.func,onChange:G.func,onSelect:G.func,onStateChange:G.func,onInputValueChange:G.func,onUserAction:G.func,onOuterClick:G.func,selectedItemChanged:G.func,stateReducer:G.func,itemCount:G.number,id:G.string,environment:G.shape({addEventListener:G.func.isRequired,removeEventListener:G.func.isRequired,document:G.shape({createElement:G.func.isRequired,getElementById:G.func.isRequired,activeElement:G.any.isRequired,body:G.any.isRequired}).isRequired,Node:G.func.isRequired}),suppressRefError:G.bool,scrollIntoView:G.func,selectedItem:G.any,isOpen:G.bool,inputValue:G.string,highlightedIndex:G.number,labelId:G.string,inputId:G.string,menuId:G.string,getItemId:G.func});function Ud(e,t){var n=t.refKey;e||console.error('downshift: The ref prop "'+n+'" from getMenuProps was not applied correctly on your menu element.')}function mT(e,t){var n=t.refKey,r=n!=="ref",i=!Uh(e);i&&!r&&!Dd.isForwardRef(e)?console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps"):!i&&r&&console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"'),!Dd.isForwardRef(e)&&!$h(e)[n]&&console.error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}var om={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function gT(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(s){yT(s,e,t,n),n[s]!==t[s]&&(o[s]=n[s])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Se({type:i},o))}function yT(e,t,n,r){var i=t.props,o=t.type,s="on"+cu(e)+"Change";i[s]&&r[e]!==void 0&&r[e]!==n[e]&&i[s](Se({type:o},r))}function vT(e,t){return t.changes}var $d=lu(function(e,t){zh(e,t)},200),bT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect,wT="useId"in C?function(t){var n=t.id,r=t.labelId,i=t.menuId,o=t.getItemId,s=t.toggleButtonId,a=t.inputId,l="downshift-"+C.useId();n||(n=l);var c=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(u){return n+"-item-"+u},toggleButtonId:s||n+"-toggle-button",inputId:a||n+"-input"});return c.current}:function(t){var n=t.id,r=n===void 0?"downshift-"+Vh():n,i=t.labelId,o=t.menuId,s=t.getItemId,a=t.toggleButtonId,l=t.inputId,c=C.useRef({labelId:i||r+"-label",menuId:o||r+"-menu",getItemId:s||function(u){return r+"-item-"+u},toggleButtonId:a||r+"-toggle-button",inputId:l||r+"-input"});return c.current};function xT(e,t,n,r){var i,o;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],o=t}else o=t===void 0?n.indexOf(e):t,i=e;return[i,o]}function cu(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function sm(e){var t=C.useRef(e);return t.current=e,t}function IT(e,t,n,r){var i=C.useRef(),o=C.useRef(),s=C.useCallback(function(f,m){o.current=m,f=vs(f,m.props);var g=e(f,m),v=m.props.stateReducer(f,Se({},m,{changes:g}));return v},[e]),a=C.useReducer(s,t,n),l=a[0],c=a[1],u=sm(t),d=C.useCallback(function(f){return c(Se({props:u.current},f))},[u]),h=o.current;return C.useEffect(function(){var f=vs(i.current,h==null?void 0:h.props),m=h&&i.current&&!r(f,l);m&&gT(h,f,l),i.current=l},[l,h,r]),[l,d]}var Yi={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:vT,scrollIntoView:Bh,environment:typeof window>"u"?void 0:window};function pr(e,t,n){n===void 0&&(n=om);var r=e["default"+cu(t)];return r!==void 0?r:n[t]}function Zi(e,t,n){n===void 0&&(n=om);var r=e[t];if(r!==void 0)return r;var i=e["initial"+cu(t)];return i!==void 0?i:pr(e,t,n)}function CT(e){var t=Zi(e,"selectedItem"),n=Zi(e,"isOpen"),r=TT(e),i=Zi(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(o){return e.itemToKey(o)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function eo(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=e.isItemDisabled,a=e.itemToKey,l=t.selectedItem,c=t.highlightedIndex;return r.length===0?-1:i!==void 0&&c===i&&!s(r[i],i)?i:o!==void 0&&!s(r[o],o)?o:l?r.findIndex(function(u){return a(l)===a(u)}):n<0&&!s(r[r.length-1],r.length-1)?r.length-1:n>0&&!s(r[0],0)?0:-1}function ST(e,t,n){var r=C.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return C.useEffect(function(){if(!e)return Ht;var i=n.map(function(u){return u.current});function o(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function s(u){r.current.isMouseDown=!1,ws(u.target,i,e)||t()}function a(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function l(){r.current.isTouchMove=!0}function c(u){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!ws(u.target,i,e,!1)&&t()}return e.addEventListener("mousedown",o),e.addEventListener("mouseup",s),e.addEventListener("touchstart",a),e.addEventListener("touchmove",l),e.addEventListener("touchend",c),function(){e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",s),e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",c)}},[n,e,t]),r.current}var am=function(){return Ht};process.env.NODE_ENV!=="production"&&(am=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=C.useRef(n.reduce(function(s,a){return s[a]={},s},{}));C.useEffect(function(){Object.keys(i.current).forEach(function(s){var a=i.current[s];if(!Object.keys(a).length){console.error("downshift: You forgot to call the "+s+" getter function on your component / element.");return}var l=a.suppressRefError,c=a.refKey,u=a.elementRef;l||u!=null&&u.current||console.error('downshift: The ref prop "'+c+'" from '+s+" was not applied correctly on your element.")})},[]);var o=C.useCallback(function(s,a,l,c){i.current[s]={suppressRefError:a,refKey:l,elementRef:c}},[]);return o});function OT(e,t,n,r){r===void 0&&(r={});var i=r.document,o=Ls();C.useEffect(function(){if(!(!e||o||!i)){var s=e(t);$d(s,i)}},n),C.useEffect(function(){return function(){$d.cancel(),aT(i)}},[i])}function ET(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,s=e.scrollIntoView,a=C.useRef(!0);return bT(function(){t<0||!n||!Object.keys(r.current).length||(a.current===!1?a.current=!0:s(i(t),o))},[t]),a}var lm=Ht;process.env.NODE_ENV!=="production"&&(lm=function(t){var n=t.props,r=t.state,i=C.useRef(n),o=Ls();C.useEffect(function(){o||(uu(r,i.current,n),i.current=n)},[r,n,o])});function qd(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return Se({isOpen:!1,highlightedIndex:-1},i&&Se({selectedItem:e.items[t],isOpen:pr(e,"isOpen"),highlightedIndex:pr(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function _T(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Ls(){var e=C.useRef(!0);return C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function ml(e){var t=pr(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function TT(e){var t=Zi(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var rs={environment:G.shape({addEventListener:G.func.isRequired,removeEventListener:G.func.isRequired,document:G.shape({createElement:G.func.isRequired,getElementById:G.func.isRequired,activeElement:G.any.isRequired,body:G.any.isRequired}).isRequired,Node:G.func.isRequired}),itemToString:G.func,itemToKey:G.func,stateReducer:G.func},um=Se({},rs,{getA11yStatusMessage:G.func,highlightedIndex:G.number,defaultHighlightedIndex:G.number,initialHighlightedIndex:G.number,isOpen:G.bool,defaultIsOpen:G.bool,initialIsOpen:G.bool,selectedItem:G.any,initialSelectedItem:G.any,defaultSelectedItem:G.any,id:G.string,labelId:G.string,menuId:G.string,getItemId:G.func,toggleButtonId:G.string,onSelectedItemChange:G.func,onHighlightedIndexChange:G.func,onStateChange:G.func,onIsOpenChange:G.func,scrollIntoView:G.func});function NT(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:eo(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:eo(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:i.isItemDisabled(i.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:ml(i),isOpen:pr(i,"isOpen"),selectedItem:pr(i,"selectedItem"),inputValue:pr(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Se({},e,o)}Ei(Ei({},um),{items:G.array.isRequired,isItemDisabled:G.func});Ei(Ei({},Yi),{isItemDisabled:function(){return!1}});process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;var du=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_down__":0,fu=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_up__":1,pu=process.env.NODE_ENV!=="production"?"__input_keydown_escape__":2,hu=process.env.NODE_ENV!=="production"?"__input_keydown_home__":3,mu=process.env.NODE_ENV!=="production"?"__input_keydown_end__":4,gu=process.env.NODE_ENV!=="production"?"__input_keydown_page_up__":5,yu=process.env.NODE_ENV!=="production"?"__input_keydown_page_down__":6,vu=process.env.NODE_ENV!=="production"?"__input_keydown_enter__":7,bu=process.env.NODE_ENV!=="production"?"__input_change__":8,xs=process.env.NODE_ENV!=="production"?"__input_blur__":9,wu=process.env.NODE_ENV!=="production"?"__input_click__":10,cm=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":11,dm=process.env.NODE_ENV!=="production"?"__item_mouse_move__":12,xu=process.env.NODE_ENV!=="production"?"__item_click__":13,fm=process.env.NODE_ENV!=="production"?"__togglebutton_click__":14,pm=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,hm=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,mm=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,gm=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,Iu=process.env.NODE_ENV!=="production"?"__function_select_item__":19,ym=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,vm=process.env.NODE_ENV!=="production"?"__function_reset__":21,Cu=process.env.NODE_ENV!=="production"?"__controlled_prop_updated_selected_item__":22,bm=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:Cu,FunctionCloseMenu:mm,FunctionOpenMenu:hm,FunctionReset:vm,FunctionSelectItem:Iu,FunctionSetHighlightedIndex:gm,FunctionSetInputValue:ym,FunctionToggleMenu:pm,InputBlur:xs,InputChange:bu,InputClick:wu,InputKeyDownArrowDown:du,InputKeyDownArrowUp:fu,InputKeyDownEnd:mu,InputKeyDownEnter:vu,InputKeyDownEscape:pu,InputKeyDownHome:hu,InputKeyDownPageDown:yu,InputKeyDownPageUp:gu,ItemClick:xu,ItemMouseMove:dm,MenuMouseLeave:cm,ToggleButtonClick:fm});function kT(e){var t=CT(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),Se({},t,{inputValue:r})}var AT=Se({},um,{items:G.array.isRequired,isItemDisabled:G.func,inputValue:G.string,defaultInputValue:G.string,initialInputValue:G.string,inputId:G.string,onInputValueChange:G.func});function RT(e,t,n,r){var i=C.useRef(),o=IT(e,t,n,r),s=o[0],a=o[1],l=Ls();return C.useEffect(function(){if(bs(t,"selectedItem")){if(!l){var c=t.itemToKey(t.selectedItem)!==t.itemToKey(i.current);c&&a({type:Cu,inputValue:t.itemToString(t.selectedItem)})}i.current=s.selectedItem===i.current?t.selectedItem:s.selectedItem}},[s.selectedItem,t.selectedItem]),[vs(s,t),a]}var wm=Ht;process.env.NODE_ENV!=="production"&&(wm=function(t,n){G.checkPropTypes(AT,t,"prop",n.name)});var PT=Se({},Yi,{isItemDisabled:function(){return!1}});function FT(e,t){var n,r=t.type,i=t.props,o=t.altKey,s;switch(r){case xu:s={isOpen:pr(i,"isOpen"),highlightedIndex:ml(i),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case du:e.isOpen?s={highlightedIndex:kr(e.highlightedIndex,1,i.items,i.isItemDisabled,!0)}:s={highlightedIndex:o&&e.selectedItem==null?-1:eo(i,e,1),isOpen:i.items.length>=0};break;case fu:e.isOpen?o?s=qd(i,e.highlightedIndex):s={highlightedIndex:kr(e.highlightedIndex,-1,i.items,i.isItemDisabled,!0)}:s={highlightedIndex:eo(i,e,-1),isOpen:i.items.length>=0};break;case vu:s=qd(i,e.highlightedIndex);break;case pu:s=Se({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case gu:s={highlightedIndex:kr(e.highlightedIndex,-10,i.items,i.isItemDisabled,!0)};break;case yu:s={highlightedIndex:kr(e.highlightedIndex,10,i.items,i.isItemDisabled,!0)};break;case hu:s={highlightedIndex:_i(0,!1,i.items,i.isItemDisabled)};break;case mu:s={highlightedIndex:_i(i.items.length-1,!0,i.items,i.isItemDisabled)};break;case xs:s=Se({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case bu:s={isOpen:!0,highlightedIndex:ml(i),inputValue:t.inputValue};break;case wu:s={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:eo(i,e,0)};break;case Iu:s={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case Cu:s={inputValue:t.inputValue};break;default:return NT(e,t,bm)}return Se({},e,s)}var DT=["onMouseLeave","refKey","ref"],MT=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],jT=["onClick","onPress","refKey","ref"],LT=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Su.stateChangeTypes=bm;function Su(e){e===void 0&&(e={}),wm(e,Su);var t=Se({},PT,e),n=t.items,r=t.scrollIntoView,i=t.environment,o=t.getA11yStatusMessage,s=RT(FT,t,kT,_T),a=s[0],l=s[1],c=a.isOpen,u=a.highlightedIndex,d=a.selectedItem,h=a.inputValue,f=C.useRef(null),m=C.useRef({}),g=C.useRef(null),v=C.useRef(null),w=Ls(),y=wT(t),b=C.useRef(),x=sm({state:a,props:t}),S=C.useCallback(function(V){return m.current[y.getItemId(V)]},[y]);OT(o,a,[c,u,d,h],i);var E=ET({menuElement:f.current,highlightedIndex:u,isOpen:c,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:S});lm({props:t,state:a}),C.useEffect(function(){var V=Zi(t,"isOpen");V&&g.current&&g.current.focus()},[]),C.useEffect(function(){w||(b.current=n.length)});var D=ST(i,C.useCallback(function(){x.current.state.isOpen&&l({type:xs,selectItem:!1})},[l,x]),C.useMemo(function(){return[f,v,g]},[f.current,v.current,g.current])),N=am("getInputProps","getMenuProps");C.useEffect(function(){c||(m.current={})},[c]),C.useEffect(function(){var V;!c||!(i!=null&&i.document)||!(g!=null&&(V=g.current)!=null&&V.focus)||i.document.activeElement!==g.current&&g.current.focus()},[c,i]);var M=C.useMemo(function(){return{ArrowDown:function(O){O.preventDefault(),l({type:du,altKey:O.altKey})},ArrowUp:function(O){O.preventDefault(),l({type:fu,altKey:O.altKey})},Home:function(O){x.current.state.isOpen&&(O.preventDefault(),l({type:hu}))},End:function(O){x.current.state.isOpen&&(O.preventDefault(),l({type:mu}))},Escape:function(O){var z=x.current.state;(z.isOpen||z.inputValue||z.selectedItem||z.highlightedIndex>-1)&&(O.preventDefault(),l({type:pu}))},Enter:function(O){var z=x.current.state;!z.isOpen||O.which===229||(O.preventDefault(),l({type:vu}))},PageUp:function(O){x.current.state.isOpen&&(O.preventDefault(),l({type:gu}))},PageDown:function(O){x.current.state.isOpen&&(O.preventDefault(),l({type:yu}))}}},[l,x]),R=C.useCallback(function(V){return Se({id:y.labelId,htmlFor:y.inputId},V)},[y]),P=C.useCallback(function(V,O){var z,$=V===void 0?{}:V,Y=$.onMouseLeave,ne=$.refKey,te=ne===void 0?"ref":ne,ae=$.ref,Z=qn($,DT),ye=O===void 0?{}:O,q=ye.suppressRefError,we=q===void 0?!1:q;return N("getMenuProps",we,te,f),Se((z={},z[te]=ni(ae,function(ee){f.current=ee}),z.id=y.menuId,z.role="listbox",z["aria-labelledby"]=Z&&Z["aria-label"]?void 0:""+y.labelId,z.onMouseLeave=ct(Y,function(){l({type:cm})}),z),Z)},[l,N,y]),F=C.useCallback(function(V){var O,z,$=V===void 0?{}:V,Y=$.item,ne=$.index,te=$.refKey,ae=te===void 0?"ref":te,Z=$.ref,ye=$.onMouseMove,q=$.onMouseDown,we=$.onClick;$.onPress;var ee=$.disabled,Ke=qn($,MT);ee!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Be=x.current,Le=Be.props,tt=Be.state,at=xT(Y,ne,Le.items,"Pass either item or index to getItemProps!"),lt=at[0],Oe=at[1],ft=Le.isItemDisabled(lt,Oe),_t="onClick",mt=we,rt=function(){D.isTouchEnd||Oe===tt.highlightedIndex||(E.current=!1,l({type:dm,index:Oe,disabled:ft}))},L=function(){l({type:xu,index:Oe})},H=function(oe){return oe.preventDefault()};return Se((O={},O[ae]=ni(Z,function(j){j&&(m.current[y.getItemId(Oe)]=j)}),O["aria-disabled"]=ft,O["aria-selected"]=Oe===tt.highlightedIndex,O.id=y.getItemId(Oe),O.role="option",O),!ft&&(z={},z[_t]=ct(mt,L),z),{onMouseMove:ct(ye,rt),onMouseDown:ct(q,H)},Ke)},[l,y,x,D,E]),U=C.useCallback(function(V){var O,z=V===void 0?{}:V,$=z.onClick;z.onPress;var Y=z.refKey,ne=Y===void 0?"ref":Y,te=z.ref,ae=qn(z,jT),Z=x.current.state,ye=function(){l({type:fm})};return Se((O={},O[ne]=ni(te,function(q){v.current=q}),O["aria-controls"]=y.menuId,O["aria-expanded"]=Z.isOpen,O.id=y.toggleButtonId,O.tabIndex=-1,O),!ae.disabled&&Se({},{onClick:ct($,ye)}),ae)},[l,x,y]),B=C.useCallback(function(V,O){var z,$=V===void 0?{}:V,Y=$.onKeyDown,ne=$.onChange,te=$.onInput,ae=$.onBlur;$.onChangeText;var Z=$.onClick,ye=$.refKey,q=ye===void 0?"ref":ye,we=$.ref,ee=qn($,LT),Ke=O===void 0?{}:O,Be=Ke.suppressRefError,Le=Be===void 0?!1:Be;N("getInputProps",Le,q,g);var tt=x.current.state,at=function(H){var j=pl(H);j&&M[j]&&M[j](H)},lt=function(H){l({type:bu,inputValue:H.target.value})},Oe=function(H){if(i!=null&&i.document&&tt.isOpen&&!D.isMouseDown){var j=H.relatedTarget===null&&i.document.activeElement!==i.document.body;l({type:xs,selectItem:!j})}},ft=function(){l({type:wu})},_t="onChange",mt={};if(!ee.disabled){var rt;mt=(rt={},rt[_t]=ct(ne,te,lt),rt.onKeyDown=ct(Y,at),rt.onBlur=ct(ae,Oe),rt.onClick=ct(Z,ft),rt)}return Se((z={},z[q]=ni(we,function(L){g.current=L}),z["aria-activedescendant"]=tt.isOpen&&tt.highlightedIndex>-1?y.getItemId(tt.highlightedIndex):"",z["aria-autocomplete"]="list",z["aria-controls"]=y.menuId,z["aria-expanded"]=tt.isOpen,z["aria-labelledby"]=ee&&ee["aria-label"]?void 0:y.labelId,z.autoComplete="off",z.id=y.inputId,z.role="combobox",z.value=tt.inputValue,z),mt,ee)},[l,y,i,M,x,D,N]),X=C.useCallback(function(){l({type:pm})},[l]),se=C.useCallback(function(){l({type:mm})},[l]),ce=C.useCallback(function(){l({type:hm})},[l]),ge=C.useCallback(function(V){l({type:gm,highlightedIndex:V})},[l]),be=C.useCallback(function(V){l({type:Iu,selectedItem:V})},[l]),I=C.useCallback(function(V){l({type:ym,inputValue:V})},[l]),J=C.useCallback(function(){l({type:vm})},[l]);return{getItemProps:F,getLabelProps:R,getMenuProps:P,getInputProps:B,getToggleButtonProps:U,toggleMenu:X,openMenu:ce,closeMenu:se,setHighlightedIndex:ge,setInputValue:I,selectItem:be,reset:J,highlightedIndex:u,isOpen:c,selectedItem:d,inputValue:h}}rs.stateReducer,rs.itemToKey,rs.environment,G.array,G.array,G.array,G.func,G.number,G.number,G.number,G.func,G.func,G.string,G.string;Yi.itemToKey,Yi.stateReducer,Yi.environment;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;const BT="_comboboxContainer_1lcc8_1",VT="_inputContainer_1lcc8_12",UT="_input_1lcc8_12",$T="_toggleButton_1lcc8_33",qT="_menu_1lcc8_39",zT="_menuBottom_1lcc8_55",KT="_menuTop_1lcc8_61",HT="_menuItem_1lcc8_66",JT="_highlighted_1lcc8_73",WT="_selected_1lcc8_77",QT="_hidden_1lcc8_81",pn={comboboxContainer:BT,inputContainer:VT,input:UT,toggleButton:$T,menu:qT,menuBottom:zT,menuTop:KT,menuItem:HT,highlighted:JT,selected:WT,hidden:QT};function GT(e){const t=e.toLowerCase();return function(r){return!e||r.label.toLowerCase().includes(t)||r.value.toLowerCase().includes(t)}}function xm({items:e,selectedValue:t,onSelectedItemChange:n,placeholder:r,disabled:i,style:o,menuPosition:s="bottom"}){const[a,l]=C.useState(e),c=C.useRef(null);C.useEffect(()=>l(e),[e]);const u=C.useCallback(E=>{(E==null?void 0:E.length)>0?l(e.filter(GT(E))):l(e)},[e]),{isOpen:d,getToggleButtonProps:h,getMenuProps:f,getInputProps:m,highlightedIndex:g,getItemProps:v,setInputValue:w}=Su({items:a,selectedItem:t?e.find(E=>E.value===t):null,itemToString:E=>(E==null?void 0:E.label)||"",onInputValueChange:({inputValue:E})=>u(E),onSelectedItemChange:({selectedItem:E})=>{var D;n(E),(D=c.current)==null||D.blur()}}),y=()=>{w(""),l(e)},b=()=>y(),x=C.useMemo(()=>{var E;return(E=e.find(D=>D.value===t))==null?void 0:E.label},[e,t]),S=()=>{w(t&&x?x:"")};return p.jsxs("div",{style:{position:"relative",...o},children:[p.jsx("div",{className:pn.comboboxContainer,children:p.jsxs("div",{className:pn.inputContainer,children:[p.jsx("input",{style:{border:"none"},disabled:i,placeholder:r,className:pn.input,...m({onFocus:b,onBlur:S,ref:c})}),p.jsx("button",{style:{border:"none"},disabled:i,"aria-label":"toggle menu",className:pn.toggleButton,type:"button",...h(),children:d?p.jsx(p.Fragment,{children:"↑"}):p.jsx(p.Fragment,{children:"↓"})})]})}),p.jsx("ul",{className:`${pn.menu} ${d&&e.length?"":pn.hidden} ${s==="top"?pn.menuTop:pn.menuBottom}`,...f(),children:d&&a.map((E,D)=>p.jsx("li",{className:`${pn.menuItem} ${g===D?pn.highlighted:""} ${t===(E==null?void 0:E.value)?pn.selected:""}`,...v({item:E,index:D}),children:p.jsx("span",{children:E.label})},E.id))})]})}function XT(e,t){var r;const n=((r=e==null?void 0:e.read)==null?void 0:r.selectedFieldMappings)||{};t.forEach(i=>{var a,l;const{field:o,value:s}=i;if(s===null){const c=n[o];delete n[o],c&&((a=e==null?void 0:e.read)!=null&&a.selectedValueMappings)&&e.read.selectedValueMappings[c]&&delete e.read.selectedValueMappings[c]}else{const c=n[o];n[o]=s,c&&c!==s&&((l=e==null?void 0:e.read)!=null&&l.selectedValueMappings)&&e.read.selectedValueMappings[c]&&delete e.read.selectedValueMappings[c]}})}function ao(e,t,n){t(e,r=>XT(r,n))}const YT="Each field must be mapped to a unique value";function Ou({field:e,onSelectChange:t,allFields:n}){var y;const{configureState:r,selectedObjectName:i,setConfigureState:o}=Xt(),[s,a]=C.useState(!0),{isError:l,removeError:c,getError:u}=An(),d=(y=r==null?void 0:r.read)==null?void 0:y.selectedFieldMappings,h=d==null?void 0:d[e.mapToName];C.useEffect(()=>{e._default&&!h&&i&&r&&ao(i,o,[{field:e.mapToName,value:e._default}]),a(!1)},[e,o,i,h,r]);const f=C.useMemo(()=>n.map(b=>({id:b.fieldName,label:b.displayName,value:b.fieldName})),[n]),m=p.jsx(xm,{disabled:s,items:f,selectedValue:h||null,onSelectedItemChange:b=>{t({target:{name:e.mapToName,value:b==null?void 0:b.value}})},placeholder:"Please select one",style:{width:"100%"}}),g=C.useCallback(()=>{i&&(ao(i,o,[{field:e.mapToName,value:null}]),l(Ee.MAPPING,i)&&c(Ee.MAPPING,i))},[e.mapToName,i,o,l,c]),{hasDuplicationError:v,errorMessage:w}=C.useMemo(()=>{const b=u(Ee.MAPPING,i),x=Array.isArray(b)&&b.length>0&&b.includes(e.mapToName);return{hasDuplicationError:x,errorMessage:x?YT:""}},[i,u,e.mapToName]);return p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem",marginBottom:".25rem"},children:[p.jsx("span",{style:{fontWeight:500},children:e.mapToDisplayName??e.mapToName}),p.jsx("span",{children:(e==null?void 0:e.prompt)&&p.jsx(Oh,{id:`tooltip-id-${e==null?void 0:e.prompt}`,tooltipText:e==null?void 0:e.prompt})})]}),p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem"},children:[m,p.jsx(Xe,{type:"button",variant:"ghost",onClick:g,children:"Clear"})]})]},e.mapToName),v&&p.jsxs("span",{style:{color:"red",fontSize:"14px",marginTop:"4px"},children:[" ",w," "]},e.mapToName)]})}const ZT="_formControl_9qd8d_1",eN="_formLabel_9qd8d_5",tN="_formLabelRequired_9qd8d_11",nN="_formInput_9qd8d_16",rN="_formInputInvalid_9qd8d_20",iN="_formError_9qd8d_24",oN="_disabled_9qd8d_30",Er={formControl:ZT,formLabel:eN,formLabelRequired:tN,formInput:nN,formInputInvalid:rN,formError:iN,disabled:oN};function Bs({id:e,label:t,isRequired:n=!1,isDisabled:r=!1,isInvalid:i=!1,errorMessage:o,children:s}){return p.jsxs("div",{className:ln(Er.formControl,{[Er.disabled]:r}),children:[t&&p.jsx("label",{htmlFor:e,className:ln(Er.formLabel,{[Er.formLabelRequired]:n}),children:t}),p.jsx("div",{id:e,className:ln(Er.formInput,{[Er.formInputInvalid]:i}),children:s}),i&&o&&p.jsx("div",{className:Er.formError,role:"alert",children:o})]})}function Im({selectedFieldMappings:e,selectedObjectName:t,fieldName:n,fieldValue:r,setError:i}){if(!e||!t)return!1;if(Object.values(e).some(s=>s===r&&s!==n)){console.error("Each field must be mapped to a unique value",e);const s=Object.keys(e).filter(l=>e[l]===r),a=[n,...s];return i(Ee.MAPPING,t,a),!0}return!1}function sN({dynamicFieldMappings:e,onSelectChange:t,allFields:n}){return e.length?p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:e.map(r=>p.jsx(Bs,{id:r.mapToName,children:p.jsx(Ou,{allFields:n,field:r,onSelectChange:t})},r.mapToName))}):null}function aN(){var m,g;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{isError:r,removeError:i,setError:o}=An(),s=((m=t==null?void 0:t.read)==null?void 0:m.allFields)||[],{fieldMapping:a}=St(),l=(g=t==null?void 0:t.read)==null?void 0:g.selectedFieldMappings,c=v=>{const{value:w,name:y}=v.target;!w||Im({selectedFieldMappings:l,selectedObjectName:e,fieldName:y,fieldValue:w,setError:o})||(e&&ao(e,n,[{field:y,value:w}]),r(Ee.MAPPING,y)&&i(Ee.MAPPING,y),e&&r(Ee.MAPPING,e)&&i(Ee.MAPPING,e))},u=C.useMemo(()=>!e||!a?[]:Object.values(a[e]||{}).flat().filter(v=>!v.fieldName),[a,e]),d=C.useMemo(()=>{var y;return(((y=t==null?void 0:t.read)==null?void 0:y.optionalMapFields)||[]).filter(b=>!u.some(x=>x.mapToName===b.mapToName))},[t,u]),h=u.length>0;return d.length>0||h?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Map the following optional fields"}),p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:[d==null?void 0:d.map(v=>p.jsx(Bs,{id:v.mapToName,children:p.jsx(Ou,{allFields:s,field:v,onSelectChange:c})},v.mapToName)),h&&p.jsx(sN,{dynamicFieldMappings:u,onSelectChange:c,allFields:s})]})]}):null}function lN(){var c;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{isError:r,removeError:i,setError:o}=An(),s=(c=t==null?void 0:t.read)==null?void 0:c.selectedFieldMappings,a=u=>{const{value:d,name:h}=u.target;!d||Im({selectedFieldMappings:s,selectedObjectName:e,fieldName:h,fieldValue:d,setError:o})||(e&&ao(e,n,[{field:h,value:d}]),r(Ee.MAPPING,h)&&i(Ee.MAPPING,h),e&&r(Ee.MAPPING,e)&&i(Ee.MAPPING,e))},l=C.useMemo(()=>{var u;return((u=t==null?void 0:t.read)==null?void 0:u.requiredMapFields)||[]},[t]);return l!=null&&l.length?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Map the following fields"}),p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:l.map(u=>{var d;return p.jsx(Bs,{id:u.mapToName,isInvalid:r(Ee.MAPPING,u.mapToName),errorMessage:"* required",children:p.jsx(Ou,{allFields:((d=t==null?void 0:t.read)==null?void 0:d.allFields)||[],field:u,onSelectChange:a})},u.mapToName)})})]}):null}const uN=(e,t)=>e.filter(n=>!t.has(n));function cN(){var h,f,m;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{fieldMapping:r}=St(),i=((h=t==null?void 0:t.read)==null?void 0:h.selectedFieldMappings)||{},o=Object.keys(i),s=((f=t==null?void 0:t.read)==null?void 0:f.requiredMapFields)||[],a=((m=t==null?void 0:t.read)==null?void 0:m.optionalMapFields)||[],l=e&&r?Object.values(r[e]||{}).flat().filter(g=>!g.fieldName):[],c=s.concat(l,a).map(g=>g.mapToName),u=new Set(c),d=uN(o,u);C.useEffect(()=>{e&&d.length&&ao(e,n,d.map(g=>({field:g,value:null})))},[e,n,d])}const dN={backgroundColor:"var(--amp-colors-bg-highlight)",borderColor:"var(--amp-colors-bg-highlight)",padding:".5rem 1rem"};function Cm({children:e,style:t}){return p.jsx(Hn,{style:{...dN,...t},children:e})}function fN(){var c,u,d;const{data:e}=yr(),{hydratedRevision:t}=Xr(),{selectedObjectName:n}=Xt(),{providerName:r}=Ot(),i=e==null?void 0:e.appName,o=(d=(u=(c=t==null?void 0:t.content)==null?void 0:c.read)==null?void 0:u.objects)==null?void 0:d.find(h=>h.objectName===n),s=(o==null?void 0:o.displayName)||n&&un(n),a=o==null?void 0:o.mapToName,l=(o==null?void 0:o.mapToDisplayName)||a&&un(a);return l&&i&&r?p.jsx(Cm,{style:{marginTop:"1rem"},children:p.jsxs("p",{style:{margin:"1rem 0"},children:[p.jsx("b",{children:l})," in ",i," is mapped to"," ",p.jsx("b",{children:s})," in ",r,"."]})}):null}function zd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sm(...e){return t=>{let n=!1;const r=e.map(i=>{const o=zd(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():zd(e[i],null)}}}}function Ti(...e){return W.useCallback(Sm(...e),e)}function Vs(e,t=[]){let n=[];function r(o,s){const a=W.createContext(s),l=n.length;n=[...n,s];const c=d=>{var w;const{scope:h,children:f,...m}=d,g=((w=h==null?void 0:h[e])==null?void 0:w[l])||a,v=W.useMemo(()=>m,Object.values(m));return p.jsx(g.Provider,{value:v,children:f})};c.displayName=o+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,m=W.useContext(f);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>W.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return W.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,pN(i,...t)]}function pN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function gn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var lo=globalThis!=null&&globalThis.document?W.useLayoutEffect:()=>{},hN=W[" useInsertionEffect ".trim().toString()]||lo;function Eu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=mN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const u=W.useRef(e!==void 0);W.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=W.useCallback(u=>{var d;if(a){const h=gN(u)?u(e):u;h!==e&&((d=s.current)==null||d.call(s,h))}else o(u)},[a,e,o,s]);return[l,c]}function mN({defaultProp:e,onChange:t}){const[n,r]=W.useState(e),i=W.useRef(n),o=W.useRef(t);return hN(()=>{o.current=t},[t]),W.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function gN(e){return typeof e=="function"}function yN(e){const t=W.useRef({value:e,previous:e});return W.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function vN(e){const[t,n]=W.useState(void 0);return lo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function bN(e,t){return W.useReducer((n,r)=>t[n][r]??n,e)}var _u=e=>{const{present:t,children:n}=e,r=wN(t),i=typeof n=="function"?n({present:r.isPresent}):W.Children.only(n),o=Ti(r.ref,xN(i));return typeof n=="function"||r.isPresent?W.cloneElement(i,{ref:o}):null};_u.displayName="Presence";function wN(e){const[t,n]=W.useState(),r=W.useRef(null),i=W.useRef(e),o=W.useRef("none"),s=e?"mounted":"unmounted",[a,l]=bN(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return W.useEffect(()=>{const c=Qo(r.current);o.current=a==="mounted"?c:"none"},[a]),lo(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Qo(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),lo(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=Qo(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&g&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=f=>{f.target===t&&(o.current=Qo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:W.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Qo(e){return(e==null?void 0:e.animationName)||"none"}function xN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gl(e){const t=IN(e),n=W.forwardRef((r,i)=>{const{children:o,...s}=r,a=W.Children.toArray(o),l=a.find(SN);if(l){const c=l.props.children,u=a.map(d=>d===l?W.Children.count(c)>1?W.Children.only(null):W.isValidElement(c)?c.props.children:null:d);return p.jsx(t,{...s,ref:i,children:W.isValidElement(c)?W.cloneElement(c,void 0,u):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function IN(e){const t=W.forwardRef((n,r)=>{const{children:i,...o}=n;if(W.isValidElement(i)){const s=EN(i),a=ON(o,i.props);return i.type!==W.Fragment&&(a.ref=r?Sm(r,s):s),W.cloneElement(i,a)}return W.Children.count(i)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CN=Symbol("radix.slottable");function SN(e){return W.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CN}function ON(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function EN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jn=_N.reduce((e,t)=>{const n=gl(`Primitive.${t}`),r=W.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Us="Checkbox",[TN,GA]=Vs(Us),[NN,Tu]=TN(Us);function kN(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:s,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[h,f]=Eu({prop:n,defaultProp:i??!1,onChange:l,caller:Us}),[m,g]=W.useState(null),[v,w]=W.useState(null),y=W.useRef(!1),b=m?!!s||!!m.closest("form"):!0,x={checked:h,disabled:o,setChecked:f,control:m,setControl:g,name:a,form:s,value:u,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:hr(i)?!1:i,isFormControl:b,bubbleInput:v,setBubbleInput:w};return p.jsx(NN,{scope:t,...x,children:AN(d)?d(x):r})}var Om="CheckboxTrigger",Em=W.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:s,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:h,isFormControl:f,bubbleInput:m}=Tu(Om,e),g=Ti(i,u),v=W.useRef(l);return W.useEffect(()=>{const w=o==null?void 0:o.form;if(w){const y=()=>d(v.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[o,d]),p.jsx(Jn.button,{type:"button",role:"checkbox","aria-checked":hr(l)?"mixed":l,"aria-required":c,"data-state":km(l),"data-disabled":a?"":void 0,disabled:a,value:s,...r,ref:g,onKeyDown:gn(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:gn(n,w=>{d(y=>hr(y)?!0:!y),m&&f&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});Em.displayName=Om;var Nu=W.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return p.jsx(kN,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:a,required:s,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(Em,{...d,ref:t,__scopeCheckbox:n}),h&&p.jsx(Nm,{__scopeCheckbox:n})]})})});Nu.displayName=Us;var _m="CheckboxIndicator",ku=W.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Tu(_m,n);return p.jsx(_u,{present:r||hr(o.checked)||o.checked===!0,children:p.jsx(Jn.span,{"data-state":km(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});ku.displayName=_m;var Tm="CheckboxBubbleInput",Nm=W.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:h,setBubbleInput:f}=Tu(Tm,e),m=Ti(n,f),g=yN(o),v=vN(r);W.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(g!==o&&S){const D=new Event("click",{bubbles:E});y.indeterminate=hr(o),S.call(y,hr(o)?!1:o),y.dispatchEvent(D)}},[h,g,o,i]);const w=W.useRef(hr(o)?!1:o);return p.jsx(Jn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??w.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Nm.displayName=Tm;function AN(e){return typeof e=="function"}function hr(e){return e==="indeterminate"}function km(e){return hr(e)?"indeterminate":e?"checked":"unchecked"}function Au(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var RN=["color"],Am=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Au(e,RN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PN=["color"],FN=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Au(e,PN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DN=["color"],Rm=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Au(e,DN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const MN="_checkboxGroupContainer_hqfeu_1",jN="_stack_hqfeu_6",LN="_selectAllContainer_hqfeu_10",BN="_fieldContainer_hqfeu_17",VN="_checkbox_hqfeu_1",Ni={checkboxGroupContainer:MN,stack:jN,selectAllContainer:LN,fieldContainer:BN,checkbox:VN};function UN({id:e,isChecked:t,label:n,onCheckedChange:r}){return p.jsxs("div",{className:Ni.fieldContainer,children:[p.jsx(Nu,{className:Ni.checkbox,id:e,onCheckedChange:r,checked:t,children:p.jsx(ku,{children:p.jsx(Am,{})})}),p.jsx("label",{htmlFor:e,style:{overflowWrap:"anywhere"},children:n})]})}function $N({id:e,isChecked:t,label:n,onCheckedChange:r,isIndeterminate:i}){return p.jsxs("div",{className:Ni.selectAllContainer,children:[p.jsx(Nu,{className:Ni.checkbox,id:e,onCheckedChange:r,checked:i?"indeterminate":t,children:p.jsxs(ku,{children:[i&&p.jsx(FN,{}),t===!0&&p.jsx(Am,{})]})}),p.jsx("label",{htmlFor:e,children:n})]})}function qN({children:e}){return p.jsx("div",{className:Ni.checkboxGroupContainer,children:e})}function zN({children:e}){return p.jsx("div",{className:Ni.stack,children:e})}const KN="_paginationContainer_1p51x_1",HN="_pageInfo_1p51x_7",JN="_searchContainer_1p51x_13",WN="_searchInput_1p51x_17",QN="_noResults_1p51x_21",Ki={paginationContainer:KN,pageInfo:HN,searchContainer:JN,searchInput:WN,noResults:QN};function Pm({items:e,onItemChange:t,itemsPerPage:n=8,showSelectAll:r=!0,showSearch:i=!0,searchPlaceholder:o="Search fields...",itemName:s="fields"}){const[a,l]=C.useState(1),[c,u]=C.useState(""),d=e.filter(x=>x.label.toLowerCase().includes(c.toLowerCase())),h=Math.ceil(d.length/n),f=(a-1)*n,m=f+n,g=d.slice(f,m),v=x=>{u(x),l(1)},w=x=>{d.forEach(S=>{t(S.id,x)})},y=d.length>0&&d.every(x=>x.isChecked),b=d.some(x=>x.isChecked);return p.jsxs(qN,{children:[i&&p.jsx("div",{className:Ki.searchContainer,children:p.jsx(Ap,{id:"field-search",type:"text",placeholder:o,value:c,onChange:x=>v(x.target.value),className:Ki.searchInput})}),r&&e.length>=2&&p.jsx($N,{id:"select-all-fields",isChecked:y,label:`Select all ${d.length} ${c?"matching ":""}${s}`,onCheckedChange:w,isIndeterminate:b&&!y}),p.jsx(zN,{children:g.map(x=>p.jsx(UN,{id:x.id,isChecked:x.isChecked,label:x.label,onCheckedChange:S=>t(x.id,S===!0)},x.id))}),h>1&&p.jsxs("div",{className:Ki.paginationContainer,children:[p.jsx(Xe,{type:"button",onClick:()=>l(x=>Math.max(1,x-1)),disabled:a===1,variant:"ghost",children:"<"}),p.jsxs("span",{className:Ki.pageInfo,children:[a," of ",h]}),p.jsx(Xe,{type:"button",onClick:()=>l(x=>Math.min(h,x+1)),disabled:a===h,variant:"ghost",children:">"})]}),d.length===0&&c&&p.jsxs("div",{className:Ki.noResults,children:["No ",s,' found matching "',c,'"']})]})}function GN(e,t,n){var i;const r=((i=e==null?void 0:e.read)==null?void 0:i.selectedOptionalFields)||{};r[t]=n,n||delete r[t]}function XN(e,t,n,r){t(e,i=>GN(i,n,r))}function YN(){var c,u;const{appName:e,configureState:t,setConfigureState:n,selectedObjectName:r}=Xt(),i=(c=t==null?void 0:t.read)==null?void 0:c.selectedOptionalFields,o=(u=t==null?void 0:t.read)==null?void 0:u.optionalFields,s=(d,h)=>{r&&t&&XN(r,n,d,h)},a=C.useMemo(()=>(o==null?void 0:o.filter(d=>!br(d)&&"fieldName"in d&&"displayName"in d).map(d=>({id:d.fieldName,label:d.displayName,isChecked:!!(i!=null&&i[d.fieldName])})).sort((d,h)=>d.label.localeCompare(h.label)))||[],[o,i]);return!!(o&&o.length>0)&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`${e} reads the following optional fields`}),p.jsx(Pm,{items:a,onItemChange:s,showSelectAll:a.length>=2},`${r}-${o==null?void 0:o.length}`)]})}function ZN(){return p.jsx(YN,{})}function ek(){var l,c,u,d;const{installation:e}=Rn(),{selectedObjectName:t}=Xt(),{displayName:n}=Dh(),{toggleReadingObject:r,isPending:i}=Mh(),o=t?(d=(u=(c=(l=e==null?void 0:e.config)==null?void 0:l.content)==null?void 0:c.read)==null?void 0:u.objects)==null?void 0:d[t]:void 0;if(!o)return null;if(!o.disabled)return p.jsx(So,{children:p.jsxs("p",{children:["Reading from ",n," is enabled."]})});const a=()=>{t&&r({objectName:t,disabled:!1,onError:h=>{console.error("Error re-enabling read object:",h)}})};return p.jsx(p.Fragment,{children:p.jsxs(Cm,{style:{backgroundColor:"var(--amp-colors-status-critical-muted)"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[p.jsx(Rm,{style:{width:"16px",height:"16px",flexShrink:0}}),p.jsx("span",{style:{fontWeight:600},children:"Reading is currently disabled"})]}),p.jsxs("p",{style:{marginTop:"0.5rem",fontSize:"0.875rem"},children:["This object is not being synced. Click below to re-enable reading from"," ",p.jsx("b",{children:n}),"."]}),p.jsx(Xe,{type:"button",onClick:a,variant:"ghost",style:{marginTop:"1rem",width:"100%"},disabled:i,children:i?"Re-enabling...":`Re-enable reading from ${n}`})]})})}const tk={color:"var(--amp-colors-text-regular)",backgroundColor:"var(--amp-colors-bg-highlight)",borderRadius:"4px",display:"inline-block",fontSize:"0.75rem",fontWeight:500,lineHeight:"1.25",padding:"0.25rem 0.5rem"};function nk({children:e,style:t,...n}){return p.jsx("span",{style:{...tk,...t},...n,children:e})}const rk="_errorAlert_1tcao_1",ik="_errorHeader_1tcao_11",ok="_errorIcon_1tcao_17",sk="_errorTitle_1tcao_24",ak="_errorMessage_1tcao_30",Hi={errorAlert:rk,errorHeader:ik,errorIcon:ok,errorTitle:sk,errorMessage:ak};function lk({error:e}){return p.jsxs("div",{className:Hi.errorAlert,children:[p.jsxs("div",{className:Hi.errorHeader,children:[p.jsx(Rm,{className:Hi.errorIcon}),p.jsx("span",{className:Hi.errorTitle,children:"Unable to load object"})]}),p.jsx("div",{className:Hi.errorMessage,children:e})]})}function uk(){var s,a,l;const{data:e}=Ts(),{selectedObjectName:t}=Xt(),{appName:n}=yr(),r=(l=(a=(s=e==null?void 0:e.content)==null?void 0:s.read)==null?void 0:a.objects)==null?void 0:l.find(c=>c.objectName===t),i=r==null?void 0:r.error,o=r==null?void 0:r.requiredFields;return i?p.jsx(lk,{error:i}):p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`${n} reads the following fields`}),p.jsx("div",{style:{display:"flex",gap:".5rem",marginBottom:".5rem",flexWrap:"wrap"},children:o!=null&&o.length?o.map(c=>br(c)?null:p.jsx(nk,{children:c.displayName},c.fieldName)):"There are no required fields."})]})}function ck(e,t,n,r,i){e.read&&(e.read.selectedValueMappings||(e.read.selectedValueMappings={}),e.read.selectedValueMappings[i]||(e.read.selectedValueMappings[i]={}),r===""&&e.read.selectedValueMappings[i][n]?delete e.read.selectedValueMappings[i][n]:e.read.selectedValueMappings[i][n]=r)}function Fm(e,t,n,r,i){t(e,o=>ck(o,e,n,r,i))}function xa(e){return e.mapToDisplayName||e.mapToName||e.fieldName||""}function dk(e,t){if(!e.fieldName)return{isValid:!1,errorMessage:"Field name is missing"};const n=t==null?void 0:t.valueType;if(!["singleSelect","multiSelect"].includes(n||""))return{isValid:!1,errorMessage:"fieldName is not a singleSelect or multiSelect"};const r=t==null?void 0:t.values;if(!r)return{isValid:!1,errorMessage:"Field values array is missing"};const i=Object.keys(r).length,o=Object.keys((e==null?void 0:e.mappedValues)||[]).length;return i!==o?{isValid:!1,errorMessage:"field values and the values to be mapped are not of the same length"}:{isValid:!0}}function fk(e,t,n){const r=Object.values(t).filter(Boolean),i=t[n];return e.filter(o=>{const s=o.value===i,a=r.includes(o.value);return s||!a})}function pk({string:e,fieldName:t}){return p.jsxs("div",{style:{display:"flex",position:"relative",paddingTop:"1rem",paddingBottom:".5rem"},children:[p.jsxs("h3",{style:{color:"var(--amp-colors-text-muted)",fontSize:"1rem",fontWeight:"400"},children:[e,p.jsx("b",{children:t})]}),p.jsx("div",{style:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"},children:p.jsx(js,{style:{width:"100%",marginLeft:"1rem"}})})]})}function hk({mappedValue:e,onSelectChange:t,fieldName:n,allValueOptions:r}){var f;const{configureState:i,selectedObjectName:o,setConfigureState:s}=Xt(),a=C.useMemo(()=>{var m,g;return((g=(m=i==null?void 0:i.read)==null?void 0:m.selectedValueMappings)==null?void 0:g[n])||{}},[(f=i==null?void 0:i.read)==null?void 0:f.selectedValueMappings,n]),l=C.useMemo(()=>a==null?void 0:a[e.mappedValue],[a,e.mappedValue]),c=C.useMemo(()=>r.map(m=>({id:m.value,label:m.displayValue,value:m.value})),[r]),u=C.useCallback(m=>{m&&t({target:{name:e.mappedValue,value:m.value,fieldName:n}})},[t,n,e.mappedValue]),d=C.useMemo(()=>p.jsx(xm,{items:c,selectedValue:l||null,onSelectedItemChange:u,placeholder:"Please select one",style:{borderRadius:"8px",width:"100%"}},l),[l,c,u]),h=C.useCallback(()=>{o&&Fm(o,s,e.mappedValue,"",n)},[o,s,e.mappedValue,n]);return p.jsxs("div",{style:{display:"flex",flexDirection:"column",marginBottom:".25rem"},children:[p.jsx("div",{style:{display:"flex",flexDirection:"row",gap:".25rem",marginBottom:".25rem"},children:p.jsx("span",{style:{fontWeight:500},children:e.mappedDisplayValue})}),p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem"},children:[d,p.jsx(Xe,{type:"button",variant:"ghost",onClick:h,children:"Clear"})]})]},e.mappedValue)}function mk(){var l,c;const{fieldMapping:e}=St(),{selectedObjectName:t,configureState:n,setConfigureState:r}=Xt(),i=(l=n==null?void 0:n.read)==null?void 0:l.selectedFieldMappings,o=(c=n==null?void 0:n.read)==null?void 0:c.selectedValueMappings,s=C.useMemo(()=>{const u=t&&e?Object.values(e[t]||{}).flat().filter(d=>d.mappedValues).map(d=>({...d})):[];if(i)for(let d=0;d<u.length;d+=1){const{mapToName:h}=u[d];i!=null&&i[h]&&(u[d].fieldName=i[h])}return u},[t,e,i]),a=C.useCallback(u=>{const{value:d,name:h,fieldName:f}=u.target;d&&t&&Fm(t,r,h,d,f)},[t,r]);return s!=null&&s.length?p.jsx(p.Fragment,{children:s.map(u=>{var f,m,g;const d=(m=(f=n==null?void 0:n.read)==null?void 0:f.allFieldsMetadata)==null?void 0:m[u.fieldName],h=dk(u,d);return h.isValid?p.jsxs(p.Fragment,{children:[p.jsx(pk,{string:"Map the values for ",fieldName:xa(u)}),p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:p.jsx(Bs,{id:xa(u),children:(g=u==null?void 0:u.mappedValues)==null?void 0:g.map(v=>{const w=(d==null?void 0:d.values)||[],y=(o==null?void 0:o[u.fieldName])||{},b=fk(w,y,v.mappedValue);return p.jsx(hk,{allValueOptions:b,mappedValue:v,onSelectChange:a,fieldName:(u==null?void 0:u.fieldName)||""},`${v.mappedValue}-${u.fieldName}`)})},xa(u))})]}):(console.error(h.errorMessage,u),null)})}):null}function gk(){return cN(),p.jsxs(p.Fragment,{children:[p.jsx(ek,{}),p.jsx(fN,{}),p.jsx(uk,{}),p.jsx(lN,{}),p.jsx(aN,{}),p.jsx(mk,{}),p.jsx(ZN,{}),p.jsx(V_,{})]})}function yk(e,t,n){var r;if(((r=e==null?void 0:e.write)==null?void 0:r.selectedWriteObjects)===null&&(e.write.selectedWriteObjects={}),e!=null&&e.write){const i=e.write.selectedWriteObjects;n&&(i[t]={objectName:t}),n||delete i[t]}}function vk(e,t,n,r){t(e,i=>{yk(i,n,r)})}function bk(){var c,u;const{appName:e,selectedObjectName:t,configureState:n,setConfigureState:r}=Xt(),i=(c=n==null?void 0:n.write)==null?void 0:c.selectedWriteObjects,o=(u=n==null?void 0:n.write)==null?void 0:u.writeObjects,s=(d,h)=>{t&&n&&vk(t,r,d,h)},a=!!o,l=(o==null?void 0:o.map(d=>({id:d.objectName,label:d.displayName,isChecked:!!(i!=null&&i[d.objectName])})))||[];return a&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`Allow ${e} to write to these objects`}),p.jsx(Pm,{items:l,onItemChange:s,showSelectAll:o.length>=2,searchPlaceholder:"Search objects...",itemName:"objects"})]})}function wk(){return p.jsx(p.Fragment,{children:p.jsx(bk,{})})}function Dm({resetComponent:e,onDisconnectSuccess:t}){return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[p.jsx(Gt,{string:"Remove connection"}),p.jsx("p",{children:"Click to disconnect your connection from the provider."}),p.jsx(kh,{resetComponent:e,onDisconnectSuccess:t,buttonText:"Remove connection",buttonVariant:"danger",buttonStyle:{fontSize:"13px",width:"100%"}})]})}const xk="_authenticationRow_1g2ms_1",Ik="_field_1g2ms_8",Ck="_value_1g2ms_12",Ia={authenticationRow:xk,field:Ik,value:Ck};function Kd({label:e,value:t}){return p.jsxs("div",{className:Ia.authenticationRow,children:[p.jsx("div",{className:Ia.field,children:e}),p.jsx("div",{className:Ia.value,children:t})]})}function Sk(){const{selectedConnection:e}=Pn(),{providerName:t}=Ot(),r=(e==null?void 0:e.provider)==="salesforce"?"subdomain":"workspace",i=`${t} ${r}`;return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Connection details"}),p.jsxs("div",{style:{paddingBottom:"1rem"},children:[p.jsx(Kd,{label:i,value:e==null?void 0:e.providerWorkspaceRef}),p.jsx(Kd,{label:"Status",value:un((e==null?void 0:e.status)||"")})]})]})}function Ok(){const{installation:e}=St(),{providerName:t}=Ot();return e?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Uninstall entire integration"}),p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",padding:"1rem 0"},children:[e!=null&&e.id?p.jsxs("p",{style:{color:"var(--amp-colors-text-muted)"},children:["By clicking below, you will uninstall the entire ",t," ","integration. You will lose any configuration you've set up."]}):p.jsx("p",{children:"You've successfully uninstalled the integration."}),p.jsx(iu,{buttonText:"Yes, uninstall",buttonVariant:"danger"})]})]}):null}function Ek(){const{installation:e,resetComponent:t}=St();return p.jsxs(p.Fragment,{children:[p.jsx(Sk,{}),p.jsx(ru,{}),e&&p.jsx(Ok,{}),!e&&p.jsx(Dm,{resetComponent:t})]})}function Mm({onSave:e,onReset:t,isLoading:n,isCreateMode:r=!1,errorMsg:i}){var ge,be,I,J,V,O,z,$,Y,ne,te,ae,Z,ye;const{installation:o}=Rn(),{hydratedRevision:s,loading:a}=Xr(),{configureState:l,selectedObjectName:c}=Xt(),u=o==null?void 0:o.config,d=u&&c&&!!fp(u,c)||!1,h=c?Ep(u,c):void 0,f=(ge=l==null?void 0:l.read)==null?void 0:ge.selectedFieldMappings,m=!yp(h,f),g=s&&c?Pl(u,s,c):void 0,v=(be=l==null?void 0:l.read)==null?void 0:be.selectedOptionalFields,w=!gp(g,v),y=c?(O=(V=(J=(I=u==null?void 0:u.content)==null?void 0:I.read)==null?void 0:J.objects)==null?void 0:V[c])==null?void 0:O.selectedValueMappings:void 0,b=(z=l==null?void 0:l.read)==null?void 0:z.selectedValueMappings,x=!vp(y,b),S=(Y=($=u==null?void 0:u.content)==null?void 0:$.write)==null?void 0:Y.objects,E=(ne=l==null?void 0:l.write)==null?void 0:ne.selectedWriteObjects,D=!bp(S||{},E||{}),P=w||m||x||D||r||c!==xi&&!d,F=!!((ye=(Z=(ae=(te=s==null?void 0:s.content)==null?void 0:te.read)==null?void 0:ae.objects)==null?void 0:Z.find(q=>q.objectName===c))!=null&&ye.error),U=a||n||!l||!c||!P||F,B=c===xi,X=c===fs,se=p.jsx(Xe,{type:"submit",disabled:U,children:r?"Install":"Save"}),ce=p.jsx(Xe,{type:"button",onClick:t,disabled:U,variant:"ghost",children:"Reset"});return n?p.jsx(io,{}):p.jsxs("form",{style:{width:"34rem"},onSubmit:e,children:[p.jsx("div",{style:{display:"flex",flexDirection:"row-reverse",gap:".8rem",marginBottom:"20px",height:"3rem"},children:!X&&p.jsxs(p.Fragment,{children:[se,ce]})}),p.jsxs(Hn,{style:{padding:"1rem 2rem",minHeight:"300px",backgroundColor:"var(--amp-colors-bg-primary)",borderColor:"var(--amp-colors-border)"},children:[i&&p.jsx(yo,{children:typeof i=="string"?i:"Installation Failed."}),a&&p.jsx(io,{}),s&&!B&&!X&&p.jsx(gk,{}),s&&B&&!X&&p.jsx(wk,{}),!a&&X&&p.jsx(Ek,{})]})]})}const jm=()=>{const{integrationId:e,groupRef:t,consumerRef:n,setInstallation:r,onInstallSuccess:i,onUpdateSuccess:o,fieldMapping:s}=St(),{hydratedRevision:a,loading:l}=Xr(),{selectedObjectName:c}=ou(),{selectedConnection:u}=Pn(),d=Mf(),{projectIdOrName:h}=Ye(),{resetBoundary:f,setErrors:m,setError:g,getError:v}=An(),{resetConfigureState:w,objectConfigurationsState:y}=su(),b=_p(c||"",y),{onNextIncompleteTab:x}=j_(),S=C.useCallback(()=>{f(Ee.INSTALLATION_MUTATION)},[f]),E=C.useCallback(N=>N?M=>{g(Ee.INSTALLATION_MUTATION,N,M)}:M=>{console.error("objectName is required to set installation error: ",M)},[g]),D=C.useCallback(N=>N?v(Ee.INSTALLATION_MUTATION,N):"",[v]);return{integrationId:e,groupRef:t,consumerRef:n,setInstallation:r,hydratedRevision:a,loading:l,selectedObjectName:c,selectedConnection:u,apiKey:d,projectIdOrName:h,resetBoundary:f,setErrors:m,setMutateInstallationError:E,getMutateInstallationError:D,resetMutateInstallationErrorState:S,resetConfigureState:w,objectConfigurationsState:y,configureState:b,onInstallSuccess:i,onUpdateSuccess:o,onNextIncompleteTab:x,fieldMapping:s}},_k=void 0;function Tk(){const{consumerRef:e,setInstallation:t,hydratedRevision:n,loading:r,selectedObjectName:i,selectedConnection:o,resetBoundary:s,setErrors:a,setMutateInstallationError:l,getMutateInstallationError:c,resetMutateInstallationErrorState:u,resetConfigureState:d,objectConfigurationsState:h,configureState:f,onInstallSuccess:m,onNextIncompleteTab:g,fieldMapping:v}=jm(),[w,y]=C.useState(!1),{createInstallation:b}=sp(),x=i===xi,S=c(i),E=C.useCallback(()=>{s(Ee.MAPPING),n!=null&&n.content&&!r&&i&&xp(n,_k,i,d)},[s,n,r,i,d]);C.useEffect(()=>{!f&&(n!=null&&n.content)&&!r&&E()},[f,h,n,r,E]);const D=()=>{u();const{requiredMapFields:R,selectedFieldMappings:P}=(f==null?void 0:f.read)||{},{errorList:F}=mp(R,P,a);if(!(F.length>0))if(i&&(o!=null&&o.id)&&e&&n){y(!0);const U=cC(f,i,n,e,v);if(!U){console.error("Error when generating createConfig from configureState"),y(!1);return}b({config:U.content,onSuccess:B=>{t(B),m==null||m(B.id,B.config),y(!1),g()},onError:B=>{l(i)(B.message),y(!1)}})}else console.error("CreateInstallallation - onSaveReadCreate: missing required props")},N=()=>{if(u(),i&&(o!=null&&o.id)&&e&&n){y(!0);const R=fC(f,n,e);if(!R){console.error("Error when generating createConfig from configureState"),y(!1);return}b({config:R.content,onSuccess:P=>{t(P),m==null||m(P.id,P.config),y(!1),g()},onError:P=>{l(i)(P.message),y(!1)}})}else console.error("CreateInstallallation - onSaveWriteCreate: missing required props")},M=R=>{R.preventDefault(),x?N():D()};return p.jsx(Mm,{errorMsg:S,isCreateMode:!0,isLoading:w,onSave:M,onReset:E})}const Nk=(e,t,n,r,i)=>{const o=Ip(e),s=Cp(e),a=Sp(t,i),l=Op(e),c={content:{read:{objects:{[t]:{objectName:t,selectedFields:o,selectedFieldMappings:s,dynamicMappingsInput:a,selectedValueMappings:l||{},backfill:r}}}}};return go(n)&&(c.content||(c.content={}),c.content.proxy={enabled:!0}),c},kk=(e,t)=>{const r={content:{write:{objects:Tp(e)}}};return go(t)&&(r.content||(r.content={}),r.content.proxy={enabled:!0}),r};function Ak({installation:e}){const{setInstallation:t,hydratedRevision:n,loading:r,selectedObjectName:i,resetBoundary:o,setErrors:s,setMutateInstallationError:a,getMutateInstallationError:l,resetConfigureState:c,configureState:u,onUpdateSuccess:d,onNextIncompleteTab:h,fieldMapping:f}=jm(),{updateInstallation:m}=lp(),[g,v]=C.useState(!1),w=i===xi,y=l(i),{config:b}=e,x=C.useCallback(()=>{o(Ee.MAPPING),n!=null&&n.content&&!r&&i&&xp(n,b,i,c)},[o,n,r,i,b,c]);C.useEffect(()=>{u||x()},[u,x]);const S=C.useMemo(()=>{var R,P,F;return(F=(P=(R=n==null?void 0:n.content)==null?void 0:R.read)==null?void 0:P.objects)==null?void 0:F.find(U=>(U==null?void 0:U.objectName)===i)},[n,i]),E=()=>{const{requiredMapFields:M,selectedFieldMappings:R}=(u==null?void 0:u.read)||{},{errorList:P}=mp(M,R,s);if(!(P.length>0))if(n&&u&&i&&S){v(!0);const F=Nk(u,i,n,S.backfill,f);if(!F){console.error("Error when generating updateConfig from configureState"),v(!1);return}m({config:F.content,onSuccess:U=>{t(U),d==null||d(U.id,U.config),v(!1),h()},onError:U=>{a(i)(U.message),v(!1)}})}else console.error("UpdateInstallation - onSaveRead missing required props")},D=()=>{if(u&&n){v(!0);const M=kk(u,n);if(!M){console.error("Error when generating write updateConfig from configureState"),v(!1);return}m({config:M.content,onSuccess:R=>{t(R),d==null||d(R.id,R.config),v(!1),h()},onError:R=>{a(i)(R.message),v(!1)}})}else console.error("UpdateInstallation - onSaveWrite missing required props")},N=M=>{M.preventDefault(),w?D():E()};return p.jsx(Mm,{errorMsg:y,onSave:N,onReset:x,isLoading:g})}function Rk(){const{integrationObj:e,installation:t}=St();return e?t&&e?p.jsx(Ak,{installation:t}):p.jsx(Tk,{}):p.jsx(ep,{message:"We can't load the integration"})}class Ru extends C.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){var r,i;console.error("Ampersand Error Boundary caught an error:",t),console.error("[Error Info]:",n),(i=(r=this.props).onError)==null||i.call(r,t,n)}render(){var t;return this.state.hasError?this.props.fallback?this.props.fallback:p.jsx(Vt,{message:((t=this.state.error)==null?void 0:t.message)||"Something went wrong. Please try again later."}):this.props.children}}function Pk(){return p.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("circle",{cx:"24",cy:"24",r:"24",fill:"#BBF7D0"}),p.jsx("path",{d:"M34.6666 18.6667L20 32.0001L13.3333 25.9395",stroke:"#16A34A",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Pu({text:e,children:t}){return p.jsx(Ri,{children:p.jsxs(Hn,{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"3rem",gap:"3rem"},children:[p.jsx(Pk,{}),p.jsx("p",{children:e}),t]})})}function Fk({provider:e}){const{providerName:t}=Ot(e),n=`You have successfully installed your ${t} integration.`;return p.jsx(Pu,{text:n,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:p.jsx(iu,{buttonText:"Uninstall",buttonVariant:"outline",buttonStyle:{fontSize:"13px"}})})})}const Dk=e=>{const{read:t,write:n}=(e==null?void 0:e.content)??{};return!t&&!n};function Mk({children:e}){var S;const t=C.useRef(!1),{projectIdOrName:n}=Ye(),{hydratedRevision:r,loading:i}=Xr(),{integrationObj:o,installation:s,groupRef:a,consumerRef:l,onInstallSuccess:c,isIntegrationDeleted:u}=St(),{mutate:d,isIdle:h,isPending:f,error:m,errorMsg:g}=op(),{selectedConnection:v,isConnectionsLoading:w}=Pn(),y=i||f||w,b=(S=r==null?void 0:r.content)==null?void 0:S.provider,x=Dk(r);return C.useEffect(()=>{var E;if(!y&&!w&&r&&x&&!s&&v&&(o!=null&&o.id)&&!u&&b){const D={projectIdOrName:n,integrationId:o==null?void 0:o.id,installation:{groupRef:a,connectionId:v==null?void 0:v.id,config:{content:{provider:b}}}};go(r)===!0&&(D.installation.config.content.proxy=(E=r==null?void 0:r.content)==null?void 0:E.proxy),h&&!t.current&&d(D,{onSuccess:N=>{t.current||(c==null||c(N==null?void 0:N.id,N.config),t.current=!0)}})}},[r,x,s,v,n,o==null?void 0:o.id,a,l,y,c,u,w,b,d,h]),x&&b&&s?p.jsx(Fk,{provider:b}):m?p.jsx(Vt,{message:g??"Create installation failed"}):o?y?p.jsx(Pi,{}):p.jsx("div",{children:e}):p.jsx(Vt,{message:"We can't load the integration"})}function Oo(){const e=Ct(),t=st();return Kn({mutationKey:["createConnection"],mutationFn:async n=>(await e()).connectionApi.generateConnection(n),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]})},onError:n=>{console.error("Error creating connection and loading provider info"),ot(n)}})}function jk({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,children:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Ye(),d=Oo(),h=C.useCallback(f=>{var w;const{apiKey:m,providerMetadata:g}=f,v={projectIdOrName:u,generateConnectionParams:{providerWorkspaceRef:(w=g==null?void 0:g.workspace)==null?void 0:w.value,groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,apiKey:m,...g&&{providerMetadata:g}}};d.mutate(v)},[u,o,i,r,n,e,d]);return a===null?p.jsx(y_,{provider:e,providerInfo:t,handleSubmit:h,error:c||null,metadataInputs:l}):s}function Lk({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,children:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Ye(),d=Oo(),h=C.useCallback(f=>{var y;const{user:m,pass:g,providerMetadata:v}=f,w={projectIdOrName:u,generateConnectionParams:{providerWorkspaceRef:(y=v==null?void 0:v.workspace)==null?void 0:y.value,groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,basicAuth:{username:m,password:g},...v&&{providerMetadata:v}}};d.mutate(w)},[u,o,i,r,n,e,d]);return a===null?p.jsx(I_,{provider:e,providerInfo:t,handleSubmit:h,error:c||null,metadataInputs:l}):s}function Bk({providerInfo:e,handleSubmit:t,isButtonDisabled:n,buttonVariant:r,metadataInputs:i}){var h;const[o,s]=C.useState({}),a=f=>{const{name:m,value:g}=f.currentTarget;s(v=>({...v,[m]:g.trim()}))},l=Oi(i,o),c=n||!l,u=((h=e.customOpts)==null?void 0:h.inputs)||[],d=()=>{const f=Ms(i,o),m=Object.fromEntries(u.map(g=>[g.name,o[g.name]]));t({customAuth:m,providerMetadata:f})};return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[u.map(f=>p.jsxs("div",{children:[p.jsx(Eh,{url:f.docsURL,prompt:f.prompt,inputName:f.displayName}),p.jsx(_n.PasswordInput,{id:f.name,name:f.name,onChange:a,placeholder:""})]},f.name)),i.map(f=>p.jsx(Co,{metadata:f,onChange:a,variant:"header"},f.name)),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:c,type:"submit",onClick:d,variant:r,children:"Next"})]})}function Vk({providerInfo:e,handleSubmit:t,error:n,isButtonDisabled:r,metadataInputs:i}){return p.jsxs(wr,{children:[p.jsx(xr,{children:`Set up ${e.displayName} integration`}),p.jsx(Fn,{error:n}),p.jsx(Bk,{providerInfo:e,handleSubmit:t,isButtonDisabled:r||!!n,metadataInputs:i})]})}function Uk({providerInfo:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,selectedConnection:s,metadataInputs:a,moduleError:l}){const{projectIdOrName:c}=Ye(),u=Oo(),[d,h]=C.useState(l||null),f=C.useCallback(m=>{var y;const{customAuth:g,providerMetadata:v}=m;h(null);const w={projectIdOrName:c,generateConnectionParams:{providerWorkspaceRef:(y=v==null?void 0:v.workspace)==null?void 0:y.value,groupName:i,groupRef:r,consumerName:n,consumerRef:t,provider:e.name,customAuth:g,...v&&{providerMetadata:v}}};u.mutate(w,{onError:b=>{ot(b,h)},onSuccess:()=>{h(null)}})},[c,i,r,n,t,e.name,u]);return s===null?p.jsx(Vk,{providerInfo:e,handleSubmit:f,error:d,metadataInputs:a}):o}function $k({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r,children:i,title:o}){if(!o&&!r)throw new Error("Either title or providerName is required");return p.jsxs(wr,{children:[p.jsx(xr,{children:o||`Set up ${r} integration`}),p.jsx(Fn,{error:t}),i,p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:"Next"})]})}function qk({...e}){return p.jsx($k,{...e})}function zk({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,selectedConnection:s,providerName:a,moduleError:l}){const{projectIdOrName:c}=Ye(),u=Oo(),d=C.useCallback(()=>{const h={projectIdOrName:c,generateConnectionParams:{groupName:i,groupRef:r,consumerName:n,consumerRef:t,provider:e}};u.mutate(h)},[c,i,r,n,t,e,u]);return s===null?p.jsx(qk,{handleSubmit:d,error:l||null,providerName:a}):o}const Kk=()=>{const e=Ct(),t=st();return Kn({mutationKey:["createOauthConnection"],mutationFn:async n=>(await e()).oAuthApi.oauthConnect(n),onSuccess:()=>{t.invalidateQueries({queryKey:["connections"]})}})};function Hk({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r}){return p.jsxs(wr,{children:[p.jsx(xr,{children:`Set up ${r} integration`}),p.jsx(_C,{children:`Click Next to sign into the ${r} account you'd like to sync.`}),p.jsx(Fn,{error:t}),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:n&&!t?"Loading...":"Next"})]})}const Jk="https://help.salesforce.com/s/articleView?id=sf.faq_domain_name_what.htm&type=5";function Wk({handleSubmit:e,setWorkspace:t,error:n,isButtonDisabled:r}){return p.jsxs(wr,{children:[p.jsx(xr,{children:"Enter your Salesforce subdomain"}),p.jsx(Fl,{href:Jk,newTab:!0,children:"What is my Salesforce subdomain?"}),p.jsx(Fn,{error:n}),p.jsxs("div",{style:{display:"flex",marginTop:"1em",alignItems:"center"},children:[p.jsx(_n.Input,{id:"salesforce-subdomain",type:"text",placeholder:"my-domain",onChange:i=>t(i.currentTarget.value)}),p.jsx("p",{style:{lineHeight:"2.2em",marginLeft:"0.4em"},children:".my.salesforce.com"})]}),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:r,type:"submit",onClick:e,children:"Next"})]})}function Qk({handleSubmit:e,setFormData:t,error:n,isButtonDisabled:r,providerName:i,metadataInputs:o}){return p.jsxs(wr,{children:[p.jsxs(xr,{children:["Enter your ",i," workspace"]}),p.jsx(Fn,{error:n}),p.jsx("br",{}),o.map(s=>p.jsx(Co,{metadata:s,onChange:a=>t(s.name,a.currentTarget.value),providerName:i},s.name)),p.jsx(Xe,{style:{marginTop:"1em",width:"100%"},disabled:r,type:"submit",onClick:e,children:"Next"})]})}const Hd=600,Jd=600,Wd="salesforce";function Gk({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,providerName:o,metadataInputs:s,moduleError:a}){const{projectId:l}=yr(),c=st(),u=C.useRef(null),[d,h]=C.useState(a||null),[f,m]=C.useState(""),[g,v]=C.useState({}),[w,y]=C.useState({}),{mutateAsync:b,isPending:x}=Kk(),{isFetching:S,refetch:E}=Al({groupRef:r,provider:e});C.useEffect(()=>{const P=F=>{var U,B,X;F.origin===Xf&&(((U=F.data)==null?void 0:U.eventType)==="AUTHORIZATION_SUCCEEDED"?(h(null),console.debug("New connection:",F.data.data.connection),c.invalidateQueries({queryKey:["amp","connections"]})):((B=F.data)==null?void 0:B.eventType)==="AUTHORIZATION_FAILED"&&(console.error("OAuth failed:",F.data.data.error),c.invalidateQueries({queryKey:["amp","connections"]}),h(F.data.data.error||"An error occurred. Please try again.")),(X=u.current)==null||X.close())};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[c]);const D=P=>{m(P),v(F=>({...F,workspace:P})),y(F=>({...F,workspace:{value:P,source:"input"}}))},N=(P,F)=>{v(U=>({...U,[P]:F})),y(U=>({...U,[P]:{value:F,source:"input"}}))},M=async()=>{var P;h(null);try{const{data:F}=await E();if(F&&F.length>0){console.debug("connections found");return}}catch{console.debug("error with fetching connections")}if(s.length>0&&!Oi(s,g)){h("Please fill in all required fields");return}try{const F=await b({connectOAuthParams:{provider:e,consumerRef:t,groupRef:r,projectId:l||"",consumerName:n,groupName:i,providerWorkspaceRef:e===Wd?f:(P=w==null?void 0:w.workspace)==null?void 0:P.value,providerMetadata:w}});if(F){const U=window.screenX+(window.outerWidth-Hd)/2,B=window.screenY+(window.outerHeight-Jd)/2.5,X=`width=${Hd},height=${Jd},left=${U},top=${B}`;u.current=window.open(F,"OAuthPopup",X)}}catch(F){console.error(F),h(F instanceof Error?F.message:String(F)||"An error occurred. Please try again.")}},R=e===Wd?p.jsx(Wk,{handleSubmit:M,setWorkspace:D,error:d,isButtonDisabled:f.length===0||x||S||!!d}):s.length>0?p.jsx(Qk,{handleSubmit:M,setFormData:N,error:d,isButtonDisabled:!Oi(s,g)||x||S||!!d,providerName:o,metadataInputs:s}):p.jsx(Hk,{handleSubmit:M,error:d,providerName:o,isButtonDisabled:x||S||!!d});return p.jsx("div",{children:R})}function Xk({provider:e,providerName:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,explicitScopesRequired:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Ye(),d=Oo(),[h,f]=C.useState(c||null),m=C.useCallback(g=>{var w,y;f(null);const v={projectIdOrName:u,generateConnectionParams:{groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,providerWorkspaceRef:(y=(w=g.providerMetadata)==null?void 0:w.workspace)==null?void 0:y.value,oauth2ClientCredentials:{clientId:g.clientId,clientSecret:g.clientSecret,scopes:g.scopes},...g.providerMetadata&&{providerMetadata:g.providerMetadata}}};d.mutate(v,{onError:()=>f("Error loading provider info")})},[u,o,i,r,n,e,d]);return a===null?p.jsx(S_,{providerName:t,handleSubmit:m,error:h,explicitScopesRequired:s,metadataInputs:l}):p.jsx(io,{})}function Yk({...e}){return p.jsx(Xk,{...e})}const Zk="authorizationCode",eA="authorizationCodePKCE",tA="clientCredentials";function nA({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,selectedConnection:s,setSelectedConnection:a,metadataInputs:l,moduleError:c}){const{providerName:u}=Ot(e);if(t.oauth2Opts===void 0)return p.jsx("em",{children:"Provider is missing OAuth2 options"});const{grantType:d,explicitScopesRequired:h}=t.oauth2Opts,f={provider:e,consumerRef:n,consumerName:r,groupRef:i,groupName:o,providerName:u,metadataInputs:l,moduleError:c};return d===Zk||d===eA?p.jsx(Gk,{...f}):d===tA?p.jsx(Yk,{...f,explicitScopesRequired:h,selectedConnection:s,setSelectedConnection:a}):d==="password"?p.jsx("em",{children:"Password flow not supported yet"}):p.jsxs("em",{children:["Unsupported grant type: ",d]})}function rA(e){const{selectedConnection:t}=Pn();C.useEffect(()=>{e&&t&&e(t)},[e,t])}function iA({onSuccess:e}){rA(e)}function Lm({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,onSuccess:s,onDisconnectSuccess:a,resetComponent:l}){var U,B,X;const{data:c,isLoading:u,isError:d,error:h,providerName:f,selectedProvider:m}=Ot(e),{provider:g,isIntegrationDeleted:v,integrationObj:w}=St(),{selectedConnection:y,setSelectedConnection:b}=Pn();iA({onSuccess:s});const x=st(),S=c,E=(B=(U=w==null?void 0:w.latestRevision)==null?void 0:U.content)==null?void 0:B.module,{module:D,error:N}=h_(E,S),M=((X=S==null?void 0:S.metadata)==null?void 0:X.input)||[],R=m_(M,D);C.useEffect(()=>{d&&(console.error("Error loading provider info."),ot(h))},[d,h]);const P=C.useCallback(()=>{x.clear(),l()},[l,x]);if(!e&&!g)throw new Error("ProtectedConnectionLayout must be given a provider prop or be used within InstallIntegrationProvider");if(v)return p.jsx(Pu,{text:"Integration successfully uninstalled.",children:p.jsx(Xe,{type:"button",onClick:P,style:{width:"100%"},children:"Reinstall Integration"})});if(y)return o;if(u)return p.jsx(Pi,{});if(S==null)return p.jsx(Vt,{message:"Provider info was not found."});const F={provider:m,consumerRef:t,consumerName:n,groupRef:r,groupName:i,selectedConnection:y,setSelectedConnection:b,providerName:f,providerInfo:S,onDisconnectSuccess:a,metadataInputs:R,moduleError:N};return S.authType==="none"?p.jsx(zk,{...F,children:o}):S.authType==="basic"?p.jsx(Lk,{...F,children:o}):S.authType==="apiKey"?p.jsx(jk,{...F,children:o}):S.authType==="custom"?p.jsx(Uk,{...F,children:o}):p.jsx(nA,{...F})}function oA(e){const t=e+"CollectionProvider",[n,r]=Vs(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:w}=g,y=C.useRef(null),b=C.useRef(new Map).current;return p.jsx(i,{scope:v,itemMap:b,collectionRef:y,children:w})};s.displayName=t;const a=e+"CollectionSlot",l=gl(a),c=C.forwardRef((g,v)=>{const{scope:w,children:y}=g,b=o(a,w),x=Ti(v,b.collectionRef);return p.jsx(l,{ref:x,children:y})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=gl(u),f=C.forwardRef((g,v)=>{const{scope:w,children:y,...b}=g,x=C.useRef(null),S=Ti(v,x),E=o(u,w);return C.useEffect(()=>(E.itemMap.set(x,{ref:x,...b}),()=>void E.itemMap.delete(x))),p.jsx(h,{[d]:"",ref:S,children:y})});f.displayName=u;function m(g){const v=o(e+"CollectionConsumer",g);return C.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,D)=>b.indexOf(E.ref.current)-b.indexOf(D.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},m,r]}var sA=W[" useId ".trim().toString()]||(()=>{}),aA=0;function Bm(e){const[t,n]=W.useState(sA());return lo(()=>{n(r=>r??String(aA++))},[e]),e||(t?`radix-${t}`:"")}function lA(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var uA=W.createContext(void 0);function Vm(e){const t=W.useContext(uA);return e||t||"ltr"}var Ca="rovingFocusGroup.onEntryFocus",cA={bubbles:!1,cancelable:!0},Eo="RovingFocusGroup",[yl,Um,dA]=oA(Eo),[fA,$m]=Vs(Eo,[dA]),[pA,hA]=fA(Eo),qm=W.forwardRef((e,t)=>p.jsx(yl.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(yl.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(mA,{...e,ref:t})})}));qm.displayName=Eo;var mA=W.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=W.useRef(null),f=Ti(t,h),m=Vm(o),[g,v]=Eu({prop:s,defaultProp:a??null,onChange:l,caller:Eo}),[w,y]=W.useState(!1),b=lA(c),x=Um(n),S=W.useRef(!1),[E,D]=W.useState(0);return W.useEffect(()=>{const N=h.current;if(N)return N.addEventListener(Ca,b),()=>N.removeEventListener(Ca,b)},[b]),p.jsx(pA,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:W.useCallback(N=>v(N),[v]),onItemShiftTab:W.useCallback(()=>y(!0),[]),onFocusableItemAdd:W.useCallback(()=>D(N=>N+1),[]),onFocusableItemRemove:W.useCallback(()=>D(N=>N-1),[]),children:p.jsx(Jn.div,{tabIndex:w||E===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:gn(e.onMouseDown,()=>{S.current=!0}),onFocus:gn(e.onFocus,N=>{const M=!S.current;if(N.target===N.currentTarget&&M&&!w){const R=new CustomEvent(Ca,cA);if(N.currentTarget.dispatchEvent(R),!R.defaultPrevented){const P=x().filter(se=>se.focusable),F=P.find(se=>se.active),U=P.find(se=>se.id===g),X=[F,U,...P].filter(Boolean).map(se=>se.ref.current);Hm(X,u)}}S.current=!1}),onBlur:gn(e.onBlur,()=>y(!1))})})}),zm="RovingFocusGroupItem",Km=W.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,l=Bm(),c=o||l,u=hA(zm,n),d=u.currentTabStopId===c,h=Um(n),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:g}=u;return W.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),p.jsx(yl.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:p.jsx(Jn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:gn(e.onMouseDown,v=>{r?u.onItemFocus(c):v.preventDefault()}),onFocus:gn(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:gn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=vA(v,u.orientation,u.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(x=>x.focusable).map(x=>x.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const x=b.indexOf(v.currentTarget);b=u.loop?bA(b,x+1):b.slice(x+1)}setTimeout(()=>Hm(b))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:g!=null}):s})})});Km.displayName=zm;var gA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vA(e,t,n){const r=yA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gA[r]}function Hm(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var wA=qm,xA=Km,$s="Tabs",[IA,XA]=Vs($s,[$m]),Jm=$m(),[CA,Fu]=IA($s),Wm=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Vm(a),[d,h]=Eu({prop:r,onChange:i,defaultProp:o??"",caller:$s});return p.jsx(CA,{scope:n,baseId:Bm(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:p.jsx(Jn.div,{dir:u,"data-orientation":s,...c,ref:t})})});Wm.displayName=$s;var Qm="TabsList",Gm=W.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Fu(Qm,n),s=Jm(n);return p.jsx(wA,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:p.jsx(Jn.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});Gm.displayName=Qm;var Xm="TabsTrigger",Ym=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Fu(Xm,n),a=Jm(n),l=eg(s.baseId,r),c=tg(s.baseId,r),u=r===s.value;return p.jsx(xA,{asChild:!0,...a,focusable:!i,active:u,children:p.jsx(Jn.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:gn(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:gn(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:gn(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});Ym.displayName=Xm;var Zm="TabsContent",SA=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Fu(Zm,n),l=eg(a.baseId,r),c=tg(a.baseId,r),u=r===a.value,d=W.useRef(u);return W.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),p.jsx(_u,{present:i||u,children:({present:h})=>p.jsx(Jn.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&o})})});SA.displayName=Zm;function eg(e,t){return`${e}-trigger-${t}`}function tg(e,t){return`${e}-content-${t}`}var OA=Wm,EA=Gm,ng=Ym;const _A=p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[p.jsx("circle",{cx:"9",cy:"9",r:"9",fill:"#BBF7D0"}),p.jsx("path",{d:"M13 7L7.5 12L5 9.72727",stroke:"#16A34A",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function TA(e,t){return t?C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},C.createElement("circle",{cx:"9",cy:"9",r:"5",fill:"#FBD38D"})):e?_A:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:p.jsx("circle",{cx:"9",cy:"9",r:"5",fill:"#BFDBFE"})})}function NA(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M12.3378 5.04365C12.4882 5.25907 12.62 5.48699 12.7315 5.7249L14.3503 6.6249C14.5524 7.5302 14.5545 8.4687 14.3565 9.3749L12.7315 10.2749C12.62 10.5128 12.4882 10.7407 12.3378 10.9562L12.369 12.8124C11.683 13.4375 10.871 13.9085 9.98776 14.1937L8.39401 13.2374C8.13185 13.2562 7.86868 13.2562 7.60651 13.2374L6.01901 14.1874C5.13295 13.9075 4.31832 13.4383 3.63151 12.8124L3.66276 10.9624C3.51356 10.744 3.38189 10.5141 3.26901 10.2749L1.65026 9.3749C1.44814 8.46961 1.446 7.53111 1.64401 6.6249L3.26901 5.7249C3.38056 5.48699 3.5123 5.25907 3.66276 5.04365L3.63151 3.1874C4.31754 2.56226 5.1295 2.09128 6.01276 1.80615L7.60651 2.7624C7.86868 2.74365 8.13185 2.74365 8.39401 2.7624L9.98151 1.8124C10.8676 2.09234 11.6822 2.5615 12.369 3.1874L12.3378 5.04365Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}const kA="_tabsRoot_ktpr0_1",AA="_tabsList_ktpr0_6",RA="_tabTrigger_ktpr0_12",Is={tabsRoot:kA,tabsList:AA,tabTrigger:RA};function PA(){return p.jsxs(p.Fragment,{children:[p.jsx(js,{style:{margin:"1rem 0"}}),p.jsx(ng,{value:fs,className:Is.tabTrigger,children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem",marginRight:".5rem"},children:[p.jsx(NA,{}),p.jsx("span",{children:"Manage"})]})})]})}function rg({objectName:e,completed:t,pending:n,displayName:r,disabled:i}){return p.jsx(ng,{value:e,className:Is.tabTrigger,children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem",marginRight:".5rem"},children:[TA(!i&&t,n),p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsx("span",{children:r||e}),n&&p.jsx("span",{style:{fontSize:".8rem",fontStyle:"italic"},children:"pending"})]})]})})}function FA({completed:e,pending:t,displayName:n}){return p.jsxs(p.Fragment,{children:[p.jsx(js,{style:{margin:"1rem 0"}}),p.jsx(rg,{objectName:xi,completed:e,pending:t,displayName:n},"other-write")]})}function DA({value:e,readNavObjects:t,onValueChange:n,objectConfigurationsState:r,writeNavObject:i}){var u,d,h,f;const{data:o}=Jf(),{installation:s}=Rn(),a=s==null?void 0:s.config,l=(d=(u=a==null?void 0:a.content)==null?void 0:u.write)==null?void 0:d.objects,c=(f=(h=r==null?void 0:r.other)==null?void 0:h.write)==null?void 0:f.selectedWriteObjects;return p.jsx(OA,{value:e,className:Is.tabsRoot,onValueChange:n,children:p.jsxs(EA,{className:Is.tabsList,children:[t.map(m=>{var P,F,U,B,X,se;const g=(U=(F=(P=a==null?void 0:a.content)==null?void 0:P.read)==null?void 0:F.objects)==null?void 0:U[m.name],v=r==null?void 0:r[m.name],w=Ep(a,m.name),y=(B=v==null?void 0:v.read)==null?void 0:B.selectedFieldMappings,b=!yp(w,y),x=o?Pl(a,o,m.name):void 0,S=(X=v==null?void 0:v.read)==null?void 0:X.selectedOptionalFields,E=!gp(x,S),D=g==null?void 0:g.selectedValueMappings,N=(se=v==null?void 0:v.read)==null?void 0:se.selectedValueMappings,M=!vp(D,N),R=E||b||M||!1;return p.jsx(rg,{objectName:m.name,displayName:m.displayName,completed:m.completed,disabled:m.disabled,pending:R},m.name)}),i&&(()=>{const m=!bp(l||{},c||{});return p.jsx(FA,{completed:i.completed,pending:m,displayName:"Write"})})(),p.jsx(PA,{})]})})}function MA(e,t){return t===fs?{name:fs,completed:!1}:e.find(n=>n.name===t)}function jA({children:e}){var w;const{data:t}=yr(),{installation:n}=St(),{providerName:r}=Ot(),{hydratedRevision:i}=Xr(),{objectConfigurationsState:o}=su(),[s,a]=C.useState(""),l=(t==null?void 0:t.appName)||"",c=n==null?void 0:n.config,u=i&&pp(c,i),d=u!==null,h=!!((w=i==null?void 0:i.content)!=null&&w.write),f=h?hp(c):void 0,m=C.useMemo(()=>{const y=[...u||[]];return f&&h&&y.push(f),y},[u,f,h]),g=MA(m,s),v=C.useCallback(()=>{const y=m.find(b=>g!==b&&!b.completed);y&&a(y.name)},[m,g]);return C.useEffect(()=>{!s&&m.length>0&&a(m[0].name)},[m,s,v]),p.jsx(Ph.Provider,{value:v,children:p.jsx(Rh.Provider,{value:g==null?void 0:g.name,children:p.jsxs(Ri,{style:{maxWidth:"55rem"},children:[p.jsxs(Hn,{style:{display:"flex",gap:"1rem",padding:"3rem",paddingBottom:"6rem",backgroundColor:"var(--amp-colors-bg-primary)"},children:[p.jsxs("div",{style:{width:"20rem"},children:[p.jsxs("h1",{style:{fontSize:"small",fontWeight:"400"},children:[r," integration"]}),p.jsx("h3",{style:{marginBottom:"20px",fontSize:"large",fontWeight:"500"},children:l}),d&&p.jsx(DA,{value:s,readNavObjects:u,onValueChange:y=>a(y),objectConfigurationsState:o,writeNavObject:f})]}),e]}),p.jsx(Rp,{})]})})})}function LA({...e}){return p.jsx(jA,{...e})}const BA="_resetContainer_lkwv9_4",ig={resetContainer:BA},VA=({integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l})=>{var v;const{projectIdOrName:c,isLoading:u}=yr(),{isLoading:d}=_s(),{isError:h,errorState:f}=An(),{seed:m,reset:g}=up();return u||d?p.jsx(Pi,{}):h(Ee.PROJECT,c)?p.jsx(Vt,{message:`Error loading project ${c}`}):h(Ee.INTEGRATION_LIST,c)?p.jsx(Vt,{message:"Error retrieving integrations for the project, double check the API key"}):(v=f[Ee.INTEGRATION_LIST])!=null&&v.apiError?p.jsx(Vt,{message:"Something went wrong, couldn't find integration information"}):p.jsx("div",{className:ig.resetContainer,children:p.jsx(WI,{integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l,resetComponent:g,children:p.jsx(ip,{children:p.jsx(Lm,{consumerRef:t,consumerName:n,groupRef:r,groupName:i,resetComponent:g,children:p.jsx(M_,{resetComponent:g,children:p.jsx(Mk,{children:p.jsx(B_,{children:p.jsx(LA,{children:p.jsx(Rk,{})})})})})})})},m)})};function UA({integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l}){const c={integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l};return p.jsx(Ru,{fallback:p.jsx(Vt,{message:"Something went wrong, couldn't find integration information"}),children:p.jsx(kl,{integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:p.jsx(VA,{...c})})})}function $A(){return p.jsxs(Ri,{style:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[p.jsx(io,{}),p.jsx("p",{children:"Redirecting"})]})}function qA({redirectURL:e,children:t}){return C.useEffect(()=>{e&&window.location.replace(e)},[e]),e?p.jsx($A,{}):t}function zA({resetComponent:e,onDisconnectSuccess:t,provider:n}){const[r,i]=C.useState(!1);return p.jsxs(p.Fragment,{children:[r===!1&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Manage connection"}),p.jsxs("div",{style:{padding:"1rem 0",width:"100%",display:"flex",flexDirection:"column",gap:"1rem"},children:[p.jsx("p",{children:"Click to reauthenticate or refresh your connection."}),p.jsx(Xe,{type:"button",onClick:()=>i(!0),variant:"ghost",style:{fontSize:"13px"},children:"Update connection"})]})]}),r===!0&&p.jsxs(p.Fragment,{children:[p.jsx(ru,{provider:n}),p.jsx(Dm,{resetComponent:e,onDisconnectSuccess:t})]})]})}function KA({provider:e,onDisconnectSuccess:t,resetComponent:n}){const{appName:r}=yr(),{providerName:i}=Ot(e),o=`You have successfully connected your ${i} account to ${r}.`;return p.jsx(Pu,{text:o,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"100%"},children:p.jsx(zA,{resetComponent:n,onDisconnectSuccess:t,provider:e})})})}function HA({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,redirectUrl:o,onSuccess:s,onDisconnectSuccess:a,onConnectSuccess:l}){const{seed:c,reset:u}=up(),d=C.useCallback(h=>{s?s(h.id):l&&l(h)},[s,l]);return p.jsx(Ru,{fallback:p.jsx(Vt,{message:"Something went wrong with the connection. Please try again."}),children:p.jsx("div",{className:ig.resetContainer,children:p.jsx(kl,{integration:"connect-provider-dummy-string",consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:p.jsx(ip,{groupRef:r,provider:e,children:p.jsx(Lm,{resetComponent:u,provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onSuccess:d,onDisconnectSuccess:a,children:p.jsx(qA,{redirectURL:o,children:p.jsx(KA,{resetComponent:u,provider:e,onDisconnectSuccess:a})})})})})},c)})}const JA=(e,t)=>{const{data:n,isLoading:r,isError:i,error:o}=_l(e,t),s=((n==null?void 0:n.length)||0)>0,a=!!n&&!r,l=n==null?void 0:n[0],c=l==null?void 0:l.config;return C.useEffect(()=>{i&&ot(o)},[i,o]),{isLoaded:a,isIntegrationInstalled:s,isLoading:r,config:c}};exports.AmpersandContext=Sl;exports.AmpersandErrorBoundary=Ru;exports.AmpersandProvider=cI;exports.ConnectProvider=HA;exports.FieldSettingWriteOnCreateEnum=Oy;exports.FieldSettingWriteOnUpdateEnum=Ey;exports.InstallIntegration=UA;exports.InstallationProvider=kl;exports.useAmpersandProviderProps=Ye;exports.useConfig=EI;exports.useConnection=Tl;exports.useCreateInstallation=sp;exports.useDeleteInstallation=YI;exports.useInstallation=Rn;exports.useIsIntegrationInstalled=JA;exports.useLocalConfig=OI;exports.useManifest=Ts;exports.useUpdateInstallation=lp;
|
|
64
|
+
*/var Pd;function G_(){return Pd||(Pd=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),m=!1,g=!1,v=!1,w=!1,y=!1,b;b=Symbol.for("react.module.reference");function x(ee){return!!(typeof ee=="string"||typeof ee=="function"||ee===n||ee===i||y||ee===r||ee===c||ee===u||w||ee===f||m||g||v||typeof ee=="object"&&ee!==null&&(ee.$$typeof===h||ee.$$typeof===d||ee.$$typeof===o||ee.$$typeof===s||ee.$$typeof===l||ee.$$typeof===b||ee.getModuleId!==void 0))}function O(ee){if(typeof ee=="object"&&ee!==null){var Ke=ee.$$typeof;switch(Ke){case e:var Be=ee.type;switch(Be){case n:case i:case r:case c:case u:return Be;default:var Le=Be&&Be.$$typeof;switch(Le){case a:case s:case l:case h:case d:case o:return Le;default:return Ke}}case t:return Ke}}}var E=s,F=o,N=e,P=l,A=n,D=h,M=d,z=t,V=i,Y=r,se=c,ce=u,ge=!1,be=!1;function I(ee){return ge||(ge=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function J(ee){return be||(be=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function B(ee){return O(ee)===s}function S(ee){return O(ee)===o}function q(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===e}function U(ee){return O(ee)===l}function X(ee){return O(ee)===n}function ne(ee){return O(ee)===h}function te(ee){return O(ee)===d}function ae(ee){return O(ee)===t}function Z(ee){return O(ee)===i}function ye(ee){return O(ee)===r}function $(ee){return O(ee)===c}function we(ee){return O(ee)===u}Me.ContextConsumer=E,Me.ContextProvider=F,Me.Element=N,Me.ForwardRef=P,Me.Fragment=A,Me.Lazy=D,Me.Memo=M,Me.Portal=z,Me.Profiler=V,Me.StrictMode=Y,Me.Suspense=se,Me.SuspenseList=ce,Me.isAsyncMode=I,Me.isConcurrentMode=J,Me.isContextConsumer=B,Me.isContextProvider=S,Me.isElement=q,Me.isForwardRef=U,Me.isFragment=X,Me.isLazy=ne,Me.isMemo=te,Me.isPortal=ae,Me.isProfiler=Z,Me.isStrictMode=ye,Me.isSuspense=$,Me.isSuspenseList=we,Me.isValidElementType=x,Me.typeOf=O}()),Me}process.env.NODE_ENV==="production"?dl.exports=Q_():dl.exports=G_();var Fd=dl.exports;const Dd=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Md=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",ba=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Md(n.overflowY,t)||Md(n.overflowX,t)||(r=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},Ho=(e,t,n,r,i,o,s,a)=>o<e&&s>t||o>e&&s<t?0:o<=e&&a<=n||s>=t&&a>=n?o-e-r:s>t&&a<n||o<e&&a>n?s-t+i:0,X_=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Y_=(e,t)=>{var n,r,i,o;if(typeof document>"u")return[];const{inline:s,boundary:a,skipOverflowHiddenElements:l}=t,c=typeof a=="function"?a:z=>z!==a;if(!Dd(e))throw new TypeError("Invalid target");const u=document.scrollingElement||document.documentElement,d=[];let h=e;for(;Dd(h)&&c(h);){if(h=X_(h),h===u){d.push(h);break}h!=null&&h===document.body&&ba(h)&&!ba(document.documentElement)||h!=null&&ba(h,l)&&d.push(h)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,m=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:g,scrollY:v}=window,{height:w,width:y,top:b,right:x,bottom:O,left:E}=e.getBoundingClientRect(),{top:F,right:N,left:P}=(z=>{const V=window.getComputedStyle(z);return{top:parseFloat(V.scrollMarginTop)||0,right:parseFloat(V.scrollMarginRight)||0,bottom:parseFloat(V.scrollMarginBottom)||0,left:parseFloat(V.scrollMarginLeft)||0}})(e);let A=b-F,D=s==="center"?E+y/2-P+N:s==="end"?x+N:E-P;const M=[];for(let z=0;z<d.length;z++){const V=d[z],{height:Y,width:se,top:ce,right:ge,bottom:be,left:I}=V.getBoundingClientRect();if(b>=0&&E>=0&&O<=m&&x<=f&&b>=ce&&O<=be&&E>=I&&x<=ge)return M;const J=getComputedStyle(V),B=parseInt(J.borderLeftWidth,10),S=parseInt(J.borderTopWidth,10),q=parseInt(J.borderRightWidth,10),U=parseInt(J.borderBottomWidth,10);let X=0,ne=0;const te="offsetWidth"in V?V.offsetWidth-V.clientWidth-B-q:0,ae="offsetHeight"in V?V.offsetHeight-V.clientHeight-S-U:0,Z="offsetWidth"in V?V.offsetWidth===0?0:se/V.offsetWidth:0,ye="offsetHeight"in V?V.offsetHeight===0?0:Y/V.offsetHeight:0;if(u===V)X=Ho(v,v+m,m,S,U,v+A,v+A+w,w),ne=s==="start"?D:s==="center"?D-f/2:s==="end"?D-f:Ho(g,g+f,f,B,q,g+D,g+D+y,y),X=Math.max(0,X+v),ne=Math.max(0,ne+g);else{X=Ho(ce,be,Y,S,U+ae,A,A+w,w),ne=s==="start"?D-I-B:s==="center"?D-(I+se/2)+te/2:s==="end"?D-ge+q+te:Ho(I,ge,se,B,q+te,D,D+y,y);const{scrollLeft:$,scrollTop:we}=V;X=ye===0?0:Math.max(0,Math.min(we+X/ye,V.scrollHeight-Y/ye+ae)),ne=Z===0?0:Math.max(0,Math.min($+ne/Z,V.scrollWidth-se/Z+te)),A+=we-X,D+=$-ne}M.push({el:V,top:X,left:ne})}return M};var Si=function(){return Si=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Si.apply(this,arguments)};var Z_=0;function jd(e){return typeof e=="function"?e:Ht}function Ht(){}function Bh(e,t){if(e){var n=Y_(e,{boundary:t});n.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scrollTop=o,i.scrollLeft=s})}}function Ld(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function su(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,s)},t)}return i.cancel=r,i}function ct(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return a&&a.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ti(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function Vh(){return String(Z_++)}function eT(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Bd(e,t){return e=Array.isArray(e)?e[0]:e,!e&&t?t:e}function Uh(e){return typeof e.type=="string"}function $h(e){return e.props}function tT(e,t){console.error('The property "'+t+'" is required in "'+e+'"')}var nT=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Jo(e){e===void 0&&(e={});var t={};return nT.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function ys(e,t){return!e||!t?e:Object.keys(e).reduce(function(n,r){return n[r]=vs(t,r)?t[r]:e[r],n},{})}function vs(e,t){return e[t]!==void 0}function fl(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function rT(e){return Object.prototype.toString.call(e)==="[object Object]"}function _r(e,t,n,r,i){var o=n.length;if(o===0)return-1;var s=o-1;(typeof e!="number"||e<0||e>s)&&(e=t>0?-1:s+1);var a=e+t;a<0?a=s:a>s&&(a=0);var l=Oi(a,t<0,n,r,i);return l===-1?e>=o?-1:e:l}function Oi(e,t,n,r,i){i===void 0&&(i=!1);var o=n.length;if(t){for(var s=e;s>=0;s--)if(!r(n[s],s))return s}else for(var a=e;a<o;a++)if(!r(n[a],a))return a;return i?Oi(t?o-1:0,t,n,r):-1}function bs(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(i){return i&&(Ld(i,e,n)||r&&Ld(i,n.document.activeElement,n))})}var au=Ht;process.env.NODE_ENV!=="production"&&(au=function(t,n,r){var i="This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";Object.keys(t).forEach(function(o){n[o]!==void 0&&r[o]===void 0?console.error('downshift: A component has changed the controlled prop "'+o+'" to be uncontrolled. '+i):n[o]===void 0&&r[o]!==void 0&&console.error('downshift: A component has changed the uncontrolled prop "'+o+'" to be controlled. '+i)})});var iT=su(function(e){qh(e).textContent=""},500);function qh(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function zh(e,t){if(!(!e||!t)){var n=qh(t);n.textContent=e,iT(t)}}function oT(e){var t=e==null?void 0:e.getElementById("a11y-status-message");t&&t.remove()}var Kh=process.env.NODE_ENV!=="production"?"__autocomplete_unknown__":0,Hh=process.env.NODE_ENV!=="production"?"__autocomplete_mouseup__":1,Jh=process.env.NODE_ENV!=="production"?"__autocomplete_item_mouseenter__":2,es=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_up__":3,ts=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_down__":4,Wh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_escape__":5,Qh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_enter__":6,Gh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_home__":7,Xh=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_end__":8,Yh=process.env.NODE_ENV!=="production"?"__autocomplete_click_item__":9,Zh=process.env.NODE_ENV!=="production"?"__autocomplete_blur_input__":10,em=process.env.NODE_ENV!=="production"?"__autocomplete_change_input__":11,tm=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_space_button__":12,pl=process.env.NODE_ENV!=="production"?"__autocomplete_click_button__":13,nm=process.env.NODE_ENV!=="production"?"__autocomplete_blur_button__":14,rm=process.env.NODE_ENV!=="production"?"__autocomplete_controlled_prop_updated_selected_item__":15,im=process.env.NODE_ENV!=="production"?"__autocomplete_touchend__":16,sT=Object.freeze({__proto__:null,blurButton:nm,blurInput:Zh,changeInput:em,clickButton:pl,clickItem:Yh,controlledPropUpdatedSelectedItem:rm,itemMouseEnter:Jh,keyDownArrowDown:ts,keyDownArrowUp:es,keyDownEnd:Xh,keyDownEnter:Qh,keyDownEscape:Wh,keyDownHome:Gh,keyDownSpaceButton:tm,mouseUp:Hh,touchEnd:im,unknown:Kh}),aT=["refKey","ref"],lT=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],uT=["onKeyDown","onBlur","onChange","onInput","onChangeText"],cT=["refKey","ref"],dT=["onMouseMove","onMouseDown","onClick","onPress","index","item"],fT=function(){var e=function(t){function n(i){var o;o=t.call(this,i)||this,o.id=o.props.id||"downshift-"+Vh(),o.menuId=o.props.menuId||o.id+"-menu",o.labelId=o.props.labelId||o.id+"-label",o.inputId=o.props.inputId||o.id+"-input",o.getItemId=o.props.getItemId||function(y){return o.id+"-item-"+y},o.items=[],o.itemCount=null,o.previousResultCount=0,o.timeoutIds=[],o.internalSetTimeout=function(y,b){var x=setTimeout(function(){o.timeoutIds=o.timeoutIds.filter(function(O){return O!==x}),y()},b);o.timeoutIds.push(x)},o.setItemCount=function(y){o.itemCount=y},o.unsetItemCount=function(){o.itemCount=null},o.isItemDisabled=function(y,b){var x=o.getItemNodeFromIndex(b);return x&&x.hasAttribute("disabled")},o.setHighlightedIndex=function(y,b){y===void 0&&(y=o.props.defaultHighlightedIndex),b===void 0&&(b={}),b=Jo(b),o.internalSetState(Se({highlightedIndex:y},b))},o.clearSelection=function(y){o.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:o.props.defaultHighlightedIndex,isOpen:o.props.defaultIsOpen},y)},o.selectItem=function(y,b,x){b=Jo(b),o.internalSetState(Se({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,selectedItem:y,inputValue:o.props.itemToString(y)},b),x)},o.selectItemAtIndex=function(y,b,x){var O=o.items[y];O!=null&&o.selectItem(O,b,x)},o.selectHighlightedItem=function(y,b){return o.selectItemAtIndex(o.getState().highlightedIndex,y,b)},o.internalSetState=function(y,b){var x,O,E={},F=typeof y=="function";return!F&&y.hasOwnProperty("inputValue")&&o.props.onInputValueChange(y.inputValue,Se({},o.getStateAndHelpers(),y)),o.setState(function(N){var P;N=o.getState(N);var A=F?y(N):y;A=o.props.stateReducer(N,A),x=A.hasOwnProperty("selectedItem");var D={};return x&&A.selectedItem!==N.selectedItem&&(O=A.selectedItem),(P=A).type||(P.type=Kh),Object.keys(A).forEach(function(M){N[M]!==A[M]&&(E[M]=A[M]),M!=="type"&&(A[M],vs(o.props,M)||(D[M]=A[M]))}),F&&A.hasOwnProperty("inputValue")&&o.props.onInputValueChange(A.inputValue,Se({},o.getStateAndHelpers(),A)),D},function(){jd(b)();var N=Object.keys(E).length>1;N&&o.props.onStateChange(E,o.getStateAndHelpers()),x&&o.props.onSelect(y.selectedItem,o.getStateAndHelpers()),O!==void 0&&o.props.onChange(O,o.getStateAndHelpers()),o.props.onUserAction(E,o.getStateAndHelpers())})},o.rootRef=function(y){return o._rootNode=y},o.getRootProps=function(y,b){var x,O=y===void 0?{}:y,E=O.refKey,F=E===void 0?"ref":E,N=O.ref,P=Un(O,aT),A=b===void 0?{}:b,D=A.suppressRefError,M=D===void 0?!1:D;o.getRootProps.called=!0,o.getRootProps.refKey=F,o.getRootProps.suppressRefError=M;var z=o.getState(),V=z.isOpen;return Se((x={},x[F]=ti(N,o.rootRef),x.role="combobox",x["aria-expanded"]=V,x["aria-haspopup"]="listbox",x["aria-owns"]=V?o.menuId:void 0,x["aria-labelledby"]=o.labelId,x),P)},o.keyDownHandlers={ArrowDown:function(b){var x=this;if(b.preventDefault(),this.getState().isOpen){var O=b.shiftKey?5:1;this.moveHighlightedIndex(O,{type:ts})}else this.internalSetState({isOpen:!0,type:ts},function(){var E=x.getItemCount();if(E>0){var F=x.getState(),N=F.highlightedIndex,P=_r(N,1,{length:E},x.isItemDisabled,!0);x.setHighlightedIndex(P,{type:ts})}})},ArrowUp:function(b){var x=this;if(b.preventDefault(),this.getState().isOpen){var O=b.shiftKey?-5:-1;this.moveHighlightedIndex(O,{type:es})}else this.internalSetState({isOpen:!0,type:es},function(){var E=x.getItemCount();if(E>0){var F=x.getState(),N=F.highlightedIndex,P=_r(N,-1,{length:E},x.isItemDisabled,!0);x.setHighlightedIndex(P,{type:es})}})},Enter:function(b){if(b.which!==229){var x=this.getState(),O=x.isOpen,E=x.highlightedIndex;if(O&&E!=null){b.preventDefault();var F=this.items[E],N=this.getItemNodeFromIndex(E);if(F==null||N&&N.hasAttribute("disabled"))return;this.selectHighlightedItem({type:Qh})}}},Escape:function(b){b.preventDefault(),this.reset(Se({type:Wh},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},o.buttonKeyDownHandlers=Se({},o.keyDownHandlers,{" ":function(b){b.preventDefault(),this.toggleMenu({type:tm})}}),o.inputKeyDownHandlers=Se({},o.keyDownHandlers,{Home:function(b){var x=this.getState(),O=x.isOpen;if(O){b.preventDefault();var E=this.getItemCount();if(!(E<=0||!O)){var F=Oi(0,!1,{length:E},this.isItemDisabled);this.setHighlightedIndex(F,{type:Gh})}}},End:function(b){var x=this.getState(),O=x.isOpen;if(O){b.preventDefault();var E=this.getItemCount();if(!(E<=0||!O)){var F=Oi(E-1,!0,{length:E},this.isItemDisabled);this.setHighlightedIndex(F,{type:Xh})}}}}),o.getToggleButtonProps=function(y){var b=y===void 0?{}:y,x=b.onClick;b.onPress;var O=b.onKeyDown,E=b.onKeyUp,F=b.onBlur,N=Un(b,lT),P=o.getState(),A=P.isOpen,D={onClick:ct(x,o.buttonHandleClick),onKeyDown:ct(O,o.buttonHandleKeyDown),onKeyUp:ct(E,o.buttonHandleKeyUp),onBlur:ct(F,o.buttonHandleBlur)},M=N.disabled?{}:D;return Se({type:"button",role:"button","aria-label":A?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},M,N)},o.buttonHandleKeyUp=function(y){y.preventDefault()},o.buttonHandleKeyDown=function(y){var b=fl(y);o.buttonKeyDownHandlers[b]&&o.buttonKeyDownHandlers[b].call(o,y)},o.buttonHandleClick=function(y){if(y.preventDefault(),o.props.environment){var b=o.props.environment.document,x=b.body,O=b.activeElement;x&&x===O&&y.target.focus()}process.env.NODE_ENV==="test"?o.toggleMenu({type:pl}):o.internalSetTimeout(function(){return o.toggleMenu({type:pl})})},o.buttonHandleBlur=function(y){var b=y.target;o.internalSetTimeout(function(){if(!(o.isMouseDown||!o.props.environment)){var x=o.props.environment.document.activeElement;(x==null||x.id!==o.inputId)&&x!==b&&o.reset({type:nm})}})},o.getLabelProps=function(y){return Se({htmlFor:o.inputId,id:o.labelId},y)},o.getInputProps=function(y){var b=y===void 0?{}:y,x=b.onKeyDown,O=b.onBlur,E=b.onChange,F=b.onInput;b.onChangeText;var N=Un(b,uT),P,A={};P="onChange";var D=o.getState(),M=D.inputValue,z=D.isOpen,V=D.highlightedIndex;if(!N.disabled){var Y;A=(Y={},Y[P]=ct(E,F,o.inputHandleChange),Y.onKeyDown=ct(x,o.inputHandleKeyDown),Y.onBlur=ct(O,o.inputHandleBlur),Y)}return Se({"aria-autocomplete":"list","aria-activedescendant":z&&typeof V=="number"&&V>=0?o.getItemId(V):void 0,"aria-controls":z?o.menuId:void 0,"aria-labelledby":N&&N["aria-label"]?void 0:o.labelId,autoComplete:"off",value:M,id:o.inputId},A,N)},o.inputHandleKeyDown=function(y){var b=fl(y);b&&o.inputKeyDownHandlers[b]&&o.inputKeyDownHandlers[b].call(o,y)},o.inputHandleChange=function(y){o.internalSetState({type:em,isOpen:!0,inputValue:y.target.value,highlightedIndex:o.props.defaultHighlightedIndex})},o.inputHandleBlur=function(){o.internalSetTimeout(function(){var y;if(!(o.isMouseDown||!o.props.environment)){var b=o.props.environment.document.activeElement,x=(b==null||(y=b.dataset)==null?void 0:y.toggle)&&o._rootNode&&o._rootNode.contains(b);x||o.reset({type:Zh})}})},o.menuRef=function(y){o._menuNode=y},o.getMenuProps=function(y,b){var x,O=y===void 0?{}:y,E=O.refKey,F=E===void 0?"ref":E,N=O.ref,P=Un(O,cT),A=b===void 0?{}:b,D=A.suppressRefError,M=D===void 0?!1:D;return o.getMenuProps.called=!0,o.getMenuProps.refKey=F,o.getMenuProps.suppressRefError=M,Se((x={},x[F]=ti(N,o.menuRef),x.role="listbox",x["aria-labelledby"]=P&&P["aria-label"]?void 0:o.labelId,x.id=o.menuId,x),P)},o.getItemProps=function(y){var b,x=y===void 0?{}:y,O=x.onMouseMove,E=x.onMouseDown,F=x.onClick;x.onPress;var N=x.index,P=x.item,A=P===void 0?process.env.NODE_ENV==="production"?void 0:tT("getItemProps","item"):P,D=Un(x,dT);N===void 0?(o.items.push(A),N=o.items.indexOf(A)):o.items[N]=A;var M="onClick",z=F,V=(b={onMouseMove:ct(O,function(){N!==o.getState().highlightedIndex&&(o.setHighlightedIndex(N,{type:Jh}),o.avoidScrolling=!0,o.internalSetTimeout(function(){return o.avoidScrolling=!1},250))}),onMouseDown:ct(E,function(se){se.preventDefault()})},b[M]=ct(z,function(){o.selectItemAtIndex(N,{type:Yh})}),b),Y=D.disabled?{onMouseDown:V.onMouseDown}:V;return Se({id:o.getItemId(N),role:"option","aria-selected":o.getState().highlightedIndex===N},Y,D)},o.clearItems=function(){o.items=[]},o.reset=function(y,b){y===void 0&&(y={}),y=Jo(y),o.internalSetState(function(x){var O=x.selectedItem;return Se({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,inputValue:o.props.itemToString(O)},y)},b)},o.toggleMenu=function(y,b){y===void 0&&(y={}),y=Jo(y),o.internalSetState(function(x){var O=x.isOpen;return Se({isOpen:!O},O&&{highlightedIndex:o.props.defaultHighlightedIndex},y)},function(){var x=o.getState(),O=x.isOpen,E=x.highlightedIndex;O&&o.getItemCount()>0&&typeof E=="number"&&o.setHighlightedIndex(E,y),jd(b)()})},o.openMenu=function(y){o.internalSetState({isOpen:!0},y)},o.closeMenu=function(y){o.internalSetState({isOpen:!1},y)},o.updateStatus=su(function(){var y;if((y=o.props)!=null&&(y=y.environment)!=null&&y.document){var b=o.getState(),x=o.items[b.highlightedIndex],O=o.getItemCount(),E=o.props.getA11yStatusMessage(Se({itemToString:o.props.itemToString,previousResultCount:o.previousResultCount,resultCount:O,highlightedItem:x},b));o.previousResultCount=O,zh(E,o.props.environment.document)}},200);var s=o.props,a=s.defaultHighlightedIndex,l=s.initialHighlightedIndex,c=l===void 0?a:l,u=s.defaultIsOpen,d=s.initialIsOpen,h=d===void 0?u:d,f=s.initialInputValue,m=f===void 0?"":f,g=s.initialSelectedItem,v=g===void 0?null:g,w=o.getState({highlightedIndex:c,isOpen:h,inputValue:m,selectedItem:v});return w.selectedItem!=null&&o.props.initialInputValue===void 0&&(w.inputValue=o.props.itemToString(w.selectedItem)),o.state=w,o}B_(n,t);var r=n.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach(function(o){clearTimeout(o)}),this.timeoutIds=[]},r.getState=function(o){return o===void 0&&(o=this.state),ys(o,this.props)},r.getItemCount=function(){var o=this.items.length;return this.itemCount!=null?o=this.itemCount:this.props.itemCount!==void 0&&(o=this.props.itemCount),o},r.getItemNodeFromIndex=function(o){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(o)):null},r.scrollHighlightedItemIntoView=function(){{var o=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(o,this._menuNode)}},r.moveHighlightedIndex=function(o,s){var a=this.getItemCount(),l=this.getState(),c=l.highlightedIndex;if(a>0){var u=_r(c,o,{length:a},this.isItemDisabled,!0);this.setHighlightedIndex(u,s)}},r.getStateAndHelpers=function(){var o=this.getState(),s=o.highlightedIndex,a=o.inputValue,l=o.selectedItem,c=o.isOpen,u=this.props.itemToString,d=this.id,h=this.getRootProps,f=this.getToggleButtonProps,m=this.getLabelProps,g=this.getMenuProps,v=this.getInputProps,w=this.getItemProps,y=this.openMenu,b=this.closeMenu,x=this.toggleMenu,O=this.selectItem,E=this.selectItemAtIndex,F=this.selectHighlightedItem,N=this.setHighlightedIndex,P=this.clearSelection,A=this.clearItems,D=this.reset,M=this.setItemCount,z=this.unsetItemCount,V=this.internalSetState;return{getRootProps:h,getToggleButtonProps:f,getLabelProps:m,getMenuProps:g,getInputProps:v,getItemProps:w,reset:D,openMenu:y,closeMenu:b,toggleMenu:x,selectItem:O,selectItemAtIndex:E,selectHighlightedItem:F,setHighlightedIndex:N,clearSelection:P,clearItems:A,setItemCount:M,unsetItemCount:z,setState:V,itemToString:u,id:d,highlightedIndex:s,inputValue:a,isOpen:c,selectedItem:l}},r.componentDidMount=function(){var o=this;if(process.env.NODE_ENV!=="production"&&this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&Vd(this._menuNode,this.getMenuProps),!this.props.environment)this.cleanup=function(){o.internalClearTimeouts()};else{var s=function(){o.isMouseDown=!0},a=function(f){o.isMouseDown=!1;var m=bs(f.target,[o._rootNode,o._menuNode],o.props.environment);!m&&o.getState().isOpen&&o.reset({type:Hh},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},l=function(){o.isTouchMove=!1},c=function(){o.isTouchMove=!0},u=function(f){var m=bs(f.target,[o._rootNode,o._menuNode],o.props.environment,!1);!o.isTouchMove&&!m&&o.getState().isOpen&&o.reset({type:im},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},d=this.props.environment;d.addEventListener("mousedown",s),d.addEventListener("mouseup",a),d.addEventListener("touchstart",l),d.addEventListener("touchmove",c),d.addEventListener("touchend",u),this.cleanup=function(){o.internalClearTimeouts(),o.updateStatus.cancel(),d.removeEventListener("mousedown",s),d.removeEventListener("mouseup",a),d.removeEventListener("touchstart",l),d.removeEventListener("touchmove",c),d.removeEventListener("touchend",u)}}},r.shouldScroll=function(o,s){var a=this.props.highlightedIndex===void 0?this.getState():this.props,l=a.highlightedIndex,c=s.highlightedIndex===void 0?o:s,u=c.highlightedIndex,d=l&&this.getState().isOpen&&!o.isOpen,h=l!==u;return d||h},r.componentDidUpdate=function(o,s){process.env.NODE_ENV!=="production"&&(au(this.state,o,this.props),this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&Vd(this._menuNode,this.getMenuProps)),vs(this.props,"selectedItem")&&this.props.selectedItemChanged(o.selectedItem,this.props.selectedItem)&&this.internalSetState({type:rm,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(s,o)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var o=Bd(this.props.children,Ht);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var s=Bd(o(this.getStateAndHelpers()));if(!s)return null;if(this.getRootProps.called||this.props.suppressRefError)return process.env.NODE_ENV!=="production"&&!this.getRootProps.suppressRefError&&!this.props.suppressRefError&&pT(s,this.getRootProps),s;if(Uh(s))return C.cloneElement(s,this.getRootProps($h(s)));if(process.env.NODE_ENV!=="production")throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function")},n}(C.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:eT,itemToString:function(n){return n==null?"":(process.env.NODE_ENV!=="production"&&rT(n)&&!n.hasOwnProperty("toString")&&console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.","The object that was passed:",n),String(n))},onStateChange:Ht,onInputValueChange:Ht,onUserAction:Ht,onChange:Ht,onSelect:Ht,onOuterClick:Ht,selectedItemChanged:function(n,r){return n!==r},environment:typeof window>"u"?void 0:window,stateReducer:function(n,r){return r},suppressRefError:!1,scrollIntoView:Bh},e.stateChangeTypes=sT,e}();process.env.NODE_ENV!=="production"&&(fT.propTypes={children:G.func,defaultHighlightedIndex:G.number,defaultIsOpen:G.bool,initialHighlightedIndex:G.number,initialSelectedItem:G.any,initialInputValue:G.string,initialIsOpen:G.bool,getA11yStatusMessage:G.func,itemToString:G.func,onChange:G.func,onSelect:G.func,onStateChange:G.func,onInputValueChange:G.func,onUserAction:G.func,onOuterClick:G.func,selectedItemChanged:G.func,stateReducer:G.func,itemCount:G.number,id:G.string,environment:G.shape({addEventListener:G.func.isRequired,removeEventListener:G.func.isRequired,document:G.shape({createElement:G.func.isRequired,getElementById:G.func.isRequired,activeElement:G.any.isRequired,body:G.any.isRequired}).isRequired,Node:G.func.isRequired}),suppressRefError:G.bool,scrollIntoView:G.func,selectedItem:G.any,isOpen:G.bool,inputValue:G.string,highlightedIndex:G.number,labelId:G.string,inputId:G.string,menuId:G.string,getItemId:G.func});function Vd(e,t){var n=t.refKey;e||console.error('downshift: The ref prop "'+n+'" from getMenuProps was not applied correctly on your menu element.')}function pT(e,t){var n=t.refKey,r=n!=="ref",i=!Uh(e);i&&!r&&!Fd.isForwardRef(e)?console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps"):!i&&r&&console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"'),!Fd.isForwardRef(e)&&!$h(e)[n]&&console.error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}var om={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function hT(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(s){mT(s,e,t,n),n[s]!==t[s]&&(o[s]=n[s])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Se({type:i},o))}function mT(e,t,n,r){var i=t.props,o=t.type,s="on"+lu(e)+"Change";i[s]&&r[e]!==void 0&&r[e]!==n[e]&&i[s](Se({type:o},r))}function gT(e,t){return t.changes}var Ud=su(function(e,t){zh(e,t)},200),yT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect,vT="useId"in C?function(t){var n=t.id,r=t.labelId,i=t.menuId,o=t.getItemId,s=t.toggleButtonId,a=t.inputId,l="downshift-"+C.useId();n||(n=l);var c=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(u){return n+"-item-"+u},toggleButtonId:s||n+"-toggle-button",inputId:a||n+"-input"});return c.current}:function(t){var n=t.id,r=n===void 0?"downshift-"+Vh():n,i=t.labelId,o=t.menuId,s=t.getItemId,a=t.toggleButtonId,l=t.inputId,c=C.useRef({labelId:i||r+"-label",menuId:o||r+"-menu",getItemId:s||function(u){return r+"-item-"+u},toggleButtonId:a||r+"-toggle-button",inputId:l||r+"-input"});return c.current};function bT(e,t,n,r){var i,o;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],o=t}else o=t===void 0?n.indexOf(e):t,i=e;return[i,o]}function lu(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function sm(e){var t=C.useRef(e);return t.current=e,t}function wT(e,t,n,r){var i=C.useRef(),o=C.useRef(),s=C.useCallback(function(f,m){o.current=m,f=ys(f,m.props);var g=e(f,m),v=m.props.stateReducer(f,Se({},m,{changes:g}));return v},[e]),a=C.useReducer(s,t,n),l=a[0],c=a[1],u=sm(t),d=C.useCallback(function(f){return c(Se({props:u.current},f))},[u]),h=o.current;return C.useEffect(function(){var f=ys(i.current,h==null?void 0:h.props),m=h&&i.current&&!r(f,l);m&&hT(h,f,l),i.current=l},[l,h,r]),[l,d]}var Xi={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:gT,scrollIntoView:Bh,environment:typeof window>"u"?void 0:window};function pr(e,t,n){n===void 0&&(n=om);var r=e["default"+lu(t)];return r!==void 0?r:n[t]}function Yi(e,t,n){n===void 0&&(n=om);var r=e[t];if(r!==void 0)return r;var i=e["initial"+lu(t)];return i!==void 0?i:pr(e,t,n)}function xT(e){var t=Yi(e,"selectedItem"),n=Yi(e,"isOpen"),r=ET(e),i=Yi(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(o){return e.itemToKey(o)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function Zi(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=e.isItemDisabled,a=e.itemToKey,l=t.selectedItem,c=t.highlightedIndex;return r.length===0?-1:i!==void 0&&c===i&&!s(r[i],i)?i:o!==void 0&&!s(r[o],o)?o:l?r.findIndex(function(u){return a(l)===a(u)}):n<0&&!s(r[r.length-1],r.length-1)?r.length-1:n>0&&!s(r[0],0)?0:-1}function IT(e,t,n){var r=C.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return C.useEffect(function(){if(!e)return Ht;var i=n.map(function(u){return u.current});function o(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function s(u){r.current.isMouseDown=!1,bs(u.target,i,e)||t()}function a(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function l(){r.current.isTouchMove=!0}function c(u){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!bs(u.target,i,e,!1)&&t()}return e.addEventListener("mousedown",o),e.addEventListener("mouseup",s),e.addEventListener("touchstart",a),e.addEventListener("touchmove",l),e.addEventListener("touchend",c),function(){e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",s),e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",c)}},[n,e,t]),r.current}var am=function(){return Ht};process.env.NODE_ENV!=="production"&&(am=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=C.useRef(n.reduce(function(s,a){return s[a]={},s},{}));C.useEffect(function(){Object.keys(i.current).forEach(function(s){var a=i.current[s];if(!Object.keys(a).length){console.error("downshift: You forgot to call the "+s+" getter function on your component / element.");return}var l=a.suppressRefError,c=a.refKey,u=a.elementRef;l||u!=null&&u.current||console.error('downshift: The ref prop "'+c+'" from '+s+" was not applied correctly on your element.")})},[]);var o=C.useCallback(function(s,a,l,c){i.current[s]={suppressRefError:a,refKey:l,elementRef:c}},[]);return o});function CT(e,t,n,r){r===void 0&&(r={});var i=r.document,o=js();C.useEffect(function(){if(!(!e||o||!i)){var s=e(t);Ud(s,i)}},n),C.useEffect(function(){return function(){Ud.cancel(),oT(i)}},[i])}function ST(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,s=e.scrollIntoView,a=C.useRef(!0);return yT(function(){t<0||!n||!Object.keys(r.current).length||(a.current===!1?a.current=!0:s(i(t),o))},[t]),a}var lm=Ht;process.env.NODE_ENV!=="production"&&(lm=function(t){var n=t.props,r=t.state,i=C.useRef(n),o=js();C.useEffect(function(){o||(au(r,i.current,n),i.current=n)},[r,n,o])});function $d(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return Se({isOpen:!1,highlightedIndex:-1},i&&Se({selectedItem:e.items[t],isOpen:pr(e,"isOpen"),highlightedIndex:pr(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function OT(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function js(){var e=C.useRef(!0);return C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function hl(e){var t=pr(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function ET(e){var t=Yi(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var ns={environment:G.shape({addEventListener:G.func.isRequired,removeEventListener:G.func.isRequired,document:G.shape({createElement:G.func.isRequired,getElementById:G.func.isRequired,activeElement:G.any.isRequired,body:G.any.isRequired}).isRequired,Node:G.func.isRequired}),itemToString:G.func,itemToKey:G.func,stateReducer:G.func},um=Se({},ns,{getA11yStatusMessage:G.func,highlightedIndex:G.number,defaultHighlightedIndex:G.number,initialHighlightedIndex:G.number,isOpen:G.bool,defaultIsOpen:G.bool,initialIsOpen:G.bool,selectedItem:G.any,initialSelectedItem:G.any,defaultSelectedItem:G.any,id:G.string,labelId:G.string,menuId:G.string,getItemId:G.func,toggleButtonId:G.string,onSelectedItemChange:G.func,onHighlightedIndexChange:G.func,onStateChange:G.func,onIsOpenChange:G.func,scrollIntoView:G.func});function _T(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Zi(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:Zi(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:i.isItemDisabled(i.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:hl(i),isOpen:pr(i,"isOpen"),selectedItem:pr(i,"selectedItem"),inputValue:pr(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Se({},e,o)}Si(Si({},um),{items:G.array.isRequired,isItemDisabled:G.func});Si(Si({},Xi),{isItemDisabled:function(){return!1}});process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;var uu=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_down__":0,cu=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_up__":1,du=process.env.NODE_ENV!=="production"?"__input_keydown_escape__":2,fu=process.env.NODE_ENV!=="production"?"__input_keydown_home__":3,pu=process.env.NODE_ENV!=="production"?"__input_keydown_end__":4,hu=process.env.NODE_ENV!=="production"?"__input_keydown_page_up__":5,mu=process.env.NODE_ENV!=="production"?"__input_keydown_page_down__":6,gu=process.env.NODE_ENV!=="production"?"__input_keydown_enter__":7,yu=process.env.NODE_ENV!=="production"?"__input_change__":8,ws=process.env.NODE_ENV!=="production"?"__input_blur__":9,vu=process.env.NODE_ENV!=="production"?"__input_click__":10,cm=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":11,dm=process.env.NODE_ENV!=="production"?"__item_mouse_move__":12,bu=process.env.NODE_ENV!=="production"?"__item_click__":13,fm=process.env.NODE_ENV!=="production"?"__togglebutton_click__":14,pm=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,hm=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,mm=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,gm=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,wu=process.env.NODE_ENV!=="production"?"__function_select_item__":19,ym=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,vm=process.env.NODE_ENV!=="production"?"__function_reset__":21,xu=process.env.NODE_ENV!=="production"?"__controlled_prop_updated_selected_item__":22,bm=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:xu,FunctionCloseMenu:mm,FunctionOpenMenu:hm,FunctionReset:vm,FunctionSelectItem:wu,FunctionSetHighlightedIndex:gm,FunctionSetInputValue:ym,FunctionToggleMenu:pm,InputBlur:ws,InputChange:yu,InputClick:vu,InputKeyDownArrowDown:uu,InputKeyDownArrowUp:cu,InputKeyDownEnd:pu,InputKeyDownEnter:gu,InputKeyDownEscape:du,InputKeyDownHome:fu,InputKeyDownPageDown:mu,InputKeyDownPageUp:hu,ItemClick:bu,ItemMouseMove:dm,MenuMouseLeave:cm,ToggleButtonClick:fm});function TT(e){var t=xT(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),Se({},t,{inputValue:r})}var NT=Se({},um,{items:G.array.isRequired,isItemDisabled:G.func,inputValue:G.string,defaultInputValue:G.string,initialInputValue:G.string,inputId:G.string,onInputValueChange:G.func});function kT(e,t,n,r){var i=C.useRef(),o=wT(e,t,n,r),s=o[0],a=o[1],l=js();return C.useEffect(function(){if(vs(t,"selectedItem")){if(!l){var c=t.itemToKey(t.selectedItem)!==t.itemToKey(i.current);c&&a({type:xu,inputValue:t.itemToString(t.selectedItem)})}i.current=s.selectedItem===i.current?t.selectedItem:s.selectedItem}},[s.selectedItem,t.selectedItem]),[ys(s,t),a]}var wm=Ht;process.env.NODE_ENV!=="production"&&(wm=function(t,n){G.checkPropTypes(NT,t,"prop",n.name)});var AT=Se({},Xi,{isItemDisabled:function(){return!1}});function RT(e,t){var n,r=t.type,i=t.props,o=t.altKey,s;switch(r){case bu:s={isOpen:pr(i,"isOpen"),highlightedIndex:hl(i),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case uu:e.isOpen?s={highlightedIndex:_r(e.highlightedIndex,1,i.items,i.isItemDisabled,!0)}:s={highlightedIndex:o&&e.selectedItem==null?-1:Zi(i,e,1),isOpen:i.items.length>=0};break;case cu:e.isOpen?o?s=$d(i,e.highlightedIndex):s={highlightedIndex:_r(e.highlightedIndex,-1,i.items,i.isItemDisabled,!0)}:s={highlightedIndex:Zi(i,e,-1),isOpen:i.items.length>=0};break;case gu:s=$d(i,e.highlightedIndex);break;case du:s=Se({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case hu:s={highlightedIndex:_r(e.highlightedIndex,-10,i.items,i.isItemDisabled,!0)};break;case mu:s={highlightedIndex:_r(e.highlightedIndex,10,i.items,i.isItemDisabled,!0)};break;case fu:s={highlightedIndex:Oi(0,!1,i.items,i.isItemDisabled)};break;case pu:s={highlightedIndex:Oi(i.items.length-1,!0,i.items,i.isItemDisabled)};break;case ws:s=Se({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case yu:s={isOpen:!0,highlightedIndex:hl(i),inputValue:t.inputValue};break;case vu:s={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Zi(i,e,0)};break;case wu:s={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case xu:s={inputValue:t.inputValue};break;default:return _T(e,t,bm)}return Se({},e,s)}var PT=["onMouseLeave","refKey","ref"],FT=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],DT=["onClick","onPress","refKey","ref"],MT=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Iu.stateChangeTypes=bm;function Iu(e){e===void 0&&(e={}),wm(e,Iu);var t=Se({},AT,e),n=t.items,r=t.scrollIntoView,i=t.environment,o=t.getA11yStatusMessage,s=kT(RT,t,TT,OT),a=s[0],l=s[1],c=a.isOpen,u=a.highlightedIndex,d=a.selectedItem,h=a.inputValue,f=C.useRef(null),m=C.useRef({}),g=C.useRef(null),v=C.useRef(null),w=js(),y=vT(t),b=C.useRef(),x=sm({state:a,props:t}),O=C.useCallback(function(B){return m.current[y.getItemId(B)]},[y]);CT(o,a,[c,u,d,h],i);var E=ST({menuElement:f.current,highlightedIndex:u,isOpen:c,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:O});lm({props:t,state:a}),C.useEffect(function(){var B=Yi(t,"isOpen");B&&g.current&&g.current.focus()},[]),C.useEffect(function(){w||(b.current=n.length)});var F=IT(i,C.useCallback(function(){x.current.state.isOpen&&l({type:ws,selectItem:!1})},[l,x]),C.useMemo(function(){return[f,v,g]},[f.current,v.current,g.current])),N=am("getInputProps","getMenuProps");C.useEffect(function(){c||(m.current={})},[c]),C.useEffect(function(){var B;!c||!(i!=null&&i.document)||!(g!=null&&(B=g.current)!=null&&B.focus)||i.document.activeElement!==g.current&&g.current.focus()},[c,i]);var P=C.useMemo(function(){return{ArrowDown:function(S){S.preventDefault(),l({type:uu,altKey:S.altKey})},ArrowUp:function(S){S.preventDefault(),l({type:cu,altKey:S.altKey})},Home:function(S){x.current.state.isOpen&&(S.preventDefault(),l({type:fu}))},End:function(S){x.current.state.isOpen&&(S.preventDefault(),l({type:pu}))},Escape:function(S){var q=x.current.state;(q.isOpen||q.inputValue||q.selectedItem||q.highlightedIndex>-1)&&(S.preventDefault(),l({type:du}))},Enter:function(S){var q=x.current.state;!q.isOpen||S.which===229||(S.preventDefault(),l({type:gu}))},PageUp:function(S){x.current.state.isOpen&&(S.preventDefault(),l({type:hu}))},PageDown:function(S){x.current.state.isOpen&&(S.preventDefault(),l({type:mu}))}}},[l,x]),A=C.useCallback(function(B){return Se({id:y.labelId,htmlFor:y.inputId},B)},[y]),D=C.useCallback(function(B,S){var q,U=B===void 0?{}:B,X=U.onMouseLeave,ne=U.refKey,te=ne===void 0?"ref":ne,ae=U.ref,Z=Un(U,PT),ye=S===void 0?{}:S,$=ye.suppressRefError,we=$===void 0?!1:$;return N("getMenuProps",we,te,f),Se((q={},q[te]=ti(ae,function(ee){f.current=ee}),q.id=y.menuId,q.role="listbox",q["aria-labelledby"]=Z&&Z["aria-label"]?void 0:""+y.labelId,q.onMouseLeave=ct(X,function(){l({type:cm})}),q),Z)},[l,N,y]),M=C.useCallback(function(B){var S,q,U=B===void 0?{}:B,X=U.item,ne=U.index,te=U.refKey,ae=te===void 0?"ref":te,Z=U.ref,ye=U.onMouseMove,$=U.onMouseDown,we=U.onClick;U.onPress;var ee=U.disabled,Ke=Un(U,FT);ee!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Be=x.current,Le=Be.props,tt=Be.state,at=bT(X,ne,Le.items,"Pass either item or index to getItemProps!"),lt=at[0],Oe=at[1],ft=Le.isItemDisabled(lt,Oe),_t="onClick",mt=we,rt=function(){F.isTouchEnd||Oe===tt.highlightedIndex||(E.current=!1,l({type:dm,index:Oe,disabled:ft}))},L=function(){l({type:bu,index:Oe})},H=function(oe){return oe.preventDefault()};return Se((S={},S[ae]=ti(Z,function(j){j&&(m.current[y.getItemId(Oe)]=j)}),S["aria-disabled"]=ft,S["aria-selected"]=Oe===tt.highlightedIndex,S.id=y.getItemId(Oe),S.role="option",S),!ft&&(q={},q[_t]=ct(mt,L),q),{onMouseMove:ct(ye,rt),onMouseDown:ct($,H)},Ke)},[l,y,x,F,E]),z=C.useCallback(function(B){var S,q=B===void 0?{}:B,U=q.onClick;q.onPress;var X=q.refKey,ne=X===void 0?"ref":X,te=q.ref,ae=Un(q,DT),Z=x.current.state,ye=function(){l({type:fm})};return Se((S={},S[ne]=ti(te,function($){v.current=$}),S["aria-controls"]=y.menuId,S["aria-expanded"]=Z.isOpen,S.id=y.toggleButtonId,S.tabIndex=-1,S),!ae.disabled&&Se({},{onClick:ct(U,ye)}),ae)},[l,x,y]),V=C.useCallback(function(B,S){var q,U=B===void 0?{}:B,X=U.onKeyDown,ne=U.onChange,te=U.onInput,ae=U.onBlur;U.onChangeText;var Z=U.onClick,ye=U.refKey,$=ye===void 0?"ref":ye,we=U.ref,ee=Un(U,MT),Ke=S===void 0?{}:S,Be=Ke.suppressRefError,Le=Be===void 0?!1:Be;N("getInputProps",Le,$,g);var tt=x.current.state,at=function(H){var j=fl(H);j&&P[j]&&P[j](H)},lt=function(H){l({type:yu,inputValue:H.target.value})},Oe=function(H){if(i!=null&&i.document&&tt.isOpen&&!F.isMouseDown){var j=H.relatedTarget===null&&i.document.activeElement!==i.document.body;l({type:ws,selectItem:!j})}},ft=function(){l({type:vu})},_t="onChange",mt={};if(!ee.disabled){var rt;mt=(rt={},rt[_t]=ct(ne,te,lt),rt.onKeyDown=ct(X,at),rt.onBlur=ct(ae,Oe),rt.onClick=ct(Z,ft),rt)}return Se((q={},q[$]=ti(we,function(L){g.current=L}),q["aria-activedescendant"]=tt.isOpen&&tt.highlightedIndex>-1?y.getItemId(tt.highlightedIndex):"",q["aria-autocomplete"]="list",q["aria-controls"]=y.menuId,q["aria-expanded"]=tt.isOpen,q["aria-labelledby"]=ee&&ee["aria-label"]?void 0:y.labelId,q.autoComplete="off",q.id=y.inputId,q.role="combobox",q.value=tt.inputValue,q),mt,ee)},[l,y,i,P,x,F,N]),Y=C.useCallback(function(){l({type:pm})},[l]),se=C.useCallback(function(){l({type:mm})},[l]),ce=C.useCallback(function(){l({type:hm})},[l]),ge=C.useCallback(function(B){l({type:gm,highlightedIndex:B})},[l]),be=C.useCallback(function(B){l({type:wu,selectedItem:B})},[l]),I=C.useCallback(function(B){l({type:ym,inputValue:B})},[l]),J=C.useCallback(function(){l({type:vm})},[l]);return{getItemProps:M,getLabelProps:A,getMenuProps:D,getInputProps:V,getToggleButtonProps:z,toggleMenu:Y,openMenu:ce,closeMenu:se,setHighlightedIndex:ge,setInputValue:I,selectItem:be,reset:J,highlightedIndex:u,isOpen:c,selectedItem:d,inputValue:h}}ns.stateReducer,ns.itemToKey,ns.environment,G.array,G.array,G.array,G.func,G.number,G.number,G.number,G.func,G.func,G.string,G.string;Xi.itemToKey,Xi.stateReducer,Xi.environment;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;const jT="_comboboxContainer_1lcc8_1",LT="_inputContainer_1lcc8_12",BT="_input_1lcc8_12",VT="_toggleButton_1lcc8_33",UT="_menu_1lcc8_39",$T="_menuBottom_1lcc8_55",qT="_menuTop_1lcc8_61",zT="_menuItem_1lcc8_66",KT="_highlighted_1lcc8_73",HT="_selected_1lcc8_77",JT="_hidden_1lcc8_81",pn={comboboxContainer:jT,inputContainer:LT,input:BT,toggleButton:VT,menu:UT,menuBottom:$T,menuTop:qT,menuItem:zT,highlighted:KT,selected:HT,hidden:JT};function WT(e){const t=e.toLowerCase();return function(r){return!e||r.label.toLowerCase().includes(t)||r.value.toLowerCase().includes(t)}}function xm({items:e,selectedValue:t,onSelectedItemChange:n,placeholder:r,disabled:i,style:o,menuPosition:s="bottom"}){const[a,l]=C.useState(e),c=C.useRef(null);C.useEffect(()=>l(e),[e]);const u=C.useCallback(E=>{(E==null?void 0:E.length)>0?l(e.filter(WT(E))):l(e)},[e]),{isOpen:d,getToggleButtonProps:h,getMenuProps:f,getInputProps:m,highlightedIndex:g,getItemProps:v,setInputValue:w}=Iu({items:a,selectedItem:t?e.find(E=>E.value===t):null,itemToString:E=>(E==null?void 0:E.label)||"",onInputValueChange:({inputValue:E})=>u(E),onSelectedItemChange:({selectedItem:E})=>{var F;n(E),(F=c.current)==null||F.blur()}}),y=()=>{w(""),l(e)},b=()=>y(),x=C.useMemo(()=>{var E;return(E=e.find(F=>F.value===t))==null?void 0:E.label},[e,t]),O=()=>{w(t&&x?x:"")};return p.jsxs("div",{style:{position:"relative",...o},children:[p.jsx("div",{className:pn.comboboxContainer,children:p.jsxs("div",{className:pn.inputContainer,children:[p.jsx("input",{style:{border:"none"},disabled:i,placeholder:r,className:pn.input,...m({onFocus:b,onBlur:O,ref:c})}),p.jsx("button",{style:{border:"none"},disabled:i,"aria-label":"toggle menu",className:pn.toggleButton,type:"button",...h(),children:d?p.jsx(p.Fragment,{children:"↑"}):p.jsx(p.Fragment,{children:"↓"})})]})}),p.jsx("ul",{className:`${pn.menu} ${d&&e.length?"":pn.hidden} ${s==="top"?pn.menuTop:pn.menuBottom}`,...f(),children:d&&a.map((E,F)=>p.jsx("li",{className:`${pn.menuItem} ${g===F?pn.highlighted:""} ${t===(E==null?void 0:E.value)?pn.selected:""}`,...v({item:E,index:F}),children:p.jsx("span",{children:E.label})},E.id))})]})}function QT(e,t){var r;const n=((r=e==null?void 0:e.read)==null?void 0:r.selectedFieldMappings)||{};t.forEach(i=>{var a,l;const{field:o,value:s}=i;if(s===null){const c=n[o];delete n[o],c&&((a=e==null?void 0:e.read)!=null&&a.selectedValueMappings)&&e.read.selectedValueMappings[c]&&delete e.read.selectedValueMappings[c]}else{const c=n[o];n[o]=s,c&&c!==s&&((l=e==null?void 0:e.read)!=null&&l.selectedValueMappings)&&e.read.selectedValueMappings[c]&&delete e.read.selectedValueMappings[c]}})}function ao(e,t,n){t(e,r=>QT(r,n))}const GT="Each field must be mapped to a unique value";function Cu({field:e,onSelectChange:t,allFields:n}){var y;const{configureState:r,selectedObjectName:i,setConfigureState:o}=Xt(),[s,a]=C.useState(!0),{isError:l,removeError:c,getError:u}=kn(),d=(y=r==null?void 0:r.read)==null?void 0:y.selectedFieldMappings,h=d==null?void 0:d[e.mapToName];C.useEffect(()=>{e._default&&!h&&i&&r&&ao(i,o,[{field:e.mapToName,value:e._default}]),a(!1)},[e,o,i,h,r]);const f=C.useMemo(()=>n.map(b=>({id:b.fieldName,label:b.displayName,value:b.fieldName})),[n]),m=p.jsx(xm,{disabled:s,items:f,selectedValue:h||null,onSelectedItemChange:b=>{t({target:{name:e.mapToName,value:b==null?void 0:b.value}})},placeholder:"Please select one",style:{width:"100%"}}),g=C.useCallback(()=>{i&&(ao(i,o,[{field:e.mapToName,value:null}]),l(Ee.MAPPING,i)&&c(Ee.MAPPING,i))},[e.mapToName,i,o,l,c]),{hasDuplicationError:v,errorMessage:w}=C.useMemo(()=>{const b=u(Ee.MAPPING,i),x=Array.isArray(b)&&b.length>0&&b.includes(e.mapToName);return{hasDuplicationError:x,errorMessage:x?GT:""}},[i,u,e.mapToName]);return p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem",marginBottom:".25rem"},children:[p.jsx("span",{style:{fontWeight:500},children:e.mapToDisplayName??e.mapToName}),p.jsx("span",{children:(e==null?void 0:e.prompt)&&p.jsx(Oh,{id:`tooltip-id-${e==null?void 0:e.prompt}`,tooltipText:e==null?void 0:e.prompt})})]}),p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem"},children:[m,p.jsx(et,{type:"button",variant:"ghost",onClick:g,children:"Clear"})]})]},e.mapToName),v&&p.jsxs("span",{style:{color:"red",fontSize:"14px",marginTop:"4px"},children:[" ",w," "]},e.mapToName)]})}const XT="_formControl_9qd8d_1",YT="_formLabel_9qd8d_5",ZT="_formLabelRequired_9qd8d_11",eN="_formInput_9qd8d_16",tN="_formInputInvalid_9qd8d_20",nN="_formError_9qd8d_24",rN="_disabled_9qd8d_30",Cr={formControl:XT,formLabel:YT,formLabelRequired:ZT,formInput:eN,formInputInvalid:tN,formError:nN,disabled:rN};function Ls({id:e,label:t,isRequired:n=!1,isDisabled:r=!1,isInvalid:i=!1,errorMessage:o,children:s}){return p.jsxs("div",{className:ln(Cr.formControl,{[Cr.disabled]:r}),children:[t&&p.jsx("label",{htmlFor:e,className:ln(Cr.formLabel,{[Cr.formLabelRequired]:n}),children:t}),p.jsx("div",{id:e,className:ln(Cr.formInput,{[Cr.formInputInvalid]:i}),children:s}),i&&o&&p.jsx("div",{className:Cr.formError,role:"alert",children:o})]})}function Im({selectedFieldMappings:e,selectedObjectName:t,fieldName:n,fieldValue:r,setError:i}){if(!e||!t)return!1;if(Object.values(e).some(s=>s===r&&s!==n)){console.error("Each field must be mapped to a unique value",e);const s=Object.keys(e).filter(l=>e[l]===r),a=[n,...s];return i(Ee.MAPPING,t,a),!0}return!1}function iN({dynamicFieldMappings:e,onSelectChange:t,allFields:n}){return e.length?p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:e.map(r=>p.jsx(Ls,{id:r.mapToName,children:p.jsx(Cu,{allFields:n,field:r,onSelectChange:t})},r.mapToName))}):null}function oN(){var m,g;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{isError:r,removeError:i,setError:o}=kn(),s=((m=t==null?void 0:t.read)==null?void 0:m.allFields)||[],{fieldMapping:a}=St(),l=(g=t==null?void 0:t.read)==null?void 0:g.selectedFieldMappings,c=v=>{const{value:w,name:y}=v.target;!w||Im({selectedFieldMappings:l,selectedObjectName:e,fieldName:y,fieldValue:w,setError:o})||(e&&ao(e,n,[{field:y,value:w}]),r(Ee.MAPPING,y)&&i(Ee.MAPPING,y),e&&r(Ee.MAPPING,e)&&i(Ee.MAPPING,e))},u=C.useMemo(()=>!e||!a?[]:Object.values(a[e]||{}).flat().filter(v=>!v.fieldName),[a,e]),d=C.useMemo(()=>{var y;return(((y=t==null?void 0:t.read)==null?void 0:y.optionalMapFields)||[]).filter(b=>!u.some(x=>x.mapToName===b.mapToName))},[t,u]),h=u.length>0;return d.length>0||h?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Map the following optional fields"}),p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:[d==null?void 0:d.map(v=>p.jsx(Ls,{id:v.mapToName,children:p.jsx(Cu,{allFields:s,field:v,onSelectChange:c})},v.mapToName)),h&&p.jsx(iN,{dynamicFieldMappings:u,onSelectChange:c,allFields:s})]})]}):null}function sN(){var c;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{isError:r,removeError:i,setError:o}=kn(),s=(c=t==null?void 0:t.read)==null?void 0:c.selectedFieldMappings,a=u=>{const{value:d,name:h}=u.target;!d||Im({selectedFieldMappings:s,selectedObjectName:e,fieldName:h,fieldValue:d,setError:o})||(e&&ao(e,n,[{field:h,value:d}]),r(Ee.MAPPING,h)&&i(Ee.MAPPING,h),e&&r(Ee.MAPPING,e)&&i(Ee.MAPPING,e))},l=C.useMemo(()=>{var u;return((u=t==null?void 0:t.read)==null?void 0:u.requiredMapFields)||[]},[t]);return l!=null&&l.length?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Map the following fields"}),p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:l.map(u=>{var d;return p.jsx(Ls,{id:u.mapToName,isInvalid:r(Ee.MAPPING,u.mapToName),errorMessage:"* required",children:p.jsx(Cu,{allFields:((d=t==null?void 0:t.read)==null?void 0:d.allFields)||[],field:u,onSelectChange:a})},u.mapToName)})})]}):null}const aN=(e,t)=>e.filter(n=>!t.has(n));function lN(){var h,f,m;const{selectedObjectName:e,configureState:t,setConfigureState:n}=Xt(),{fieldMapping:r}=St(),i=((h=t==null?void 0:t.read)==null?void 0:h.selectedFieldMappings)||{},o=Object.keys(i),s=((f=t==null?void 0:t.read)==null?void 0:f.requiredMapFields)||[],a=((m=t==null?void 0:t.read)==null?void 0:m.optionalMapFields)||[],l=e&&r?Object.values(r[e]||{}).flat().filter(g=>!g.fieldName):[],c=s.concat(l,a).map(g=>g.mapToName),u=new Set(c),d=aN(o,u);C.useEffect(()=>{e&&d.length&&ao(e,n,d.map(g=>({field:g,value:null})))},[e,n,d])}const uN={backgroundColor:"var(--amp-colors-bg-highlight)",borderColor:"var(--amp-colors-bg-highlight)",padding:".5rem 1rem"};function Cm({children:e,style:t}){return p.jsx(Kn,{style:{...uN,...t},children:e})}function cN(){var c,u,d;const{data:e}=yr(),{hydratedRevision:t}=Gr(),{selectedObjectName:n}=Xt(),{providerName:r}=Ot(),i=e==null?void 0:e.appName,o=(d=(u=(c=t==null?void 0:t.content)==null?void 0:c.read)==null?void 0:u.objects)==null?void 0:d.find(h=>h.objectName===n),s=(o==null?void 0:o.displayName)||n&&un(n),a=o==null?void 0:o.mapToName,l=(o==null?void 0:o.mapToDisplayName)||a&&un(a);return l&&i&&r?p.jsx(Cm,{style:{marginTop:"1rem"},children:p.jsxs("p",{style:{margin:"1rem 0"},children:[p.jsx("b",{children:l})," in ",i," is mapped to"," ",p.jsx("b",{children:s})," in ",r,"."]})}):null}function qd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sm(...e){return t=>{let n=!1;const r=e.map(i=>{const o=qd(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():qd(e[i],null)}}}}function Ei(...e){return W.useCallback(Sm(...e),e)}function Bs(e,t=[]){let n=[];function r(o,s){const a=W.createContext(s),l=n.length;n=[...n,s];const c=d=>{var w;const{scope:h,children:f,...m}=d,g=((w=h==null?void 0:h[e])==null?void 0:w[l])||a,v=W.useMemo(()=>m,Object.values(m));return p.jsx(g.Provider,{value:v,children:f})};c.displayName=o+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,m=W.useContext(f);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>W.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return W.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,dN(i,...t)]}function dN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function gn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var lo=globalThis!=null&&globalThis.document?W.useLayoutEffect:()=>{},fN=W[" useInsertionEffect ".trim().toString()]||lo;function Su({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=pN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const u=W.useRef(e!==void 0);W.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=W.useCallback(u=>{var d;if(a){const h=hN(u)?u(e):u;h!==e&&((d=s.current)==null||d.call(s,h))}else o(u)},[a,e,o,s]);return[l,c]}function pN({defaultProp:e,onChange:t}){const[n,r]=W.useState(e),i=W.useRef(n),o=W.useRef(t);return fN(()=>{o.current=t},[t]),W.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function hN(e){return typeof e=="function"}function mN(e){const t=W.useRef({value:e,previous:e});return W.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function gN(e){const[t,n]=W.useState(void 0);return lo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function yN(e,t){return W.useReducer((n,r)=>t[n][r]??n,e)}var Ou=e=>{const{present:t,children:n}=e,r=vN(t),i=typeof n=="function"?n({present:r.isPresent}):W.Children.only(n),o=Ei(r.ref,bN(i));return typeof n=="function"||r.isPresent?W.cloneElement(i,{ref:o}):null};Ou.displayName="Presence";function vN(e){const[t,n]=W.useState(),r=W.useRef(null),i=W.useRef(e),o=W.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yN(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return W.useEffect(()=>{const c=Wo(r.current);o.current=a==="mounted"?c:"none"},[a]),lo(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Wo(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),lo(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=Wo(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&g&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=f=>{f.target===t&&(o.current=Wo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:W.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Wo(e){return(e==null?void 0:e.animationName)||"none"}function bN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ml(e){const t=wN(e),n=W.forwardRef((r,i)=>{const{children:o,...s}=r,a=W.Children.toArray(o),l=a.find(IN);if(l){const c=l.props.children,u=a.map(d=>d===l?W.Children.count(c)>1?W.Children.only(null):W.isValidElement(c)?c.props.children:null:d);return p.jsx(t,{...s,ref:i,children:W.isValidElement(c)?W.cloneElement(c,void 0,u):null})}return p.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function wN(e){const t=W.forwardRef((n,r)=>{const{children:i,...o}=n;if(W.isValidElement(i)){const s=SN(i),a=CN(o,i.props);return i.type!==W.Fragment&&(a.ref=r?Sm(r,s):s),W.cloneElement(i,a)}return W.Children.count(i)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xN=Symbol("radix.slottable");function IN(e){return W.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xN}function CN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function SN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ON=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jn=ON.reduce((e,t)=>{const n=ml(`Primitive.${t}`),r=W.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Vs="Checkbox",[EN,HA]=Bs(Vs),[_N,Eu]=EN(Vs);function TN(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:s,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[h,f]=Su({prop:n,defaultProp:i??!1,onChange:l,caller:Vs}),[m,g]=W.useState(null),[v,w]=W.useState(null),y=W.useRef(!1),b=m?!!s||!!m.closest("form"):!0,x={checked:h,disabled:o,setChecked:f,control:m,setControl:g,name:a,form:s,value:u,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:hr(i)?!1:i,isFormControl:b,bubbleInput:v,setBubbleInput:w};return p.jsx(_N,{scope:t,...x,children:NN(d)?d(x):r})}var Om="CheckboxTrigger",Em=W.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:s,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:h,isFormControl:f,bubbleInput:m}=Eu(Om,e),g=Ei(i,u),v=W.useRef(l);return W.useEffect(()=>{const w=o==null?void 0:o.form;if(w){const y=()=>d(v.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[o,d]),p.jsx(Jn.button,{type:"button",role:"checkbox","aria-checked":hr(l)?"mixed":l,"aria-required":c,"data-state":km(l),"data-disabled":a?"":void 0,disabled:a,value:s,...r,ref:g,onKeyDown:gn(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:gn(n,w=>{d(y=>hr(y)?!0:!y),m&&f&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});Em.displayName=Om;var _u=W.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return p.jsx(TN,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:a,required:s,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(Em,{...d,ref:t,__scopeCheckbox:n}),h&&p.jsx(Nm,{__scopeCheckbox:n})]})})});_u.displayName=Vs;var _m="CheckboxIndicator",Tu=W.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Eu(_m,n);return p.jsx(Ou,{present:r||hr(o.checked)||o.checked===!0,children:p.jsx(Jn.span,{"data-state":km(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});Tu.displayName=_m;var Tm="CheckboxBubbleInput",Nm=W.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:h,setBubbleInput:f}=Eu(Tm,e),m=Ei(n,f),g=mN(o),v=gN(r);W.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(g!==o&&O){const F=new Event("click",{bubbles:E});y.indeterminate=hr(o),O.call(y,hr(o)?!1:o),y.dispatchEvent(F)}},[h,g,o,i]);const w=W.useRef(hr(o)?!1:o);return p.jsx(Jn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??w.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Nm.displayName=Tm;function NN(e){return typeof e=="function"}function hr(e){return e==="indeterminate"}function km(e){return hr(e)?"indeterminate":e?"checked":"unchecked"}function Nu(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var kN=["color"],Am=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Nu(e,kN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AN=["color"],RN=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Nu(e,AN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PN=["color"],Rm=C.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Nu(e,PN);return C.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),C.createElement("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const FN="_checkboxGroupContainer_hqfeu_1",DN="_stack_hqfeu_6",MN="_selectAllContainer_hqfeu_10",jN="_fieldContainer_hqfeu_17",LN="_checkbox_hqfeu_1",_i={checkboxGroupContainer:FN,stack:DN,selectAllContainer:MN,fieldContainer:jN,checkbox:LN};function BN({id:e,isChecked:t,label:n,onCheckedChange:r}){return p.jsxs("div",{className:_i.fieldContainer,children:[p.jsx(_u,{className:_i.checkbox,id:e,onCheckedChange:r,checked:t,children:p.jsx(Tu,{children:p.jsx(Am,{})})}),p.jsx("label",{htmlFor:e,style:{overflowWrap:"anywhere"},children:n})]})}function VN({id:e,isChecked:t,label:n,onCheckedChange:r,isIndeterminate:i}){return p.jsxs("div",{className:_i.selectAllContainer,children:[p.jsx(_u,{className:_i.checkbox,id:e,onCheckedChange:r,checked:i?"indeterminate":t,children:p.jsxs(Tu,{children:[i&&p.jsx(RN,{}),t===!0&&p.jsx(Am,{})]})}),p.jsx("label",{htmlFor:e,children:n})]})}function UN({children:e}){return p.jsx("div",{className:_i.checkboxGroupContainer,children:e})}function $N({children:e}){return p.jsx("div",{className:_i.stack,children:e})}const qN="_paginationContainer_1p51x_1",zN="_pageInfo_1p51x_7",KN="_searchContainer_1p51x_13",HN="_searchInput_1p51x_17",JN="_noResults_1p51x_21",zi={paginationContainer:qN,pageInfo:zN,searchContainer:KN,searchInput:HN,noResults:JN};function Pm({items:e,onItemChange:t,itemsPerPage:n=8,showSelectAll:r=!0,showSearch:i=!0,searchPlaceholder:o="Search fields...",itemName:s="fields"}){const[a,l]=C.useState(1),[c,u]=C.useState(""),d=e.filter(x=>x.label.toLowerCase().includes(c.toLowerCase())),h=Math.ceil(d.length/n),f=(a-1)*n,m=f+n,g=d.slice(f,m),v=x=>{u(x),l(1)},w=x=>{d.forEach(O=>{t(O.id,x)})},y=d.length>0&&d.every(x=>x.isChecked),b=d.some(x=>x.isChecked);return p.jsxs(UN,{children:[i&&p.jsx("div",{className:zi.searchContainer,children:p.jsx(kp,{id:"field-search",type:"text",placeholder:o,value:c,onChange:x=>v(x.target.value),className:zi.searchInput})}),r&&e.length>=2&&p.jsx(VN,{id:"select-all-fields",isChecked:y,label:`Select all ${d.length} ${c?"matching ":""}${s}`,onCheckedChange:w,isIndeterminate:b&&!y}),p.jsx($N,{children:g.map(x=>p.jsx(BN,{id:x.id,isChecked:x.isChecked,label:x.label,onCheckedChange:O=>t(x.id,O===!0)},x.id))}),h>1&&p.jsxs("div",{className:zi.paginationContainer,children:[p.jsx(et,{type:"button",onClick:()=>l(x=>Math.max(1,x-1)),disabled:a===1,variant:"ghost",children:"<"}),p.jsxs("span",{className:zi.pageInfo,children:[a," of ",h]}),p.jsx(et,{type:"button",onClick:()=>l(x=>Math.min(h,x+1)),disabled:a===h,variant:"ghost",children:">"})]}),d.length===0&&c&&p.jsxs("div",{className:zi.noResults,children:["No ",s,' found matching "',c,'"']})]})}function WN(e,t,n){var i;const r=((i=e==null?void 0:e.read)==null?void 0:i.selectedOptionalFields)||{};r[t]=n,n||delete r[t]}function QN(e,t,n,r){t(e,i=>WN(i,n,r))}function GN(){var c,u;const{appName:e,configureState:t,setConfigureState:n,selectedObjectName:r}=Xt(),i=(c=t==null?void 0:t.read)==null?void 0:c.selectedOptionalFields,o=(u=t==null?void 0:t.read)==null?void 0:u.optionalFields,s=(d,h)=>{r&&t&&QN(r,n,d,h)},a=C.useMemo(()=>(o==null?void 0:o.filter(d=>!Ri(d)&&"fieldName"in d&&"displayName"in d).map(d=>({id:d.fieldName,label:d.displayName,isChecked:!!(i!=null&&i[d.fieldName])})).sort((d,h)=>d.label.localeCompare(h.label)))||[],[o,i]);return!!(o&&o.length>0)&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`${e} reads the following optional fields`}),p.jsx(Pm,{items:a,onItemChange:s,showSelectAll:a.length>=2},`${r}-${o==null?void 0:o.length}`)]})}function XN(){return p.jsx(GN,{})}function YN(){var l,c,u,d;const{installation:e}=An(),{selectedObjectName:t}=Xt(),{displayName:n}=Dh(),{toggleReadingObject:r,isPending:i}=Mh(),o=t?(d=(u=(c=(l=e==null?void 0:e.config)==null?void 0:l.content)==null?void 0:c.read)==null?void 0:u.objects)==null?void 0:d[t]:void 0;if(!o)return null;if(!o.disabled)return p.jsx(Co,{children:p.jsxs("p",{children:["Reading from ",n," is enabled."]})});const a=()=>{t&&r({objectName:t,disabled:!1,onError:h=>{console.error("Error re-enabling read object:",h)}})};return p.jsx(p.Fragment,{children:p.jsxs(Cm,{style:{backgroundColor:"var(--amp-colors-status-critical-muted)"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[p.jsx(Rm,{style:{width:"16px",height:"16px",flexShrink:0}}),p.jsx("span",{style:{fontWeight:600},children:"Reading is currently disabled"})]}),p.jsxs("p",{style:{marginTop:"0.5rem",fontSize:"0.875rem"},children:["This object is not being synced. Click below to re-enable reading from"," ",p.jsx("b",{children:n}),"."]}),p.jsx(et,{type:"button",onClick:a,variant:"ghost",style:{marginTop:"1rem",width:"100%"},disabled:i,children:i?"Re-enabling...":`Re-enable reading from ${n}`})]})})}const ZN={color:"var(--amp-colors-text-regular)",backgroundColor:"var(--amp-colors-bg-highlight)",borderRadius:"4px",display:"inline-block",fontSize:"0.75rem",fontWeight:500,lineHeight:"1.25",padding:"0.25rem 0.5rem"};function ek({children:e,style:t,...n}){return p.jsx("span",{style:{...ZN,...t},...n,children:e})}const tk="_errorAlert_1tcao_1",nk="_errorHeader_1tcao_11",rk="_errorIcon_1tcao_17",ik="_errorTitle_1tcao_24",ok="_errorMessage_1tcao_30",Ki={errorAlert:tk,errorHeader:nk,errorIcon:rk,errorTitle:ik,errorMessage:ok};function sk({error:e}){return p.jsxs("div",{className:Ki.errorAlert,children:[p.jsxs("div",{className:Ki.errorHeader,children:[p.jsx(Rm,{className:Ki.errorIcon}),p.jsx("span",{className:Ki.errorTitle,children:"Unable to load object"})]}),p.jsx("div",{className:Ki.errorMessage,children:e})]})}function ak(){var s,a,l;const{data:e}=_s(),{selectedObjectName:t}=Xt(),{appName:n}=yr(),r=(l=(a=(s=e==null?void 0:e.content)==null?void 0:s.read)==null?void 0:a.objects)==null?void 0:l.find(c=>c.objectName===t),i=r==null?void 0:r.error,o=r==null?void 0:r.requiredFields;return i?p.jsx(sk,{error:i}):p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`${n} reads the following fields`}),p.jsx("div",{style:{display:"flex",gap:".5rem",marginBottom:".5rem",flexWrap:"wrap"},children:o!=null&&o.length?o.map(c=>Ri(c)?null:p.jsx(ek,{children:c.displayName},c.fieldName)):"There are no required fields."})]})}function lk(e,t,n,r,i){e.read&&(e.read.selectedValueMappings||(e.read.selectedValueMappings={}),e.read.selectedValueMappings[i]||(e.read.selectedValueMappings[i]={}),r===""&&e.read.selectedValueMappings[i][n]?delete e.read.selectedValueMappings[i][n]:e.read.selectedValueMappings[i][n]=r)}function Fm(e,t,n,r,i){t(e,o=>lk(o,e,n,r,i))}function wa(e){return e.mapToDisplayName||e.mapToName||e.fieldName||""}function uk(e,t){if(!e.fieldName)return{isValid:!1,errorMessage:"Field name is missing"};const n=t==null?void 0:t.valueType;if(!["singleSelect","multiSelect"].includes(n||""))return{isValid:!1,errorMessage:"fieldName is not a singleSelect or multiSelect"};const r=t==null?void 0:t.values;if(!r)return{isValid:!1,errorMessage:"Field values array is missing"};const i=Object.keys(r).length,o=Object.keys((e==null?void 0:e.mappedValues)||[]).length;return i!==o?{isValid:!1,errorMessage:"field values and the values to be mapped are not of the same length"}:{isValid:!0}}function ck(e,t,n){const r=Object.values(t).filter(Boolean),i=t[n];return e.filter(o=>{const s=o.value===i,a=r.includes(o.value);return s||!a})}function dk({string:e,fieldName:t}){return p.jsxs("div",{style:{display:"flex",position:"relative",paddingTop:"1rem",paddingBottom:".5rem"},children:[p.jsxs("h3",{style:{color:"var(--amp-colors-text-muted)",fontSize:"1rem",fontWeight:"400"},children:[e,p.jsx("b",{children:t})]}),p.jsx("div",{style:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"},children:p.jsx(Ms,{style:{width:"100%",marginLeft:"1rem"}})})]})}function fk({mappedValue:e,onSelectChange:t,fieldName:n,allValueOptions:r}){var f;const{configureState:i,selectedObjectName:o,setConfigureState:s}=Xt(),a=C.useMemo(()=>{var m,g;return((g=(m=i==null?void 0:i.read)==null?void 0:m.selectedValueMappings)==null?void 0:g[n])||{}},[(f=i==null?void 0:i.read)==null?void 0:f.selectedValueMappings,n]),l=C.useMemo(()=>a==null?void 0:a[e.mappedValue],[a,e.mappedValue]),c=C.useMemo(()=>r.map(m=>({id:m.value,label:m.displayValue,value:m.value})),[r]),u=C.useCallback(m=>{m&&t({target:{name:e.mappedValue,value:m.value,fieldName:n}})},[t,n,e.mappedValue]),d=C.useMemo(()=>p.jsx(xm,{items:c,selectedValue:l||null,onSelectedItemChange:u,placeholder:"Please select one",style:{borderRadius:"8px",width:"100%"}},l),[l,c,u]),h=C.useCallback(()=>{o&&Fm(o,s,e.mappedValue,"",n)},[o,s,e.mappedValue,n]);return p.jsxs("div",{style:{display:"flex",flexDirection:"column",marginBottom:".25rem"},children:[p.jsx("div",{style:{display:"flex",flexDirection:"row",gap:".25rem",marginBottom:".25rem"},children:p.jsx("span",{style:{fontWeight:500},children:e.mappedDisplayValue})}),p.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:".25rem"},children:[d,p.jsx(et,{type:"button",variant:"ghost",onClick:h,children:"Clear"})]})]},e.mappedValue)}function pk(){var l,c;const{fieldMapping:e}=St(),{selectedObjectName:t,configureState:n,setConfigureState:r}=Xt(),i=(l=n==null?void 0:n.read)==null?void 0:l.selectedFieldMappings,o=(c=n==null?void 0:n.read)==null?void 0:c.selectedValueMappings,s=C.useMemo(()=>{const u=t&&e?Object.values(e[t]||{}).flat().filter(d=>d.mappedValues).map(d=>({...d})):[];if(i)for(let d=0;d<u.length;d+=1){const{mapToName:h}=u[d];i!=null&&i[h]&&(u[d].fieldName=i[h])}return u},[t,e,i]),a=C.useCallback(u=>{const{value:d,name:h,fieldName:f}=u.target;d&&t&&Fm(t,r,h,d,f)},[t,r]);return s!=null&&s.length?p.jsx(p.Fragment,{children:s.map(u=>{var f,m,g;const d=(m=(f=n==null?void 0:n.read)==null?void 0:f.allFieldsMetadata)==null?void 0:m[u.fieldName],h=uk(u,d);return h.isValid?p.jsxs(p.Fragment,{children:[p.jsx(dk,{string:"Map the values for ",fieldName:wa(u)}),p.jsx("div",{style:{display:"flex",gap:"1rem",flexDirection:"column"},children:p.jsx(Ls,{id:wa(u),children:(g=u==null?void 0:u.mappedValues)==null?void 0:g.map(v=>{const w=(d==null?void 0:d.values)||[],y=(o==null?void 0:o[u.fieldName])||{},b=ck(w,y,v.mappedValue);return p.jsx(fk,{allValueOptions:b,mappedValue:v,onSelectChange:a,fieldName:(u==null?void 0:u.fieldName)||""},`${v.mappedValue}-${u.fieldName}`)})},wa(u))})]}):(console.error(h.errorMessage,u),null)})}):null}function hk(){return lN(),p.jsxs(p.Fragment,{children:[p.jsx(YN,{}),p.jsx(cN,{}),p.jsx(ak,{}),p.jsx(sN,{}),p.jsx(oN,{}),p.jsx(pk,{}),p.jsx(XN,{}),p.jsx(L_,{})]})}function mk(e,t,n){var r;if(((r=e==null?void 0:e.write)==null?void 0:r.selectedWriteObjects)===null&&(e.write.selectedWriteObjects={}),e!=null&&e.write){const i=e.write.selectedWriteObjects;n&&(i[t]={objectName:t}),n||delete i[t]}}function gk(e,t,n,r){t(e,i=>{mk(i,n,r)})}function yk(){var c,u;const{appName:e,selectedObjectName:t,configureState:n,setConfigureState:r}=Xt(),i=(c=n==null?void 0:n.write)==null?void 0:c.selectedWriteObjects,o=(u=n==null?void 0:n.write)==null?void 0:u.writeObjects,s=(d,h)=>{t&&n&&gk(t,r,d,h)},a=!!o,l=(o==null?void 0:o.map(d=>({id:d.objectName,label:d.displayName,isChecked:!!(i!=null&&i[d.objectName])})))||[];return a&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:`Allow ${e} to write to these objects`}),p.jsx(Pm,{items:l,onItemChange:s,showSelectAll:o.length>=2,searchPlaceholder:"Search objects...",itemName:"objects"})]})}function vk(){return p.jsx(p.Fragment,{children:p.jsx(yk,{})})}function Dm({resetComponent:e,onDisconnectSuccess:t}){return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[p.jsx(Gt,{string:"Remove connection"}),p.jsx("p",{children:"Click to disconnect your connection from the provider."}),p.jsx(kh,{resetComponent:e,onDisconnectSuccess:t,buttonText:"Remove connection",buttonVariant:"danger",buttonStyle:{fontSize:"13px",width:"100%"}})]})}const bk="_authenticationRow_1g2ms_1",wk="_field_1g2ms_8",xk="_value_1g2ms_12",xa={authenticationRow:bk,field:wk,value:xk};function zd({label:e,value:t}){return p.jsxs("div",{className:xa.authenticationRow,children:[p.jsx("div",{className:xa.field,children:e}),p.jsx("div",{className:xa.value,children:t})]})}function Ik(){const{selectedConnection:e}=Rn(),{providerName:t}=Ot(),r=(e==null?void 0:e.provider)==="salesforce"?"subdomain":"workspace",i=`${t} ${r}`;return p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Connection details"}),p.jsxs("div",{style:{paddingBottom:"1rem"},children:[p.jsx(zd,{label:i,value:e==null?void 0:e.providerWorkspaceRef}),p.jsx(zd,{label:"Status",value:un((e==null?void 0:e.status)||"")})]})]})}function Ck(){const{installation:e}=St(),{providerName:t}=Ot();return e?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Uninstall entire integration"}),p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",padding:"1rem 0"},children:[e!=null&&e.id?p.jsxs("p",{style:{color:"var(--amp-colors-text-muted)"},children:["By clicking below, you will uninstall the entire ",t," ","integration. You will lose any configuration you've set up."]}):p.jsx("p",{children:"You've successfully uninstalled the integration."}),p.jsx(nu,{buttonText:"Yes, uninstall",buttonVariant:"danger"})]})]}):null}function Sk(){const{installation:e,resetComponent:t}=St();return p.jsxs(p.Fragment,{children:[p.jsx(Ik,{}),p.jsx(tu,{}),e&&p.jsx(Ck,{}),!e&&p.jsx(Dm,{resetComponent:t})]})}function Mm({onSave:e,onReset:t,isLoading:n,isCreateMode:r=!1,errorMsg:i}){var ge,be,I,J,B,S,q,U,X,ne,te,ae,Z,ye;const{installation:o}=An(),{hydratedRevision:s,loading:a}=Gr(),{configureState:l,selectedObjectName:c}=Xt(),u=o==null?void 0:o.config,d=u&&c&&!!cp(u,c)||!1,h=c?Sp(u,c):void 0,f=(ge=l==null?void 0:l.read)==null?void 0:ge.selectedFieldMappings,m=!mp(h,f),g=s&&c?Rl(u,s,c):void 0,v=(be=l==null?void 0:l.read)==null?void 0:be.selectedOptionalFields,w=!hp(g,v),y=c?(S=(B=(J=(I=u==null?void 0:u.content)==null?void 0:I.read)==null?void 0:J.objects)==null?void 0:B[c])==null?void 0:S.selectedValueMappings:void 0,b=(q=l==null?void 0:l.read)==null?void 0:q.selectedValueMappings,x=!gp(y,b),O=(X=(U=u==null?void 0:u.content)==null?void 0:U.write)==null?void 0:X.objects,E=(ne=l==null?void 0:l.write)==null?void 0:ne.selectedWriteObjects,F=!yp(O||{},E||{}),D=w||m||x||F||r||c!==bi&&!d,M=!!((ye=(Z=(ae=(te=s==null?void 0:s.content)==null?void 0:te.read)==null?void 0:ae.objects)==null?void 0:Z.find($=>$.objectName===c))!=null&&ye.error),z=a||n||!l||!c||!D||M,V=c===bi,Y=c===ds,se=p.jsx(et,{type:"submit",disabled:z,children:r?"Install":"Save"}),ce=p.jsx(et,{type:"button",onClick:t,disabled:z,variant:"ghost",children:"Reset"});return n?p.jsx(io,{}):p.jsxs("form",{style:{width:"34rem"},onSubmit:e,children:[p.jsx("div",{style:{display:"flex",flexDirection:"row-reverse",gap:".8rem",marginBottom:"20px",height:"3rem"},children:!Y&&p.jsxs(p.Fragment,{children:[se,ce]})}),p.jsxs(Kn,{style:{padding:"1rem 2rem",minHeight:"300px",backgroundColor:"var(--amp-colors-bg-primary)",borderColor:"var(--amp-colors-border)"},children:[i&&p.jsx(go,{children:typeof i=="string"?i:"Installation Failed."}),a&&p.jsx(io,{}),s&&!V&&!Y&&p.jsx(hk,{}),s&&V&&!Y&&p.jsx(vk,{}),!a&&Y&&p.jsx(Sk,{})]})]})}const jm=()=>{const{integrationId:e,groupRef:t,consumerRef:n,setInstallation:r,onInstallSuccess:i,onUpdateSuccess:o,fieldMapping:s}=St(),{hydratedRevision:a,loading:l}=Gr(),{selectedObjectName:c}=ru(),{selectedConnection:u}=Rn(),d=Ff(),{projectIdOrName:h}=Xe(),{resetBoundary:f,setErrors:m,setError:g,getError:v}=kn(),{resetConfigureState:w,objectConfigurationsState:y}=iu(),b=Op(c||"",y),{onNextIncompleteTab:x}=D_(),O=C.useCallback(()=>{f(Ee.INSTALLATION_MUTATION)},[f]),E=C.useCallback(N=>N?P=>{g(Ee.INSTALLATION_MUTATION,N,P)}:P=>{console.error("objectName is required to set installation error: ",P)},[g]),F=C.useCallback(N=>N?v(Ee.INSTALLATION_MUTATION,N):"",[v]);return{integrationId:e,groupRef:t,consumerRef:n,setInstallation:r,hydratedRevision:a,loading:l,selectedObjectName:c,selectedConnection:u,apiKey:d,projectIdOrName:h,resetBoundary:f,setErrors:m,setMutateInstallationError:E,getMutateInstallationError:F,resetMutateInstallationErrorState:O,resetConfigureState:w,objectConfigurationsState:y,configureState:b,onInstallSuccess:i,onUpdateSuccess:o,onNextIncompleteTab:x,fieldMapping:s}},Ok=void 0;function Ek(){const{consumerRef:e,setInstallation:t,hydratedRevision:n,loading:r,selectedObjectName:i,selectedConnection:o,resetBoundary:s,setErrors:a,setMutateInstallationError:l,getMutateInstallationError:c,resetMutateInstallationErrorState:u,resetConfigureState:d,objectConfigurationsState:h,configureState:f,onInstallSuccess:m,onNextIncompleteTab:g,fieldMapping:v}=jm(),[w,y]=C.useState(!1),{createInstallation:b}=ip(),x=i===bi,O=c(i),E=C.useCallback(()=>{s(Ee.MAPPING),n!=null&&n.content&&!r&&i&&bp(n,Ok,i,d)},[s,n,r,i,d]);C.useEffect(()=>{!f&&(n!=null&&n.content)&&!r&&E()},[f,h,n,r,E]);const F=()=>{u();const{requiredMapFields:A,selectedFieldMappings:D}=(f==null?void 0:f.read)||{},{errorList:M}=pp(A,D,a);if(!(M.length>0))if(i&&(o!=null&&o.id)&&e&&n){y(!0);const z=lC(f,i,n,e,v);if(!z){console.error("Error when generating createConfig from configureState"),y(!1);return}b({config:z.content,onSuccess:V=>{t(V),m==null||m(V.id,V.config),y(!1),g()},onError:V=>{l(i)(V.message),y(!1)}})}else console.error("CreateInstallallation - onSaveReadCreate: missing required props")},N=()=>{if(u(),i&&(o!=null&&o.id)&&e&&n){y(!0);const A=cC(f,n,e);if(!A){console.error("Error when generating createConfig from configureState"),y(!1);return}b({config:A.content,onSuccess:D=>{t(D),m==null||m(D.id,D.config),y(!1),g()},onError:D=>{l(i)(D.message),y(!1)}})}else console.error("CreateInstallallation - onSaveWriteCreate: missing required props")},P=A=>{A.preventDefault(),x?N():F()};return p.jsx(Mm,{errorMsg:O,isCreateMode:!0,isLoading:w,onSave:P,onReset:E})}const _k=(e,t,n)=>{const r=wp(e),i=xp(e),o=Ip(t,n),s=Cp(e);return{content:{read:{objects:{[t]:{objectName:t,selectedFields:r,selectedFieldMappings:i,dynamicMappingsInput:o,selectedValueMappings:s||{}}}}}}},Tk=e=>({content:{write:{objects:_p(e)}}});function Nk({installation:e}){const{setInstallation:t,hydratedRevision:n,loading:r,selectedObjectName:i,resetBoundary:o,setErrors:s,setMutateInstallationError:a,getMutateInstallationError:l,resetConfigureState:c,configureState:u,onUpdateSuccess:d,onNextIncompleteTab:h,fieldMapping:f}=jm(),{updateInstallation:m}=sp(),[g,v]=C.useState(!1),w=i===bi,y=l(i),{config:b}=e,x=C.useCallback(()=>{o(Ee.MAPPING),n!=null&&n.content&&!r&&i&&bp(n,b,i,c)},[o,n,r,i,b,c]);C.useEffect(()=>{u||x()},[u,x]);const O=C.useMemo(()=>{var A,D,M;return(M=(D=(A=n==null?void 0:n.content)==null?void 0:A.read)==null?void 0:D.objects)==null?void 0:M.find(z=>(z==null?void 0:z.objectName)===i)},[n,i]),E=()=>{const{requiredMapFields:P,selectedFieldMappings:A}=(u==null?void 0:u.read)||{},{errorList:D}=pp(P,A,s);if(!(D.length>0))if(n&&u&&i&&O){v(!0);const M=_k(u,i,f);if(!M){console.error("Error when generating updateConfig from configureState"),v(!1);return}m({config:M.content,onSuccess:z=>{t(z),d==null||d(z.id,z.config),v(!1),h()},onError:z=>{a(i)(z.message),v(!1)}})}else console.error("UpdateInstallation - onSaveRead missing required props")},F=()=>{if(u&&n){v(!0);const P=Tk(u);if(!P){console.error("Error when generating write updateConfig from configureState"),v(!1);return}m({config:P.content,onSuccess:A=>{t(A),d==null||d(A.id,A.config),v(!1),h()},onError:A=>{a(i)(A.message),v(!1)}})}else console.error("UpdateInstallation - onSaveWrite missing required props")},N=P=>{P.preventDefault(),w?F():E()};return p.jsx(Mm,{errorMsg:y,onSave:N,onReset:x,isLoading:g})}function kk(){const{integrationObj:e,installation:t}=St();return e?t&&e?p.jsx(Nk,{installation:t}):p.jsx(Ek,{}):p.jsx(Yf,{message:"We can't load the integration"})}class ku extends C.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){var r,i;console.error("Ampersand Error Boundary caught an error:",t),console.error("[Error Info]:",n),(i=(r=this.props).onError)==null||i.call(r,t,n)}render(){var t;return this.state.hasError?this.props.fallback?this.props.fallback:p.jsx(Vt,{message:((t=this.state.error)==null?void 0:t.message)||"Something went wrong. Please try again later."}):this.props.children}}function Ak(){return p.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("circle",{cx:"24",cy:"24",r:"24",fill:"#BBF7D0"}),p.jsx("path",{d:"M34.6666 18.6667L20 32.0001L13.3333 25.9395",stroke:"#16A34A",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Au({text:e,children:t}){return p.jsx(ki,{children:p.jsxs(Kn,{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"3rem",gap:"3rem"},children:[p.jsx(Ak,{}),p.jsx("p",{children:e}),t]})})}function Rk({provider:e}){const{providerName:t}=Ot(e),n=`You have successfully installed your ${t} integration.`;return p.jsx(Au,{text:n,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:p.jsx(nu,{buttonText:"Uninstall",buttonVariant:"outline",buttonStyle:{fontSize:"13px"}})})})}const Pk=e=>{const{read:t,write:n}=(e==null?void 0:e.content)??{};return!t&&!n};function Fk({children:e}){var O;const t=C.useRef(!1),{projectIdOrName:n}=Xe(),{hydratedRevision:r,loading:i}=Gr(),{integrationObj:o,installation:s,groupRef:a,consumerRef:l,onInstallSuccess:c,isIntegrationDeleted:u}=St(),{mutate:d,isIdle:h,isPending:f,error:m,errorMsg:g}=rp(),{selectedConnection:v,isConnectionsLoading:w}=Rn(),y=i||f||w,b=(O=r==null?void 0:r.content)==null?void 0:O.provider,x=Pk(r);return C.useEffect(()=>{var E;if(!y&&!w&&r&&x&&!s&&v&&(o!=null&&o.id)&&!u&&b){const F={projectIdOrName:n,integrationId:o==null?void 0:o.id,installation:{groupRef:a,connectionId:v==null?void 0:v.id,config:{content:{provider:b}}}};Ep(r)===!0&&(F.installation.config.content.proxy=(E=r==null?void 0:r.content)==null?void 0:E.proxy),h&&!t.current&&d(F,{onSuccess:N=>{t.current||(c==null||c(N==null?void 0:N.id,N.config),t.current=!0)}})}},[r,x,s,v,n,o==null?void 0:o.id,a,l,y,c,u,w,b,d,h]),x&&b&&s?p.jsx(Rk,{provider:b}):m?p.jsx(Vt,{message:g??"Create installation failed"}):o?y?p.jsx(Ai,{}):p.jsx("div",{children:e}):p.jsx(Vt,{message:"We can't load the integration"})}function So(){const e=Ct(),t=st();return zn({mutationKey:["createConnection"],mutationFn:async n=>(await e()).connectionApi.generateConnection(n),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","connections"]})},onError:n=>{console.error("Error creating connection and loading provider info"),ot(n)}})}function Dk({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,children:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Xe(),d=So(),h=C.useCallback(f=>{var w;const{apiKey:m,providerMetadata:g}=f,v={projectIdOrName:u,generateConnectionParams:{providerWorkspaceRef:(w=g==null?void 0:g.workspace)==null?void 0:w.value,groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,apiKey:m,...g&&{providerMetadata:g}}};d.mutate(v)},[u,o,i,r,n,e,d]);return a===null?p.jsx(m_,{provider:e,providerInfo:t,handleSubmit:h,error:c||null,metadataInputs:l}):s}function Mk({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,children:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Xe(),d=So(),h=C.useCallback(f=>{var y;const{user:m,pass:g,providerMetadata:v}=f,w={projectIdOrName:u,generateConnectionParams:{providerWorkspaceRef:(y=v==null?void 0:v.workspace)==null?void 0:y.value,groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,basicAuth:{username:m,password:g},...v&&{providerMetadata:v}}};d.mutate(w)},[u,o,i,r,n,e,d]);return a===null?p.jsx(w_,{provider:e,providerInfo:t,handleSubmit:h,error:c||null,metadataInputs:l}):s}function jk({providerInfo:e,handleSubmit:t,isButtonDisabled:n,buttonVariant:r,metadataInputs:i}){var h;const[o,s]=C.useState({}),a=f=>{const{name:m,value:g}=f.currentTarget;s(v=>({...v,[m]:g.trim()}))},l=Ci(i,o),c=n||!l,u=((h=e.customOpts)==null?void 0:h.inputs)||[],d=()=>{const f=Ds(i,o),m=Object.fromEntries(u.map(g=>[g.name,o[g.name]]));t({customAuth:m,providerMetadata:f})};return p.jsxs("div",{style:{display:"flex",gap:"1rem",flexDirection:"column",marginTop:"1rem"},children:[u.map(f=>p.jsxs("div",{children:[p.jsx(Eh,{url:f.docsURL,prompt:f.prompt,inputName:f.displayName}),p.jsx($n.PasswordInput,{id:f.name,name:f.name,onChange:a,placeholder:""})]},f.name)),i.map(f=>p.jsx(Io,{metadata:f,onChange:a,variant:"header"},f.name)),p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:c,type:"submit",onClick:d,variant:r,children:"Next"})]})}function Lk({providerInfo:e,handleSubmit:t,error:n,isButtonDisabled:r,metadataInputs:i}){return p.jsxs(Jr,{children:[p.jsx(Wr,{children:`Set up ${e.displayName} integration`}),p.jsx(Hn,{error:n}),p.jsx(jk,{providerInfo:e,handleSubmit:t,isButtonDisabled:r||!!n,metadataInputs:i})]})}function Bk({providerInfo:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,selectedConnection:s,metadataInputs:a,moduleError:l}){const{projectIdOrName:c}=Xe(),u=So(),[d,h]=C.useState(l||null),f=C.useCallback(m=>{var y;const{customAuth:g,providerMetadata:v}=m;h(null);const w={projectIdOrName:c,generateConnectionParams:{providerWorkspaceRef:(y=v==null?void 0:v.workspace)==null?void 0:y.value,groupName:i,groupRef:r,consumerName:n,consumerRef:t,provider:e.name,customAuth:g,...v&&{providerMetadata:v}}};u.mutate(w,{onError:b=>{ot(b,h)},onSuccess:()=>{h(null)}})},[c,i,r,n,t,e.name,u]);return s===null?p.jsx(Lk,{providerInfo:e,handleSubmit:f,error:d,metadataInputs:a}):o}function Vk({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r,children:i,title:o}){if(!o&&!r)throw new Error("Either title or providerName is required");return p.jsxs(Jr,{children:[p.jsx(Wr,{children:o||`Set up ${r} integration`}),p.jsx(Hn,{error:t}),i,p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:"Next"})]})}function Uk({...e}){return p.jsx(Vk,{...e})}function $k({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,selectedConnection:s,providerName:a,moduleError:l}){const{projectIdOrName:c}=Xe(),u=So(),d=C.useCallback(()=>{const h={projectIdOrName:c,generateConnectionParams:{groupName:i,groupRef:r,consumerName:n,consumerRef:t,provider:e}};u.mutate(h)},[c,i,r,n,t,e,u]);return s===null?p.jsx(Uk,{handleSubmit:d,error:l||null,providerName:a}):o}const qk=()=>{const e=Ct(),t=st();return zn({mutationKey:["createOauthConnection"],mutationFn:async n=>(await e()).oAuthApi.oauthConnect(n),onSuccess:()=>{t.invalidateQueries({queryKey:["connections"]})}})};function zk({handleSubmit:e,error:t,isButtonDisabled:n,providerName:r}){return p.jsxs(Jr,{children:[p.jsx(Wr,{children:`Set up ${r} integration`}),p.jsx(OC,{children:`Click Next to sign into the ${r} account you'd like to sync.`}),p.jsx(Hn,{error:t}),p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:n,type:"submit",onClick:e,children:n&&!t?"Loading...":"Next"})]})}function Kk({handleSubmit:e,setFormData:t,error:n,isButtonDisabled:r,providerName:i,metadataInputs:o}){return p.jsxs(Jr,{children:[p.jsxs(Wr,{children:["Enter your ",i," workspace"]}),p.jsx(Hn,{error:n}),p.jsx("br",{}),o.map(s=>p.jsx(Io,{metadata:s,onChange:a=>t(s.name,a.currentTarget.value),providerName:i},s.name)),p.jsx(et,{style:{marginTop:"1em",width:"100%"},disabled:r,type:"submit",onClick:e,children:"Next"})]})}const Kd=600,Hd=600;function Hk({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,providerName:o,metadataInputs:s,moduleError:a}){const{projectId:l}=yr(),c=st(),u=C.useRef(null),[d,h]=C.useState(a||null),[f,m]=C.useState({}),[g,v]=C.useState({}),{mutateAsync:w,isPending:y}=qk(),{isFetching:b,refetch:x}=kl({groupRef:r,provider:e});C.useEffect(()=>{const N=P=>{var A,D,M;P.origin===Qf&&(((A=P.data)==null?void 0:A.eventType)==="AUTHORIZATION_SUCCEEDED"?(h(null),console.debug("New connection:",P.data.data.connection),c.invalidateQueries({queryKey:["amp","connections"]})):((D=P.data)==null?void 0:D.eventType)==="AUTHORIZATION_FAILED"&&(console.error("OAuth failed:",P.data.data.error),c.invalidateQueries({queryKey:["amp","connections"]}),h(P.data.data.error||"An error occurred. Please try again.")),(M=u.current)==null||M.close())};return window.addEventListener("message",N),()=>window.removeEventListener("message",N)},[c]);const O=(N,P)=>{m(A=>({...A,[N]:P})),v(A=>({...A,[N]:{value:P,source:"input"}}))},E=async()=>{var N;h(null);try{const{data:P}=await x();if(P&&P.length>0){console.debug("connections found");return}}catch{console.debug("error with fetching connections")}if(s.length>0&&!Ci(s,f)){h("Please fill in all required fields");return}try{const P=await w({connectOAuthParams:{provider:e,consumerRef:t,groupRef:r,projectId:l||"",consumerName:n,groupName:i,providerWorkspaceRef:(N=g==null?void 0:g.workspace)==null?void 0:N.value,providerMetadata:g}});if(P){const A=window.screenX+(window.outerWidth-Kd)/2,D=window.screenY+(window.outerHeight-Hd)/2.5,M=`width=${Kd},height=${Hd},left=${A},top=${D}`;u.current=window.open(P,"OAuthPopup",M)}}catch(P){console.error(P),h(P instanceof Error?P.message:String(P)||"An error occurred. Please try again.")}},F=s.length>0?p.jsx(Kk,{handleSubmit:E,setFormData:O,error:d,isButtonDisabled:!Ci(s,f)||y||b||!!d,providerName:o,metadataInputs:s}):p.jsx(zk,{handleSubmit:E,error:d,providerName:o,isButtonDisabled:y||b||!!d});return p.jsx("div",{children:F})}function Jk({provider:e,providerName:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,explicitScopesRequired:s,selectedConnection:a,metadataInputs:l,moduleError:c}){const{projectIdOrName:u}=Xe(),d=So(),[h,f]=C.useState(c||null),m=C.useCallback(g=>{var w,y;f(null);const v={projectIdOrName:u,generateConnectionParams:{groupName:o,groupRef:i,consumerName:r,consumerRef:n,provider:e,providerWorkspaceRef:(y=(w=g.providerMetadata)==null?void 0:w.workspace)==null?void 0:y.value,oauth2ClientCredentials:{clientId:g.clientId,clientSecret:g.clientSecret,scopes:g.scopes},...g.providerMetadata&&{providerMetadata:g.providerMetadata}}};d.mutate(v,{onError:()=>f("Error loading provider info")})},[u,o,i,r,n,e,d]);return a===null?p.jsx(I_,{providerName:t,handleSubmit:m,error:h,explicitScopesRequired:s,metadataInputs:l}):p.jsx(io,{})}function Wk({...e}){return p.jsx(Jk,{...e})}const Qk="authorizationCode",Gk="authorizationCodePKCE",Xk="clientCredentials";function Yk({provider:e,providerInfo:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,selectedConnection:s,setSelectedConnection:a,metadataInputs:l,moduleError:c}){const{providerName:u}=Ot(e);if(t.oauth2Opts===void 0)return p.jsx("em",{children:"Provider is missing OAuth2 options"});const{grantType:d,explicitScopesRequired:h}=t.oauth2Opts,f={provider:e,consumerRef:n,consumerName:r,groupRef:i,groupName:o,providerName:u,metadataInputs:l,moduleError:c};return d===Qk||d===Gk?p.jsx(Hk,{...f}):d===Xk?p.jsx(Wk,{...f,explicitScopesRequired:h,selectedConnection:s,setSelectedConnection:a}):d==="password"?p.jsx("em",{children:"Password flow not supported yet"}):p.jsxs("em",{children:["Unsupported grant type: ",d]})}function Zk(e){const{selectedConnection:t}=Rn();C.useEffect(()=>{e&&t&&e(t)},[e,t])}function eA({onSuccess:e}){Zk(e)}function Lm({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:o,onSuccess:s,onDisconnectSuccess:a,resetComponent:l}){var z,V,Y;const{data:c,isLoading:u,isError:d,error:h,providerName:f,selectedProvider:m}=Ot(e),{provider:g,isIntegrationDeleted:v,integrationObj:w}=St(),{selectedConnection:y,setSelectedConnection:b}=Rn();eA({onSuccess:s});const x=st(),O=c,E=(V=(z=w==null?void 0:w.latestRevision)==null?void 0:z.content)==null?void 0:V.module,{module:F,error:N}=f_(E,O),P=((Y=O==null?void 0:O.metadata)==null?void 0:Y.input)||[],A=p_(P,F);C.useEffect(()=>{d&&(console.error("Error loading provider info."),ot(h))},[d,h]);const D=C.useCallback(()=>{x.clear(),l()},[l,x]);if(!e&&!g)throw new Error("ProtectedConnectionLayout must be given a provider prop or be used within InstallIntegrationProvider");if(v)return p.jsx(Au,{text:"Integration successfully uninstalled.",children:p.jsx(et,{type:"button",onClick:D,style:{width:"100%"},children:"Reinstall Integration"})});if(y)return o;if(u)return p.jsx(Ai,{});if(O==null)return p.jsx(Vt,{message:"Provider info was not found."});const M={provider:m,consumerRef:t,consumerName:n,groupRef:r,groupName:i,selectedConnection:y,setSelectedConnection:b,providerName:f,providerInfo:O,onDisconnectSuccess:a,metadataInputs:A,moduleError:N};return O.authType==="none"?p.jsx($k,{...M,children:o}):O.authType==="basic"?p.jsx(Mk,{...M,children:o}):O.authType==="apiKey"?p.jsx(Dk,{...M,children:o}):O.authType==="custom"?p.jsx(Bk,{...M,children:o}):p.jsx(Yk,{...M})}function tA(e){const t=e+"CollectionProvider",[n,r]=Bs(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:w}=g,y=C.useRef(null),b=C.useRef(new Map).current;return p.jsx(i,{scope:v,itemMap:b,collectionRef:y,children:w})};s.displayName=t;const a=e+"CollectionSlot",l=ml(a),c=C.forwardRef((g,v)=>{const{scope:w,children:y}=g,b=o(a,w),x=Ei(v,b.collectionRef);return p.jsx(l,{ref:x,children:y})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=ml(u),f=C.forwardRef((g,v)=>{const{scope:w,children:y,...b}=g,x=C.useRef(null),O=Ei(v,x),E=o(u,w);return C.useEffect(()=>(E.itemMap.set(x,{ref:x,...b}),()=>void E.itemMap.delete(x))),p.jsx(h,{[d]:"",ref:O,children:y})});f.displayName=u;function m(g){const v=o(e+"CollectionConsumer",g);return C.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,F)=>b.indexOf(E.ref.current)-b.indexOf(F.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},m,r]}var nA=W[" useId ".trim().toString()]||(()=>{}),rA=0;function Bm(e){const[t,n]=W.useState(nA());return lo(()=>{n(r=>r??String(rA++))},[e]),e||(t?`radix-${t}`:"")}function iA(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var oA=W.createContext(void 0);function Vm(e){const t=W.useContext(oA);return e||t||"ltr"}var Ia="rovingFocusGroup.onEntryFocus",sA={bubbles:!1,cancelable:!0},Oo="RovingFocusGroup",[gl,Um,aA]=tA(Oo),[lA,$m]=Bs(Oo,[aA]),[uA,cA]=lA(Oo),qm=W.forwardRef((e,t)=>p.jsx(gl.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(gl.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(dA,{...e,ref:t})})}));qm.displayName=Oo;var dA=W.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=W.useRef(null),f=Ei(t,h),m=Vm(o),[g,v]=Su({prop:s,defaultProp:a??null,onChange:l,caller:Oo}),[w,y]=W.useState(!1),b=iA(c),x=Um(n),O=W.useRef(!1),[E,F]=W.useState(0);return W.useEffect(()=>{const N=h.current;if(N)return N.addEventListener(Ia,b),()=>N.removeEventListener(Ia,b)},[b]),p.jsx(uA,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:W.useCallback(N=>v(N),[v]),onItemShiftTab:W.useCallback(()=>y(!0),[]),onFocusableItemAdd:W.useCallback(()=>F(N=>N+1),[]),onFocusableItemRemove:W.useCallback(()=>F(N=>N-1),[]),children:p.jsx(Jn.div,{tabIndex:w||E===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:gn(e.onMouseDown,()=>{O.current=!0}),onFocus:gn(e.onFocus,N=>{const P=!O.current;if(N.target===N.currentTarget&&P&&!w){const A=new CustomEvent(Ia,sA);if(N.currentTarget.dispatchEvent(A),!A.defaultPrevented){const D=x().filter(se=>se.focusable),M=D.find(se=>se.active),z=D.find(se=>se.id===g),Y=[M,z,...D].filter(Boolean).map(se=>se.ref.current);Hm(Y,u)}}O.current=!1}),onBlur:gn(e.onBlur,()=>y(!1))})})}),zm="RovingFocusGroupItem",Km=W.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,l=Bm(),c=o||l,u=cA(zm,n),d=u.currentTabStopId===c,h=Um(n),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:g}=u;return W.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),p.jsx(gl.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:p.jsx(Jn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:gn(e.onMouseDown,v=>{r?u.onItemFocus(c):v.preventDefault()}),onFocus:gn(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:gn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=hA(v,u.orientation,u.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(x=>x.focusable).map(x=>x.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const x=b.indexOf(v.currentTarget);b=u.loop?mA(b,x+1):b.slice(x+1)}setTimeout(()=>Hm(b))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:g!=null}):s})})});Km.displayName=zm;var fA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function hA(e,t,n){const r=pA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fA[r]}function Hm(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gA=qm,yA=Km,Us="Tabs",[vA,JA]=Bs(Us,[$m]),Jm=$m(),[bA,Ru]=vA(Us),Wm=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Vm(a),[d,h]=Su({prop:r,onChange:i,defaultProp:o??"",caller:Us});return p.jsx(bA,{scope:n,baseId:Bm(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:p.jsx(Jn.div,{dir:u,"data-orientation":s,...c,ref:t})})});Wm.displayName=Us;var Qm="TabsList",Gm=W.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Ru(Qm,n),s=Jm(n);return p.jsx(gA,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:p.jsx(Jn.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});Gm.displayName=Qm;var Xm="TabsTrigger",Ym=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Ru(Xm,n),a=Jm(n),l=eg(s.baseId,r),c=tg(s.baseId,r),u=r===s.value;return p.jsx(yA,{asChild:!0,...a,focusable:!i,active:u,children:p.jsx(Jn.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:gn(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:gn(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:gn(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});Ym.displayName=Xm;var Zm="TabsContent",wA=W.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Ru(Zm,n),l=eg(a.baseId,r),c=tg(a.baseId,r),u=r===a.value,d=W.useRef(u);return W.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),p.jsx(Ou,{present:i||u,children:({present:h})=>p.jsx(Jn.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&o})})});wA.displayName=Zm;function eg(e,t){return`${e}-trigger-${t}`}function tg(e,t){return`${e}-content-${t}`}var xA=Wm,IA=Gm,ng=Ym;const CA=p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[p.jsx("circle",{cx:"9",cy:"9",r:"9",fill:"#BBF7D0"}),p.jsx("path",{d:"M13 7L7.5 12L5 9.72727",stroke:"#16A34A",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function SA(e,t){return t?C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},C.createElement("circle",{cx:"9",cy:"9",r:"5",fill:"#FBD38D"})):e?CA:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:p.jsx("circle",{cx:"9",cy:"9",r:"5",fill:"#BFDBFE"})})}function OA(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M12.3378 5.04365C12.4882 5.25907 12.62 5.48699 12.7315 5.7249L14.3503 6.6249C14.5524 7.5302 14.5545 8.4687 14.3565 9.3749L12.7315 10.2749C12.62 10.5128 12.4882 10.7407 12.3378 10.9562L12.369 12.8124C11.683 13.4375 10.871 13.9085 9.98776 14.1937L8.39401 13.2374C8.13185 13.2562 7.86868 13.2562 7.60651 13.2374L6.01901 14.1874C5.13295 13.9075 4.31832 13.4383 3.63151 12.8124L3.66276 10.9624C3.51356 10.744 3.38189 10.5141 3.26901 10.2749L1.65026 9.3749C1.44814 8.46961 1.446 7.53111 1.64401 6.6249L3.26901 5.7249C3.38056 5.48699 3.5123 5.25907 3.66276 5.04365L3.63151 3.1874C4.31754 2.56226 5.1295 2.09128 6.01276 1.80615L7.60651 2.7624C7.86868 2.74365 8.13185 2.74365 8.39401 2.7624L9.98151 1.8124C10.8676 2.09234 11.6822 2.5615 12.369 3.1874L12.3378 5.04365Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}const EA="_tabsRoot_ktpr0_1",_A="_tabsList_ktpr0_6",TA="_tabTrigger_ktpr0_12",xs={tabsRoot:EA,tabsList:_A,tabTrigger:TA};function NA(){return p.jsxs(p.Fragment,{children:[p.jsx(Ms,{style:{margin:"1rem 0"}}),p.jsx(ng,{value:ds,className:xs.tabTrigger,children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem",marginRight:".5rem"},children:[p.jsx(OA,{}),p.jsx("span",{children:"Manage"})]})})]})}function rg({objectName:e,completed:t,pending:n,displayName:r,disabled:i}){return p.jsx(ng,{value:e,className:xs.tabTrigger,children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem",marginRight:".5rem"},children:[SA(!i&&t,n),p.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[p.jsx("span",{children:r||e}),n&&p.jsx("span",{style:{fontSize:".8rem",fontStyle:"italic"},children:"pending"})]})]})})}function kA({completed:e,pending:t,displayName:n}){return p.jsxs(p.Fragment,{children:[p.jsx(Ms,{style:{margin:"1rem 0"}}),p.jsx(rg,{objectName:bi,completed:e,pending:t,displayName:n},"other-write")]})}function AA({value:e,readNavObjects:t,onValueChange:n,objectConfigurationsState:r,writeNavObject:i}){var u,d,h,f;const{data:o}=Kf(),{installation:s}=An(),a=s==null?void 0:s.config,l=(d=(u=a==null?void 0:a.content)==null?void 0:u.write)==null?void 0:d.objects,c=(f=(h=r==null?void 0:r.other)==null?void 0:h.write)==null?void 0:f.selectedWriteObjects;return p.jsx(xA,{value:e,className:xs.tabsRoot,onValueChange:n,children:p.jsxs(IA,{className:xs.tabsList,children:[t.map(m=>{var D,M,z,V,Y,se;const g=(z=(M=(D=a==null?void 0:a.content)==null?void 0:D.read)==null?void 0:M.objects)==null?void 0:z[m.name],v=r==null?void 0:r[m.name],w=Sp(a,m.name),y=(V=v==null?void 0:v.read)==null?void 0:V.selectedFieldMappings,b=!mp(w,y),x=o?Rl(a,o,m.name):void 0,O=(Y=v==null?void 0:v.read)==null?void 0:Y.selectedOptionalFields,E=!hp(x,O),F=g==null?void 0:g.selectedValueMappings,N=(se=v==null?void 0:v.read)==null?void 0:se.selectedValueMappings,P=!gp(F,N),A=E||b||P||!1;return p.jsx(rg,{objectName:m.name,displayName:m.displayName,completed:m.completed,disabled:m.disabled,pending:A},m.name)}),i&&(()=>{const m=!yp(l||{},c||{});return p.jsx(kA,{completed:i.completed,pending:m,displayName:"Write"})})(),p.jsx(NA,{})]})})}function RA(e,t){return t===ds?{name:ds,completed:!1}:e.find(n=>n.name===t)}function PA({children:e}){var w;const{data:t}=yr(),{installation:n}=St(),{providerName:r}=Ot(),{hydratedRevision:i}=Gr(),{objectConfigurationsState:o}=iu(),[s,a]=C.useState(""),l=(t==null?void 0:t.appName)||"",c=n==null?void 0:n.config,u=i&&dp(c,i),d=u!==null,h=!!((w=i==null?void 0:i.content)!=null&&w.write),f=h?fp(c):void 0,m=C.useMemo(()=>{const y=[...u||[]];return f&&h&&y.push(f),y},[u,f,h]),g=RA(m,s),v=C.useCallback(()=>{const y=m.find(b=>g!==b&&!b.completed);y&&a(y.name)},[m,g]);return C.useEffect(()=>{!s&&m.length>0&&a(m[0].name)},[m,s,v]),p.jsx(Ph.Provider,{value:v,children:p.jsx(Rh.Provider,{value:g==null?void 0:g.name,children:p.jsxs(ki,{style:{maxWidth:"55rem"},children:[p.jsxs(Kn,{style:{display:"flex",gap:"1rem",padding:"3rem",paddingBottom:"6rem",backgroundColor:"var(--amp-colors-bg-primary)"},children:[p.jsxs("div",{style:{width:"20rem"},children:[p.jsxs("h1",{style:{fontSize:"small",fontWeight:"400"},children:[r," integration"]}),p.jsx("h3",{style:{marginBottom:"20px",fontSize:"large",fontWeight:"500"},children:l}),d&&p.jsx(AA,{value:s,readNavObjects:u,onValueChange:y=>a(y),objectConfigurationsState:o,writeNavObject:f})]}),e]}),p.jsx(Ap,{})]})})})}function FA({...e}){return p.jsx(PA,{...e})}const DA="_resetContainer_lkwv9_4",ig={resetContainer:DA},MA=({integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l})=>{var v;const{projectIdOrName:c,isLoading:u}=yr(),{isLoading:d}=Es(),{isError:h,errorState:f}=kn(),{seed:m,reset:g}=ap();return u||d?p.jsx(Ai,{}):h(Ee.PROJECT,c)?p.jsx(Vt,{message:`Error loading project ${c}`}):h(Ee.INTEGRATION_LIST,c)?p.jsx(Vt,{message:"Error retrieving integrations for the project, double check the API key"}):(v=f[Ee.INTEGRATION_LIST])!=null&&v.apiError?p.jsx(Vt,{message:"Something went wrong, couldn't find integration information"}):p.jsx("div",{className:ig.resetContainer,children:p.jsx(QI,{integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l,resetComponent:g,children:p.jsx(np,{children:p.jsx(Lm,{consumerRef:t,consumerName:n,groupRef:r,groupName:i,resetComponent:g,children:p.jsx(F_,{resetComponent:g,children:p.jsx(Fk,{children:p.jsx(j_,{children:p.jsx(FA,{children:p.jsx(kk,{})})})})})})})},m)})};function jA({integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l}){const c={integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onInstallSuccess:o,onUpdateSuccess:s,onUninstallSuccess:a,fieldMapping:l};return p.jsx(ku,{fallback:p.jsx(Vt,{message:"Something went wrong, couldn't find integration information"}),children:p.jsx(Nl,{integration:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:p.jsx(MA,{...c})})})}function LA(){return p.jsxs(ki,{style:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[p.jsx(io,{}),p.jsx("p",{children:"Redirecting"})]})}function BA({redirectURL:e,children:t}){return C.useEffect(()=>{e&&window.location.replace(e)},[e]),e?p.jsx(LA,{}):t}function VA({resetComponent:e,onDisconnectSuccess:t,provider:n}){const[r,i]=C.useState(!1);return p.jsxs(p.Fragment,{children:[r===!1&&p.jsxs(p.Fragment,{children:[p.jsx(Gt,{string:"Manage connection"}),p.jsxs("div",{style:{padding:"1rem 0",width:"100%",display:"flex",flexDirection:"column",gap:"1rem"},children:[p.jsx("p",{children:"Click to reauthenticate or refresh your connection."}),p.jsx(et,{type:"button",onClick:()=>i(!0),variant:"ghost",style:{fontSize:"13px"},children:"Update connection"})]})]}),r===!0&&p.jsxs(p.Fragment,{children:[p.jsx(tu,{provider:n}),p.jsx(Dm,{resetComponent:e,onDisconnectSuccess:t})]})]})}function UA({provider:e,onDisconnectSuccess:t,resetComponent:n}){const{appName:r}=yr(),{providerName:i}=Ot(e),o=`You have successfully connected your ${i} account to ${r}.`;return p.jsx(Au,{text:o,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"100%"},children:p.jsx(VA,{resetComponent:n,onDisconnectSuccess:t,provider:e})})})}function $A({provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,redirectUrl:o,onSuccess:s,onDisconnectSuccess:a,onConnectSuccess:l}){const{seed:c,reset:u}=ap(),d=C.useCallback(h=>{s?s(h.id):l&&l(h)},[s,l]);return p.jsx(ku,{fallback:p.jsx(Vt,{message:"Something went wrong with the connection. Please try again."}),children:p.jsx("div",{className:ig.resetContainer,children:p.jsx(Nl,{integration:"connect-provider-dummy-string",consumerRef:t,consumerName:n,groupRef:r,groupName:i,children:p.jsx(np,{groupRef:r,provider:e,children:p.jsx(Lm,{resetComponent:u,provider:e,consumerRef:t,consumerName:n,groupRef:r,groupName:i,onSuccess:d,onDisconnectSuccess:a,children:p.jsx(BA,{redirectURL:o,children:p.jsx(UA,{resetComponent:u,provider:e,onDisconnectSuccess:a})})})})})},c)})}const qA=(e,t,n)=>{const{data:r,isLoading:i,isError:o,error:s}=El(e,t,n),a=((r==null?void 0:r.length)||0)>0,l=!!r&&!i,c=r==null?void 0:r[0],u=c==null?void 0:c.config;return C.useEffect(()=>{o&&ot(s)},[o,s]),{isLoaded:l,isIntegrationInstalled:a,isLoading:i,config:u,isError:o,error:s}};exports.AmpersandContext=Cl;exports.AmpersandErrorBoundary=ku;exports.AmpersandProvider=cI;exports.ConnectProvider=$A;exports.FieldSettingWriteOnCreateEnum=Oy;exports.FieldSettingWriteOnUpdateEnum=Ey;exports.InstallIntegration=jA;exports.InstallationProvider=Nl;exports.useAmpersandProviderProps=Xe;exports.useConfig=_I;exports.useConnection=_l;exports.useCreateInstallation=ip;exports.useDeleteInstallation=ZI;exports.useInstallation=An;exports.useIsIntegrationInstalled=qA;exports.useLocalConfig=EI;exports.useManifest=_s;exports.useUpdateInstallation=sp;
|
|
65
65
|
//# sourceMappingURL=amp-react.cjs.js.map
|