@widgetic/embed-sdk 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/chunks/ABTestManager.js +1 -1
- package/dist/browser/chunks/api.js +1 -1
- package/dist/browser/chunks/core.js +1 -1
- package/dist/browser/chunks/display.js +1 -1
- package/dist/browser/chunks/renderers.js +1 -1
- package/dist/browser/chunks/scanner.js +1 -1
- package/dist/browser/chunks/security.js +1 -1
- package/dist/browser/chunks/workflows.js +1 -1
- package/dist/browser/embed-bootstrap.js +1 -1
- package/dist/browser/embed-sdk.js +1 -1
- package/dist/esm/chunks/ABTestManager.js +1 -1
- package/dist/esm/chunks/api.js +1 -1
- package/dist/esm/chunks/core.js +1 -1
- package/dist/esm/chunks/display.js +1 -1
- package/dist/esm/chunks/renderers.js +1 -1
- package/dist/esm/chunks/scanner.js +1 -1
- package/dist/esm/chunks/security.js +1 -1
- package/dist/esm/chunks/workflows.js +1 -1
- package/dist/esm/embed-bootstrap.js +1 -1
- package/dist/esm/embed-sdk.js +1 -1
- package/dist/esm/types/core/constants.d.ts +1 -1
- package/dist/esm/types/core/version.d.ts +1 -1
- package/dist/esm/types/utils/autoscale-request.d.ts +11 -0
- package/dist/esm/types/utils/embed-autoscale.d.ts +139 -0
- package/dist/esm/types/utils/hydrate-published-host.d.ts +8 -2
- package/dist/esm/types/utils/mount-direct-widget.d.ts +5 -0
- package/dist/esm/types/utils/workflow-shared-contract.d.ts +7 -0
- package/dist/esm/types/workflows/workflow-stage.d.ts +1 -1
- package/dist/umd/embed-bootstrap.js +1 -1
- package/dist/umd/embed-sdk.js +1 -1
- package/package.json +1 -1
package/dist/esm/chunks/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./vendor.js";const t="2.1.3",n="https://api.axiom.co/v1",i="widgetic-performance",o="https://events.statsigapi.net/v1/custom",r=!0,a=1,s=1e3,d="",u=2500,l=2e3,c=100,p=50,h=.1,g=.05,f=1800,v=1200,m=800,w=600,y=3e3,I=2e3,R=5e5,T=3e5,k="50px",A=.1,q=3,S=3,C=1e3,E=10,U=5e3,b=36e5,_=6,x=!0,D=!0,B=!1,M="info",P=t,K=t;function W(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?O.DEV_API_URL:O.PROD_API_URL}${O.VERSION}`}const O={DEV_API_URL:"http://localhost:3000",PROD_API_URL:"https://api.widgetic.com",PROD_CLIENT_URL:"https://widgetic.com",PROD_CDN_URL:"https://cdn.widgetic.com",VERSION:"/api/v1",ENABLE_EDITING:!0},z="auto",G="inline",L="fixed",$=350,j=200,N=!1,V={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},X=10,F=5e3,H=3;let Y=B;const Z={get enabled(){return Y},logLevel:M},J=["apikey","api_key","api-key","servicekey","service_key","service-key","token","access_token","auth_token","secret","password","private_key","authorization","bearer","internal_key","public_api_key","public_internal_key"];function Q(e){if("string"==typeof e){const t=e.toLowerCase();for(const n of J)if(t.includes(n))return e.replace(/([a-zA-Z_-]*(?:key|token|secret|password)[a-zA-Z_-]*[:\s=]+)([^\s,}]+)/gi,"$1[REDACTED]");return e}if(null==e)return e;if(Array.isArray(e))return e.map(Q);if("object"==typeof e){const t={};for(const[n,i]of Object.entries(e)){const e=n.toLowerCase();J.some((t=>e.includes(t.toLowerCase())||e===t.toLowerCase()))&&"string"==typeof i&&i.length>0?t[n]=`[REDACTED_${i.length}_CHARS]`:t[n]=Q(i)}return t}return e}const ee=new class{constructor(e=Z.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return Z.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(Q)]}debug(e,...t){this.shouldLog("debug")}info(e,...t){this.shouldLog("info")}warn(e,...t){this.shouldLog("warn")}error(e,...t){this.shouldLog("error")}setLevel(e){this.currentLevel=this.logLevels[e]}setDebug(e){!function(e){Y=e}(e)}},te={debug:(e,...t)=>ee.debug(e,...t),info:(e,...t)=>ee.info(e,...t),warn:(e,...t)=>ee.warn(e,...t),error:(e,...t)=>ee.error(e,...t),setLevel:e=>ee.setLevel(e)};class ne{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}class ie{constructor(e){this.tokenEndpoint=e.tokenEndpoint||e.endpoint||"",this.refreshEndpoint=e.refreshEndpoint,this.headers=e.headers||{},e.apiKey&&!this.headers.Authorization&&(this.headers.Authorization=`Bearer ${e.apiKey}`)}getToken(){return e(this,void 0,void 0,(function*(){if(this.cachedToken&&(yield this.isTokenValid()))return this.cachedToken;const e=yield fetch(this.tokenEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},this.headers)});if(!e.ok)throw new Error(`Failed to fetch token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in?this.tokenExpiry=Date.now()+1e3*t.expires_in:t.expires_at&&(this.tokenExpiry=new Date(t.expires_at).getTime()),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}refreshToken(){return e(this,void 0,void 0,(function*(){if(!this.refreshEndpoint)return this.getToken();const e=yield fetch(this.refreshEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json",Authorization:`Bearer ${this.cachedToken}`},this.headers)});if(!e.ok)throw new Error(`Failed to refresh token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in&&(this.tokenExpiry=Date.now()+1e3*t.expires_in),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.cachedToken&&(!this.tokenExpiry||Date.now()<this.tokenExpiry)}))}}class oe{constructor(e,t){this.tokenFunction=e,this.validationFunction=t}getToken(){return e(this,void 0,void 0,(function*(){return yield this.tokenFunction()}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!this.validationFunction||(yield this.validationFunction())}))}}class re{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){if(!this.apiKey)throw new Error("No API key available. Please configure a TokenProvider or set API keys.");return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}var ae="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};const se="https://api.widgetic.com/v1".replace(/\/+$/,""),de="X-SDK-Version";class ue{constructor(e){if(this.configuration={basePath:se,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>ae(this,void 0,void 0,(function*(){return t})),this.configuration.headers={"Content-Type":"application/json"}}else if(e){this.configuration=Object.assign(Object.assign({},e),{basePath:e.basePath||se});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>ae(this,void 0,void 0,(function*(){return n}))}e.headers||(this.configuration.headers={"Content-Type":"application/json"})}}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:se}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||fe}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>ae(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const le=new ue;class ce{constructor(e=le){this.configuration=e,this.fetchApi=(e,t)=>ae(this,void 0,void 0,(function*(){let n,i={url:e,init:t};this.middleware&&Array.isArray(this.middleware)||(this.middleware=[]);for(const e of this.middleware)e.pre&&(i=(yield e.pre(Object.assign({fetch:this.fetchApi},i)))||i);try{n=yield(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(const t of this.middleware)t.onError&&(n=(yield t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0}))||n);if(void 0===n)throw e instanceof Error?new he(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(n=(yield e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()}))||n);return n})),"string"!=typeof e&&(!e||e instanceof ue)||(e=new ue(e)),this.configuration=e,this.middleware=this.configuration.middleware||[]}withMiddleware(...e){const t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){const t=e.map((e=>({pre:e})));return this.withMiddleware(...t)}withPostMiddleware(...e){const t=e.map((e=>({post:e})));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&ce.jsonRegex.test(e)}request(e,t){return ae(this,void 0,void 0,(function*(){var n;const{url:i,init:o}=yield this.createFetchParams(e,t),r=new Headers(Object.assign(Object.assign(Object.assign({},this.configuration.headers),e.headers||{}),o.headers||{})),a=Object.assign(Object.assign({},o),{headers:r}),s=yield this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;const d=s.clone();let u="Response returned an error code",l=null;try{const e=yield d.json(),t=e.error,i=t&&"object"==typeof t?t.message:t;u=e.message||i||u;const o=null===(n=null==e?void 0:e.error)||void 0===n?void 0:n.code;"string"==typeof o&&o.length>0&&(l=o)}catch(e){try{u=yield d.text()}catch(e){u=s.statusText}}throw new pe(s,u,l)}))}createFetchParams(e,t){return ae(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||se).replace(/\/+$/,"")+(e.path.startsWith("/")?e.path:`/${e.path}`);void 0!==e.query&&0!==Object.keys(e.query).length&&(n+="?"+this.configuration.queryParamsStringify(e.query));const i=Object.assign({},this.configuration.headers,e.headers);Object.keys(i).forEach((e=>void 0===i[e]?delete i[e]:{}));Object.keys(i).some((e=>e.toLowerCase()===de.toLowerCase()))||(i[de]="@widgetic/api-sdk/1.0.45");const o=this.configuration.apiKey;if(o&&!i.Authorization)try{const e=yield o("Authorization");e&&(i.Authorization=e.startsWith("Bearer ")?e:`Bearer ${e}`)}catch(e){}const r="function"==typeof t?t:()=>ae(this,void 0,void 0,(function*(){return t})),a={method:e.method,headers:i,body:e.body,credentials:this.configuration.credentials},s=Object.assign(Object.assign({},a),yield r({init:a,context:e}));let d;var u;u=s.body,d="undefined"!=typeof FormData&&u instanceof FormData||s.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(s.body)?s.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(s.body):s.body;return{url:n,init:Object.assign(Object.assign({},s),{body:d})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}ce.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class pe extends Error{constructor(e,t,n=null){super(t),this.response=e,this.name="ResponseError",this.code=n}}class he extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class ge extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function fe(e,t=""){return Object.keys(e).map((n=>ve(n,e[n],t))).filter((e=>e.length>0)).join("&")}function ve(e,t,n=""){const i=n+(n.length?`[${e}]`:e);if(t instanceof Array){const e=t.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${e}`}if(t instanceof Set){return ve(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?fe(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}function me(e,t){return Object.keys(e).reduce(((n,i)=>Object.assign(Object.assign({},n),{[i]:t(e[i])})),{})}class we{constructor(e,t=e=>e){this.raw=e,this.transformer=t}unwrapSuccessEnvelope(e){if(e&&"object"==typeof e&&"success"in e&&"data"in e){const{success:t,data:n,meta:i}=e,o="boolean"!=typeof t||t;return Array.isArray(n)?{success:o,data:n,meta:i,rawData:n}:n&&"object"==typeof n?Object.assign({success:o,data:n,meta:i},n):{success:o,data:n,meta:i}}return e}value(){return ae(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class ye{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){}))}}function Ie(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:null==e.endpointId?void 0:e.endpointId,url:null==e.url?void 0:e.url,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Re(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:e.endpointId,url:e.url,secret:e.secret,createdAt:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Te(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,abTestId:null==e.abTestId?void 0:e.abTestId,compositionId:null==e.compositionId?void 0:e.compositionId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,trafficPercentage:null==e.trafficPercentage?void 0:e.trafficPercentage,goalTarget:null==e.goalTarget?void 0:e.goalTarget,embedCode:null==e.embedCode?void 0:e.embedCode,totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function ke(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,organizationId:null==e.organizationId?void 0:e.organizationId,workspaceType:null==e.workspaceType?void 0:e.workspaceType,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,status:null==e.status?void 0:e.status,successMetrics:null==e.successMetrics?void 0:e.successMetrics,primaryMetric:null==e.primaryMetric?void 0:e.primaryMetric,confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel,minSampleSize:null==e.minSampleSize?void 0:e.minSampleSize,autoGraduate:null==e.autoGraduate?void 0:e.autoGraduate,graduationThreshold:null==e.graduationThreshold?void 0:e.graduationThreshold,startDate:null==e.startDate?void 0:new Date(e.startDate),endDate:null==e.endDate?void 0:new Date(e.endDate),durationDays:null==e.durationDays?void 0:e.durationDays,winningVariantId:null==e.winningVariantId?void 0:e.winningVariantId,graduatedAt:null==e.graduatedAt?void 0:new Date(e.graduatedAt),statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(Te)}}(e)}function Ae(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,ab_test_id:null==e.ab_test_id?void 0:e.ab_test_id,variant_id:null==e.variant_id?void 0:e.variant_id,user_id:null==e.user_id?void 0:e.user_id,session_id:null==e.session_id?void 0:e.session_id,user_identifier_hash:null==e.user_identifier_hash?void 0:e.user_identifier_hash,assigned_at:null==e.assigned_at?void 0:new Date(e.assigned_at)}}(e)}function qe(e){return function(e){if(null==e)return e;return{hasMeaningfulContrast:null==e.hasMeaningfulContrast?void 0:e.hasMeaningfulContrast,primaryDriver:null==e.primaryDriver?void 0:e.primaryDriver,cognitiveClarityScore:null==e.cognitiveClarityScore?void 0:e.cognitiveClarityScore,safeToGraduate:null==e.safeToGraduate?void 0:e.safeToGraduate,qualitativeReason:null==e.qualitativeReason?void 0:e.qualitativeReason}}(e)}function Se(e){return function(e){if(null==e)return e;return{action:null==e.action?void 0:e.action,reason:null==e.reason?void 0:e.reason,minAdditionalSamples:null==e.minAdditionalSamples?void 0:e.minAdditionalSamples}}(e)}function Ce(e){return function(e){if(null==e)return e;return{detected:null==e.detected?void 0:e.detected,pValue:null==e.pValue?void 0:e.pValue}}(e)}function Ee(e){return function(e){if(null==e)return e;return{totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,totalImpressionEvents:null==e.totalImpressionEvents?void 0:e.totalImpressionEvents,totalConversionEvents:null==e.totalConversionEvents?void 0:e.totalConversionEvents,counting:null==e.counting?void 0:e.counting,overallConversionRate:null==e.overallConversionRate?void 0:e.overallConversionRate,statisticalPower:null==e.statisticalPower?void 0:e.statisticalPower,sampleSizeNeededPerVariant:null==e.sampleSizeNeededPerVariant?void 0:e.sampleSizeNeededPerVariant,sampleRatioMismatch:null==e.sampleRatioMismatch?void 0:Ce(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function Ue(e){return function(e){if(null==e)return e;return{variantId:null==e.variantId?void 0:e.variantId,variantName:null==e.variantName?void 0:e.variantName,impressions:null==e.impressions?void 0:e.impressions,conversions:null==e.conversions?void 0:e.conversions,rawImpressions:null==e.rawImpressions?void 0:e.rawImpressions,rawConversions:null==e.rawConversions?void 0:e.rawConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,confidenceIntervalLower:null==e.confidenceIntervalLower?void 0:e.confidenceIntervalLower,confidenceIntervalUpper:null==e.confidenceIntervalUpper?void 0:e.confidenceIntervalUpper,zScore:null==e.zScore?void 0:e.zScore,pValue:null==e.pValue?void 0:e.pValue,isWinner:null==e.isWinner?void 0:e.isWinner,liftPercentage:null==e.liftPercentage?void 0:e.liftPercentage,statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,significantlyWorse:null==e.significantlyWorse?void 0:e.significantlyWorse,bayesianProbabilityToBeatControl:null==e.bayesianProbabilityToBeatControl?void 0:e.bayesianProbabilityToBeatControl}}(e)}function be(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:Ee(e.overall),variants:null==e.variants?void 0:e.variants.map(Ue),recommendation:null==e.recommendation?void 0:Se(e.recommendation)}}(e)}function _e(e){return function(e){if(null==e)return e;return{id:e.id,title:e.title,status:e.status,charCount:e.charCount,chunkCount:e.chunkCount,createdAt:new Date(e.createdAt),readyAt:null==e.readyAt?null:new Date(e.readyAt)}}(e)}function xe(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_e(e.data)}}(e)}function De(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,translationId:null==e.translationId?void 0:e.translationId,compositionId:null==e.compositionId?void 0:e.compositionId,languageCode:null==e.languageCode?void 0:e.languageCode,languageName:null==e.languageName?void 0:e.languageName,isRoot:null==e.isRoot?void 0:e.isRoot,embedCode:null==e.embedCode?void 0:e.embedCode,totalViews:null==e.totalViews?void 0:e.totalViews,status:null==e.status?void 0:e.status,translationProgress:null==e.translationProgress?void 0:e.translationProgress,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Be(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,status:null==e.status?void 0:e.status,embedCode:null==e.embedCode?void 0:e.embedCode,selectedLanguages:null==e.selectedLanguages?void 0:e.selectedLanguages,totalViews:null==e.totalViews?void 0:e.totalViews,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(De)}}(e)}function Me(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data),message:null==e.message?void 0:e.message}}(e)}function Pe(e){return function(e){if(null==e)return e;return{documents:e.documents,characters:e.characters,maxDocuments:e.maxDocuments,maxTotalChars:e.maxTotalChars}}(e)}function Ke(e){return function(e){if(null==e)return e;return{documents:e.documents.map(_e),totals:Pe(e.totals)}}(e)}function We(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function Oe(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),country:e.country,region:null==e.region?void 0:e.region,city:null==e.city?void 0:e.city,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function ze(e){return function(e){if(null==e)return e;return{total_views:null==e.total_views?void 0:e.total_views,unique_views:null==e.unique_views?void 0:e.unique_views,total_interactions:null==e.total_interactions?void 0:e.total_interactions,unique_interactions:null==e.unique_interactions?void 0:e.unique_interactions,average_session_time:null==e.average_session_time?void 0:e.average_session_time,bounce_rate:null==e.bounce_rate?void 0:e.bounce_rate}}(e)}function Ge(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),deviceType:e.deviceType,views:e.views,uniqueUsers:e.uniqueUsers,avgSessionDuration:e.avgSessionDuration,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Le(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,timestamp:new Date(e.timestamp),eventType:e.eventType,eventData:null==e.eventData?void 0:e.eventData,userId:null==e.userId?void 0:e.userId,sessionId:null==e.sessionId?void 0:e.sessionId,ipAddress:null==e.ipAddress?void 0:e.ipAddress,userAgent:null==e.userAgent?void 0:e.userAgent,referrer:null==e.referrer?void 0:e.referrer,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function $e(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),source:e.source,source_url:null==e.source_url?void 0:e.source_url,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function je(e){return function(e){if(null==e)return e;return{summary:ze(e.summary),devices:e.devices.map(Ge),geography:e.geography.map(Oe),referrers:e.referrers.map($e),events:null==e.events?void 0:e.events.map(Le)}}(e)}function Ne(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(Le),totalEvents:null==e.totalEvents?void 0:e.totalEvents,databaseStored:null==e.databaseStored?void 0:e.databaseStored,axiomStreamed:null==e.axiomStreamed?void 0:e.axiomStreamed,processingTimeMs:null==e.processingTimeMs?void 0:e.processingTimeMs}}(e)}function Ve(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,eventType:e.eventType,eventData:e.eventData,userId:e.userId,sessionId:e.sessionId,ipAddress:e.ipAddress,userAgent:e.userAgent,referrer:e.referrer}}(e,!1)}function Xe(e){return function(e){if(null==e)return e;return{events:e.events.map(Ve)}}(e,!1)}function Fe(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function He(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function Ye(e){return function(e){if(null==e)return e;return{should_stop:null==e.should_stop?void 0:e.should_stop,reason:null==e.reason?void 0:e.reason,new_status:null==e.new_status?void 0:e.new_status}}(e)}function Ze(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ye(e.data)}}(e)}function Je(e){return function(e){if(null==e)return e;return{id:e.id,creatorId:e.creatorId,widgetId:e.widgetId,name:e.name,content:e.content,contentVersion:null==e.contentVersion?void 0:e.contentVersion,status:e.status,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),embedSettings:null==e.embedSettings?void 0:e.embedSettings,design:null==e.design?void 0:e.design,databaseId:null==e.databaseId?void 0:e.databaseId,projectId:null==e.projectId?void 0:e.projectId,managedUserId:null==e.managedUserId?void 0:e.managedUserId,direct:null==e.direct?void 0:e.direct}}(e)}function Qe(e){return function(e){if(null==e)return e;return{url:e.url,refreshSeconds:e.refreshSeconds}}(e)}function et(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function tt(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(et),rows:e.rows}}(e)}function nt(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(tt)}}(e)}function it(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function ot(e){return function(e){if(null==e)return e;return{group:null==e.group?void 0:e.group,count:null==e.count?void 0:e.count,avg:null==e.avg?void 0:e.avg,min:null==e.min?void 0:e.min,max:null==e.max?void 0:e.max,sum:null==e.sum?void 0:e.sum}}(e)}function rt(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(ot),truncated:null==e.truncated?void 0:e.truncated}}(e)}function at(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,table:e.table,totalRows:e.totalRows,tallies:null==e.tallies?null:e.tallies.map(it),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:rt(e.aggregates)}}(e)}function st(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,compositionId:null==e.compositionId?void 0:e.compositionId,version:null==e.version?void 0:e.version,content:null==e.content?void 0:e.content,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function dt(e){return function(e){if(null==e)return e;return{path:e.path,message:e.message,expected:null==e.expected?void 0:e.expected,actual:null==e.actual?void 0:e.actual}}(e)}function ut(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function lt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:ut(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent,item:null==e.item?void 0:e.item}}(e)}function ct(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ae(e.data)}}(e)}function pt(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,compositionId:e.compositionId,trafficPercentage:e.trafficPercentage,goalTarget:e.goalTarget}}(e,!1)}function ht(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,workspaceType:e.workspaceType,variants:e.variants.map(pt),successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function gt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Je(e.data),meta:null==e.meta?void 0:gt(e.meta)}}(e)}function vt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:lt(e.data)}}(e)}function mt(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function wt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function yt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function It(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Je(e.data),meta:null==e.meta?void 0:yt(e.meta)}}(e)}function Rt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data),message:null==e.message?void 0:e.message}}(e)}function Tt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId,warnings:null==e.warnings?void 0:e.warnings}}(e)}function kt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Tt(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function At(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Re(e.data)}}(e)}function qt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data)}}(e)}function St(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Ct(e){return function(e){if(null==e)return e;return{deleted:null==e.deleted?void 0:e.deleted,contentVersion:null==e.contentVersion?void 0:e.contentVersion}}(e)}function Et(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Ut(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function bt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ut(e.data)}}(e)}function _t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function xt(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(e)}function Dt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:xt(e.data)}}(e)}function Bt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId}}(e)}function Mt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Bt(e.data),warnings:null==e.warnings?void 0:e.warnings}}(e)}function Pt(e){return function(e){if(null==e)return e;return{token:null==e.token?void 0:e.token,tokenType:null==e.tokenType?void 0:e.tokenType,expiresIn:null==e.expiresIn?void 0:e.expiresIn,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt),scopes:null==e.scopes?void 0:e.scopes}}(e)}function Kt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Pt(e.data)}}(e)}function Wt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,composition_id:null==e.composition_id?void 0:e.composition_id,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage,goal_target:null==e.goal_target?void 0:e.goal_target}}(e)}function Ot(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,name:null==e.name?void 0:e.name,status:null==e.status?void 0:e.status,variants:null==e.variants?void 0:e.variants.map(Wt),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(e)}function zt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ke(e.data)}}(e)}function Gt(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total}}(e)}function Lt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Je),meta:null==e.meta?void 0:Gt(e.meta)}}(e)}function $t(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,tracking:null==e.tracking?void 0:e.tracking,supportsElementTarget:null==e.supportsElementTarget?void 0:e.supportsElementTarget,available:null==e.available?void 0:e.available,unavailableReason:null==e.unavailableReason?void 0:e.unavailableReason}}(e)}function jt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map($t)}}(e)}function Nt(e){return function(e){if(null==e)return e;return{selector:null==e.selector?void 0:e.selector,label:null==e.label?void 0:e.label,kind:null==e.kind?void 0:e.kind,tag:null==e.tag?void 0:e.tag,metrics:null==e.metrics?void 0:e.metrics,preferred:null==e.preferred?void 0:e.preferred,matchCount:null==e.matchCount?void 0:e.matchCount}}(e)}function Vt(e){return function(e){if(null==e)return e;return{metric:null==e.metric?void 0:e.metric,label:null==e.label?void 0:e.label,description:null==e.description?void 0:e.description,selector:null==e.selector?void 0:e.selector,recommended:null==e.recommended?void 0:e.recommended}}(e)}function Xt(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,complete:null==e.complete?void 0:e.complete,note:null==e.note?void 0:e.note,goals:null==e.goals?void 0:e.goals.map(Vt),targets:null==e.targets?void 0:e.targets.map(Nt)}}(e)}function Ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Xt(e.data)}}(e)}function Ht(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Je(e.data)}}(e)}function Yt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,contentItems:null==e.contentItems?void 0:e.contentItems,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Zt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function Jt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,theme:null==e.theme?void 0:e.theme,componentGroups:null==e.componentGroups?void 0:e.componentGroups,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Qt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,version:null==e.version?void 0:e.version,type:null==e.type?void 0:e.type,componentGroups:null==e.componentGroups?void 0:e.componentGroups,defaults:null==e.defaults?void 0:e.defaults}}(e)}function en(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,previewUrl:null==e.previewUrl?void 0:e.previewUrl}}(e)}function tn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(st)}}(e)}function nn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,error:null==e.error?void 0:e.error}}(e)}function on(e){return function(e){if(null==e)return e;return{compositions:null==e.compositions?void 0:e.compositions.map(Je),errors:null==e.errors?void 0:e.errors.map(nn)}}(e)}function rn(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(e)}function an(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:rn(e.data)}}(e)}function sn(e){return function(e){if(null==e)return e;return{name:null==e.name?void 0:e.name,nativeName:null==e.nativeName?void 0:e.nativeName,region:null==e.region?void 0:e.region,isPreselected:null==e.isPreselected?void 0:e.isPreselected}}(e)}function dn(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:me(e.languages,sn),preselected:null==e.preselected?void 0:e.preselected}}(e)}function un(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:dn(e.data)}}(e)}function ln(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data)}}(e)}function cn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views,percentage:null==e.percentage?void 0:e.percentage}}(e)}function pn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views}}(e)}function hn(e){return function(e){if(null==e)return e;return{totalViews:null==e.totalViews?void 0:e.totalViews,languageBreakdown:null==e.languageBreakdown?void 0:e.languageBreakdown.map(cn),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(pn),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(e)}function gn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:hn(e.data)}}(e)}function fn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,languageCompositions:null==e.languageCompositions?void 0:e.languageCompositions,status:null==e.status?void 0:e.status}}(e)}function vn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:fn(e.data)}}(e)}function mn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Be),count:null==e.count?void 0:e.count}}(e)}function wn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,composition_id:null==e.composition_id?void 0:e.composition_id,name:null==e.name?void 0:e.name,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage}}(e)}function yn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,version:null==e.version?void 0:e.version,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),isPublished:null==e.isPublished?void 0:e.isPublished,prompt:null==e.prompt?void 0:e.prompt,publishedBy:null==e.publishedBy?void 0:e.publishedBy}}(e)}function In(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(yn)}}(e)}function Rn(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total,limit:null==e.limit?void 0:e.limit,offset:null==e.offset?void 0:e.offset,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage}}(e)}function Tn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Bt),meta:null==e.meta?void 0:Rn(e.meta)}}(e)}function kn(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Bt),errors:null==e.errors?void 0:e.errors.map(nn)}}(e)}function An(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data)}}(e)}function qn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:qe(e.data)}}(e)}function Sn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:be(e.data)}}(e)}function Cn(e){return function(e){if(null==e)return e;return{count:null==e.count?void 0:e.count,workspace_type:null==e.workspace_type?void 0:e.workspace_type}}(e)}function En(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(ke),meta:null==e.meta?void 0:Cn(e.meta)}}(e)}function Un(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,month:e.month,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function bn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function _n(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:We(e.data)}}(e)}function xn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function Dn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:xn(e.data)}}(e)}function Bn(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function Mn(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function Pn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:Mn(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function Kn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function Wn(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:Kn(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function On(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Wn(e.data)}}(e)}function zn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data),message:null==e.message?void 0:e.message}}(e)}function Gn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data),message:null==e.message?void 0:e.message}}(e)}function Ln(e){return function(e){if(null==e)return e;return{limit:null==e.limit?void 0:e.limit,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage,nextCursor:null==e.nextCursor?void 0:e.nextCursor,previousCursor:null==e.previousCursor?void 0:e.previousCursor}}(e)}function $n(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:Ln(e.pagination)}}(e)}function jn(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:$n(e.meta)}}(e)}function Nn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Vn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString(),user_id:e.user_id,session_id:e.session_id}}(e,!1)}function Xn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Vn(e.data)}}(e,!1)}function Fn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message,count:null==e.count?void 0:e.count}}(e)}function Hn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,user_id:e.user_id,session_id:e.session_id,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString()}}(e,!1)}function Yn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Hn(e.data)}}(e,!1)}function Zn(e){return function(e){if(null==e)return e;return{events:e.events.map(Yn)}}(e,!1)}function Jn(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function Qn(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,variants:null==e.variants?void 0:e.variants.map(Jn),confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function ei(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function ti(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function ni(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ti(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function ii(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(e)}function oi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ii(e.data)}}(e)}function ri(e){return function(e){if(null==e)return e;return{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(dt),warnings:null==e.warnings?void 0:e.warnings.map(dt),sanitizedContent:null==e.sanitizedContent?void 0:e.sanitizedContent}}(e)}function ai(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,reason:null==e.reason?void 0:e.reason,message:null==e.message?void 0:e.message}}(e)}function si(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ai(e.data)}}(e)}function di(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,tokenType:null==e.tokenType?void 0:e.tokenType,scopes:null==e.scopes?void 0:e.scopes,userId:null==e.userId?void 0:e.userId,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt)}}(e)}function ui(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:di(e.data)}}(e)}function li(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,impact:null==e.impact?void 0:e.impact}}(e)}function ci(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,reason:null==e.reason?void 0:e.reason}}(e)}function pi(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,blockers:null==e.blockers?void 0:e.blockers.map(ci),warnings:null==e.warnings?void 0:e.warnings.map(li)}}(e)}function hi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:pi(e.data)}}(e)}function gi(e){return function(e){if(null==e)return e;return{variant:null==e.variant?void 0:e.variant,metric:null==e.metric?void 0:e.metric,reason:null==e.reason?void 0:e.reason}}(e)}function fi(e){return function(e){if(null==e)return e;return{is_valid:null==e.is_valid?void 0:e.is_valid,issues:null==e.issues?void 0:e.issues.map(gi),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function vi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:fi(e.data)}}(e)}function mi(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function wi(e){return function(e){if(null==e)return e;return{variants:e.variants.map(mi),success_metrics:e.success_metrics}}(e,!1)}function yi(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,affected_compositions:null==e.affected_compositions?void 0:e.affected_compositions,blockers:null==e.blockers?void 0:e.blockers.map(ci),warnings:null==e.warnings?void 0:e.warnings.map(li)}}(e)}function Ii(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:yi(e.data)}}(e)}function Ri(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,weekNumber:e.weekNumber,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}var Ti="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class ki extends ce{assignVariantRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new ge("assignVariantRequest",'Required parameter "assignVariantRequest" was null or undefined when calling assignVariant().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/{id}/assign".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.assignVariantRequest,o=r,null==o?o:{user_id:o.user_id,session_id:o.session_id})},t);var o,r;return new we(i,(e=>Te(e)))}))}assignVariant(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling checkWorkspaceABTestAutoStop().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/auto-stop-check".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Ze(e)))}))}checkWorkspaceABTestAutoStop(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new ge("createABTestAssignmentRequest",'Required parameter "createABTestAssignmentRequest" was null or undefined when calling createABTestAssignment().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/assignments",method:"POST",headers:n,query:{},body:(r=e.createABTestAssignmentRequest,o=r,null==o?o:{experiment_id:o.experiment_id,variant_id:o.variant_id,user_id:o.user_id,session_id:o.session_id,device_type:o.device_type,user_agent:o.user_agent,ip_address:o.ip_address,country_code:o.country_code})},t);var o,r;return new we(i,(e=>ct(e)))}))}createABTestAssignment(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABConversionWebhookRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABConversionWebhook().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>At(e)))}))}createWorkspaceABConversionWebhook(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new ge("createABTestRequest",'Required parameter "createABTestRequest" was null or undefined when calling createWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:ht(e.createABTestRequest)},t);return new we(i,(e=>qt(e)))}))}createWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABConversionWebhookRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>bt(e)))}))}deleteWorkspaceABConversionWebhook(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling deleteWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>_t(e)))}))}deleteWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getABTestConfig().');const n=yield this.request({path:"/ab-tests/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>Ot(e)))}))}getABTestConfig(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(e){return Ti(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/metrics/available",method:"GET",headers:t,query:{}},e);return new we(n,(e=>jt(e)))}))}getAvailableMetrics(e){return Ti(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionABGoalTargets().');const n={};null!=e.metric&&(n.metric=e.metric);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/compositions/{id}/ab-goal-targets".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>Ft(e)))}))}getCompositionABGoalTargets(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getVariantConfig().');const n=yield this.request({path:"/ab-tests/variants/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>wn(e)))}))}getVariantConfig(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABConversionWebhookRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>An(e)))}))}getWorkspaceABConversionWebhook(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>qt(e)))}))}getWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestDiagnosis().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/diagnosis".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>qn(e)))}))}getWorkspaceABTestDiagnosis(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestStatistics().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/statistics".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Sn(e)))}))}getWorkspaceABTestStatistics(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceABTests().');const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:i,query:n},t);return new we(o,(e=>En(e)))}))}listWorkspaceABTests(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling pauseWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/pause".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>qt(e)))}))}pauseWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}rotateWorkspaceABConversionWebhookSecretRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling rotateWorkspaceABConversionWebhookSecret().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook/rotate".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>At(e)))}))}rotateWorkspaceABConversionWebhookSecret(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.rotateWorkspaceABConversionWebhookSecretRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new ge("setWorkspaceABTestDurationRequest",'Required parameter "setWorkspaceABTestDurationRequest" was null or undefined when calling setWorkspaceABTestDuration().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/duration".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:(r=e.setWorkspaceABTestDurationRequest,o=r,null==o?o:{duration_days:o.duration_days})},t);var o,r;return new we(i,(e=>zn(e)))}))}setWorkspaceABTestDuration(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling startWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/start".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>qt(e)))}))}startWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling stopWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/stop".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{},body:(r=e.stopWorkspaceABTestRequest,o=r,null==o?o:{winning_variant_id:o.winning_variant_id,winningVariantId:o.winningVariantId})},t);var o,r;return new we(i,(e=>Gn(e)))}))}stopWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new ge("trackABTestEventRequest",'Required parameter "trackABTestEventRequest" was null or undefined when calling trackABTestEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/events",method:"POST",headers:n,query:{},body:Xn(e.trackABTestEventRequest)},t);return new we(i,(e=>Nn(e)))}))}trackABTestEvent(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new ge("trackBulkABTestEventsRequest",'Required parameter "trackBulkABTestEventsRequest" was null or undefined when calling trackBulkABTestEvents().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/bulk",method:"POST",headers:n,query:{},body:Zn(e.trackBulkABTestEventsRequest)},t);return new we(i,(e=>Fn(e)))}))}trackBulkABTestEvents(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new ge("updateABTestRequest",'Required parameter "updateABTestRequest" was null or undefined when calling updateWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:Qn(e.updateABTestRequest)},t);return new we(i,(e=>qt(e)))}))}updateWorkspaceABTest(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new ge("validateWorkspaceCompositionDeletionRequest",'Required parameter "validateWorkspaceCompositionDeletionRequest" was null or undefined when calling validateWorkspaceCompositionDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-composition-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceCompositionDeletionRequest,o=r,null==o?o:{composition_ids:o.composition_ids})},t);var o,r;return new we(i,(e=>hi(e)))}))}validateWorkspaceCompositionDeletion(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new ge("validateWorkspaceGoalTrackingRequest",'Required parameter "validateWorkspaceGoalTrackingRequest" was null or undefined when calling validateWorkspaceGoalTracking().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-goal-tracking".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:wi(e.validateWorkspaceGoalTrackingRequest)},t);return new we(i,(e=>vi(e)))}))}validateWorkspaceGoalTracking(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new ge("validateWorkspaceWidgetDeletionRequest",'Required parameter "validateWorkspaceWidgetDeletionRequest" was null or undefined when calling validateWorkspaceWidgetDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-widget-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceWidgetDeletionRequest,o=r,null==o?o:{widget_id:o.widget_id})},t);var o,r;return new we(i,(e=>Ii(e)))}))}validateWorkspaceWidgetDeletion(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.value()}))}}var Ai="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class qi extends ce{analyticsEventsBulkPostRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.analyticsEventsBulkPostRequest)throw new ge("analyticsEventsBulkPostRequest",'Required parameter "analyticsEventsBulkPostRequest" was null or undefined when calling analyticsEventsBulkPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/analytics/events/bulk",method:"POST",headers:n,query:{},body:Xe(e.analyticsEventsBulkPostRequest)},t);return new we(i,(e=>Ne(e)))}))}analyticsEventsBulkPost(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.analyticsEventsBulkPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDailyGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDailyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/daily".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(St)))}))}compositionsIdAnalyticsDailyGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDailyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDashboardGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDashboardGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.includeEvents&&(n.include_events=e.includeEvents);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/dashboard".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>je(e)))}))}compositionsIdAnalyticsDashboardGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDashboardGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDevicesGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDevicesGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.deviceType&&(n.device_type=e.deviceType),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/devices".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Ge)))}))}compositionsIdAnalyticsDevicesGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDevicesGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.eventType&&(n.event_type=e.eventType),null!=e.userId&&(n.user_id=e.userId),null!=e.sessionId&&(n.session_id=e.sessionId),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Le)))}))}compositionsIdAnalyticsEventsGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsPostRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsPost().');if(null==e.newAnalyticsEvent)throw new ge("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling compositionsIdAnalyticsEventsPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:Ve(e.newAnalyticsEvent)},t);return new we(i,(e=>Le(e)))}))}compositionsIdAnalyticsEventsPost(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsGeographyGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsGeographyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.country&&(n.country=e.country),null!=e.region&&(n.region=e.region),null!=e.city&&(n.city=e.city),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/geography".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Oe)))}))}compositionsIdAnalyticsGeographyGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsGeographyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsMonthlyGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsMonthlyGet().');const n={};null!=e.month&&(n.month=e.month),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/monthly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Un)))}))}compositionsIdAnalyticsMonthlyGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsMonthlyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsReferrersGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsReferrersGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.source&&(n.source=e.source),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/referrers".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map($e)))}))}compositionsIdAnalyticsReferrersGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsReferrersGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsWeeklyGetRaw(e,t){return Ai(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsWeeklyGet().');const n={};null!=e.weekNumber&&(n.week_number=e.weekNumber),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/weekly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Ri)))}))}compositionsIdAnalyticsWeeklyGet(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsWeeklyGetRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(e){return Ai(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/flush",method:"POST",headers:t,query:{}},e);return new we(n,(e=>jn(e)))}))}flushAxiomEvents(e){return Ai(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(e){return Ai(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/status",method:"GET",headers:t,query:{}},e);return new we(n,(e=>jn(e)))}))}getAxiomStatus(e){return Ai(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}}var Si="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ci extends ce{completeSignupRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new ge("completeSignupRequest",'Required parameter "completeSignupRequest" was null or undefined when calling completeSignup().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/complete-signup",method:"POST",headers:n,query:{},body:(r=e.completeSignupRequest,o=r,null==o?o:{userId:o.userId,email:o.email,role:o.role,plan:o.plan,token:o.token})},t);var o,r;return new ye(i)}))}completeSignup(e,t){return Si(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling confirmEmail().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/confirm-email",method:"POST",headers:n,query:{},body:ei(e.updateEmailRequest)},t);return new ye(i)}))}confirmEmail(e,t){return Si(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new ge("bridgeId",'Required parameter "bridgeId" was null or undefined when calling consumeOAuthSessionBridge().');const n=yield this.request({path:"/auth/oauth-session/{bridgeId}".replace("{bridgeId}",encodeURIComponent(String(e.bridgeId))),method:"GET",headers:{},query:{}},t);return new ye(n)}))}consumeOAuthSessionBridge(e,t){return Si(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return Si(this,void 0,void 0,(function*(){const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/delete-account",method:"POST",headers:n,query:{},body:(r=e.deleteAccountRequest,o=r,null==o?o:{password:o.password})},t);var o,r;return new ye(i)}))}deleteAccount(){return Si(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return Si(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/session",method:"GET",headers:t,query:{}},e);return new ye(n)}))}getSession(e){return Si(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return Si(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/get-metadata",method:"GET",headers:t,query:{}},e);return new ye(n)}))}getUserMetadata(e){return Si(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.provider)throw new ge("provider",'Required parameter "provider" was null or undefined when calling initiateOAuth().');const n={};null!=e.redirectTo&&(n.redirectTo=e.redirectTo),null!=e.role&&(n.role=e.role),null!=e.plan&&(n.plan=e.plan);const i=yield this.request({path:"/auth/oauth/{provider}".replace("{provider}",encodeURIComponent(String(e.provider))),method:"GET",headers:{},query:n},t);return new ye(i)}))}initiateOAuth(e,t){return Si(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new ge("loginUserRequest",'Required parameter "loginUserRequest" was null or undefined when calling loginUser().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/login",method:"POST",headers:n,query:{},body:(r=e.loginUserRequest,o=r,null==o?o:{email:o.email,password:o.password})},t);var o,r;return new we(i,(e=>bn(e)))}))}loginUser(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return Si(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/logout",method:"POST",headers:t,query:{}},e);return new ye(n)}))}logoutUser(e){return Si(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}refreshSessionRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new ge("refreshSessionRequest",'Required parameter "refreshSessionRequest" was null or undefined when calling refreshSession().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/refresh",method:"POST",headers:n,query:{},body:(r=e.refreshSessionRequest,o=r,null==o?o:{refresh_token:o.refresh_token})},t);var o,r;return new ye(i)}))}refreshSession(e,t){return Si(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resendConfirmation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/resend-confirmation",method:"POST",headers:n,query:{},body:Bn(e.resetPasswordRequest)},t);return new ye(i)}))}resendConfirmation(e,t){return Si(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resetPassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/reset-password",method:"POST",headers:n,query:{},body:Bn(e.resetPasswordRequest)},t);return new ye(i)}))}resetPassword(e,t){return Si(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new ge("signupUserRequest",'Required parameter "signupUserRequest" was null or undefined when calling signupUser().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup",method:"POST",headers:n,query:{},body:(r=e.signupUserRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,inviteCode:o.inviteCode,name:o.name,returnTo:o.returnTo})},t);var o,r;return new ye(i)}))}signupUser(e,t){return Si(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new ge("signupWithInvitationRequest",'Required parameter "signupWithInvitationRequest" was null or undefined when calling signupWithInvitation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup-with-invitation",method:"POST",headers:n,query:{},body:(r=e.signupWithInvitationRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,invitationId:o.invitationId,organizationId:o.organizationId})},t);var o,r;return new ye(i)}))}signupWithInvitation(e,t){return Si(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling updateEmail().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-email",method:"POST",headers:n,query:{},body:ei(e.updateEmailRequest)},t);return new ye(i)}))}updateEmail(e,t){return Si(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new ge("updateNameRequest",'Required parameter "updateNameRequest" was null or undefined when calling updateName().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/update-name",method:"POST",headers:n,query:{},body:(r=e.updateNameRequest,o=r,null==o?o:{token:o.token,name:o.name})},t);var o,r;return new ye(i)}))}updateName(e,t){return Si(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new ge("updatePasswordRequest",'Required parameter "updatePasswordRequest" was null or undefined when calling updatePassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-password",method:"POST",headers:n,query:{},body:(r=e.updatePasswordRequest,o=r,null==o?o:{token:o.token,email:o.email,password:o.password})},t);var o,r;return new ye(i)}))}updatePassword(e,t){return Si(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new ge("updateUserMetadataRequest",'Required parameter "updateUserMetadataRequest" was null or undefined when calling updateUserMetadata().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/update-metadata",method:"POST",headers:n,query:{},body:(r=e.updateUserMetadataRequest,o=r,null==o?o:{metadata:o.metadata})},t);var o,r;return new ye(i)}))}updateUserMetadata(e,t){return Si(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.code)throw new ge("code",'Required parameter "code" was null or undefined when calling validateInviteCode().');const n={};null!=e.code&&(n.code=e.code);const i=yield this.request({path:"/auth/invite-code",method:"GET",headers:{},query:n},t);return new we(i,(e=>si(e)))}))}validateInviteCode(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.value()}))}}var Ei="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ui extends ce{addAiAnswersKnowledgeDocumentRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new ge("addAiAnswersKnowledgeDocumentRequest",'Required parameter "addAiAnswersKnowledgeDocumentRequest" was null or undefined when calling addAiAnswersKnowledgeDocument().');const n={"Content-Type":"application/json"};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addAiAnswersKnowledgeDocumentRequest,o=r,null==o?o:{title:o.title,text:o.text})},t);var o,r;return new we(i,(e=>xe(e)))}))}addAiAnswersKnowledgeDocument(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling checkCompositionAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Fe(e)))}))}checkCompositionAccess(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new ge("createCompositionContentItemRequest",'Required parameter "createCompositionContentItemRequest" was null or undefined when calling createCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))),method:"POST",headers:n,query:{},body:mt(e.createCompositionContentItemRequest)},t);return new we(i,(e=>vt(e)))}))}createCompositionContentItem(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new ge("body",'Required parameter "body" was null or undefined when calling createCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"POST",headers:n,query:{},body:e.body},t);return new we(i,(e=>wt(e)))}))}createCompositionDatabaseRecord(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new ge("newComposition",'Required parameter "newComposition" was null or undefined when calling createComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions",method:"POST",headers:n,query:{},body:(r=e.newComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,creatorId:o.creatorId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>ft(e)))}))}createComposition(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}deleteCompositionContentItemRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling deleteCompositionContentItem().');const n={};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Ct(e)))}))}deleteCompositionContentItem(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDataSource().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling deleteCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>wt(e)))}))}deleteCompositionDatabaseRecord(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteComposition().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new ye(i)}))}deleteComposition(e,t){return Ei(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}describeCompositionEntriesRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling describeCompositionEntries().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/entries".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>nt(e)))}))}describeCompositionEntries(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling duplicateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateCompositionRequest,o=r,null==o?o:{name:o.name,includeDatabase:o.includeDatabase})},t);var o,r;return new we(i,(e=>Dt(e)))}))}duplicateComposition(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getAiAnswersKnowledge().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>zt(e)))}))}getAiAnswersKnowledge(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return Ei(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.sort&&(n.sort=e.sort),null!=e.widgetId&&(n.widgetId=e.widgetId),null!=e.workspace&&(n.workspace=e.workspace),null!=e.projectFolder&&(n.projectFolder=e.projectFolder),null!=e.status&&(n.status=e.status),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions",method:"GET",headers:i,query:n},t);return new we(o,(e=>Lt(e)))}))}getAllCompositions(){return Ei(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionById().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Ht(e)))}))}getCompositionById(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionContentSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Yt(e)))}))}getCompositionContentSchema(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionContent().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionContent(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDataSource().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Qe(e)))}))}getCompositionDataSource(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling getCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>wt(e)))}))}getCompositionDatabaseRecord(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecords().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Zt(e)))}))}getCompositionDatabaseRecords(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDesignSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Jt(e)))}))}getCompositionDesignSchema(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDesign().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionDesign(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/embed".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Qt(e)))}))}getCompositionEmbedSchema(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSettings().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/embed-settings".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionEmbedSettings(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionPreview().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/preview".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>en(e)))}))}getCompositionPreview(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionVersions().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/versions".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>tn(e)))}))}getCompositionVersions(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new ge("getCompositionsBatchRequest",'Required parameter "getCompositionsBatchRequest" was null or undefined when calling getCompositionsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/batch",method:"POST",headers:n,query:{},body:(r=e.getCompositionsBatchRequest,o=r,null==o?o:{compositionIds:o.compositionIds})},t);var o,r;return new we(i,(e=>on(e)))}))}getCompositionsBatch(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new ge("requestBody",'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"PATCH",headers:n,query:{},body:e.requestBody},t);return new we(i,(e=>vt(e)))}))}patchCompositionContentItem(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling readCompositionEntries().');const n={};null!=e.groupBy&&(n.groupBy=e.groupBy),null!=e.rows&&(n.rows=e.rows),null!=e.aggregate&&(n.aggregate=e.aggregate),null!=e.column&&(n.column=e.column),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.context&&(n.context=e.context),null!=e.filter&&(n.filter=e.filter);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/entries/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new we(o,(e=>at(e)))}))}readCompositionEntries(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new ge("documentId",'Required parameter "documentId" was null or undefined when calling removeAiAnswersKnowledgeDocument().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/{documentId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{documentId}",encodeURIComponent(String(e.documentId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>_n(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new ge("setCompositionDataSourceRequest",'Required parameter "setCompositionDataSourceRequest" was null or undefined when calling setCompositionDataSource().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setCompositionDataSourceRequest,o=r,null==o?o:{url:o.url,refreshSeconds:o.refreshSeconds})},t);var o,r;return new we(i,(e=>Qe(e)))}))}setCompositionDataSource(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new ge("setDynamicContentRequest",'Required parameter "setDynamicContentRequest" was null or undefined when calling setDynamicContent().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setDynamicContentRequest,o=r,null==o?o:{content:o.content,validate:o.validate,partial:o.partial,version:o.version,source:o.source})},t);var o,r;return new we(i,(e=>Pn(e)))}))}setDynamicContent(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new ge("body",'Required parameter "body" was null or undefined when calling updateCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"PUT",headers:n,query:{},body:e.body},t);return new we(i,(e=>wt(e)))}))}updateCompositionDatabaseRecord(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new ge("updateCompositionStatusRequest",'Required parameter "updateCompositionStatusRequest" was null or undefined when calling updateCompositionStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateCompositionStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new we(i,(e=>Je(e)))}))}updateCompositionStatus(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new ge("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId})},t);var o,r;return new we(i,(e=>Ht(e)))}))}updateComposition(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return Ei(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new ge("requestBody",'Required parameter "requestBody" was null or undefined when calling validateCompositionContent().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/validate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:e.requestBody},t);return new we(i,(e=>ri(e)))}))}validateCompositionContent(e,t){return Ei(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}var bi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class _i extends ce{exchangeTokenRaw(e,t){return bi(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new ge("exchangeTokenRequest",'Required parameter "exchangeTokenRequest" was null or undefined when calling exchangeToken().');const n={"Content-Type":"application/json"};this.configuration&&this.configuration.apiKey&&(n.Authorization=yield this.configuration.apiKey("Authorization"));const i=yield this.request({path:"/tokens/exchange",method:"POST",headers:n,query:{},body:(r=e.exchangeTokenRequest,o=r,null==o?o:{scopes:o.scopes,expiresIn:o.expiresIn})},t);var o,r;return new we(i,(e=>Kt(e)))}))}exchangeToken(e,t){return bi(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return bi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.apiKey&&(t.Authorization=yield this.configuration.apiKey("Authorization")),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("BearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/tokens/validate",method:"GET",headers:t,query:{}},e);return new we(n,(e=>ui(e)))}))}validateToken(e){return bi(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var xi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Di extends ce{addLanguagesToTranslationRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new ge("addLanguagesToTranslationRequest",'Required parameter "addLanguagesToTranslationRequest" was null or undefined when calling addLanguagesToTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addLanguagesToTranslationRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new we(i,(e=>Me(e)))}))}addLanguagesToTranslation(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new ge("createTranslationRequest",'Required parameter "createTranslationRequest" was null or undefined when calling createTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations",method:"POST",headers:n,query:{},body:(r=e.createTranslationRequest,o=r,null==o?o:{name:o.name,description:o.description,root_composition_id:o.root_composition_id,root_language:o.root_language,selected_languages:o.selected_languages})},t);var o,r;return new we(i,(e=>Rt(e)))}))}createTranslation(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Et(e)))}))}deleteTranslation(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return xi(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new we(t,(e=>an(e)))}))}getLanguagePresets(e){return xi(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return xi(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new we(t,(e=>un(e)))}))}getSupportedLanguages(e){return xi(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>ln(e)))}))}getTranslation(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslationAnalytics().');const n={};null!=e.period&&(n.period=e.period);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations/{id}/analytics".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>gn(e)))}))}getTranslationAnalytics(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslationConfig().');const n=yield this.request({path:"/translations/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>vn(e)))}))}getTranslationConfig(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return xi(this,void 0,void 0,(function*(){const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations",method:"GET",headers:i,query:n},t);return new we(o,(e=>mn(e)))}))}getTranslations(){return xi(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new ge("languageCode",'Required parameter "languageCode" was null or undefined when calling removeLanguageFromTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages/{languageCode}".replace("{id}",encodeURIComponent(String(e.id))).replace("{languageCode}",encodeURIComponent(String(e.languageCode))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Me(e)))}))}removeLanguageFromTranslation(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling retranslateExperiment().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/retranslate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.retranslateExperimentRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new we(i,(e=>Et(e)))}))}retranslateExperiment(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new ge("submitTranslationAnalyticsEventRequest",'Required parameter "submitTranslationAnalyticsEventRequest" was null or undefined when calling submitTranslationAnalyticsEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/translations/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.submitTranslationAnalyticsEventRequest,o=r,null==o?o:{eventType:o.eventType,language:o.language,compositionId:o.compositionId,metadata:o.metadata})},t);var o,r;return new ye(i)}))}submitTranslationAnalyticsEvent(e,t){return xi(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return xi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new ge("updateTranslationStatusRequest",'Required parameter "updateTranslationStatusRequest" was null or undefined when calling updateTranslationStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateTranslationStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new we(i,(e=>Me(e)))}))}updateTranslationStatus(e,t){return xi(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var Bi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Mi extends ce{checkWidgetAccessRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling checkWidgetAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>He(e)))}))}checkWidgetAccess(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new ge("createCompositionFromWidgetRequest",'Required parameter "createCompositionFromWidgetRequest" was null or undefined when calling createCompositionFromWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/composition".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.createCompositionFromWidgetRequest,o=r,null==o?o:{name:o.name,content:o.content,design:o.design,embedSettings:o.embedSettings,locale:o.locale,managedUserId:o.managedUserId})},t);var o,r;return new we(i,(e=>It(e)))}))}createCompositionFromWidget(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new ge("newWidget",'Required parameter "newWidget" was null or undefined when calling createWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets",method:"POST",headers:n,query:{},body:(r=e.newWidget,o=r,null==o?o:{name:o.name,type:o.type,content:o.content,isPublic:o.isPublic,isDraft:o.isDraft,canvasId:o.canvasId,projectId:o.projectId,organizationId:o.organizationId,workspaceType:o.workspaceType,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>kt(e)))}))}createWidget(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{},body:(r=e.deleteWidgetRequest,o=r,null==o?o:{reason:o.reason})},t);var o,r;return new ye(i)}))}deleteWidget(e,t){return Bi(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling detachWidget().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/detach".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{}},t);return new ye(i)}))}detachWidget(e,t){return Bi(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling duplicateWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateWidgetRequest,o=r,null==o?o:{name:o.name,canvas_id:o.canvas_id,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>Mt(e)))}))}duplicateWidget(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getWidgetContentSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getWidgetContentSchema(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getWidgetDesignSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getWidgetDesignSchema(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling getWidgetPublishHistory().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history".replace("{widgetId}",encodeURIComponent(String(e.widgetId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>In(e)))}))}getWidgetPublishHistory(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new ge("getWidgetsBatchRequest",'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/batch",method:"POST",headers:n,query:{},body:(r=e.getWidgetsBatchRequest,o=r,null==o?o:{widgetIds:o.widgetIds})},t);var o,r;return new we(i,(e=>kn(e)))}))}getWidgetsBatch(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return Bi(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.canvasId&&(n.canvasId=e.canvasId),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/widgets",method:"GET",headers:i,query:n},t);return new we(o,(e=>Tn(e)))}))}getWidgets(){return Bi(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new ge("renameWidgetPublishHistoryTitleRequest",'Required parameter "renameWidgetPublishHistoryTitleRequest" was null or undefined when calling renameWidgetPublishHistoryTitle().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/title".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"PATCH",headers:n,query:{},body:(r=e.renameWidgetPublishHistoryTitleRequest,o=r,null==o?o:{commitTitle:o.commitTitle})},t);var o,r;return new we(i,(e=>Dn(e)))}))}renameWidgetPublishHistoryTitle(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling setWidgetPublishHistoryLive().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/set-live".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>On(e)))}))}setWidgetPublishHistoryLive(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new ge("updateWidgetRequest",'Required parameter "updateWidgetRequest" was null or undefined when calling updateWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:n,query:{},body:(r=e.updateWidgetRequest,o=r,null==o?o:{name:o.name,description:o.description,canvasId:o.canvasId,projectId:o.projectId,projectFolder:o.projectFolder})},t);var o,r;return new ye(i)}))}updateWidget(e,t){return Bi(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new ge("updateWidgetRepositoryRequest",'Required parameter "updateWidgetRepositoryRequest" was null or undefined when calling updateWidgetRepository().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/repository".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateWidgetRepositoryRequest,o=r,null==o?o:{repositoryId:o.repositoryId})},t);var o,r;return new we(i,(e=>ni(e)))}))}updateWidgetRepository(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return Bi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new ge("uploadWidgetThumbnailRequest",'Required parameter "uploadWidgetThumbnailRequest" was null or undefined when calling uploadWidgetThumbnail().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/thumbnail".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.uploadWidgetThumbnailRequest,o=r,null==o?o:{imageDataUrl:o.imageDataUrl})},t);var o,r;return new we(i,(e=>oi(e)))}))}uploadWidgetThumbnail(e,t){return Bi(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}}class Pi extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class Ki{constructor(e={}){var t,n;this.currentToken=null,this.apiKey=null,this.refreshTimer=null,this.config=Object.assign({apiUrl:e.apiUrl||W(),debug:e.debug||!1},e),this.apiKey=e.apiKey||"undefined"!=typeof process&&((null===(t={NODE_ENV:"production"})||void 0===t?void 0:t.PUBLIC_API_KEY)||(null===(n={NODE_ENV:"production"})||void 0===n?void 0:n.API_KEY))||null}createTokensApiForApiKey(t){const n=new ue({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${K}`}});return new _i(n)}createTokensApiForAccessToken(t){const n=new ue({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${K}`}});return new _i(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&te.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(Ki.validatedTokens.has(this.currentToken.token))return this.currentToken.token;if(yield this.validateToken())return this.currentToken.token}if(this.apiKey)return yield this.exchangeApiKeyForJWT(t),this.currentToken.token;throw new Pi("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new Pi("No API key available for exchange","NO_API_KEY");const n={scopes:(null==t?void 0:t.scopes)||this.getDefaultScopes(),expiresIn:(null==t?void 0:t.expiresIn)||1800};try{const t=this.createTokensApiForApiKey(this.apiKey),i=yield t.exchangeToken({exchangeTokenRequest:n}),o=(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.token)||(null==i?void 0:i.token);if(!o)throw new Pi("Token exchange response missing token","INVALID_RESPONSE");const r=(null==i?void 0:i.data)||i,a={token:o,tokenType:r.tokenType||"Bearer",expiresAt:r.expiresAt?r.expiresAt instanceof Date?r.expiresAt.toISOString():String(r.expiresAt):null,scopes:r.scopes||[]};return this.setToken(a),this.config.debug&&te.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof Pi?e:new Pi(`Token exchange failed: ${e instanceof Error?e.message:String(e)}`,"TOKEN_EXCHANGE_ERROR");throw this.config.onAuthError&&this.config.onAuthError(t),t}}))}validateToken(){return e(this,void 0,void 0,(function*(){var e;if(!this.currentToken)return!1;if(Ki.validatedTokens.has(this.currentToken.token))return!0;try{const t=this.createTokensApiForAccessToken(this.currentToken.token),n=yield t.validateToken();return!0===(null==n?void 0:n.success)&&!0===(null===(e=n.data)||void 0===e?void 0:e.valid)||!0===(null==n?void 0:n.valid)?(Ki.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&te.warn("AuthManager: Token validation failed",e),!1}}))}setToken(e){this.currentToken=e,e.expiresAt&&this.scheduleTokenRefresh(e),this.config.onTokenRefreshed&&this.config.onTokenRefreshed(e.token)}clearToken(){this.currentToken&&Ki.validatedTokens.delete(this.currentToken.token),this.currentToken=null,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}isTokenValid(e){if(!e.expiresAt)return!0;const t=new Date(e.expiresAt).getTime();return Date.now()<t-6e4}scheduleTokenRefresh(t){if(!t.expiresAt||!this.apiKey)return;const n=new Date(t.expiresAt).getTime()-Date.now()-3e5;n>0&&(this.refreshTimer=setTimeout((()=>e(this,void 0,void 0,(function*(){try{yield this.exchangeApiKeyForJWT({scopes:t.scopes}),this.config.debug&&te.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&te.error("AuthManager: Automatic token refresh failed",e),this.config.onTokenExpired&&this.config.onTokenExpired()}}))),n))}getDefaultScopes(){return["compositions:read","widgets:read","projects:read"]}getCurrentTokenInfo(){return this.currentToken}hasAuthMethod(){return!(!this.apiKey&&!this.currentToken)}dispose(){this.clearToken(),this.apiKey=null,this.config.debug&&te.debug("AuthManager: Disposed")}}Ki.validatedTokens=new Set;const Wi=P,Oi={};let zi=null,Gi=null;const Li={API_URL:O.PROD_API_URL,API_VERSION:O.VERSION,CLIENT_URL:O.PROD_CLIENT_URL,PRODUCTION_URL:O.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:O.ENABLE_EDITING,API_KEY:Oi.PUBLIC_API_KEY,AXIOM_API_KEY:Oi.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:Oi.PUBLIC_STATSIG_KEY};function $i(e){zi=e}function ji(){return zi}function Ni(){return Gi||(Gi=new Ki({apiUrl:Hi(),debug:no.enabled})),Gi}function Vi(e){Ni().setApiKey(e)}function Xi(){return e(this,void 0,void 0,(function*(){if(Gi&&Gi.hasAuthMethod())try{return yield Gi.getValidToken()}catch(e){}if(zi)return yield zi.getToken();const e=Li.API_KEY;if(!e)throw new Error("No authentication method available. Please configure an API key, TokenProvider, or set PUBLIC_API_KEY in environment variables.");return e}))}function Fi(e){const t=(null==e?void 0:e.tokenProvider)||zi;if(!t){const t=(null==e?void 0:e.apiKey)||Li.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||Hi(),tokenProvider:t?new re(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||Hi(),tokenProvider:t}}function Hi(){return Li.API_URL}function Yi(){return Li.PRODUCTION_URL}function Zi(){return`${Hi()}${Li.API_VERSION}`}const Ji={isProduction:"production"===Li.NODE_ENV,apiUrl:Hi(),apiKey:Li.API_KEY},Qi={renderMode:z,displayMode:G,resize:L,width:$,height:j,autoscale:N},eo={customElements:V.CUSTOM_ELEMENTS,http3:V.HTTP3,resizeObserver:V.RESIZE_OBSERVER},to={batchSize:X,loadTimeout:F,retryAttempts:H},no={enabled:B,logLevel:M},io={AXIOM_API_KEY:Li.AXIOM_API_KEY||"",AXIOM_DATASET:i,AXIOM_API_ENDPOINT:n,STATSIG_API_KEY:Li.STATSIG_KEY||"",STATSIG_API_ENDPOINT:o,ENABLE_PERFORMANCE_TRACKING:r,PERFORMANCE_SAMPLE_RATE:a,PERFORMANCE_REPORTING_ENDPOINT:d,LCP_THRESHOLD:u,LCP_WARNING_THRESHOLD:l,FID_THRESHOLD:c,FID_WARNING_THRESHOLD:p,CLS_THRESHOLD:h,CLS_WARNING_THRESHOLD:g,FCP_THRESHOLD:f,FCP_WARNING_THRESHOLD:v,TTFB_THRESHOLD:m,TTFB_WARNING_THRESHOLD:w,WIDGET_LOAD_THRESHOLD:y,WIDGET_LOAD_WARNING_THRESHOLD:I,BUNDLE_SIZE_THRESHOLD:R,BUNDLE_SIZE_WARNING_THRESHOLD:T,MAX_METRICS_BUFFER:s},oo={ROOT_MARGIN:k,THRESHOLD:A,MAX_CONCURRENT:q,RETRY_ATTEMPTS:S,RETRY_DELAY:C},ro={MAX_PRELOAD_REQUESTS:E,PREFETCH_TIMEOUT:U,CACHE_DURATION:b,MAX_CONCURRENT_REQUESTS:_,DNS_PREFETCH_ENABLED:x,PRECONNECT_ENABLED:D},ao={DEBUG:B,LOG_LEVEL:M,VERSION:P};function so(){return Fi()}var uo=Object.freeze({__proto__:null,BROWSER_FEATURES:eo,DEBUG:no,DEFAULT_WIDGET_CONFIG:Qi,LAZY_LOADING_CONFIG:oo,PERFORMANCE:to,PERFORMANCE_CONFIG:io,RESOURCE_CONFIG:ro,SDK_CONFIG:ao,VERSION:Wi,config:Li,createSdkConfig:Fi,environment:Ji,getApiUrl:Hi,getAuthManager:Ni,getAuthToken:Xi,getCdnUrl:Yi,getConfiguration:so,getTokenProvider:ji,getVersionedApiUrl:Zi,setApiKey:Vi,setTokenProvider:$i});const lo="widgetic_session_id",co=new Map;let po=null;function ho(e){var t;try{const t=localStorage.getItem(e);if(null!==t)return t}catch(e){}return null!==(t=co.get(e))&&void 0!==t?t:null}function go(e,t){co.set(e,t);try{localStorage.setItem(e,t)}catch(t){ee.debug("localStorage is not available; keeping the A/B test state in memory",{key:e,error:t})}}function fo(e){co.delete(e);try{localStorage.removeItem(e)}catch(t){ee.debug("localStorage is not available; the value was only forgotten in memory",{key:e,error:t})}}function vo(){const e=ho(lo);return e||(po||(po=function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return`visitor_${crypto.randomUUID()}`}catch(e){}return`visitor_${Math.random().toString(36).slice(2,12)}_${Date.now().toString(36)}`}()),go(lo,po),po)}function mo(e,t){return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}(`${t}:${e}`)%1e4/100}function wo(e,t,n){if(!e||0===e.length)return null;const i=mo(t,n);let o=0;for(const t of e)if(o+=Number(t.trafficPercentage)||0,i<o)return t;return e[e.length-1]}function yo(e,t){if(!e||!t)return!1;try{return null!==e.closest(t)}catch(e){return ee.warn("The goal target is not a selector this browser understands",{goalTarget:t,error:e}),!1}}export{Ki as A,vo as B,ue as C,Qi as D,ie as E,oe as F,wo as G,uo as H,io as P,ne as S,Di as T,Wi as V,Mi as W,Zi as a,Ui as b,Yi as c,Li as d,ee as e,no as f,Xi as g,so as h,Vi as i,re as j,ji as k,te as l,Hi as m,O as n,Ci as o,Fi as p,fo as q,ho as r,$i as s,yo as t,qi as u,Pi as v,go as w,Ni as x,ki as y,lo as z};
|
|
1
|
+
import{_ as e}from"./vendor.js";const t="2.1.4",n="https://api.axiom.co/v1",i="widgetic-performance",o="https://events.statsigapi.net/v1/custom",r=!0,a=1,s=1e3,d="",u=2500,l=2e3,c=100,p=50,h=.1,g=.05,f=1800,v=1200,m=800,w=600,y=3e3,I=2e3,R=5e5,T=3e5,k="50px",A=.1,q=3,S=3,C=1e3,E=10,U=5e3,b=36e5,_=6,x=!0,D=!0,B=!1,M="info",P=t,K=t;function W(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?O.DEV_API_URL:O.PROD_API_URL}${O.VERSION}`}const O={DEV_API_URL:"http://localhost:3000",PROD_API_URL:"https://api.widgetic.com",PROD_CLIENT_URL:"https://widgetic.com",PROD_CDN_URL:"https://cdn.widgetic.com",VERSION:"/api/v1",ENABLE_EDITING:!0},z="auto",G="inline",L="fixed",$=350,j=200,N=!1,V={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},X=10,F=5e3,H=3;let Y=B;const Z={get enabled(){return Y},logLevel:M},J=["apikey","api_key","api-key","servicekey","service_key","service-key","token","access_token","auth_token","secret","password","private_key","authorization","bearer","internal_key","public_api_key","public_internal_key"];function Q(e){if("string"==typeof e){const t=e.toLowerCase();for(const n of J)if(t.includes(n))return e.replace(/([a-zA-Z_-]*(?:key|token|secret|password)[a-zA-Z_-]*[:\s=]+)([^\s,}]+)/gi,"$1[REDACTED]");return e}if(null==e)return e;if(Array.isArray(e))return e.map(Q);if("object"==typeof e){const t={};for(const[n,i]of Object.entries(e)){const e=n.toLowerCase();J.some((t=>e.includes(t.toLowerCase())||e===t.toLowerCase()))&&"string"==typeof i&&i.length>0?t[n]=`[REDACTED_${i.length}_CHARS]`:t[n]=Q(i)}return t}return e}const ee=new class{constructor(e=Z.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return Z.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(Q)]}debug(e,...t){this.shouldLog("debug")}info(e,...t){this.shouldLog("info")}warn(e,...t){this.shouldLog("warn")}error(e,...t){this.shouldLog("error")}setLevel(e){this.currentLevel=this.logLevels[e]}setDebug(e){!function(e){Y=e}(e)}},te={debug:(e,...t)=>ee.debug(e,...t),info:(e,...t)=>ee.info(e,...t),warn:(e,...t)=>ee.warn(e,...t),error:(e,...t)=>ee.error(e,...t),setLevel:e=>ee.setLevel(e)};class ne{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}class ie{constructor(e){this.tokenEndpoint=e.tokenEndpoint||e.endpoint||"",this.refreshEndpoint=e.refreshEndpoint,this.headers=e.headers||{},e.apiKey&&!this.headers.Authorization&&(this.headers.Authorization=`Bearer ${e.apiKey}`)}getToken(){return e(this,void 0,void 0,(function*(){if(this.cachedToken&&(yield this.isTokenValid()))return this.cachedToken;const e=yield fetch(this.tokenEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},this.headers)});if(!e.ok)throw new Error(`Failed to fetch token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in?this.tokenExpiry=Date.now()+1e3*t.expires_in:t.expires_at&&(this.tokenExpiry=new Date(t.expires_at).getTime()),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}refreshToken(){return e(this,void 0,void 0,(function*(){if(!this.refreshEndpoint)return this.getToken();const e=yield fetch(this.refreshEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json",Authorization:`Bearer ${this.cachedToken}`},this.headers)});if(!e.ok)throw new Error(`Failed to refresh token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in&&(this.tokenExpiry=Date.now()+1e3*t.expires_in),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.cachedToken&&(!this.tokenExpiry||Date.now()<this.tokenExpiry)}))}}class oe{constructor(e,t){this.tokenFunction=e,this.validationFunction=t}getToken(){return e(this,void 0,void 0,(function*(){return yield this.tokenFunction()}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!this.validationFunction||(yield this.validationFunction())}))}}class re{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){if(!this.apiKey)throw new Error("No API key available. Please configure a TokenProvider or set API keys.");return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}var ae="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};const se="https://api.widgetic.com/v1".replace(/\/+$/,""),de="X-SDK-Version";class ue{constructor(e){if(this.configuration={basePath:se,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>ae(this,void 0,void 0,(function*(){return t})),this.configuration.headers={"Content-Type":"application/json"}}else if(e){this.configuration=Object.assign(Object.assign({},e),{basePath:e.basePath||se});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>ae(this,void 0,void 0,(function*(){return n}))}e.headers||(this.configuration.headers={"Content-Type":"application/json"})}}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:se}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||fe}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>ae(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const le=new ue;class ce{constructor(e=le){this.configuration=e,this.fetchApi=(e,t)=>ae(this,void 0,void 0,(function*(){let n,i={url:e,init:t};this.middleware&&Array.isArray(this.middleware)||(this.middleware=[]);for(const e of this.middleware)e.pre&&(i=(yield e.pre(Object.assign({fetch:this.fetchApi},i)))||i);try{n=yield(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(const t of this.middleware)t.onError&&(n=(yield t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0}))||n);if(void 0===n)throw e instanceof Error?new he(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(n=(yield e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()}))||n);return n})),"string"!=typeof e&&(!e||e instanceof ue)||(e=new ue(e)),this.configuration=e,this.middleware=this.configuration.middleware||[]}withMiddleware(...e){const t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){const t=e.map((e=>({pre:e})));return this.withMiddleware(...t)}withPostMiddleware(...e){const t=e.map((e=>({post:e})));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&ce.jsonRegex.test(e)}request(e,t){return ae(this,void 0,void 0,(function*(){var n;const{url:i,init:o}=yield this.createFetchParams(e,t),r=new Headers(Object.assign(Object.assign(Object.assign({},this.configuration.headers),e.headers||{}),o.headers||{})),a=Object.assign(Object.assign({},o),{headers:r}),s=yield this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;const d=s.clone();let u="Response returned an error code",l=null;try{const e=yield d.json(),t=e.error,i=t&&"object"==typeof t?t.message:t;u=e.message||i||u;const o=null===(n=null==e?void 0:e.error)||void 0===n?void 0:n.code;"string"==typeof o&&o.length>0&&(l=o)}catch(e){try{u=yield d.text()}catch(e){u=s.statusText}}throw new pe(s,u,l)}))}createFetchParams(e,t){return ae(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||se).replace(/\/+$/,"")+(e.path.startsWith("/")?e.path:`/${e.path}`);void 0!==e.query&&0!==Object.keys(e.query).length&&(n+="?"+this.configuration.queryParamsStringify(e.query));const i=Object.assign({},this.configuration.headers,e.headers);Object.keys(i).forEach((e=>void 0===i[e]?delete i[e]:{}));Object.keys(i).some((e=>e.toLowerCase()===de.toLowerCase()))||(i[de]="@widgetic/api-sdk/1.0.45");const o=this.configuration.apiKey;if(o&&!i.Authorization)try{const e=yield o("Authorization");e&&(i.Authorization=e.startsWith("Bearer ")?e:`Bearer ${e}`)}catch(e){}const r="function"==typeof t?t:()=>ae(this,void 0,void 0,(function*(){return t})),a={method:e.method,headers:i,body:e.body,credentials:this.configuration.credentials},s=Object.assign(Object.assign({},a),yield r({init:a,context:e}));let d;var u;u=s.body,d="undefined"!=typeof FormData&&u instanceof FormData||s.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(s.body)?s.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(s.body):s.body;return{url:n,init:Object.assign(Object.assign({},s),{body:d})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}ce.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class pe extends Error{constructor(e,t,n=null){super(t),this.response=e,this.name="ResponseError",this.code=n}}class he extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class ge extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function fe(e,t=""){return Object.keys(e).map((n=>ve(n,e[n],t))).filter((e=>e.length>0)).join("&")}function ve(e,t,n=""){const i=n+(n.length?`[${e}]`:e);if(t instanceof Array){const e=t.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${e}`}if(t instanceof Set){return ve(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?fe(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}function me(e,t){return Object.keys(e).reduce(((n,i)=>Object.assign(Object.assign({},n),{[i]:t(e[i])})),{})}class we{constructor(e,t=e=>e){this.raw=e,this.transformer=t}unwrapSuccessEnvelope(e){if(e&&"object"==typeof e&&"success"in e&&"data"in e){const{success:t,data:n,meta:i}=e,o="boolean"!=typeof t||t;return Array.isArray(n)?{success:o,data:n,meta:i,rawData:n}:n&&"object"==typeof n?Object.assign({success:o,data:n,meta:i},n):{success:o,data:n,meta:i}}return e}value(){return ae(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class ye{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){}))}}function Ie(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:null==e.endpointId?void 0:e.endpointId,url:null==e.url?void 0:e.url,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Re(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:e.endpointId,url:e.url,secret:e.secret,createdAt:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Te(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,abTestId:null==e.abTestId?void 0:e.abTestId,compositionId:null==e.compositionId?void 0:e.compositionId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,trafficPercentage:null==e.trafficPercentage?void 0:e.trafficPercentage,goalTarget:null==e.goalTarget?void 0:e.goalTarget,embedCode:null==e.embedCode?void 0:e.embedCode,totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function ke(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,organizationId:null==e.organizationId?void 0:e.organizationId,workspaceType:null==e.workspaceType?void 0:e.workspaceType,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,status:null==e.status?void 0:e.status,successMetrics:null==e.successMetrics?void 0:e.successMetrics,primaryMetric:null==e.primaryMetric?void 0:e.primaryMetric,confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel,minSampleSize:null==e.minSampleSize?void 0:e.minSampleSize,autoGraduate:null==e.autoGraduate?void 0:e.autoGraduate,graduationThreshold:null==e.graduationThreshold?void 0:e.graduationThreshold,startDate:null==e.startDate?void 0:new Date(e.startDate),endDate:null==e.endDate?void 0:new Date(e.endDate),durationDays:null==e.durationDays?void 0:e.durationDays,winningVariantId:null==e.winningVariantId?void 0:e.winningVariantId,graduatedAt:null==e.graduatedAt?void 0:new Date(e.graduatedAt),statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(Te)}}(e)}function Ae(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,ab_test_id:null==e.ab_test_id?void 0:e.ab_test_id,variant_id:null==e.variant_id?void 0:e.variant_id,user_id:null==e.user_id?void 0:e.user_id,session_id:null==e.session_id?void 0:e.session_id,user_identifier_hash:null==e.user_identifier_hash?void 0:e.user_identifier_hash,assigned_at:null==e.assigned_at?void 0:new Date(e.assigned_at)}}(e)}function qe(e){return function(e){if(null==e)return e;return{hasMeaningfulContrast:null==e.hasMeaningfulContrast?void 0:e.hasMeaningfulContrast,primaryDriver:null==e.primaryDriver?void 0:e.primaryDriver,cognitiveClarityScore:null==e.cognitiveClarityScore?void 0:e.cognitiveClarityScore,safeToGraduate:null==e.safeToGraduate?void 0:e.safeToGraduate,qualitativeReason:null==e.qualitativeReason?void 0:e.qualitativeReason}}(e)}function Se(e){return function(e){if(null==e)return e;return{action:null==e.action?void 0:e.action,reason:null==e.reason?void 0:e.reason,minAdditionalSamples:null==e.minAdditionalSamples?void 0:e.minAdditionalSamples}}(e)}function Ce(e){return function(e){if(null==e)return e;return{detected:null==e.detected?void 0:e.detected,pValue:null==e.pValue?void 0:e.pValue}}(e)}function Ee(e){return function(e){if(null==e)return e;return{totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,totalImpressionEvents:null==e.totalImpressionEvents?void 0:e.totalImpressionEvents,totalConversionEvents:null==e.totalConversionEvents?void 0:e.totalConversionEvents,counting:null==e.counting?void 0:e.counting,overallConversionRate:null==e.overallConversionRate?void 0:e.overallConversionRate,statisticalPower:null==e.statisticalPower?void 0:e.statisticalPower,sampleSizeNeededPerVariant:null==e.sampleSizeNeededPerVariant?void 0:e.sampleSizeNeededPerVariant,sampleRatioMismatch:null==e.sampleRatioMismatch?void 0:Ce(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function Ue(e){return function(e){if(null==e)return e;return{variantId:null==e.variantId?void 0:e.variantId,variantName:null==e.variantName?void 0:e.variantName,impressions:null==e.impressions?void 0:e.impressions,conversions:null==e.conversions?void 0:e.conversions,rawImpressions:null==e.rawImpressions?void 0:e.rawImpressions,rawConversions:null==e.rawConversions?void 0:e.rawConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,confidenceIntervalLower:null==e.confidenceIntervalLower?void 0:e.confidenceIntervalLower,confidenceIntervalUpper:null==e.confidenceIntervalUpper?void 0:e.confidenceIntervalUpper,zScore:null==e.zScore?void 0:e.zScore,pValue:null==e.pValue?void 0:e.pValue,isWinner:null==e.isWinner?void 0:e.isWinner,liftPercentage:null==e.liftPercentage?void 0:e.liftPercentage,statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,significantlyWorse:null==e.significantlyWorse?void 0:e.significantlyWorse,bayesianProbabilityToBeatControl:null==e.bayesianProbabilityToBeatControl?void 0:e.bayesianProbabilityToBeatControl}}(e)}function be(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:Ee(e.overall),variants:null==e.variants?void 0:e.variants.map(Ue),recommendation:null==e.recommendation?void 0:Se(e.recommendation)}}(e)}function _e(e){return function(e){if(null==e)return e;return{id:e.id,title:e.title,status:e.status,charCount:e.charCount,chunkCount:e.chunkCount,createdAt:new Date(e.createdAt),readyAt:null==e.readyAt?null:new Date(e.readyAt)}}(e)}function xe(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_e(e.data)}}(e)}function De(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,translationId:null==e.translationId?void 0:e.translationId,compositionId:null==e.compositionId?void 0:e.compositionId,languageCode:null==e.languageCode?void 0:e.languageCode,languageName:null==e.languageName?void 0:e.languageName,isRoot:null==e.isRoot?void 0:e.isRoot,embedCode:null==e.embedCode?void 0:e.embedCode,totalViews:null==e.totalViews?void 0:e.totalViews,status:null==e.status?void 0:e.status,translationProgress:null==e.translationProgress?void 0:e.translationProgress,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Be(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,status:null==e.status?void 0:e.status,embedCode:null==e.embedCode?void 0:e.embedCode,selectedLanguages:null==e.selectedLanguages?void 0:e.selectedLanguages,totalViews:null==e.totalViews?void 0:e.totalViews,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(De)}}(e)}function Me(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data),message:null==e.message?void 0:e.message}}(e)}function Pe(e){return function(e){if(null==e)return e;return{documents:e.documents,characters:e.characters,maxDocuments:e.maxDocuments,maxTotalChars:e.maxTotalChars}}(e)}function Ke(e){return function(e){if(null==e)return e;return{documents:e.documents.map(_e),totals:Pe(e.totals)}}(e)}function We(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function Oe(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),country:e.country,region:null==e.region?void 0:e.region,city:null==e.city?void 0:e.city,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function ze(e){return function(e){if(null==e)return e;return{total_views:null==e.total_views?void 0:e.total_views,unique_views:null==e.unique_views?void 0:e.unique_views,total_interactions:null==e.total_interactions?void 0:e.total_interactions,unique_interactions:null==e.unique_interactions?void 0:e.unique_interactions,average_session_time:null==e.average_session_time?void 0:e.average_session_time,bounce_rate:null==e.bounce_rate?void 0:e.bounce_rate}}(e)}function Ge(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),deviceType:e.deviceType,views:e.views,uniqueUsers:e.uniqueUsers,avgSessionDuration:e.avgSessionDuration,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Le(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,timestamp:new Date(e.timestamp),eventType:e.eventType,eventData:null==e.eventData?void 0:e.eventData,userId:null==e.userId?void 0:e.userId,sessionId:null==e.sessionId?void 0:e.sessionId,ipAddress:null==e.ipAddress?void 0:e.ipAddress,userAgent:null==e.userAgent?void 0:e.userAgent,referrer:null==e.referrer?void 0:e.referrer,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function $e(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),source:e.source,source_url:null==e.source_url?void 0:e.source_url,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function je(e){return function(e){if(null==e)return e;return{summary:ze(e.summary),devices:e.devices.map(Ge),geography:e.geography.map(Oe),referrers:e.referrers.map($e),events:null==e.events?void 0:e.events.map(Le)}}(e)}function Ne(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(Le),totalEvents:null==e.totalEvents?void 0:e.totalEvents,databaseStored:null==e.databaseStored?void 0:e.databaseStored,axiomStreamed:null==e.axiomStreamed?void 0:e.axiomStreamed,processingTimeMs:null==e.processingTimeMs?void 0:e.processingTimeMs}}(e)}function Ve(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,eventType:e.eventType,eventData:e.eventData,userId:e.userId,sessionId:e.sessionId,ipAddress:e.ipAddress,userAgent:e.userAgent,referrer:e.referrer}}(e,!1)}function Xe(e){return function(e){if(null==e)return e;return{events:e.events.map(Ve)}}(e,!1)}function Fe(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function He(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function Ye(e){return function(e){if(null==e)return e;return{should_stop:null==e.should_stop?void 0:e.should_stop,reason:null==e.reason?void 0:e.reason,new_status:null==e.new_status?void 0:e.new_status}}(e)}function Ze(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ye(e.data)}}(e)}function Je(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name}}(e)}function Qe(e){return function(e){if(null==e)return e;return{id:e.id,creatorId:e.creatorId,widgetId:e.widgetId,name:e.name,content:e.content,contentVersion:null==e.contentVersion?void 0:e.contentVersion,status:e.status,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),embedSettings:null==e.embedSettings?void 0:e.embedSettings,design:null==e.design?void 0:e.design,databaseId:null==e.databaseId?void 0:e.databaseId,projectId:null==e.projectId?void 0:e.projectId,managedUserId:null==e.managedUserId?void 0:e.managedUserId,direct:null==e.direct?void 0:e.direct,lastEditedBy:null==e.lastEditedBy?void 0:Je(e.lastEditedBy),lastEditedAt:null==e.lastEditedAt?void 0:new Date(e.lastEditedAt)}}(e)}function et(e){return function(e){if(null==e)return e;return{url:e.url,refreshSeconds:e.refreshSeconds}}(e)}function tt(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function nt(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(tt),rows:e.rows}}(e)}function it(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(nt)}}(e)}function ot(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function rt(e){return function(e){if(null==e)return e;return{group:null==e.group?void 0:e.group,count:null==e.count?void 0:e.count,avg:null==e.avg?void 0:e.avg,min:null==e.min?void 0:e.min,max:null==e.max?void 0:e.max,sum:null==e.sum?void 0:e.sum}}(e)}function at(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(rt),truncated:null==e.truncated?void 0:e.truncated}}(e)}function st(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,table:e.table,totalRows:e.totalRows,tallies:null==e.tallies?null:e.tallies.map(ot),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:at(e.aggregates)}}(e)}function dt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,compositionId:null==e.compositionId?void 0:e.compositionId,version:null==e.version?void 0:e.version,content:null==e.content?void 0:e.content,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function ut(e){return function(e){if(null==e)return e;return{path:e.path,message:e.message,expected:null==e.expected?void 0:e.expected,actual:null==e.actual?void 0:e.actual}}(e)}function lt(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function ct(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:lt(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent,item:null==e.item?void 0:e.item}}(e)}function pt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ae(e.data)}}(e)}function ht(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,compositionId:e.compositionId,trafficPercentage:e.trafficPercentage,goalTarget:e.goalTarget}}(e,!1)}function gt(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,workspaceType:e.workspaceType,variants:e.variants.map(ht),successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function ft(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function vt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Qe(e.data),meta:null==e.meta?void 0:ft(e.meta)}}(e)}function mt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ct(e.data)}}(e)}function wt(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function yt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function It(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function Rt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Qe(e.data),meta:null==e.meta?void 0:It(e.meta)}}(e)}function Tt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data),message:null==e.message?void 0:e.message}}(e)}function kt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId,warnings:null==e.warnings?void 0:e.warnings}}(e)}function At(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:kt(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function qt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Re(e.data)}}(e)}function St(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data)}}(e)}function Ct(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Et(e){return function(e){if(null==e)return e;return{deleted:null==e.deleted?void 0:e.deleted,contentVersion:null==e.contentVersion?void 0:e.contentVersion}}(e)}function Ut(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function bt(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function _t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:bt(e.data)}}(e)}function xt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Dt(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(e)}function Bt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Dt(e.data)}}(e)}function Mt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId}}(e)}function Pt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Mt(e.data),warnings:null==e.warnings?void 0:e.warnings}}(e)}function Kt(e){return function(e){if(null==e)return e;return{token:null==e.token?void 0:e.token,tokenType:null==e.tokenType?void 0:e.tokenType,expiresIn:null==e.expiresIn?void 0:e.expiresIn,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt),scopes:null==e.scopes?void 0:e.scopes}}(e)}function Wt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Kt(e.data)}}(e)}function Ot(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,composition_id:null==e.composition_id?void 0:e.composition_id,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage,goal_target:null==e.goal_target?void 0:e.goal_target}}(e)}function zt(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,name:null==e.name?void 0:e.name,status:null==e.status?void 0:e.status,variants:null==e.variants?void 0:e.variants.map(Ot),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(e)}function Gt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ke(e.data)}}(e)}function Lt(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total}}(e)}function $t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Qe),meta:null==e.meta?void 0:Lt(e.meta)}}(e)}function jt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,tracking:null==e.tracking?void 0:e.tracking,supportsElementTarget:null==e.supportsElementTarget?void 0:e.supportsElementTarget,available:null==e.available?void 0:e.available,unavailableReason:null==e.unavailableReason?void 0:e.unavailableReason}}(e)}function Nt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(jt)}}(e)}function Vt(e){return function(e){if(null==e)return e;return{selector:null==e.selector?void 0:e.selector,label:null==e.label?void 0:e.label,kind:null==e.kind?void 0:e.kind,tag:null==e.tag?void 0:e.tag,metrics:null==e.metrics?void 0:e.metrics,preferred:null==e.preferred?void 0:e.preferred,matchCount:null==e.matchCount?void 0:e.matchCount}}(e)}function Xt(e){return function(e){if(null==e)return e;return{metric:null==e.metric?void 0:e.metric,label:null==e.label?void 0:e.label,description:null==e.description?void 0:e.description,selector:null==e.selector?void 0:e.selector,recommended:null==e.recommended?void 0:e.recommended}}(e)}function Ft(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,complete:null==e.complete?void 0:e.complete,note:null==e.note?void 0:e.note,goals:null==e.goals?void 0:e.goals.map(Xt),targets:null==e.targets?void 0:e.targets.map(Vt)}}(e)}function Ht(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ft(e.data)}}(e)}function Yt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Qe(e.data)}}(e)}function Zt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,contentItems:null==e.contentItems?void 0:e.contentItems,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Jt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function Qt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,theme:null==e.theme?void 0:e.theme,componentGroups:null==e.componentGroups?void 0:e.componentGroups,metadata:null==e.metadata?void 0:e.metadata}}(e)}function en(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,version:null==e.version?void 0:e.version,type:null==e.type?void 0:e.type,componentGroups:null==e.componentGroups?void 0:e.componentGroups,defaults:null==e.defaults?void 0:e.defaults}}(e)}function tn(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,previewUrl:null==e.previewUrl?void 0:e.previewUrl}}(e)}function nn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(dt)}}(e)}function on(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,error:null==e.error?void 0:e.error}}(e)}function rn(e){return function(e){if(null==e)return e;return{compositions:null==e.compositions?void 0:e.compositions.map(Qe),errors:null==e.errors?void 0:e.errors.map(on)}}(e)}function an(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(e)}function sn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:an(e.data)}}(e)}function dn(e){return function(e){if(null==e)return e;return{name:null==e.name?void 0:e.name,nativeName:null==e.nativeName?void 0:e.nativeName,region:null==e.region?void 0:e.region,isPreselected:null==e.isPreselected?void 0:e.isPreselected}}(e)}function un(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:me(e.languages,dn),preselected:null==e.preselected?void 0:e.preselected}}(e)}function ln(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:un(e.data)}}(e)}function cn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data)}}(e)}function pn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views,percentage:null==e.percentage?void 0:e.percentage}}(e)}function hn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views}}(e)}function gn(e){return function(e){if(null==e)return e;return{totalViews:null==e.totalViews?void 0:e.totalViews,languageBreakdown:null==e.languageBreakdown?void 0:e.languageBreakdown.map(pn),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(hn),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(e)}function fn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:gn(e.data)}}(e)}function vn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,languageCompositions:null==e.languageCompositions?void 0:e.languageCompositions,status:null==e.status?void 0:e.status}}(e)}function mn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:vn(e.data)}}(e)}function wn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Be),count:null==e.count?void 0:e.count}}(e)}function yn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,composition_id:null==e.composition_id?void 0:e.composition_id,name:null==e.name?void 0:e.name,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage}}(e)}function In(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,version:null==e.version?void 0:e.version,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),isPublished:null==e.isPublished?void 0:e.isPublished,prompt:null==e.prompt?void 0:e.prompt,publishedBy:null==e.publishedBy?void 0:e.publishedBy}}(e)}function Rn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(In)}}(e)}function Tn(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total,limit:null==e.limit?void 0:e.limit,offset:null==e.offset?void 0:e.offset,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage}}(e)}function kn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Mt),meta:null==e.meta?void 0:Tn(e.meta)}}(e)}function An(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Mt),errors:null==e.errors?void 0:e.errors.map(on)}}(e)}function qn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data)}}(e)}function Sn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:qe(e.data)}}(e)}function Cn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:be(e.data)}}(e)}function En(e){return function(e){if(null==e)return e;return{count:null==e.count?void 0:e.count,workspace_type:null==e.workspace_type?void 0:e.workspace_type}}(e)}function Un(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(ke),meta:null==e.meta?void 0:En(e.meta)}}(e)}function bn(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,month:e.month,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function _n(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function xn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:We(e.data)}}(e)}function Dn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function Bn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Dn(e.data)}}(e)}function Mn(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function Pn(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function Kn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:Pn(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function Wn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function On(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:Wn(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function zn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:On(e.data)}}(e)}function Gn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data),message:null==e.message?void 0:e.message}}(e)}function Ln(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data),message:null==e.message?void 0:e.message}}(e)}function $n(e){return function(e){if(null==e)return e;return{limit:null==e.limit?void 0:e.limit,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage,nextCursor:null==e.nextCursor?void 0:e.nextCursor,previousCursor:null==e.previousCursor?void 0:e.previousCursor}}(e)}function jn(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:$n(e.pagination)}}(e)}function Nn(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:jn(e.meta)}}(e)}function Vn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Xn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString(),user_id:e.user_id,session_id:e.session_id}}(e,!1)}function Fn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Xn(e.data)}}(e,!1)}function Hn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message,count:null==e.count?void 0:e.count}}(e)}function Yn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,user_id:e.user_id,session_id:e.session_id,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString()}}(e,!1)}function Zn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Yn(e.data)}}(e,!1)}function Jn(e){return function(e){if(null==e)return e;return{events:e.events.map(Zn)}}(e,!1)}function Qn(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function ei(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,variants:null==e.variants?void 0:e.variants.map(Qn),confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function ti(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function ni(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function ii(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ni(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function oi(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(e)}function ri(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:oi(e.data)}}(e)}function ai(e){return function(e){if(null==e)return e;return{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(ut),warnings:null==e.warnings?void 0:e.warnings.map(ut),sanitizedContent:null==e.sanitizedContent?void 0:e.sanitizedContent}}(e)}function si(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,reason:null==e.reason?void 0:e.reason,message:null==e.message?void 0:e.message}}(e)}function di(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:si(e.data)}}(e)}function ui(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,tokenType:null==e.tokenType?void 0:e.tokenType,scopes:null==e.scopes?void 0:e.scopes,userId:null==e.userId?void 0:e.userId,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt)}}(e)}function li(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ui(e.data)}}(e)}function ci(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,impact:null==e.impact?void 0:e.impact}}(e)}function pi(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,reason:null==e.reason?void 0:e.reason}}(e)}function hi(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,blockers:null==e.blockers?void 0:e.blockers.map(pi),warnings:null==e.warnings?void 0:e.warnings.map(ci)}}(e)}function gi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:hi(e.data)}}(e)}function fi(e){return function(e){if(null==e)return e;return{variant:null==e.variant?void 0:e.variant,metric:null==e.metric?void 0:e.metric,reason:null==e.reason?void 0:e.reason}}(e)}function vi(e){return function(e){if(null==e)return e;return{is_valid:null==e.is_valid?void 0:e.is_valid,issues:null==e.issues?void 0:e.issues.map(fi),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function mi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:vi(e.data)}}(e)}function wi(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function yi(e){return function(e){if(null==e)return e;return{variants:e.variants.map(wi),success_metrics:e.success_metrics}}(e,!1)}function Ii(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,affected_compositions:null==e.affected_compositions?void 0:e.affected_compositions,blockers:null==e.blockers?void 0:e.blockers.map(pi),warnings:null==e.warnings?void 0:e.warnings.map(ci)}}(e)}function Ri(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ii(e.data)}}(e)}function Ti(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,weekNumber:e.weekNumber,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}var ki="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ai extends ce{assignVariantRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new ge("assignVariantRequest",'Required parameter "assignVariantRequest" was null or undefined when calling assignVariant().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/{id}/assign".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.assignVariantRequest,o=r,null==o?o:{user_id:o.user_id,session_id:o.session_id})},t);var o,r;return new we(i,(e=>Te(e)))}))}assignVariant(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling checkWorkspaceABTestAutoStop().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/auto-stop-check".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Ze(e)))}))}checkWorkspaceABTestAutoStop(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new ge("createABTestAssignmentRequest",'Required parameter "createABTestAssignmentRequest" was null or undefined when calling createABTestAssignment().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/assignments",method:"POST",headers:n,query:{},body:(r=e.createABTestAssignmentRequest,o=r,null==o?o:{experiment_id:o.experiment_id,variant_id:o.variant_id,user_id:o.user_id,session_id:o.session_id,device_type:o.device_type,user_agent:o.user_agent,ip_address:o.ip_address,country_code:o.country_code})},t);var o,r;return new we(i,(e=>pt(e)))}))}createABTestAssignment(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABConversionWebhookRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABConversionWebhook().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>qt(e)))}))}createWorkspaceABConversionWebhook(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new ge("createABTestRequest",'Required parameter "createABTestRequest" was null or undefined when calling createWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:gt(e.createABTestRequest)},t);return new we(i,(e=>St(e)))}))}createWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABConversionWebhookRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>_t(e)))}))}deleteWorkspaceABConversionWebhook(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling deleteWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>xt(e)))}))}deleteWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getABTestConfig().');const n=yield this.request({path:"/ab-tests/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>zt(e)))}))}getABTestConfig(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(e){return ki(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/metrics/available",method:"GET",headers:t,query:{}},e);return new we(n,(e=>Nt(e)))}))}getAvailableMetrics(e){return ki(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionABGoalTargets().');const n={};null!=e.metric&&(n.metric=e.metric);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/compositions/{id}/ab-goal-targets".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>Ht(e)))}))}getCompositionABGoalTargets(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getVariantConfig().');const n=yield this.request({path:"/ab-tests/variants/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>yn(e)))}))}getVariantConfig(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABConversionWebhookRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>qn(e)))}))}getWorkspaceABConversionWebhook(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>St(e)))}))}getWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestDiagnosis().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/diagnosis".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Sn(e)))}))}getWorkspaceABTestDiagnosis(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestStatistics().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/statistics".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Cn(e)))}))}getWorkspaceABTestStatistics(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceABTests().');const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:i,query:n},t);return new we(o,(e=>Un(e)))}))}listWorkspaceABTests(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling pauseWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/pause".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>St(e)))}))}pauseWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}rotateWorkspaceABConversionWebhookSecretRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling rotateWorkspaceABConversionWebhookSecret().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook/rotate".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>qt(e)))}))}rotateWorkspaceABConversionWebhookSecret(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.rotateWorkspaceABConversionWebhookSecretRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new ge("setWorkspaceABTestDurationRequest",'Required parameter "setWorkspaceABTestDurationRequest" was null or undefined when calling setWorkspaceABTestDuration().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/duration".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:(r=e.setWorkspaceABTestDurationRequest,o=r,null==o?o:{duration_days:o.duration_days})},t);var o,r;return new we(i,(e=>Gn(e)))}))}setWorkspaceABTestDuration(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling startWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/start".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>St(e)))}))}startWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling stopWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/stop".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{},body:(r=e.stopWorkspaceABTestRequest,o=r,null==o?o:{winning_variant_id:o.winning_variant_id,winningVariantId:o.winningVariantId})},t);var o,r;return new we(i,(e=>Ln(e)))}))}stopWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new ge("trackABTestEventRequest",'Required parameter "trackABTestEventRequest" was null or undefined when calling trackABTestEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/events",method:"POST",headers:n,query:{},body:Fn(e.trackABTestEventRequest)},t);return new we(i,(e=>Vn(e)))}))}trackABTestEvent(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new ge("trackBulkABTestEventsRequest",'Required parameter "trackBulkABTestEventsRequest" was null or undefined when calling trackBulkABTestEvents().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/bulk",method:"POST",headers:n,query:{},body:Jn(e.trackBulkABTestEventsRequest)},t);return new we(i,(e=>Hn(e)))}))}trackBulkABTestEvents(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new ge("updateABTestRequest",'Required parameter "updateABTestRequest" was null or undefined when calling updateWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:ei(e.updateABTestRequest)},t);return new we(i,(e=>St(e)))}))}updateWorkspaceABTest(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new ge("validateWorkspaceCompositionDeletionRequest",'Required parameter "validateWorkspaceCompositionDeletionRequest" was null or undefined when calling validateWorkspaceCompositionDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-composition-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceCompositionDeletionRequest,o=r,null==o?o:{composition_ids:o.composition_ids})},t);var o,r;return new we(i,(e=>gi(e)))}))}validateWorkspaceCompositionDeletion(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new ge("validateWorkspaceGoalTrackingRequest",'Required parameter "validateWorkspaceGoalTrackingRequest" was null or undefined when calling validateWorkspaceGoalTracking().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-goal-tracking".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:yi(e.validateWorkspaceGoalTrackingRequest)},t);return new we(i,(e=>mi(e)))}))}validateWorkspaceGoalTracking(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new ge("validateWorkspaceWidgetDeletionRequest",'Required parameter "validateWorkspaceWidgetDeletionRequest" was null or undefined when calling validateWorkspaceWidgetDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-widget-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceWidgetDeletionRequest,o=r,null==o?o:{widget_id:o.widget_id})},t);var o,r;return new we(i,(e=>Ri(e)))}))}validateWorkspaceWidgetDeletion(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.value()}))}}var qi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Si extends ce{analyticsEventsBulkPostRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.analyticsEventsBulkPostRequest)throw new ge("analyticsEventsBulkPostRequest",'Required parameter "analyticsEventsBulkPostRequest" was null or undefined when calling analyticsEventsBulkPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/analytics/events/bulk",method:"POST",headers:n,query:{},body:Xe(e.analyticsEventsBulkPostRequest)},t);return new we(i,(e=>Ne(e)))}))}analyticsEventsBulkPost(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.analyticsEventsBulkPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDailyGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDailyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/daily".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Ct)))}))}compositionsIdAnalyticsDailyGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDailyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDashboardGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDashboardGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.includeEvents&&(n.include_events=e.includeEvents);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/dashboard".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>je(e)))}))}compositionsIdAnalyticsDashboardGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDashboardGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDevicesGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDevicesGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.deviceType&&(n.device_type=e.deviceType),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/devices".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Ge)))}))}compositionsIdAnalyticsDevicesGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDevicesGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.eventType&&(n.event_type=e.eventType),null!=e.userId&&(n.user_id=e.userId),null!=e.sessionId&&(n.session_id=e.sessionId),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Le)))}))}compositionsIdAnalyticsEventsGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsPostRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsPost().');if(null==e.newAnalyticsEvent)throw new ge("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling compositionsIdAnalyticsEventsPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:Ve(e.newAnalyticsEvent)},t);return new we(i,(e=>Le(e)))}))}compositionsIdAnalyticsEventsPost(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsGeographyGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsGeographyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.country&&(n.country=e.country),null!=e.region&&(n.region=e.region),null!=e.city&&(n.city=e.city),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/geography".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Oe)))}))}compositionsIdAnalyticsGeographyGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsGeographyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsMonthlyGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsMonthlyGet().');const n={};null!=e.month&&(n.month=e.month),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/monthly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(bn)))}))}compositionsIdAnalyticsMonthlyGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsMonthlyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsReferrersGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsReferrersGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.source&&(n.source=e.source),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/referrers".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map($e)))}))}compositionsIdAnalyticsReferrersGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsReferrersGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsWeeklyGetRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsWeeklyGet().');const n={};null!=e.weekNumber&&(n.week_number=e.weekNumber),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/weekly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>e.map(Ti)))}))}compositionsIdAnalyticsWeeklyGet(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsWeeklyGetRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(e){return qi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/flush",method:"POST",headers:t,query:{}},e);return new we(n,(e=>Nn(e)))}))}flushAxiomEvents(e){return qi(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(e){return qi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/status",method:"GET",headers:t,query:{}},e);return new we(n,(e=>Nn(e)))}))}getAxiomStatus(e){return qi(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}}var Ci="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ei extends ce{completeSignupRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new ge("completeSignupRequest",'Required parameter "completeSignupRequest" was null or undefined when calling completeSignup().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/complete-signup",method:"POST",headers:n,query:{},body:(r=e.completeSignupRequest,o=r,null==o?o:{userId:o.userId,email:o.email,role:o.role,plan:o.plan,token:o.token})},t);var o,r;return new ye(i)}))}completeSignup(e,t){return Ci(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling confirmEmail().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/confirm-email",method:"POST",headers:n,query:{},body:ti(e.updateEmailRequest)},t);return new ye(i)}))}confirmEmail(e,t){return Ci(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new ge("bridgeId",'Required parameter "bridgeId" was null or undefined when calling consumeOAuthSessionBridge().');const n=yield this.request({path:"/auth/oauth-session/{bridgeId}".replace("{bridgeId}",encodeURIComponent(String(e.bridgeId))),method:"GET",headers:{},query:{}},t);return new ye(n)}))}consumeOAuthSessionBridge(e,t){return Ci(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return Ci(this,void 0,void 0,(function*(){const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/delete-account",method:"POST",headers:n,query:{},body:(r=e.deleteAccountRequest,o=r,null==o?o:{password:o.password})},t);var o,r;return new ye(i)}))}deleteAccount(){return Ci(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return Ci(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/session",method:"GET",headers:t,query:{}},e);return new ye(n)}))}getSession(e){return Ci(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return Ci(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/get-metadata",method:"GET",headers:t,query:{}},e);return new ye(n)}))}getUserMetadata(e){return Ci(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.provider)throw new ge("provider",'Required parameter "provider" was null or undefined when calling initiateOAuth().');const n={};null!=e.redirectTo&&(n.redirectTo=e.redirectTo),null!=e.role&&(n.role=e.role),null!=e.plan&&(n.plan=e.plan);const i=yield this.request({path:"/auth/oauth/{provider}".replace("{provider}",encodeURIComponent(String(e.provider))),method:"GET",headers:{},query:n},t);return new ye(i)}))}initiateOAuth(e,t){return Ci(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new ge("loginUserRequest",'Required parameter "loginUserRequest" was null or undefined when calling loginUser().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/login",method:"POST",headers:n,query:{},body:(r=e.loginUserRequest,o=r,null==o?o:{email:o.email,password:o.password})},t);var o,r;return new we(i,(e=>_n(e)))}))}loginUser(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return Ci(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/logout",method:"POST",headers:t,query:{}},e);return new ye(n)}))}logoutUser(e){return Ci(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}refreshSessionRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new ge("refreshSessionRequest",'Required parameter "refreshSessionRequest" was null or undefined when calling refreshSession().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/refresh",method:"POST",headers:n,query:{},body:(r=e.refreshSessionRequest,o=r,null==o?o:{refresh_token:o.refresh_token})},t);var o,r;return new ye(i)}))}refreshSession(e,t){return Ci(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resendConfirmation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/resend-confirmation",method:"POST",headers:n,query:{},body:Mn(e.resetPasswordRequest)},t);return new ye(i)}))}resendConfirmation(e,t){return Ci(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resetPassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/reset-password",method:"POST",headers:n,query:{},body:Mn(e.resetPasswordRequest)},t);return new ye(i)}))}resetPassword(e,t){return Ci(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new ge("signupUserRequest",'Required parameter "signupUserRequest" was null or undefined when calling signupUser().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup",method:"POST",headers:n,query:{},body:(r=e.signupUserRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,inviteCode:o.inviteCode,name:o.name,returnTo:o.returnTo})},t);var o,r;return new ye(i)}))}signupUser(e,t){return Ci(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new ge("signupWithInvitationRequest",'Required parameter "signupWithInvitationRequest" was null or undefined when calling signupWithInvitation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup-with-invitation",method:"POST",headers:n,query:{},body:(r=e.signupWithInvitationRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,invitationId:o.invitationId,organizationId:o.organizationId})},t);var o,r;return new ye(i)}))}signupWithInvitation(e,t){return Ci(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling updateEmail().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-email",method:"POST",headers:n,query:{},body:ti(e.updateEmailRequest)},t);return new ye(i)}))}updateEmail(e,t){return Ci(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new ge("updateNameRequest",'Required parameter "updateNameRequest" was null or undefined when calling updateName().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/update-name",method:"POST",headers:n,query:{},body:(r=e.updateNameRequest,o=r,null==o?o:{token:o.token,name:o.name})},t);var o,r;return new ye(i)}))}updateName(e,t){return Ci(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new ge("updatePasswordRequest",'Required parameter "updatePasswordRequest" was null or undefined when calling updatePassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-password",method:"POST",headers:n,query:{},body:(r=e.updatePasswordRequest,o=r,null==o?o:{token:o.token,email:o.email,password:o.password})},t);var o,r;return new ye(i)}))}updatePassword(e,t){return Ci(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new ge("updateUserMetadataRequest",'Required parameter "updateUserMetadataRequest" was null or undefined when calling updateUserMetadata().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/update-metadata",method:"POST",headers:n,query:{},body:(r=e.updateUserMetadataRequest,o=r,null==o?o:{metadata:o.metadata})},t);var o,r;return new ye(i)}))}updateUserMetadata(e,t){return Ci(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.code)throw new ge("code",'Required parameter "code" was null or undefined when calling validateInviteCode().');const n={};null!=e.code&&(n.code=e.code);const i=yield this.request({path:"/auth/invite-code",method:"GET",headers:{},query:n},t);return new we(i,(e=>di(e)))}))}validateInviteCode(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.value()}))}}var Ui="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class bi extends ce{addAiAnswersKnowledgeDocumentRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new ge("addAiAnswersKnowledgeDocumentRequest",'Required parameter "addAiAnswersKnowledgeDocumentRequest" was null or undefined when calling addAiAnswersKnowledgeDocument().');const n={"Content-Type":"application/json"};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addAiAnswersKnowledgeDocumentRequest,o=r,null==o?o:{title:o.title,text:o.text})},t);var o,r;return new we(i,(e=>xe(e)))}))}addAiAnswersKnowledgeDocument(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling checkCompositionAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Fe(e)))}))}checkCompositionAccess(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new ge("createCompositionContentItemRequest",'Required parameter "createCompositionContentItemRequest" was null or undefined when calling createCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))),method:"POST",headers:n,query:{},body:wt(e.createCompositionContentItemRequest)},t);return new we(i,(e=>mt(e)))}))}createCompositionContentItem(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new ge("body",'Required parameter "body" was null or undefined when calling createCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"POST",headers:n,query:{},body:e.body},t);return new we(i,(e=>yt(e)))}))}createCompositionDatabaseRecord(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new ge("newComposition",'Required parameter "newComposition" was null or undefined when calling createComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions",method:"POST",headers:n,query:{},body:(r=e.newComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,creatorId:o.creatorId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>vt(e)))}))}createComposition(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}deleteCompositionContentItemRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling deleteCompositionContentItem().');const n={};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Et(e)))}))}deleteCompositionContentItem(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDataSource().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling deleteCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>yt(e)))}))}deleteCompositionDatabaseRecord(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteComposition().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new ye(i)}))}deleteComposition(e,t){return Ui(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}describeCompositionEntriesRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling describeCompositionEntries().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/entries".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>it(e)))}))}describeCompositionEntries(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling duplicateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateCompositionRequest,o=r,null==o?o:{name:o.name,includeDatabase:o.includeDatabase})},t);var o,r;return new we(i,(e=>Bt(e)))}))}duplicateComposition(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getAiAnswersKnowledge().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Gt(e)))}))}getAiAnswersKnowledge(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return Ui(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.sort&&(n.sort=e.sort),null!=e.widgetId&&(n.widgetId=e.widgetId),null!=e.workspace&&(n.workspace=e.workspace),null!=e.projectFolder&&(n.projectFolder=e.projectFolder),null!=e.status&&(n.status=e.status),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions",method:"GET",headers:i,query:n},t);return new we(o,(e=>$t(e)))}))}getAllCompositions(){return Ui(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionById().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Yt(e)))}))}getCompositionById(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionContentSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Zt(e)))}))}getCompositionContentSchema(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionContent().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionContent(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDataSource().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>et(e)))}))}getCompositionDataSource(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling getCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>yt(e)))}))}getCompositionDatabaseRecord(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecords().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Jt(e)))}))}getCompositionDatabaseRecords(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDesignSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Qt(e)))}))}getCompositionDesignSchema(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDesign().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionDesign(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/embed".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>en(e)))}))}getCompositionEmbedSchema(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSettings().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/embed-settings".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getCompositionEmbedSettings(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionPreview().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/preview".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>tn(e)))}))}getCompositionPreview(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionVersions().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/versions".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>nn(e)))}))}getCompositionVersions(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new ge("getCompositionsBatchRequest",'Required parameter "getCompositionsBatchRequest" was null or undefined when calling getCompositionsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/batch",method:"POST",headers:n,query:{},body:(r=e.getCompositionsBatchRequest,o=r,null==o?o:{compositionIds:o.compositionIds})},t);var o,r;return new we(i,(e=>rn(e)))}))}getCompositionsBatch(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new ge("requestBody",'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"PATCH",headers:n,query:{},body:e.requestBody},t);return new we(i,(e=>mt(e)))}))}patchCompositionContentItem(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling readCompositionEntries().');const n={};null!=e.groupBy&&(n.groupBy=e.groupBy),null!=e.rows&&(n.rows=e.rows),null!=e.aggregate&&(n.aggregate=e.aggregate),null!=e.column&&(n.column=e.column),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.context&&(n.context=e.context),null!=e.filter&&(n.filter=e.filter);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/entries/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new we(o,(e=>st(e)))}))}readCompositionEntries(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new ge("documentId",'Required parameter "documentId" was null or undefined when calling removeAiAnswersKnowledgeDocument().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/{documentId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{documentId}",encodeURIComponent(String(e.documentId))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>xn(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new ge("setCompositionDataSourceRequest",'Required parameter "setCompositionDataSourceRequest" was null or undefined when calling setCompositionDataSource().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setCompositionDataSourceRequest,o=r,null==o?o:{url:o.url,refreshSeconds:o.refreshSeconds})},t);var o,r;return new we(i,(e=>et(e)))}))}setCompositionDataSource(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new ge("setDynamicContentRequest",'Required parameter "setDynamicContentRequest" was null or undefined when calling setDynamicContent().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setDynamicContentRequest,o=r,null==o?o:{content:o.content,validate:o.validate,partial:o.partial,version:o.version,source:o.source})},t);var o,r;return new we(i,(e=>Kn(e)))}))}setDynamicContent(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new ge("body",'Required parameter "body" was null or undefined when calling updateCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"PUT",headers:n,query:{},body:e.body},t);return new we(i,(e=>yt(e)))}))}updateCompositionDatabaseRecord(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new ge("updateCompositionStatusRequest",'Required parameter "updateCompositionStatusRequest" was null or undefined when calling updateCompositionStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateCompositionStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new we(i,(e=>Qe(e)))}))}updateCompositionStatus(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new ge("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId})},t);var o,r;return new we(i,(e=>Yt(e)))}))}updateComposition(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new ge("requestBody",'Required parameter "requestBody" was null or undefined when calling validateCompositionContent().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/validate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:e.requestBody},t);return new we(i,(e=>ai(e)))}))}validateCompositionContent(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}var _i="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class xi extends ce{exchangeTokenRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new ge("exchangeTokenRequest",'Required parameter "exchangeTokenRequest" was null or undefined when calling exchangeToken().');const n={"Content-Type":"application/json"};this.configuration&&this.configuration.apiKey&&(n.Authorization=yield this.configuration.apiKey("Authorization"));const i=yield this.request({path:"/tokens/exchange",method:"POST",headers:n,query:{},body:(r=e.exchangeTokenRequest,o=r,null==o?o:{scopes:o.scopes,expiresIn:o.expiresIn})},t);var o,r;return new we(i,(e=>Wt(e)))}))}exchangeToken(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return _i(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.apiKey&&(t.Authorization=yield this.configuration.apiKey("Authorization")),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("BearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/tokens/validate",method:"GET",headers:t,query:{}},e);return new we(n,(e=>li(e)))}))}validateToken(e){return _i(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var Di="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Bi extends ce{addLanguagesToTranslationRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new ge("addLanguagesToTranslationRequest",'Required parameter "addLanguagesToTranslationRequest" was null or undefined when calling addLanguagesToTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addLanguagesToTranslationRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new we(i,(e=>Me(e)))}))}addLanguagesToTranslation(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new ge("createTranslationRequest",'Required parameter "createTranslationRequest" was null or undefined when calling createTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations",method:"POST",headers:n,query:{},body:(r=e.createTranslationRequest,o=r,null==o?o:{name:o.name,description:o.description,root_composition_id:o.root_composition_id,root_language:o.root_language,selected_languages:o.selected_languages})},t);var o,r;return new we(i,(e=>Tt(e)))}))}createTranslation(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Ut(e)))}))}deleteTranslation(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return Di(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new we(t,(e=>sn(e)))}))}getLanguagePresets(e){return Di(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return Di(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new we(t,(e=>ln(e)))}))}getSupportedLanguages(e){return Di(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>cn(e)))}))}getTranslation(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslationAnalytics().');const n={};null!=e.period&&(n.period=e.period);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations/{id}/analytics".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new we(o,(e=>fn(e)))}))}getTranslationAnalytics(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getTranslationConfig().');const n=yield this.request({path:"/translations/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new we(n,(e=>mn(e)))}))}getTranslationConfig(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return Di(this,void 0,void 0,(function*(){const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations",method:"GET",headers:i,query:n},t);return new we(o,(e=>wn(e)))}))}getTranslations(){return Di(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new ge("languageCode",'Required parameter "languageCode" was null or undefined when calling removeLanguageFromTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages/{languageCode}".replace("{id}",encodeURIComponent(String(e.id))).replace("{languageCode}",encodeURIComponent(String(e.languageCode))),method:"DELETE",headers:n,query:{}},t);return new we(i,(e=>Me(e)))}))}removeLanguageFromTranslation(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling retranslateExperiment().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/retranslate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.retranslateExperimentRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new we(i,(e=>Ut(e)))}))}retranslateExperiment(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new ge("submitTranslationAnalyticsEventRequest",'Required parameter "submitTranslationAnalyticsEventRequest" was null or undefined when calling submitTranslationAnalyticsEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/translations/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.submitTranslationAnalyticsEventRequest,o=r,null==o?o:{eventType:o.eventType,language:o.language,compositionId:o.compositionId,metadata:o.metadata})},t);var o,r;return new ye(i)}))}submitTranslationAnalyticsEvent(e,t){return Di(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new ge("updateTranslationStatusRequest",'Required parameter "updateTranslationStatusRequest" was null or undefined when calling updateTranslationStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateTranslationStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new we(i,(e=>Me(e)))}))}updateTranslationStatus(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var Mi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Pi extends ce{checkWidgetAccessRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling checkWidgetAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>He(e)))}))}checkWidgetAccess(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new ge("createCompositionFromWidgetRequest",'Required parameter "createCompositionFromWidgetRequest" was null or undefined when calling createCompositionFromWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/composition".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.createCompositionFromWidgetRequest,o=r,null==o?o:{name:o.name,content:o.content,design:o.design,embedSettings:o.embedSettings,locale:o.locale,managedUserId:o.managedUserId})},t);var o,r;return new we(i,(e=>Rt(e)))}))}createCompositionFromWidget(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new ge("newWidget",'Required parameter "newWidget" was null or undefined when calling createWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets",method:"POST",headers:n,query:{},body:(r=e.newWidget,o=r,null==o?o:{name:o.name,type:o.type,content:o.content,isPublic:o.isPublic,isDraft:o.isDraft,canvasId:o.canvasId,projectId:o.projectId,organizationId:o.organizationId,workspaceType:o.workspaceType,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>At(e)))}))}createWidget(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{},body:(r=e.deleteWidgetRequest,o=r,null==o?o:{reason:o.reason})},t);var o,r;return new ye(i)}))}deleteWidget(e,t){return Mi(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling detachWidget().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/detach".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{}},t);return new ye(i)}))}detachWidget(e,t){return Mi(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling duplicateWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateWidgetRequest,o=r,null==o?o:{name:o.name,canvas_id:o.canvas_id,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new we(i,(e=>Pt(e)))}))}duplicateWidget(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getWidgetContentSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getWidgetContentSchema(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getWidgetDesignSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i)}))}getWidgetDesignSchema(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling getWidgetPublishHistory().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history".replace("{widgetId}",encodeURIComponent(String(e.widgetId))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>Rn(e)))}))}getWidgetPublishHistory(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new ge("getWidgetsBatchRequest",'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/batch",method:"POST",headers:n,query:{},body:(r=e.getWidgetsBatchRequest,o=r,null==o?o:{widgetIds:o.widgetIds})},t);var o,r;return new we(i,(e=>An(e)))}))}getWidgetsBatch(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return Mi(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.canvasId&&(n.canvasId=e.canvasId),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/widgets",method:"GET",headers:i,query:n},t);return new we(o,(e=>kn(e)))}))}getWidgets(){return Mi(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new ge("renameWidgetPublishHistoryTitleRequest",'Required parameter "renameWidgetPublishHistoryTitleRequest" was null or undefined when calling renameWidgetPublishHistoryTitle().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/title".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"PATCH",headers:n,query:{},body:(r=e.renameWidgetPublishHistoryTitleRequest,o=r,null==o?o:{commitTitle:o.commitTitle})},t);var o,r;return new we(i,(e=>Bn(e)))}))}renameWidgetPublishHistoryTitle(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling setWidgetPublishHistoryLive().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/set-live".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>zn(e)))}))}setWidgetPublishHistoryLive(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new ge("updateWidgetRequest",'Required parameter "updateWidgetRequest" was null or undefined when calling updateWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:n,query:{},body:(r=e.updateWidgetRequest,o=r,null==o?o:{name:o.name,description:o.description,canvasId:o.canvasId,projectId:o.projectId,projectFolder:o.projectFolder})},t);var o,r;return new ye(i)}))}updateWidget(e,t){return Mi(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new ge("updateWidgetRepositoryRequest",'Required parameter "updateWidgetRepositoryRequest" was null or undefined when calling updateWidgetRepository().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/repository".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateWidgetRepositoryRequest,o=r,null==o?o:{repositoryId:o.repositoryId})},t);var o,r;return new we(i,(e=>ii(e)))}))}updateWidgetRepository(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return Mi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new ge("uploadWidgetThumbnailRequest",'Required parameter "uploadWidgetThumbnailRequest" was null or undefined when calling uploadWidgetThumbnail().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/thumbnail".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.uploadWidgetThumbnailRequest,o=r,null==o?o:{imageDataUrl:o.imageDataUrl})},t);var o,r;return new we(i,(e=>ri(e)))}))}uploadWidgetThumbnail(e,t){return Mi(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}}class Ki extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class Wi{constructor(e={}){var t,n;this.currentToken=null,this.apiKey=null,this.refreshTimer=null,this.config=Object.assign({apiUrl:e.apiUrl||W(),debug:e.debug||!1},e),this.apiKey=e.apiKey||"undefined"!=typeof process&&((null===(t={NODE_ENV:"production"})||void 0===t?void 0:t.PUBLIC_API_KEY)||(null===(n={NODE_ENV:"production"})||void 0===n?void 0:n.API_KEY))||null}createTokensApiForApiKey(t){const n=new ue({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${K}`}});return new xi(n)}createTokensApiForAccessToken(t){const n=new ue({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${K}`}});return new xi(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&te.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(Wi.validatedTokens.has(this.currentToken.token))return this.currentToken.token;if(yield this.validateToken())return this.currentToken.token}if(this.apiKey)return yield this.exchangeApiKeyForJWT(t),this.currentToken.token;throw new Ki("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new Ki("No API key available for exchange","NO_API_KEY");const n={scopes:(null==t?void 0:t.scopes)||this.getDefaultScopes(),expiresIn:(null==t?void 0:t.expiresIn)||1800};try{const t=this.createTokensApiForApiKey(this.apiKey),i=yield t.exchangeToken({exchangeTokenRequest:n}),o=(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.token)||(null==i?void 0:i.token);if(!o)throw new Ki("Token exchange response missing token","INVALID_RESPONSE");const r=(null==i?void 0:i.data)||i,a={token:o,tokenType:r.tokenType||"Bearer",expiresAt:r.expiresAt?r.expiresAt instanceof Date?r.expiresAt.toISOString():String(r.expiresAt):null,scopes:r.scopes||[]};return this.setToken(a),this.config.debug&&te.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof Ki?e:new Ki(`Token exchange failed: ${e instanceof Error?e.message:String(e)}`,"TOKEN_EXCHANGE_ERROR");throw this.config.onAuthError&&this.config.onAuthError(t),t}}))}validateToken(){return e(this,void 0,void 0,(function*(){var e;if(!this.currentToken)return!1;if(Wi.validatedTokens.has(this.currentToken.token))return!0;try{const t=this.createTokensApiForAccessToken(this.currentToken.token),n=yield t.validateToken();return!0===(null==n?void 0:n.success)&&!0===(null===(e=n.data)||void 0===e?void 0:e.valid)||!0===(null==n?void 0:n.valid)?(Wi.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&te.warn("AuthManager: Token validation failed",e),!1}}))}setToken(e){this.currentToken=e,e.expiresAt&&this.scheduleTokenRefresh(e),this.config.onTokenRefreshed&&this.config.onTokenRefreshed(e.token)}clearToken(){this.currentToken&&Wi.validatedTokens.delete(this.currentToken.token),this.currentToken=null,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}isTokenValid(e){if(!e.expiresAt)return!0;const t=new Date(e.expiresAt).getTime();return Date.now()<t-6e4}scheduleTokenRefresh(t){if(!t.expiresAt||!this.apiKey)return;const n=new Date(t.expiresAt).getTime()-Date.now()-3e5;n>0&&(this.refreshTimer=setTimeout((()=>e(this,void 0,void 0,(function*(){try{yield this.exchangeApiKeyForJWT({scopes:t.scopes}),this.config.debug&&te.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&te.error("AuthManager: Automatic token refresh failed",e),this.config.onTokenExpired&&this.config.onTokenExpired()}}))),n))}getDefaultScopes(){return["compositions:read","widgets:read","projects:read"]}getCurrentTokenInfo(){return this.currentToken}hasAuthMethod(){return!(!this.apiKey&&!this.currentToken)}dispose(){this.clearToken(),this.apiKey=null,this.config.debug&&te.debug("AuthManager: Disposed")}}Wi.validatedTokens=new Set;const Oi=P,zi={};let Gi=null,Li=null;const $i={API_URL:O.PROD_API_URL,API_VERSION:O.VERSION,CLIENT_URL:O.PROD_CLIENT_URL,PRODUCTION_URL:O.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:O.ENABLE_EDITING,API_KEY:zi.PUBLIC_API_KEY,AXIOM_API_KEY:zi.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:zi.PUBLIC_STATSIG_KEY};function ji(e){Gi=e}function Ni(){return Gi}function Vi(){return Li||(Li=new Wi({apiUrl:Yi(),debug:io.enabled})),Li}function Xi(e){Vi().setApiKey(e)}function Fi(){return e(this,void 0,void 0,(function*(){if(Li&&Li.hasAuthMethod())try{return yield Li.getValidToken()}catch(e){}if(Gi)return yield Gi.getToken();const e=$i.API_KEY;if(!e)throw new Error("No authentication method available. Please configure an API key, TokenProvider, or set PUBLIC_API_KEY in environment variables.");return e}))}function Hi(e){const t=(null==e?void 0:e.tokenProvider)||Gi;if(!t){const t=(null==e?void 0:e.apiKey)||$i.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||Yi(),tokenProvider:t?new re(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||Yi(),tokenProvider:t}}function Yi(){return $i.API_URL}function Zi(){return $i.PRODUCTION_URL}function Ji(){return`${Yi()}${$i.API_VERSION}`}const Qi={isProduction:"production"===$i.NODE_ENV,apiUrl:Yi(),apiKey:$i.API_KEY},eo={renderMode:z,displayMode:G,resize:L,width:$,height:j,autoscale:N},to={customElements:V.CUSTOM_ELEMENTS,http3:V.HTTP3,resizeObserver:V.RESIZE_OBSERVER},no={batchSize:X,loadTimeout:F,retryAttempts:H},io={enabled:B,logLevel:M},oo={AXIOM_API_KEY:$i.AXIOM_API_KEY||"",AXIOM_DATASET:i,AXIOM_API_ENDPOINT:n,STATSIG_API_KEY:$i.STATSIG_KEY||"",STATSIG_API_ENDPOINT:o,ENABLE_PERFORMANCE_TRACKING:r,PERFORMANCE_SAMPLE_RATE:a,PERFORMANCE_REPORTING_ENDPOINT:d,LCP_THRESHOLD:u,LCP_WARNING_THRESHOLD:l,FID_THRESHOLD:c,FID_WARNING_THRESHOLD:p,CLS_THRESHOLD:h,CLS_WARNING_THRESHOLD:g,FCP_THRESHOLD:f,FCP_WARNING_THRESHOLD:v,TTFB_THRESHOLD:m,TTFB_WARNING_THRESHOLD:w,WIDGET_LOAD_THRESHOLD:y,WIDGET_LOAD_WARNING_THRESHOLD:I,BUNDLE_SIZE_THRESHOLD:R,BUNDLE_SIZE_WARNING_THRESHOLD:T,MAX_METRICS_BUFFER:s},ro={ROOT_MARGIN:k,THRESHOLD:A,MAX_CONCURRENT:q,RETRY_ATTEMPTS:S,RETRY_DELAY:C},ao={MAX_PRELOAD_REQUESTS:E,PREFETCH_TIMEOUT:U,CACHE_DURATION:b,MAX_CONCURRENT_REQUESTS:_,DNS_PREFETCH_ENABLED:x,PRECONNECT_ENABLED:D},so={DEBUG:B,LOG_LEVEL:M,VERSION:P};function uo(){return Hi()}var lo=Object.freeze({__proto__:null,BROWSER_FEATURES:to,DEBUG:io,DEFAULT_WIDGET_CONFIG:eo,LAZY_LOADING_CONFIG:ro,PERFORMANCE:no,PERFORMANCE_CONFIG:oo,RESOURCE_CONFIG:ao,SDK_CONFIG:so,VERSION:Oi,config:$i,createSdkConfig:Hi,environment:Qi,getApiUrl:Yi,getAuthManager:Vi,getAuthToken:Fi,getCdnUrl:Zi,getConfiguration:uo,getTokenProvider:Ni,getVersionedApiUrl:Ji,setApiKey:Xi,setTokenProvider:ji});const co="widgetic_session_id",po=new Map;let ho=null;function go(e){var t;try{const t=localStorage.getItem(e);if(null!==t)return t}catch(e){}return null!==(t=po.get(e))&&void 0!==t?t:null}function fo(e,t){po.set(e,t);try{localStorage.setItem(e,t)}catch(t){ee.debug("localStorage is not available; keeping the A/B test state in memory",{key:e,error:t})}}function vo(e){po.delete(e);try{localStorage.removeItem(e)}catch(t){ee.debug("localStorage is not available; the value was only forgotten in memory",{key:e,error:t})}}function mo(){const e=go(co);return e||(ho||(ho=function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return`visitor_${crypto.randomUUID()}`}catch(e){}return`visitor_${Math.random().toString(36).slice(2,12)}_${Date.now().toString(36)}`}()),fo(co,ho),ho)}function wo(e,t){return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}(`${t}:${e}`)%1e4/100}function yo(e,t,n){if(!e||0===e.length)return null;const i=wo(t,n);let o=0;for(const t of e)if(o+=Number(t.trafficPercentage)||0,i<o)return t;return e[e.length-1]}function Io(e,t){if(!e||!t)return!1;try{return null!==e.closest(t)}catch(e){return ee.warn("The goal target is not a selector this browser understands",{goalTarget:t,error:e}),!1}}export{Wi as A,mo as B,ue as C,eo as D,ie as E,oe as F,yo as G,lo as H,oo as P,ne as S,Bi as T,Oi as V,Pi as W,Ji as a,bi as b,Zi as c,$i as d,ee as e,io as f,Fi as g,uo as h,Xi as i,re as j,Ni as k,te as l,Yi as m,O as n,Ei as o,Hi as p,vo as q,go as r,ji as s,Io as t,Si as u,Ki as v,fo as w,Vi as x,Ai as y,co as z};
|