@apolitical/sdk 12.0.0 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/gtm","http-status-codes","socket.io-client","buffer"],t):"object"==typeof exports?exports.ApoliticalSDK=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):e.ApoliticalSDK=t(e["@apolitical/content"],e["@apolitical/error-reporting"],e["@apolitical/gtm"],e["http-status-codes"],e["socket.io-client"],e.buffer)}(this,(e,t,r,n,o,s)=>(()=>{"use strict";var a={584:t=>{t.exports=e},568:e=>{e.exports=t},59:e=>{e.exports=r},18:e=>{e.exports=s},606:e=>{e.exports=n},443:e=>{e.exports=o}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};c.r(l),c.d(l,{assets:()=>rr,auth:()=>ir,badges:()=>Cs,buildAnswer:()=>ga,buildCardCtaClickHandler:()=>ya,buildCarouselCard:()=>Sa,buildQuestion:()=>ta,carouselCards:()=>_s,contentInteraction:()=>Ur,decodeBase64:()=>Ra,default:()=>Aa,editorialPages:()=>js,getEntries:()=>p.getEntries,getEntry:()=>p.getEntry,management:()=>Yr,mgmt:()=>rn,payments:()=>an,people:()=>Ao,peopleEngagement:()=>$o,qaQuestions:()=>Hs,reportError:()=>h.reportError,search:()=>Vo,socials:()=>Is,useMaps:()=>ea});var u={};c.r(u),c.d(u,{hasBrowserEnv:()=>je,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>xe,origin:()=>qe});var d={};c.r(d),c.d(d,{read:()=>Fo,remove:()=>Go,stream:()=>qo});var p=c(584),h=c(568),f=c(59);const E={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates",PROFILE_IMAGES:"/profile-images",LINK_PREVIEWS:"/link-previews"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments",PROFILE:"/users/me/profile"}},MGMT_API:{BASE_URL:"/api/mgmt-api",ENDPOINTS:{REFERRALS:"/referrals",BULK_REFERRALS:"/bulk-referrals",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",COMMUNITIES:"/communities",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_REFERRALS:"/referrals",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{SEARCH:"/search",CHATBOT:{COURSES:"/chatbot/me/courses"}}},SOCIALS_API:{BASE_URL:"/api/socials-api",ENDPOINTS:{COMMUNITIES:"/communities"},PATHS:{ACTIVITIES:"activities",REACTIONS:"reactions"}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},BADGES:{TYPE:"badge",INCLUDE:0,LIMIT:1e3,SELECT:"fields.name,fields.slug,fields.description,fields.icon,fields.colour",SKIP:0},CAROUSELS:{CARD_TYPES:{communityPage:{INCLUDE:1,SELECT:"fields.image,fields.slug,fields.title"},customCard:{INCLUDE:1,SELECT:"fields.icon,fields.label,fields.image,fields.primaryText,fields.secondaryText,fields.authorName,fields.authorImage,fields.link,fields.openInNewTab"},solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.coverImage,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},courseJourney:{INCLUDE:1,SELECT:"fields.bannerImage,fields.slug,fields.title,fields.accessPrivacy,fields.partnerLogos"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title,fields.courseType"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COMMUNITY:{TYPE:"communityPage"},COURSES:{TYPE:"microcourse"},COURSE_JOURNEYS:{TYPE:"courseJourney"},CUSTOM_CARD:{TYPE:"customCard"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug,fields.showCarouselCta,fields.header,fields.subHeader",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-fields.postedAt",SELECT:"sys.updatedAt,fields.postedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},GOOGLE:{MAPS:{LIBRARIES:{PLACES:"places",GEOCODING:"geocoding"},VERSION:"weekly"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"},STATUS_CODES:{INVALID_TOKEN:498},ERROR_MESSAGES:{INVALID_TOKEN:"Invalid token error: Logging user out..."}},{HUBSPOT:{ENVIRONMENTS_MAPPING:S,EMAIL_IDS:g}}=E;let m={emailIds:{}};const w=({environment:e})=>{const t=(e=>{if(!e)throw new Error("Cannot map environment: Environment not defined");if(!S[e])throw new Error(`Cannot map environment: No mapping found for environment ${e}`);return S[e]})(e);m.emailIds=g[t]},y=({apiKey:e})=>{m.googleMaps={apiKey:e}},I=()=>m,{APOLITICAL:{WEBSITES:{LIVE:R,LOCALHOST:A,STAGING:T,STAGING_SPLITTER:b},ENVIRONMENTS:{PRODUCTION:O,LOCAL:N}}}=E,P=e=>{let t=null;e?t=e:"undefined"!=typeof window&&(t=window.origin||window.location.origin),t||new Error("Cannot select environment: Website not defined");let r=null;const n=t.match(T);return n?r=n[1].split(b)[0]:t===R?r=O:t.includes(A)&&(r=N),r||new Error(`Cannot select environment: No rule for website ${t}`),r};function C(e,t){return function(){return e.apply(t,arguments)}}const{toString:L}=Object.prototype,{getPrototypeOf:U}=Object,{iterator:$,toStringTag:_}=Symbol,v=(D=Object.create(null),e=>{const t=L.call(e);return D[t]||(D[t]=t.slice(8,-1).toLowerCase())});var D;const B=e=>(e=e.toLowerCase(),t=>v(t)===e),k=e=>t=>typeof t===e,{isArray:j}=Array,x=k("undefined");function M(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&G(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const F=B("ArrayBuffer"),q=k("string"),G=k("function"),V=k("number"),K=e=>null!==e&&"object"==typeof e,H=e=>{if("object"!==v(e))return!1;const t=U(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||_ in e||$ in e)},Y=B("Date"),W=B("File"),z=B("Blob"),J=B("FileList"),Q=B("URLSearchParams"),[X,Z,ee,te]=["ReadableStream","Request","Response","Headers"].map(B);function re(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),j(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(M(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function ne(e,t){if(M(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,se=e=>!x(e)&&e!==oe,ae=(ie="undefined"!=typeof Uint8Array&&U(Uint8Array),e=>ie&&e instanceof ie);var ie;const ce=B("HTMLFormElement"),le=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ue=B("RegExp"),de=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};re(r,(r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)}),Object.defineProperties(e,n)},pe=B("AsyncFunction"),he=(fe="function"==typeof setImmediate,Ee=G(oe.postMessage),fe?setImmediate:Ee?(Se=`axios@${Math.random()}`,ge=[],oe.addEventListener("message",({source:e,data:t})=>{e===oe&&t===Se&&ge.length&&ge.shift()()},!1),e=>{ge.push(e),oe.postMessage(Se,"*")}):e=>setTimeout(e));var fe,Ee,Se,ge;const me="undefined"!=typeof queueMicrotask?queueMicrotask.bind(oe):"undefined"!=typeof process&&process.nextTick||he,we={isArray:j,isArrayBuffer:F,isBuffer:M,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||G(e.append)&&("formdata"===(t=v(e))||"object"===t&&G(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&F(e.buffer),t},isString:q,isNumber:V,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:H,isEmptyObject:e=>{if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:X,isRequest:Z,isResponse:ee,isHeaders:te,isUndefined:x,isDate:Y,isFile:W,isBlob:z,isRegExp:ue,isFunction:G,isStream:e=>K(e)&&G(e.pipe),isURLSearchParams:Q,isTypedArray:ae,isFileList:J,forEach:re,merge:function e(){const{caseless:t,skipUndefined:r}=se(this)&&this||{},n={},o=(o,s)=>{const a=t&&ne(n,s)||s;H(n[a])&&H(o)?n[a]=e(n[a],o):H(o)?n[a]=e({},o):j(o)?n[a]=o.slice():r&&x(o)||(n[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&re(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(re(t,(t,n)=>{r&&G(t)?e[n]=C(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,a;const i={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],n&&!n(a,e,t)||i[a]||(t[a]=e[a],i[a]=!0);e=!1!==r&&U(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:v,kindOfTest:B,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(j(e))return e;let t=e.length;if(!V(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[$]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:ce,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:de,freezeMethods:e=>{de(e,(t,r)=>{if(G(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];G(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return j(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ne,global:oe,isContextDefined:se,isSpecCompliantForm:function(e){return!!(e&&G(e.append)&&"FormData"===e[_]&&e[$])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[n]=e;const o=j(e)?[]:{};return re(e,(e,t)=>{const s=r(e,n+1);!x(s)&&(o[t]=s)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:pe,isThenable:e=>e&&(K(e)||G(e))&&G(e.then)&&G(e.catch),setImmediate:he,asap:me,isIterable:e=>null!=e&&G(e[$])};function ye(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}we.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=ye.prototype,Re={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Re[e]={value:e}}),Object.defineProperties(ye,Re),Object.defineProperty(Ie,"isAxiosError",{value:!0}),ye.from=(e,t,r,n,o,s)=>{const a=Object.create(Ie);we.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const i=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ye.call(a,i,c,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",s&&Object.assign(a,s),a};const Ae=ye;function Te(e){return we.isPlainObject(e)||we.isArray(e)}function be(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map(function(e,t){return e=be(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Ne=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)}),Pe=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!we.isUndefined(t[e])})).metaTokens,o=r.visitor||l,s=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&we.isSpecCompliantForm(t);if(!we.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(we.isBoolean(e))return e.toString();if(!i&&we.isBlob(e))throw new Ae("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let i=e;if(e&&!o&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Te)}(e)||(we.isFileList(e)||we.endsWith(r,"[]"))&&(i=we.toArray(e)))return r=be(r),i.forEach(function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===a?Oe([r],n,s):null===a?r:r+"[]",c(e))}),!1;return!!Te(e)||(t.append(Oe(o,r,s),c(e)),!1)}const u=[],d=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),we.forEach(r,function(r,s){!0===(!(we.isUndefined(r)||null===r)&&o.call(t,r,we.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])}),u.pop()}}(e),t};function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Le(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ue=Le.prototype;Ue.append=function(e,t){this._pairs.push([e,t])},Ue.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const $e=Le;function _e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ve(e,t,r){if(!t)return e;const n=r&&r.encode||_e;we.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(s=o?o(t,r):we.isURLSearchParams(t)?t.toString():new $e(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const De=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(t){null!==t&&e(t)})}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ke={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},je="undefined"!=typeof window&&"undefined"!=typeof document,xe="object"==typeof navigator&&navigator||void 0,Me=je&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=je&&window.location.href||"http://localhost",Ge={...u,...ke},Ve=function(e){function t(e,r,n,o){let s=e[o++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),i=o>=e.length;return s=!s&&we.isArray(n)?n.length:s,i?(we.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!a):(n[s]&&we.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&we.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!a)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,(e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null},Ke={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=we.isObject(e);if(o&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n?JSON.stringify(Ve(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new Ge.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ge.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Pe(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ke.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Ae.from(e,Ae.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ge.classes.FormData,Blob:Ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{Ke.headers[e]={}});const He=Ke,Ye=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),We=Symbol("internals");function ze(e){return e&&String(e).trim().toLowerCase()}function Je(e){return!1===e||null==e?e:we.isArray(e)?e.map(Je):String(e)}function Qe(e,t,r,n,o){return we.isFunction(n)?n.call(this,t,r):(o&&(t=r),we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0)}class Xe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=ze(t);if(!o)throw new Error("header name must be a non-empty string");const s=we.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=Je(e))}const s=(e,t)=>we.forEach(e,(e,r)=>o(e,r,t));if(we.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(we.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Ye[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(we.isObject(e)&&we.isIterable(e)){let r,n,o={};for(const t of e){if(!we.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?we.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=ze(e)){const r=we.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ze(e)){const r=we.findKey(this,e);return!(!r||void 0===this[r]||t&&!Qe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=ze(e)){const o=we.findKey(r,e);!o||t&&!Qe(0,r[o],o,t)||(delete r[o],n=!0)}}return we.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Qe(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return we.forEach(this,(n,o)=>{const s=we.findKey(r,o);if(s)return t[s]=Je(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Je(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return we.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[We]=this[We]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ze(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}Xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),we.reduceDescriptors(Xe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),we.freezeMethods(Xe);const Ze=Xe;function et(e,t){const r=this||He,n=t||r,o=Ze.from(n.headers);let s=n.data;return we.forEach(e,function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function tt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,r){Ae.call(this,null==e?"canceled":e,Ae.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(rt,Ae,{__CANCEL__:!0});const nt=rt;function ot(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ae("Request failed with status code "+r.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const st=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=n[a];o||(o=c),r[s]=i,n[s]=c;let u=a,d=0;for(;u!==s;)d+=r[u++],u%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let r,n,o=0,s=1e3/t;const a=(t,s=Date.now())=>{o=s,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-o;i>=s?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},s-i)))},()=>r&&a(r)]}(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,i=s-n,c=o(i);n=s,e({loaded:s,total:a,progress:a?s/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},at=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},it=e=>(...t)=>we.asap(()=>e(...t)),ct=Ge.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ge.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ge.origin),Ge.navigator&&/(msie|trident)/i.test(Ge.navigator.userAgent)):()=>!0,lt=Ge.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const a=[e+"="+encodeURIComponent(t)];we.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),we.isString(n)&&a.push("path="+n),we.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ut(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const dt=e=>e instanceof Ze?{...e}:e;function pt(e,t){t=t||{};const r={};function n(e,t,r,n){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge.call({caseless:n},e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function o(e,t,r,o){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function s(e,t){if(!we.isUndefined(t))return n(void 0,t)}function a(e,t){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function i(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):void 0}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(e,t,r)=>o(dt(e),dt(t),0,!0)};return we.forEach(Object.keys({...e,...t}),function(n){const s=c[n]||o,a=s(e[n],t[n],n);we.isUndefined(a)&&s!==i||(r[n]=a)}),r}const ht=e=>{const t=pt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:i}=t;if(t.headers=a=Ze.from(a),t.url=ve(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),we.isFormData(r))if(Ge.hasStandardBrowserEnv||Ge.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(we.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(Ge.hasStandardBrowserEnv&&(n&&we.isFunction(n)&&(n=n(t)),n||!1!==n&&ct(t.url))){const e=o&&s&&lt.read(s);e&&a.set(o,e)}return t},ft="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ht(e);let o=n.data;const s=Ze.from(n.headers).normalize();let a,i,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=n;function f(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let E=new XMLHttpRequest;function S(){if(!E)return;const n=Ze.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());ot(function(e){t(e),f()},function(e){r(e),f()},{data:d&&"text"!==d&&"json"!==d?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:n,config:e,request:E}),E=null}E.open(n.method.toUpperCase(),n.url,!0),E.timeout=n.timeout,"onloadend"in E?E.onloadend=S:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(S)},E.onabort=function(){E&&(r(new Ae("Request aborted",Ae.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new Ae(n,Ae.ERR_NETWORK,e,E);o.event=t||null,r(o),E=null},E.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Be;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Ae(t,o.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,E)),E=null},void 0===o&&s.setContentType(null),"setRequestHeader"in E&&we.forEach(s.toJSON(),function(e,t){E.setRequestHeader(t,e)}),we.isUndefined(n.withCredentials)||(E.withCredentials=!!n.withCredentials),d&&"json"!==d&&(E.responseType=n.responseType),h&&([c,u]=st(h,!0),E.addEventListener("progress",c)),p&&E.upload&&([i,l]=st(p),E.upload.addEventListener("progress",i),E.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(a=t=>{E&&(r(!t||t.type?new nt(null,e,E):t),E.abort(),E=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Ge.protocols.indexOf(g)?r(new Ae("Unsupported protocol "+g+":",Ae.ERR_BAD_REQUEST,e)):E.send(o||null)})},Et=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ae?t:new nt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Ae(`timeout ${t} of ms exceeded`,Ae.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:i}=n;return i.unsubscribe=()=>we.asap(a),i}},St=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},gt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*St(r,t)}(e,t);let s,a=0,i=e=>{s||(s=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return i(),void e.close();let s=n.byteLength;if(r){let e=a+=s;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw i(e),e}},cancel:e=>(i(e),o.return())},{highWaterMark:2})},{isFunction:mt}=we,wt=(({Request:e,Response:t})=>({Request:e,Response:t}))(we.global),{ReadableStream:yt,TextEncoder:It}=we.global,Rt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},At=e=>{e=we.merge.call({skipUndefined:!0},wt,e);const{fetch:t,Request:r,Response:n}=e,o=t?mt(t):"function"==typeof fetch,s=mt(r),a=mt(n);if(!o)return!1;const i=o&&mt(yt),c=o&&("function"==typeof It?(l=new It,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=s&&i&&Rt(()=>{let e=!1;const t=new r(Ge.origin,{body:new yt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&i&&Rt(()=>we.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Ae(`Response type '${e}' is not supported`,Ae.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:o,method:a,data:i,signal:l,cancelToken:h,timeout:f,onDownloadProgress:E,onUploadProgress:S,responseType:g,headers:m,withCredentials:w="same-origin",fetchOptions:y}=ht(e),I=t||fetch;g=g?(g+"").toLowerCase():"text";let R=Et([l,h&&h.toAbortSignal()],f),A=null;const T=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let b;try{if(S&&u&&"get"!==a&&"head"!==a&&0!==(b=await(async(e,t)=>{const n=we.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(we.isBlob(e))return e.size;if(we.isSpecCompliantForm(e)){const t=new r(Ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return we.isArrayBufferView(e)||we.isArrayBuffer(e)?e.byteLength:(we.isURLSearchParams(e)&&(e+=""),we.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(m,i))){let e,t=new r(o,{method:"POST",body:i,duplex:"half"});if(we.isFormData(i)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,r]=at(b,st(it(S)));i=gt(t.body,65536,e,r)}}we.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in r.prototype,l={...y,signal:R,method:a.toUpperCase(),headers:m.normalize().toJSON(),body:i,duplex:"half",credentials:t?w:void 0};A=s&&new r(o,l);let h=await(s?I(A,y):I(o,l));const f=d&&("stream"===g||"response"===g);if(d&&(E||f&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=we.toFiniteNumber(h.headers.get("content-length")),[r,o]=E&&at(t,st(it(E),!0))||[];h=new n(gt(h.body,65536,r,()=>{o&&o(),T&&T()}),e)}g=g||"text";let O=await p[we.findKey(p,g)||"text"](h,e);return!f&&T&&T(),await new Promise((t,r)=>{ot(t,r,{data:O,headers:Ze.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:A})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ae("Network Error",Ae.ERR_NETWORK,e,A),{cause:t.cause||t});throw Ae.from(t,t&&t.code,e,A)}}},Tt=new Map,bt=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a,i,c=s.length,l=Tt;for(;c--;)a=s[c],i=l.get(a),void 0===i&&l.set(a,i=c?new Map:At(t)),l=i;return i},Ot=(bt(),{http:null,xhr:ft,fetch:{get:bt}});we.forEach(Ot,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Pt=e=>we.isFunction(e)||null===e||!1===e,Ct=(e,t)=>{e=we.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){let r;if(n=e[a],o=n,!Pt(n)&&(o=Ot[(r=String(n)).toLowerCase()],void 0===o))throw new Ae(`Unknown adapter '${r}'`);if(o&&(we.isFunction(o)||(o=o.get(t))))break;s[r||"#"+a]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function Lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function Ut(e){return Lt(e),e.headers=Ze.from(e.headers),e.data=et.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ct(e.adapter||He.adapter,e)(e).then(function(t){return Lt(e),t.data=et.call(e,e.transformResponse,t),t.headers=Ze.from(t.headers),t},function(t){return tt(t)||(Lt(e),t&&t.response&&(t.response.data=et.call(e,e.transformResponse,t.response),t.response.headers=Ze.from(t.response.headers))),Promise.reject(t)})}const $t="1.12.2",_t={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_t[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const vt={};_t.transitional=function(e,t,r){function n(e,t){return"[Axios v"+$t+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new Ae(n(o," has been removed"+(t?" in "+t:"")),Ae.ERR_DEPRECATED);return t&&!vt[o]&&(vt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}},_t.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=t[s];if(a){const t=e[s],r=void 0===t||a(t,s,e);if(!0!==r)throw new Ae("option "+s+" must be "+r,Ae.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}},validators:_t},Bt=Dt.validators;class kt{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),null!=n&&(we.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Bt.function,serialize:Bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dt.assertOptions(t,{baseUrl:Bt.spelling("baseURL"),withXsrfToken:Bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&we.merge(o.common,o[t.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ze.concat(s,o);const a=[];let i=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!i){const e=[Ut.bind(this),void 0];for(e.unshift(...a),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=a.length;let p=t;for(;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Ut.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ve(ut((e=pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],function(e){kt.prototype[e]=function(t,r){return this.request(pt(r||{},{method:e,url:t,data:(r||{}).data}))}}),we.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}kt.prototype[e]=t(),kt.prototype[e+"Form"]=t(!0)});const jt=kt;class xt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new nt(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xt(function(t){e=t}),cancel:e}}}const Mt=xt,Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ft).forEach(([e,t])=>{Ft[t]=e});const qt=Ft,Gt=function e(t){const r=new jt(t),n=C(jt.prototype.request,r);return we.extend(n,jt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(pt(t,r))},n}(He);Gt.Axios=jt,Gt.CanceledError=nt,Gt.CancelToken=Mt,Gt.isCancel=tt,Gt.VERSION=$t,Gt.toFormData=Pe,Gt.AxiosError=Ae,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=function(e){return function(t){return e.apply(null,t)}},Gt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},Gt.mergeConfig=pt,Gt.AxiosHeaders=Ze,Gt.formToJSON=e=>Ve(we.isHTMLForm(e)?new FormData(e):e),Gt.getAdapter=Ct,Gt.HttpStatusCode=qt,Gt.default=Gt;const Vt=Gt,Kt=async e=>{try{const{message:t,response:r,request:n}=e;let o=t;return r?o+=` - The request was made and the server responded with ${JSON.stringify({status:r.status,data:r.data})}`:n&&(o+=" - The request was made but no response was received"),console.warn(o),await(0,h.reportError)(new Error(o)),o}catch(e){return console.warn(`Cannot handle error: ${e.message}`),e.message}},{APIS:{ASSETS_API:{BASE_URL:Ht,ENDPOINTS:{USERS:Yt,CERTIFICATES:Wt}}}}=E,zt={create:async(e,t)=>{let r=[];try{const{data:n}=await Vt.post(`${Ht}${Yt}/${e}${Wt}`,t);n&&(r=n)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:Jt,ENDPOINTS:{USERS:Qt,PROFILE_IMAGES:Xt}}}}=E,Zt={create:async({userId:e,fileObject:t})=>{let r=[];try{if(!e)throw new Error("userSlug not found!");const n=new FormData;n.append("file",t);const{data:o}=await Vt.post(`${Jt}${Qt}/${e}${Xt}`,n);o&&(r=o)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:er,ENDPOINTS:{LINK_PREVIEWS:tr}}}}=E,rr={certificates:zt,profileImages:Zt,linkPreviews:{get:async e=>{let t={};try{if(!e)throw new Error("url not found!");const{data:r}=await Vt.get(`${er}${tr}/${encodeURIComponent(btoa(e))}`);r&&r.url&&(t=r)}catch(e){await Kt(e)}return t}}},{APIS:{AUTH_API:{BASE_URL:nr,ENDPOINTS:{USER_PASSWORD:or,USERS:sr}}},USERS:{MYSELF:ar}}=E,ir={userPassword:{update:async e=>{let t=null;try{t=await Vt.put(`${nr}${sr}/${ar}${or}`,e)}catch(e){t={message:(((e||{}).response||{}).data||{}).message},await Kt(e)}return t}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:cr,ENDPOINTS:{ANSWERS:lr,QUESTIONS:ur,LIKES:dr}}}}=E,pr=`${cr}${ur}`,hr={create:async({questionSlug:e},t)=>{try{await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.put(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:fr,ENDPOINTS:{QUESTIONS:Er}}}}=E,Sr=`${fr}${Er}`,gr={create:async e=>{try{return await Vt.post(Sr,e)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e})=>{try{await Vt.delete(`${Sr}/${encodeURIComponent(e)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e},t)=>{try{return await Vt.put(`${Sr}/${encodeURIComponent(e)}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:mr,ENDPOINTS:{REPLIES:wr,ANSWERS:yr,QUESTIONS:Ir,LIKES:Rr}}}}=E,Ar=`${mr}${Ir}`,Tr=({questionSlug:e,answerSlug:t,replySlug:r},n=!1)=>{let o=`${Ar}/${encodeURIComponent(e)}${yr}/${encodeURIComponent(t)}${wr}`;return r&&(o=`${o}/${encodeURIComponent(r)}`,n&&(o=`${o}${Rr}`)),o},br={create:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(Tr({questionSlug:e,answerSlug:t}),r)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t,replySlug:r},n)=>{try{return await Vt.put(Tr({questionSlug:e,answerSlug:t,replySlug:r}),n)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Tr({questionSlug:e,answerSlug:t,replySlug:r}))}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t,replySlug:r,payload:n})=>{try{await Vt.post(Tr({questionSlug:e,answerSlug:t,replySlug:r},!0),n)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Tr({questionSlug:e,answerSlug:t,replySlug:r},!0))}catch(e){const t=await Kt(e);throw new Error(t)}},getReplyUrl:Tr},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Or,ENDPOINTS:{QUESTIONS:Nr,ANSWERS:Pr,LIKES:Cr}}}}=E,Lr=`${Or}${Nr}`,Ur={answers:hr,questions:gr,replies:br,likes:{create:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.post(`${Lr}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Cr}`)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${Lr}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Cr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}}},{APIS:{MANAGEMENT_API:{BASE_URL:$r,ENDPOINTS:{ACCOUNTS:_r}}}}=E,vr={create:async e=>{try{await Vt.post(`${$r}${_r}`,e)}catch(e){throw await Kt(e),e}},read:async e=>{let t=null;try{({data:t}=await Vt.get(`${$r}${_r}/${encodeURIComponent(e)}`))}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${$r}${_r}/${encodeURIComponent(e)}`,t)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Dr,ENDPOINTS:{EVENT_REGISTRATIONS:Br}}}}=E,kr={create:async e=>{try{await Vt.post(`${Dr}${Br}`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:jr,ENDPOINTS:{LOGINS:xr,LOGIN_PASSWORDLESS:Mr}}}}=E,Fr=`${jr}${xr}`,qr={update:async e=>{try{await Vt.put(`${Fr}/${encodeURIComponent(e)}${Mr}`)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Gr}}}=E,Vr={create:async e=>{try{await Vt.post(`${Gr}/users/${e.id}/products`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:Kr,ENDPOINTS:{PROFILE:Hr}}}}=E,Yr={accounts:vr,eventRegistrations:kr,passwordless:qr,userProducts:Vr,profile:{update:async e=>{try{const t=["name","jobTitle","organization","location","biography","image"];if(!Object.keys(e).some(e=>t.includes(e)))throw new Error("Profile data should include at least one of 'name', 'jobTitle', 'organization', 'location', 'biography', 'image'");await Vt.put(`${Kr}${Hr}`,e)}catch(e){const t=await Kt(e);throw new Error(`An error occurred while trying to update the user's profile in the management api: ${t}`)}}}},{APIS:{MGMT_API:{BASE_URL:Wr,ENDPOINTS:{REFERRALS:zr}}}}=E,Jr={create:async e=>{try{await Vt.post(`${Wr}${zr}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:Qr,ENDPOINTS:{BULK_REFERRALS:Xr}}}}=E,Zr={create:async e=>{try{await Vt.post(`${Qr}${Xr}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:en,ENDPOINTS:{BULK_ENROLMENTS:tn}}}}=E,rn={referrals:Jr,bulkReferrals:Zr,bulkEnrolments:{create:async e=>{try{await Vt.post(`${en}${tn}`,e)}catch(e){throw await Kt(e),e}}}},{APIS:{PAYMENTS_API:{BASE_URL_V2:nn,ENDPOINTS:{PRODUCTS:on}}}}=E,sn=`${nn}${on}`,an={products:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(sn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_API:{BASE_URL_V2:cn,ENDPOINTS:{BULK_ENROLMENTS:ln}}}}=E,un={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${cn}${ln}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}};var dn=c(606);const{OK:pn,MULTIPLE_CHOICES:hn,NOT_FOUND:fn,FORBIDDEN:En}=dn.StatusCodes,Sn=e=>e>=pn&&e<hn||e===En||e===fn,{APIS:{PEOPLE_API:{BASE_URL_V2:gn,ENDPOINTS:{USERS:mn}}},STATUS_CODES:{INVALID_TOKEN:wn},ERROR_MESSAGES:{INVALID_TOKEN:yn}}=E,In=async e=>{let t=null;try{const{data:r}=await Vt.get(`${gn}${mn}/${encodeURIComponent(e)}`,{validateStatus:Sn});r&&r.id&&(t=r)}catch(e){if(e?.response?.status===wn)throw new Error(yn);await Kt(e)}return t},Rn=async e=>{let t=[];try{if(e&&e.length<2)throw new Error("users list method requires at least two ids");const r=e.map(e=>`ids=${encodeURIComponent(e)}`).join("&"),n=await Vt.get(`${gn}${mn}?${r}`,{validateStatus:Sn});n&&n.length&&(t=n)}catch(e){await Kt(e)}return t},An={read:In,update:async(e,t)=>{let r=!1;try{const{data:n}=await Vt.put(`${gn}${mn}/${encodeURIComponent(e)}`,t);r=!(!n||!n.id)}catch(e){await Kt(e)}return r},list:Rn},{APIS:{PEOPLE_API:{BASE_URL_V2:Tn,ENDPOINTS:{USERS:bn,USER_LIKES:On}}},USERS:{MYSELF:Nn}}=E,Pn=`${Tn}${bn}/${Nn}${On}`,Cn=async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Pn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},Ln={list:Cn},Un={authors:{readQuestionAuthors:async(e,t,r)=>{try{if(e.author=await In(e.authorId),e.answers&&e.answers.length&&!r.ignoreAnswersAuthors){e.answers.sort((e,t)=>new Date(t.updatedAt)-new Date(e.updatedAt)),e.totalAnswers=e.answers.length;let n=e.answers;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.answers.slice(t,t+r.limit)}for(let e of n){e.author=e.authorId&&await In(e.authorId)||{};const[r]=t?await Cn({contentType:E.CONTENTFUL.ANSWERS.TYPE,contentSlug:e.slug}):[null];e.userLiked=!!r}e.answers=n}else e.answers||(e.answers=[]);return e}catch(e){throw await Kt(e),new Error(`Cannot read authors for question: ${e.message}`)}},readAuthors:async(e=[])=>{let t=[];try{if(!1===Array.isArray(e))throw new Error("authorIds is not an array!");if(e&&1===e.length){const r=await In(e[0]);r&&t.push(r)}else if(e&&e.length>1){const r=await Rn(e);r&&r.length>0&&(t=r)}}catch(e){throw await Kt(e),new Error(`Cannot read authors: ${e.message}`)}return t}}},{APIS:{PEOPLE_API:{BASE_URL:$n,ENDPOINTS:{REGISTRATIONS:_n}}}}=E,vn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${$n}${_n}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:Dn,ENDPOINTS:{COMMUNITIES:Bn,USERS:kn}}}}=E,jn=`${Dn}${kn}`;function xn(e){const t=e["content-range"].split(" ")[1].split("/"),[r,n,o]=[...t[0].split("-"),t[1]].map(e=>parseInt(e,10)||0);return{start:r,end:n,total:o}}const Mn={list:async(e="me",t={})=>{let r={items:[],start:0,end:0,total:0},n=t?{params:t}:{params:{}};try{const{data:t,headers:o}=await Vt.get(`${jn}/${e}${Bn}`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});return t?.length>0&&(r={data:t,pagination:xn(o)}),r}catch(e){await Kt(e)}return r}},{APIS:{PEOPLE_API:{BASE_URL_V2:Fn,ENDPOINTS:{USERS:qn,USER_COURSES:Gn}}},USERS:{MYSELF:Vn}}=E,Kn=`${Fn}${qn}/${Vn}${Gn}`,Hn={create:async e=>{try{await Vt.post(Kn,e)}catch(e){await Kt(e)}},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Kn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${Kn}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:Yn,ENDPOINTS:{USERS:Wn,USER_EVENTS:zn}}},USERS:{MYSELF:Jn}}=E,Qn=`${Yn}${Wn}/${Jn}${zn}`,Xn={list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Qn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:Zn,ENDPOINTS:{USERS:eo,USER_LESSONS:to}}},USERS:{MYSELF:ro}}=E,no=`${Zn}${eo}/${ro}${to}`,oo={create:async e=>{let t=null;try{t=await Vt.post(no,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(no,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:so,ENDPOINTS:{USERS:ao,USER_PRODUCTS:io}}},USERS:{MYSELF:co}}=E,lo=`${so}${ao}/${co}${io}`,uo={create:async e=>{let t=null;try{t=await Vt.post(lo,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(lo,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${lo}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:po,ENDPOINTS:{USERS:ho,USER_RATINGS:fo}}},USERS:{MYSELF:Eo}}=E,So=`${po}${ho}/${Eo}${fo}`,go={create:async e=>{let t=null;try{const{data:r}=await Vt.post(So,e);r?.id&&(t=r)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${So}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:mo,ENDPOINTS:{USERS:wo,USER_REFERRALS:yo}}},USERS:{MYSELF:Io}}=E,Ro=`${mo}${wo}/${Io}${yo}`,Ao={bulkEnrolments:un,handlers:Un,registrations:vn,users:An,userCommunities:Mn,userCourses:Hn,userEvents:Xn,userLessons:oo,userLikes:Ln,userProducts:uo,userRatings:go,userReferrals:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Ro,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:To,ENDPOINTS:{ENQUIRY_EMAILS:bo}}}}=E,Oo={create:async e=>{let t=null;try{const{data:r}=await Vt.post(`${To}${bo}`,e);r&&(t=r)}catch(e){await Kt(e)}return t}},No={forms:{sendEnquiryEmails:async e=>{let t=null;try{const{emailIds:r}=I();t=await $o.emails.create({...r,...e})}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Po,ENDPOINTS:{USERS:Co,USER_PROPERTIES:Lo}}},USERS:{MYSELF:Uo}}=E,$o={emails:Oo,handlers:No,userProperties:{update:async(e,t)=>{try{await Vt.put(`${Po}${Co}/${Uo}${Lo}/${e}`,t)}catch(e){await Kt(e)}}}};var _o=c(443);const{APIS:{SEARCH_API:{BASE_URL:vo,ENDPOINTS:{SEARCH:Do}}}}=E,Bo=`${vo}${Do}`,ko={ask:async e=>{try{let t=null;const{data:r}=await Vt.get(Bo,{params:{question:e}});return r?.answer&&r?.references&&r?.version&&(t=r),t}catch(e){const t=await Kt(e);throw new Error(t)}},stream:(e,t,r)=>{const n=(0,_o.io)(void 0,{path:"/api/search-api/web-sockets"});function o(){n.emit("search",{question:e})}function s(e){r(e),a(),n.disconnect()}function a(){n.off("connect",o),n.off("update",t),n.off("result",s)}return n.on("connect",o),n.on("update",t),n.on("result",s),a}},{APIS:{SEARCH_API:{BASE_URL:jo,ENDPOINTS:{CHATBOT:{COURSES:xo}}}}}=E,Mo=`${jo}${xo}`;async function Fo(e,t){try{let r=null;const{data:n}=await Vt.get(`${Mo}/${e}`,{params:{text:t}});return n&&(r=n),r}catch(e){await Kt(e)}}const qo=(e,t,r,n)=>{const o=(0,_o.io)(void 0,{path:"/api/search-api/web-sockets"});function s(){o.emit("chatbot",{text:e,courseSlug:t})}o.on("connect",s),o.on("update",r),o.on("result",function e(t){n(t),o.off("connect",s),o.off("update",r),o.off("result",e),o.disconnect()})};async function Go(e){try{let t=null;const{data:r}=await Vt.delete(`${Mo}/${e}`);return r&&(t=r),t}catch(e){await Kt(e)}}const Vo={...ko,chatbot:{courses:d}},{APIS:{SOCIALS_API:{BASE_URL:Ko,ENDPOINTS:{COMMUNITIES:Ho},PATHS:{ACTIVITIES:Yo}}}}=E,Wo=`${Ko}${Ho}`,zo={read:async(e,t)=>{let r=null;try{const{data:n}=await Vt.get(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`);n&&(r=n)}catch(e){await Kt(e)}return r},list:async(e,t={})=>{let r=null;try{const{data:n}=await Vt.get(`${Wo}/${encodeURIComponent(e)}/${Yo}`,{params:t});n&&(r=n)}catch(e){await Kt(e)}return r},create:async(e,t)=>{let r=null;try{const{data:n}=await Vt.post(`${Wo}/${encodeURIComponent(e)}/${Yo}`,t);(n?.content||n?.title)&&(r=n)}catch(e){await Kt(e)}return r},update:async(e,t,r)=>{let n=null;try{const{data:o}=await Vt.put(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`,r);(o?.content||o?.title)&&(n=o)}catch(e){await Kt(e)}return n},remove:async(e,t)=>{let r=null;try{const{data:n}=await Vt.delete(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:Jo,ENDPOINTS:{COMMUNITIES:Qo}}}}=E,Xo=`${Jo}${Qo}`,Zo={read:async e=>{let t=null;try{const{data:r}=await Vt.get(`${Xo}/${encodeURIComponent(e)}`);r?.title?t=r:r?.page?.title&&(t=r?.page)}catch(e){await Kt(e)}return t},join:async(e,t)=>{let r=null;try{const{data:n}=await Vt.post(`${Xo}/${encodeURIComponent(e)}/members`,t);r=n}catch(e){await Kt(e)}return r},leave:async e=>{let t=null;try{const{data:r}=await Vt.delete(`${Xo}/${encodeURIComponent(e)}/members/me`);t=r}catch(e){await Kt(e)}return t}},{APIS:{SOCIALS_API:{BASE_URL:es,ENDPOINTS:{COMMUNITIES:ts},PATHS:{ACTIVITIES:rs,REACTIONS:ns}}}}=E,os=`${es}${ts}`,ss={create:async({slug:e,activityId:t,reactionId:r})=>{let n=null;const o={kind:"like"};let s=`${os}/${encodeURIComponent(e)}`;s=t?`${s}/${rs}/${t}/${ns}`:`${s}/${ns}/${r}/${ns}`;try{const{data:e}=await Vt.post(s,o);n=e}catch(e){await Kt(e)}return n},remove:async({slug:e,reactionId:t})=>{let r=null;try{const{data:n}=await Vt.delete(`${os}/${encodeURIComponent(e)}/${ns}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:as,ENDPOINTS:{COMMUNITIES:is}}}}=E,cs=`${as}${is}`,ls={list:async(e,t)=>{let r={data:[],pagination:{start:0,end:0,total:0}},n=t?{params:t}:{params:{}};try{const{data:t}=await Vt.get(`${cs}/${encodeURIComponent(e)}/members`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});(t?.data?.length>0||t?.pagination)&&(r=t)}catch(e){await Kt(e)}return r},read:async(e,t=!0)=>{let r=null;try{let n=`${cs}/${encodeURIComponent(e)}/members`;t&&(n+="/me");const o=await Vt.get(n,{headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});r=o.data,!r&&o.pagnination&&(r=o.pagnination)}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:us,ENDPOINTS:{COMMUNITIES:ds},PATHS:{ACTIVITIES:ps,REACTIONS:hs}}}}=E,fs=`${us}${ds}`,Es={create:async({slug:e,activityId:t})=>{let r=null;const n={kind:"pin"};let o=`${fs}/${encodeURIComponent(e)}`;o=`${o}/${ps}/${t}/${hs}`;try{const{data:e}=await Vt.post(o,n);r=e}catch(e){await Kt(e)}return r},remove:async({slug:e,reactionId:t})=>{let r=null;try{const{data:n}=await Vt.delete(`${fs}/${encodeURIComponent(e)}/${hs}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:Ss,ENDPOINTS:{COMMUNITIES:gs},PATHS:{ACTIVITIES:ms,REACTIONS:ws}}}}=E,ys=`${Ss}${gs}`,Is={activities:zo,communities:Zo,members:ls,likes:ss,pins:Es,reactions:{create:async(e,t,r,n)=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}/${ws}`:`${s}/${ws}/${r}/${ws}`;try{const{data:e}=await Vt.post(s,n);o=e}catch(e){await Kt(e)}return o},list:async(e,{activityId:t,reactionId:r},n={})=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}/${ws}`:`${s}/${ws}/${r}/${ws}`;try{const{data:e}=await Vt.get(s,{params:n});e&&(o=e)}catch(e){await Kt(e)}return o},remove:async(e,t)=>{let r=null;try{const{data:n}=await Vt.delete(`${ys}/${encodeURIComponent(e)}/${ws}/${t}`);r=n}catch(e){await Kt(e)}return r},update:async(e,t,r,n)=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}`:`${s}/${ws}/${r}`;try{const{data:e}=await Vt.put(s,n);o=e}catch(e){await Kt(e)}return o}}},{CONTENTFUL:Rs}=E,{TYPE:As,ORDER:Ts,SELECT:bs,SKIP:Os,LIMIT:Ns,INCLUDE:Ps}=Rs.BADGES,Cs={list:async()=>{try{return await(0,p.getEntries)({content_type:As,include:Ps,limit:Ns,order:Ts,select:bs,skip:Os})}catch(e){return await Kt(e),[]}}},{CONTENTFUL:Ls}=E,{CARD_TYPES:Us}=Ls.CAROUSELS,$s={read:async(e,t)=>{try{if(!t||!t.sys||!t.sys.id)throw new Error("Invalid link to card");if(!e||!Us[e])throw new Error("Unsupported card content type");const{INCLUDE:r,SELECT:n}=Us[e],o=await(0,p.getEntry)({content_type:e,"sys.id":t.sys.id,include:r,select:n},{assetDetails:!0});if("courseJourney"===e){const e=await(0,p.getEntry)({content_type:"course","fields.journeys.sys.id":t.sys.id,include:1,select:"fields.slug,fields.journeys"});o.courseParent=e}return o}catch(e){throw await Kt(e),new Error(`Cannot read carousel card: ${e.message}`)}}},_s=$s,{CONTENTFUL:vs}=E,{INCLUDE:Ds,SELECT:Bs,TYPE:ks}=vs.EDITORIAL_PAGES,js={read:async e=>{try{return await(0,p.getEntry)({content_type:ks,"fields.slug":e,include:Ds,select:Bs})}catch(e){throw await Kt(e),new Error(`Cannot read editorial page: ${e.message}`)}}},{CONTENTFUL:xs}=E,{TYPE:Ms,ORDER:Fs,SELECT:qs,SKIP:Gs,LIMIT:Vs,INCLUDE:Ks}=xs.QUESTIONS,Hs={read:async e=>{try{return await(0,p.getEntry)({content_type:Ms,"fields.slug":e,include:2,select:qs})}catch(e){throw await Kt(e),new Error(`Cannot read question: ${e.message}`)}},list:async(e={})=>{try{return await(0,p.getEntries)({content_type:Ms,include:Ks,limit:Vs,order:Fs,select:qs,skip:Gs,...e})}catch(e){throw await Kt(e),new Error(`Cannot list questions: ${e.message}`)}}};var Ys=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;0!==o--;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r};const Ws="__googleMapsScriptId";var zs;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(zs||(zs={}));class Js{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:n,id:o=Ws,language:s,libraries:a=[],mapIds:i,nonce:c,region:l,retries:u=3,url:d="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=n,this.id=o||Ws,this.language=s,this.libraries=a,this.mapIds=i,this.nonce=c,this.region=l,this.retries=u,this.url=d,this.version=p,Js.instance){if(!Ys(this.options,Js.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Js.instance.options)}`);return Js.instance}Js.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?zs.FAILURE:this.done?zs.SUCCESS:this.loading?zs.LOADING:zs.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))return void this.callback();const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(e=>!r[e]&&delete r[e]),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{let t,r,n,o="The Google Maps JavaScript API",s="google",a="importLibrary",i="__ib__",c=document,l=window;l=l[s]||(l[s]={});const u=l.maps||(l.maps={}),d=new Set,p=new URLSearchParams,h=()=>t||(t=new Promise((a,l)=>{return h=this,f=void 0,S=function*(){var h;for(n in yield r=c.createElement("script"),r.id=this.id,p.set("libraries",[...d]+""),e)p.set(n.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase()),e[n]);p.set("callback",s+".maps."+i),r.src=this.url+"?"+p,u[i]=a,r.onerror=()=>t=l(Error(o+" could not load.")),r.nonce=this.nonce||(null===(h=c.querySelector("script[nonce]"))||void 0===h?void 0:h.nonce)||"",c.head.append(r)},new((E=void 0)||(E=Promise))(function(e,t){function r(e){try{o(S.next(e))}catch(e){t(e)}}function n(e){try{o(S.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof E?o:new E(function(e){e(o)})).then(r,n)}o((S=S.apply(h,f||[])).next())});var h,f,E,S}));u[a]?console.warn(o+" only loads once. Ignoring:",e):u[a]=(e,...t)=>d.add(e)&&h().then(()=>u[a](e,...t))})(r);const n=this.libraries.map(e=>this.importLibrary(e));n.length||n.push(this.importLibrary("core")),Promise.all(n).then(()=>this.callback(),e=>{const t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}const{GOOGLE:{MAPS:{LIBRARIES:{GEOCODING:Qs,PLACES:Xs},VERSION:Zs}}}=E,ea=function(e={}){let t=[];const r=I(),n=new Js({apiKey:r?.googleMaps?.apiKey,version:Zs});return{buildLocation:async function(e){try{const r=t.find(t=>t.description===e);if(!r)throw new Error("Place not found");const{place_id:o,description:s}=r,{Geocoder:a}=await n.importLibrary(Qs),i=new a;return new Promise(e=>{i.geocode({placeId:o},(t=[],r)=>{if("OK"===r){const r=t[0].address_components.find(e=>e.types.includes("country")),n=r?r.short_name:null;e({id:o,en:s,code:n})}else e({id:o,en:s,code:null})}).catch(()=>e({id:o,en:s,code:null}))})}catch(e){return await Kt(e),null}},isValidPlace:function(e){return t.some(t=>t.description===e)},predictPlaces:async function(r){try{const{AutocompleteService:o}=await n.importLibrary(Xs),s=new o;return new Promise(n=>{s.getPlacePredictions({...e,input:r,types:["(cities)"]},(e=[],r)=>{"OK"===r?(t=e,n(e)):n([])}).catch(()=>n([]))})}catch(e){return await Kt(e),[]}}}},ta=async(e,t,r={ignoreAnswersAuthors:!1})=>{try{let n={};return n=await Hs.read(e),n=await Ao.handlers.authors.readQuestionAuthors(n,t,r),n}catch(e){throw await Kt(e),new Error(`Cannot build question: ${e.message}`)}},{ARTICLES:{TYPE:ra},COURSES:{TYPE:na},COURSE_JOURNEYS:{TYPE:oa},CUSTOM_CARD:{TYPE:sa},COMMUNITY:{TYPE:aa},EVENTS:{TYPE:ia},LISTS:{TYPE:ca},QUESTIONS:{TYPE:la},LEARNING_HUB:{TYPE:ua}}=E.CONTENTFUL,da={ClosedHidden:"closed-hidden",ClosedVisible:"closed-visible",OpenHidden:"open-hidden",OpenVisible:"open-visible"},pa=e=>e&&e.url?(Object.assign(e,{aspect:"responsiveCard",query:"q=90&fit=fill"}),e):null,ha=e=>e&&e.url?`${e.url}?w=100&h=100&fit=thumb&f=center`:null,fa=e=>e.toLowerCase().split(" ")[0],Ea={[ra]:async e=>{const{authorIds:t,authorTag:r,image:n,coverImage:o,publishedDate:s,readingTime:a,slug:i,title:c}=e;let l=n;o&&(l.url=o.url,l.width=o.width,l.height=o.height,l.color=o.color);const u=await Ao.handlers.authors.readAuthors(t),d=u&&u.length?u:r?[fa(r)]:null;return{banner:pa(l),contributors:d,publishedDate:s,readingTime:a,slug:i,title:c}},[aa]:async e=>{const{title:t,slug:r,image:n,privacy:o,createdAt:s}=e,a=[da.ClosedVisible,da.ClosedHidden].includes(o),i=[da.OpenVisible,da.ClosedVisible].includes(o);return{banner:n?pa(n):null,slug:r,title:t,privacy:o,isPrivate:a,isVisible:i,createdAt:s}},[na]:async(e,t)=>{const{banner:r,freeCourse:n,partnershipDetails:o,slug:s,title:a,registered:i,courseType:c,courseV2:l}=e,u={banner:pa(r),slug:s,title:a,pill:n?"free":"premium",registered:!!i,courseType:c,courseV2:l};if(o){const{partners:e}=o;if(e)if(e.length>1){let t=[];for(let r=0;r<e.length;r++)t.push(e[r].title);u.partner=t}else u.partner=[e[0].title]}if(void 0===i&&t){const[e]=await Ao.userProducts.list({courseSlug:s});u.registered=!!e}return u},[oa]:async(e,t)=>{const{bannerImage:r,slug:n,title:o,courseParent:s,accessPrivacy:a,partnerLogos:i,locale:c}=e;let l,u=!1;if(t){const[e]=await Ao.userProducts.list({courseSlug:s.slug,journeySlug:n});u=!!e}return l=s.journeys&&s.journeys[0]?.slug===n?s.slug:`${s.slug}/${n}`,{banner:pa(r),slug:l,title:o,partner:i?i.map(e=>e.title):[],registered:u,pill:a.includes("open")?"free":"premium",courseType:a.includes("public")?"Public":"Private",customLabel:"Course",locale:c||"en"}},[sa]:e=>{const{authorName:t,authorImage:r,icon:n,image:o,label:s,link:a,primaryText:i}=e;return{...e,banner:o?pa(o):null,customIcon:n?n.toLowerCase():null,customLabel:s,contributors:t?[{name:t,image:r?{thumbnail:ha(r)}:null}]:null,slug:a,text:i}},[ia]:async(e,t)=>{const{bannerImage:r,defaultStartDate:n,isEventOngoing:o,slug:s,speakers:a,title:i,registered:c}=e,l=new Date(n),u=!!l&&l<new Date;if(a&&a.length)for(const e of a)e.image=ha(e.image);const d={banner:pa(r),dateHasPassed:u,title:i,slug:s,isOngoingEvent:o,contributors:a,startDate:l,registered:!!c};if(void 0===c&&t){const[e]=await Ao.userEvents.list({eventSlug:s});d.registered=!!e}return d},[ca]:async e=>{const{hero:t,slug:r,title:n}=e;return{banner:pa(t),slug:r,title:n}},[la]:async e=>{const{answers:t,authorId:r,createdAt:n,slug:o,title:s}=e;let a=null;if(r){const e=await Ao.users.read(r);e&&(a=e)}return{answers:t&&t.length?t.length:0,contributors:a?[a]:[],createdAt:n,slug:o,title:s}},[ua]:e=>{const{bannerSection:t,customLabel:r,slug:n,title:o}=e;return{banner:pa(t.image),slug:n,title:o,customLabel:r}},people:e=>{const{id:t,name:r,jobTitle:n,location:o,image:s,customLink:a}=e;return{profile:s,slug:a?.link||t,title:r,text:n,secondaryText:o,customLinkText:a?.text}}},Sa=async({contentType:e,...t}={},r)=>{try{if(!Ea[e])throw new Error("Content type not supported");if("function"!=typeof Ea[e])throw new Error("No builder function for content type");return"people"!==e&&t.sys&&t.sys.type&&"Link"===t.sys.type&&(t=await _s.read(e,t)),{contentType:e,...await Ea[e](t,r)}}catch(e){throw await Kt(e),new Error(`Cannot build carousel card: ${e.message}`)}},ga=async(e,t,r={})=>{try{if(!e.replies||0===e.replies.length)return e.replies=[],e;e.replies.sort((e,t)=>new Date(e.postedAt)-new Date(t.postedAt)),e.totalReplies=e.totalReplies||e.replies.length;let n=e.replies;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.replies.slice(t,t+r.limit)}for(const r of n){if(r.authorId===e.authorId){r.author=e.author,r.userLiked=!1;continue}r.author=r.authorId&&await In(r.authorId)||{};const[n]=t?await Cn({contentType:E.CONTENTFUL.REPLIES.TYPE,contentSlug:r.slug}):[null];r.userLiked=!!n}return e.replies=n,e}catch(e){throw await Kt(e),new Error(`Cannot build replies for answer: ${e.message}`)}},ma="success",wa="error",ya=e=>async t=>{const{contentType:r}=t;switch(r){case"event":try{return await Yr.eventRegistrations.create({eventSlug:t.slug,expectation:null,userEmail:e.email,startsAt:new Date(t.startDate).toISOString()}),ma}catch(e){return reportError(new Error(`Error registering for event: ${JSON.stringify(e)}`)),wa}case"microcourse":try{return await Yr.userProducts.create({id:e.id,courseSlug:t.slug,email:e.email,courseType:t.courseType}),ma}catch(e){return reportError(new Error(`Error registering for microcourse: ${JSON.stringify(e)}`)),wa}case"communityPage":try{return await Is.communities.join(t.slug,{...e.image.thumbnail&&{thumbnail:e.image.thumbnail},...e.jobTitle&&{jobTitle:e.jobTitle},...e.location&&{location:{...e.location}},...e.organization&&{organization:e.organization}}),ma}catch(e){return reportError(new Error(`Error joining community: ${JSON.stringify(e)}`)),wa}default:return wa}};var Ia=c(18);const Ra=e=>e&&Ia.Buffer.from(e,"base64").toString("ascii");function Aa({contentContext:e=null,errorsContext:t=null,googleMapsContext:r=null,gtmContext:n=null,origin:o}){try{const s=P(o);return e&&(0,p.setContext)(Object.assign({},e,{environment:s})),t&&(0,h.setContext)(Object.assign({},t,{environment:s})),r&&y(Object.assign({},r,{environment:s})),n&&((0,f.setContext)(Object.assign({},n,{environment:s})),(0,f.setupGTM)()),w(Object.assign({},{environment:s})),s}catch(e){console.warn(`Cannot load SDK: ${e.message}`)}}return l})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/gtm","http-status-codes","socket.io-client","buffer"],t):"object"==typeof exports?exports.ApoliticalSDK=t(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/gtm"),require("http-status-codes"),require("socket.io-client"),require("buffer")):e.ApoliticalSDK=t(e["@apolitical/content"],e["@apolitical/error-reporting"],e["@apolitical/gtm"],e["http-status-codes"],e["socket.io-client"],e.buffer)}(this,(e,t,r,n,o,s)=>(()=>{"use strict";var a={584:t=>{t.exports=e},568:e=>{e.exports=t},59:e=>{e.exports=r},18:e=>{e.exports=s},606:e=>{e.exports=n},443:e=>{e.exports=o}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};c.r(l),c.d(l,{assets:()=>rr,auth:()=>ir,badges:()=>Cs,buildAnswer:()=>ga,buildCardCtaClickHandler:()=>ya,buildCarouselCard:()=>Sa,buildQuestion:()=>ta,carouselCards:()=>_s,contentInteraction:()=>Ur,decodeBase64:()=>Ra,default:()=>Aa,editorialPages:()=>js,getEntries:()=>p.getEntries,getEntry:()=>p.getEntry,management:()=>Yr,mgmt:()=>rn,payments:()=>an,people:()=>Ao,peopleEngagement:()=>$o,qaQuestions:()=>Hs,reportError:()=>h.reportError,search:()=>Vo,socials:()=>Is,useMaps:()=>ea});var u={};c.r(u),c.d(u,{hasBrowserEnv:()=>je,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>xe,origin:()=>qe});var d={};c.r(d),c.d(d,{read:()=>Fo,remove:()=>Go,stream:()=>qo});var p=c(584),h=c(568),f=c(59);const E={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates",PROFILE_IMAGES:"/profile-images",LINK_PREVIEWS:"/link-previews"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments",PROFILE:"/users/me/profile"}},MGMT_API:{BASE_URL:"/api/mgmt-api",ENDPOINTS:{REFERRALS:"/referrals",BULK_REFERRALS:"/bulk-referrals",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",COMMUNITIES:"/communities",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_REFERRALS:"/referrals",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{AI_SEARCH:"/ai-search",CHATBOT:{COURSES:"/chatbot/me/courses"}}},SOCIALS_API:{BASE_URL:"/api/socials-api",ENDPOINTS:{COMMUNITIES:"/communities"},PATHS:{ACTIVITIES:"activities",REACTIONS:"reactions"}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},BADGES:{TYPE:"badge",INCLUDE:0,LIMIT:1e3,SELECT:"fields.name,fields.slug,fields.description,fields.icon,fields.colour",SKIP:0},CAROUSELS:{CARD_TYPES:{communityPage:{INCLUDE:1,SELECT:"fields.image,fields.slug,fields.title"},customCard:{INCLUDE:1,SELECT:"fields.icon,fields.label,fields.image,fields.primaryText,fields.secondaryText,fields.authorName,fields.authorImage,fields.link,fields.openInNewTab"},solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.coverImage,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},courseJourney:{INCLUDE:1,SELECT:"fields.bannerImage,fields.slug,fields.title,fields.accessPrivacy,fields.partnerLogos"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title,fields.courseType"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COMMUNITY:{TYPE:"communityPage"},COURSES:{TYPE:"microcourse"},COURSE_JOURNEYS:{TYPE:"courseJourney"},CUSTOM_CARD:{TYPE:"customCard"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug,fields.showCarouselCta,fields.header,fields.subHeader",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-fields.postedAt",SELECT:"sys.updatedAt,fields.postedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},GOOGLE:{MAPS:{LIBRARIES:{PLACES:"places",GEOCODING:"geocoding"},VERSION:"weekly"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"},STATUS_CODES:{INVALID_TOKEN:498},ERROR_MESSAGES:{INVALID_TOKEN:"Invalid token error: Logging user out..."}},{HUBSPOT:{ENVIRONMENTS_MAPPING:S,EMAIL_IDS:g}}=E;let m={emailIds:{}};const w=({environment:e})=>{const t=(e=>{if(!e)throw new Error("Cannot map environment: Environment not defined");if(!S[e])throw new Error(`Cannot map environment: No mapping found for environment ${e}`);return S[e]})(e);m.emailIds=g[t]},y=({apiKey:e})=>{m.googleMaps={apiKey:e}},I=()=>m,{APOLITICAL:{WEBSITES:{LIVE:R,LOCALHOST:A,STAGING:T,STAGING_SPLITTER:b},ENVIRONMENTS:{PRODUCTION:O,LOCAL:N}}}=E,P=e=>{let t=null;e?t=e:"undefined"!=typeof window&&(t=window.origin||window.location.origin),t||new Error("Cannot select environment: Website not defined");let r=null;const n=t.match(T);return n?r=n[1].split(b)[0]:t===R?r=O:t.includes(A)&&(r=N),r||new Error(`Cannot select environment: No rule for website ${t}`),r};function C(e,t){return function(){return e.apply(t,arguments)}}const{toString:L}=Object.prototype,{getPrototypeOf:U}=Object,{iterator:$,toStringTag:_}=Symbol,v=(D=Object.create(null),e=>{const t=L.call(e);return D[t]||(D[t]=t.slice(8,-1).toLowerCase())});var D;const B=e=>(e=e.toLowerCase(),t=>v(t)===e),k=e=>t=>typeof t===e,{isArray:j}=Array,x=k("undefined");function M(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&G(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const F=B("ArrayBuffer"),q=k("string"),G=k("function"),V=k("number"),K=e=>null!==e&&"object"==typeof e,H=e=>{if("object"!==v(e))return!1;const t=U(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||_ in e||$ in e)},Y=B("Date"),W=B("File"),z=B("Blob"),J=B("FileList"),Q=B("URLSearchParams"),[X,Z,ee,te]=["ReadableStream","Request","Response","Headers"].map(B);function re(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),j(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(M(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function ne(e,t){if(M(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,se=e=>!x(e)&&e!==oe,ae=(ie="undefined"!=typeof Uint8Array&&U(Uint8Array),e=>ie&&e instanceof ie);var ie;const ce=B("HTMLFormElement"),le=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ue=B("RegExp"),de=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};re(r,(r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)}),Object.defineProperties(e,n)},pe=B("AsyncFunction"),he=(fe="function"==typeof setImmediate,Ee=G(oe.postMessage),fe?setImmediate:Ee?(Se=`axios@${Math.random()}`,ge=[],oe.addEventListener("message",({source:e,data:t})=>{e===oe&&t===Se&&ge.length&&ge.shift()()},!1),e=>{ge.push(e),oe.postMessage(Se,"*")}):e=>setTimeout(e));var fe,Ee,Se,ge;const me="undefined"!=typeof queueMicrotask?queueMicrotask.bind(oe):"undefined"!=typeof process&&process.nextTick||he,we={isArray:j,isArrayBuffer:F,isBuffer:M,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||G(e.append)&&("formdata"===(t=v(e))||"object"===t&&G(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&F(e.buffer),t},isString:q,isNumber:V,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:H,isEmptyObject:e=>{if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:X,isRequest:Z,isResponse:ee,isHeaders:te,isUndefined:x,isDate:Y,isFile:W,isBlob:z,isRegExp:ue,isFunction:G,isStream:e=>K(e)&&G(e.pipe),isURLSearchParams:Q,isTypedArray:ae,isFileList:J,forEach:re,merge:function e(){const{caseless:t,skipUndefined:r}=se(this)&&this||{},n={},o=(o,s)=>{const a=t&&ne(n,s)||s;H(n[a])&&H(o)?n[a]=e(n[a],o):H(o)?n[a]=e({},o):j(o)?n[a]=o.slice():r&&x(o)||(n[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&re(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(re(t,(t,n)=>{r&&G(t)?e[n]=C(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,a;const i={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],n&&!n(a,e,t)||i[a]||(t[a]=e[a],i[a]=!0);e=!1!==r&&U(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:v,kindOfTest:B,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(j(e))return e;let t=e.length;if(!V(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[$]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:ce,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:de,freezeMethods:e=>{de(e,(t,r)=>{if(G(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];G(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return j(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ne,global:oe,isContextDefined:se,isSpecCompliantForm:function(e){return!!(e&&G(e.append)&&"FormData"===e[_]&&e[$])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[n]=e;const o=j(e)?[]:{};return re(e,(e,t)=>{const s=r(e,n+1);!x(s)&&(o[t]=s)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:pe,isThenable:e=>e&&(K(e)||G(e))&&G(e.then)&&G(e.catch),setImmediate:he,asap:me,isIterable:e=>null!=e&&G(e[$])};function ye(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}we.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=ye.prototype,Re={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Re[e]={value:e}}),Object.defineProperties(ye,Re),Object.defineProperty(Ie,"isAxiosError",{value:!0}),ye.from=(e,t,r,n,o,s)=>{const a=Object.create(Ie);we.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const i=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ye.call(a,i,c,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",s&&Object.assign(a,s),a};const Ae=ye;function Te(e){return we.isPlainObject(e)||we.isArray(e)}function be(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map(function(e,t){return e=be(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Ne=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)}),Pe=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!we.isUndefined(t[e])})).metaTokens,o=r.visitor||l,s=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&we.isSpecCompliantForm(t);if(!we.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(we.isBoolean(e))return e.toString();if(!i&&we.isBlob(e))throw new Ae("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let i=e;if(e&&!o&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Te)}(e)||(we.isFileList(e)||we.endsWith(r,"[]"))&&(i=we.toArray(e)))return r=be(r),i.forEach(function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===a?Oe([r],n,s):null===a?r:r+"[]",c(e))}),!1;return!!Te(e)||(t.append(Oe(o,r,s),c(e)),!1)}const u=[],d=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),we.forEach(r,function(r,s){!0===(!(we.isUndefined(r)||null===r)&&o.call(t,r,we.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])}),u.pop()}}(e),t};function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Le(e,t){this._pairs=[],e&&Pe(e,this,t)}const Ue=Le.prototype;Ue.append=function(e,t){this._pairs.push([e,t])},Ue.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const $e=Le;function _e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ve(e,t,r){if(!t)return e;const n=r&&r.encode||_e;we.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(s=o?o(t,r):we.isURLSearchParams(t)?t.toString():new $e(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const De=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(t){null!==t&&e(t)})}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ke={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},je="undefined"!=typeof window&&"undefined"!=typeof document,xe="object"==typeof navigator&&navigator||void 0,Me=je&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=je&&window.location.href||"http://localhost",Ge={...u,...ke},Ve=function(e){function t(e,r,n,o){let s=e[o++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),i=o>=e.length;return s=!s&&we.isArray(n)?n.length:s,i?(we.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!a):(n[s]&&we.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&we.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!a)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,(e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null},Ke={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=we.isObject(e);if(o&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n?JSON.stringify(Ve(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pe(e,new Ge.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ge.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Pe(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ke.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Ae.from(e,Ae.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ge.classes.FormData,Blob:Ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{Ke.headers[e]={}});const He=Ke,Ye=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),We=Symbol("internals");function ze(e){return e&&String(e).trim().toLowerCase()}function Je(e){return!1===e||null==e?e:we.isArray(e)?e.map(Je):String(e)}function Qe(e,t,r,n,o){return we.isFunction(n)?n.call(this,t,r):(o&&(t=r),we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0)}class Xe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=ze(t);if(!o)throw new Error("header name must be a non-empty string");const s=we.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=Je(e))}const s=(e,t)=>we.forEach(e,(e,r)=>o(e,r,t));if(we.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(we.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Ye[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(we.isObject(e)&&we.isIterable(e)){let r,n,o={};for(const t of e){if(!we.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?we.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=ze(e)){const r=we.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ze(e)){const r=we.findKey(this,e);return!(!r||void 0===this[r]||t&&!Qe(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=ze(e)){const o=we.findKey(r,e);!o||t&&!Qe(0,r[o],o,t)||(delete r[o],n=!0)}}return we.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Qe(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return we.forEach(this,(n,o)=>{const s=we.findKey(r,o);if(s)return t[s]=Je(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Je(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return we.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[We]=this[We]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ze(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}Xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),we.reduceDescriptors(Xe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),we.freezeMethods(Xe);const Ze=Xe;function et(e,t){const r=this||He,n=t||r,o=Ze.from(n.headers);let s=n.data;return we.forEach(e,function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function tt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,r){Ae.call(this,null==e?"canceled":e,Ae.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(rt,Ae,{__CANCEL__:!0});const nt=rt;function ot(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ae("Request failed with status code "+r.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const st=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=n[a];o||(o=c),r[s]=i,n[s]=c;let u=a,d=0;for(;u!==s;)d+=r[u++],u%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let r,n,o=0,s=1e3/t;const a=(t,s=Date.now())=>{o=s,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-o;i>=s?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},s-i)))},()=>r&&a(r)]}(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,i=s-n,c=o(i);n=s,e({loaded:s,total:a,progress:a?s/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},at=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},it=e=>(...t)=>we.asap(()=>e(...t)),ct=Ge.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ge.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ge.origin),Ge.navigator&&/(msie|trident)/i.test(Ge.navigator.userAgent)):()=>!0,lt=Ge.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const a=[e+"="+encodeURIComponent(t)];we.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),we.isString(n)&&a.push("path="+n),we.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ut(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const dt=e=>e instanceof Ze?{...e}:e;function pt(e,t){t=t||{};const r={};function n(e,t,r,n){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge.call({caseless:n},e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function o(e,t,r,o){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function s(e,t){if(!we.isUndefined(t))return n(void 0,t)}function a(e,t){return we.isUndefined(t)?we.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function i(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):void 0}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(e,t,r)=>o(dt(e),dt(t),0,!0)};return we.forEach(Object.keys({...e,...t}),function(n){const s=c[n]||o,a=s(e[n],t[n],n);we.isUndefined(a)&&s!==i||(r[n]=a)}),r}const ht=e=>{const t=pt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:i}=t;if(t.headers=a=Ze.from(a),t.url=ve(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),we.isFormData(r))if(Ge.hasStandardBrowserEnv||Ge.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(we.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(Ge.hasStandardBrowserEnv&&(n&&we.isFunction(n)&&(n=n(t)),n||!1!==n&&ct(t.url))){const e=o&&s&&lt.read(s);e&&a.set(o,e)}return t},ft="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ht(e);let o=n.data;const s=Ze.from(n.headers).normalize();let a,i,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=n;function f(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let E=new XMLHttpRequest;function S(){if(!E)return;const n=Ze.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());ot(function(e){t(e),f()},function(e){r(e),f()},{data:d&&"text"!==d&&"json"!==d?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:n,config:e,request:E}),E=null}E.open(n.method.toUpperCase(),n.url,!0),E.timeout=n.timeout,"onloadend"in E?E.onloadend=S:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(S)},E.onabort=function(){E&&(r(new Ae("Request aborted",Ae.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new Ae(n,Ae.ERR_NETWORK,e,E);o.event=t||null,r(o),E=null},E.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Be;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Ae(t,o.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,E)),E=null},void 0===o&&s.setContentType(null),"setRequestHeader"in E&&we.forEach(s.toJSON(),function(e,t){E.setRequestHeader(t,e)}),we.isUndefined(n.withCredentials)||(E.withCredentials=!!n.withCredentials),d&&"json"!==d&&(E.responseType=n.responseType),h&&([c,u]=st(h,!0),E.addEventListener("progress",c)),p&&E.upload&&([i,l]=st(p),E.upload.addEventListener("progress",i),E.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(a=t=>{E&&(r(!t||t.type?new nt(null,e,E):t),E.abort(),E=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Ge.protocols.indexOf(g)?r(new Ae("Unsupported protocol "+g+":",Ae.ERR_BAD_REQUEST,e)):E.send(o||null)})},Et=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ae?t:new nt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Ae(`timeout ${t} of ms exceeded`,Ae.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:i}=n;return i.unsubscribe=()=>we.asap(a),i}},St=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},gt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*St(r,t)}(e,t);let s,a=0,i=e=>{s||(s=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return i(),void e.close();let s=n.byteLength;if(r){let e=a+=s;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw i(e),e}},cancel:e=>(i(e),o.return())},{highWaterMark:2})},{isFunction:mt}=we,wt=(({Request:e,Response:t})=>({Request:e,Response:t}))(we.global),{ReadableStream:yt,TextEncoder:It}=we.global,Rt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},At=e=>{e=we.merge.call({skipUndefined:!0},wt,e);const{fetch:t,Request:r,Response:n}=e,o=t?mt(t):"function"==typeof fetch,s=mt(r),a=mt(n);if(!o)return!1;const i=o&&mt(yt),c=o&&("function"==typeof It?(l=new It,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=s&&i&&Rt(()=>{let e=!1;const t=new r(Ge.origin,{body:new yt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&i&&Rt(()=>we.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Ae(`Response type '${e}' is not supported`,Ae.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:o,method:a,data:i,signal:l,cancelToken:h,timeout:f,onDownloadProgress:E,onUploadProgress:S,responseType:g,headers:m,withCredentials:w="same-origin",fetchOptions:y}=ht(e),I=t||fetch;g=g?(g+"").toLowerCase():"text";let R=Et([l,h&&h.toAbortSignal()],f),A=null;const T=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let b;try{if(S&&u&&"get"!==a&&"head"!==a&&0!==(b=await(async(e,t)=>{const n=we.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(we.isBlob(e))return e.size;if(we.isSpecCompliantForm(e)){const t=new r(Ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return we.isArrayBufferView(e)||we.isArrayBuffer(e)?e.byteLength:(we.isURLSearchParams(e)&&(e+=""),we.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(m,i))){let e,t=new r(o,{method:"POST",body:i,duplex:"half"});if(we.isFormData(i)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,r]=at(b,st(it(S)));i=gt(t.body,65536,e,r)}}we.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in r.prototype,l={...y,signal:R,method:a.toUpperCase(),headers:m.normalize().toJSON(),body:i,duplex:"half",credentials:t?w:void 0};A=s&&new r(o,l);let h=await(s?I(A,y):I(o,l));const f=d&&("stream"===g||"response"===g);if(d&&(E||f&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=we.toFiniteNumber(h.headers.get("content-length")),[r,o]=E&&at(t,st(it(E),!0))||[];h=new n(gt(h.body,65536,r,()=>{o&&o(),T&&T()}),e)}g=g||"text";let O=await p[we.findKey(p,g)||"text"](h,e);return!f&&T&&T(),await new Promise((t,r)=>{ot(t,r,{data:O,headers:Ze.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:A})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ae("Network Error",Ae.ERR_NETWORK,e,A),{cause:t.cause||t});throw Ae.from(t,t&&t.code,e,A)}}},Tt=new Map,bt=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a,i,c=s.length,l=Tt;for(;c--;)a=s[c],i=l.get(a),void 0===i&&l.set(a,i=c?new Map:At(t)),l=i;return i},Ot=(bt(),{http:null,xhr:ft,fetch:{get:bt}});we.forEach(Ot,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Pt=e=>we.isFunction(e)||null===e||!1===e,Ct=(e,t)=>{e=we.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){let r;if(n=e[a],o=n,!Pt(n)&&(o=Ot[(r=String(n)).toLowerCase()],void 0===o))throw new Ae(`Unknown adapter '${r}'`);if(o&&(we.isFunction(o)||(o=o.get(t))))break;s[r||"#"+a]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function Lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function Ut(e){return Lt(e),e.headers=Ze.from(e.headers),e.data=et.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ct(e.adapter||He.adapter,e)(e).then(function(t){return Lt(e),t.data=et.call(e,e.transformResponse,t),t.headers=Ze.from(t.headers),t},function(t){return tt(t)||(Lt(e),t&&t.response&&(t.response.data=et.call(e,e.transformResponse,t.response),t.response.headers=Ze.from(t.response.headers))),Promise.reject(t)})}const $t="1.12.2",_t={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_t[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const vt={};_t.transitional=function(e,t,r){function n(e,t){return"[Axios v"+$t+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new Ae(n(o," has been removed"+(t?" in "+t:"")),Ae.ERR_DEPRECATED);return t&&!vt[o]&&(vt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}},_t.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=t[s];if(a){const t=e[s],r=void 0===t||a(t,s,e);if(!0!==r)throw new Ae("option "+s+" must be "+r,Ae.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}},validators:_t},Bt=Dt.validators;class kt{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Dt.assertOptions(r,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),null!=n&&(we.isFunction(n)?t.paramsSerializer={serialize:n}:Dt.assertOptions(n,{encode:Bt.function,serialize:Bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dt.assertOptions(t,{baseUrl:Bt.spelling("baseURL"),withXsrfToken:Bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&we.merge(o.common,o[t.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ze.concat(s,o);const a=[];let i=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!i){const e=[Ut.bind(this),void 0];for(e.unshift(...a),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=a.length;let p=t;for(;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Ut.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ve(ut((e=pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],function(e){kt.prototype[e]=function(t,r){return this.request(pt(r||{},{method:e,url:t,data:(r||{}).data}))}}),we.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}kt.prototype[e]=t(),kt.prototype[e+"Form"]=t(!0)});const jt=kt;class xt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new nt(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xt(function(t){e=t}),cancel:e}}}const Mt=xt,Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ft).forEach(([e,t])=>{Ft[t]=e});const qt=Ft,Gt=function e(t){const r=new jt(t),n=C(jt.prototype.request,r);return we.extend(n,jt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(pt(t,r))},n}(He);Gt.Axios=jt,Gt.CanceledError=nt,Gt.CancelToken=Mt,Gt.isCancel=tt,Gt.VERSION=$t,Gt.toFormData=Pe,Gt.AxiosError=Ae,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=function(e){return function(t){return e.apply(null,t)}},Gt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},Gt.mergeConfig=pt,Gt.AxiosHeaders=Ze,Gt.formToJSON=e=>Ve(we.isHTMLForm(e)?new FormData(e):e),Gt.getAdapter=Ct,Gt.HttpStatusCode=qt,Gt.default=Gt;const Vt=Gt,Kt=async e=>{try{const{message:t,response:r,request:n}=e;let o=t;return r?o+=` - The request was made and the server responded with ${JSON.stringify({status:r.status,data:r.data})}`:n&&(o+=" - The request was made but no response was received"),console.warn(o),await(0,h.reportError)(new Error(o)),o}catch(e){return console.warn(`Cannot handle error: ${e.message}`),e.message}},{APIS:{ASSETS_API:{BASE_URL:Ht,ENDPOINTS:{USERS:Yt,CERTIFICATES:Wt}}}}=E,zt={create:async(e,t)=>{let r=[];try{const{data:n}=await Vt.post(`${Ht}${Yt}/${e}${Wt}`,t);n&&(r=n)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:Jt,ENDPOINTS:{USERS:Qt,PROFILE_IMAGES:Xt}}}}=E,Zt={create:async({userId:e,fileObject:t})=>{let r=[];try{if(!e)throw new Error("userSlug not found!");const n=new FormData;n.append("file",t);const{data:o}=await Vt.post(`${Jt}${Qt}/${e}${Xt}`,n);o&&(r=o)}catch(e){await Kt(e)}return r}},{APIS:{ASSETS_API:{BASE_URL:er,ENDPOINTS:{LINK_PREVIEWS:tr}}}}=E,rr={certificates:zt,profileImages:Zt,linkPreviews:{get:async e=>{let t={};try{if(!e)throw new Error("url not found!");const{data:r}=await Vt.get(`${er}${tr}/${encodeURIComponent(btoa(e))}`);r&&r.url&&(t=r)}catch(e){await Kt(e)}return t}}},{APIS:{AUTH_API:{BASE_URL:nr,ENDPOINTS:{USER_PASSWORD:or,USERS:sr}}},USERS:{MYSELF:ar}}=E,ir={userPassword:{update:async e=>{let t=null;try{t=await Vt.put(`${nr}${sr}/${ar}${or}`,e)}catch(e){t={message:(((e||{}).response||{}).data||{}).message},await Kt(e)}return t}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:cr,ENDPOINTS:{ANSWERS:lr,QUESTIONS:ur,LIKES:dr}}}}=E,pr=`${cr}${ur}`,hr={create:async({questionSlug:e},t)=>{try{await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.put(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`,r)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${pr}/${encodeURIComponent(e)}${lr}/${encodeURIComponent(t)}${dr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:fr,ENDPOINTS:{QUESTIONS:Er}}}}=E,Sr=`${fr}${Er}`,gr={create:async e=>{try{return await Vt.post(Sr,e)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e})=>{try{await Vt.delete(`${Sr}/${encodeURIComponent(e)}`)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e},t)=>{try{return await Vt.put(`${Sr}/${encodeURIComponent(e)}`,t)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:mr,ENDPOINTS:{REPLIES:wr,ANSWERS:yr,QUESTIONS:Ir,LIKES:Rr}}}}=E,Ar=`${mr}${Ir}`,Tr=({questionSlug:e,answerSlug:t,replySlug:r},n=!1)=>{let o=`${Ar}/${encodeURIComponent(e)}${yr}/${encodeURIComponent(t)}${wr}`;return r&&(o=`${o}/${encodeURIComponent(r)}`,n&&(o=`${o}${Rr}`)),o},br={create:async({questionSlug:e,answerSlug:t},r)=>{try{return await Vt.post(Tr({questionSlug:e,answerSlug:t}),r)}catch(e){const t=await Kt(e);throw new Error(t)}},update:async({questionSlug:e,answerSlug:t,replySlug:r},n)=>{try{return await Vt.put(Tr({questionSlug:e,answerSlug:t,replySlug:r}),n)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Tr({questionSlug:e,answerSlug:t,replySlug:r}))}catch(e){const t=await Kt(e);throw new Error(t)}},like:async({questionSlug:e,answerSlug:t,replySlug:r,payload:n})=>{try{await Vt.post(Tr({questionSlug:e,answerSlug:t,replySlug:r},!0),n)}catch(e){const t=await Kt(e);throw new Error(t)}},unlike:async({questionSlug:e,answerSlug:t,replySlug:r})=>{try{await Vt.delete(Tr({questionSlug:e,answerSlug:t,replySlug:r},!0))}catch(e){const t=await Kt(e);throw new Error(t)}},getReplyUrl:Tr},{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Or,ENDPOINTS:{QUESTIONS:Nr,ANSWERS:Pr,LIKES:Cr}}}}=E,Lr=`${Or}${Nr}`,Ur={answers:hr,questions:gr,replies:br,likes:{create:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.post(`${Lr}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Cr}`)}catch(e){const t=await Kt(e);throw new Error(t)}},remove:async({questionSlug:e,answerSlug:t})=>{try{return await Vt.delete(`${Lr}/${encodeURIComponent(e)}${Pr}/${encodeURIComponent(t)}${Cr}`)}catch(e){const t=await Kt(e);throw new Error(t)}}}},{APIS:{MANAGEMENT_API:{BASE_URL:$r,ENDPOINTS:{ACCOUNTS:_r}}}}=E,vr={create:async e=>{try{await Vt.post(`${$r}${_r}`,e)}catch(e){throw await Kt(e),e}},read:async e=>{let t=null;try{({data:t}=await Vt.get(`${$r}${_r}/${encodeURIComponent(e)}`))}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${$r}${_r}/${encodeURIComponent(e)}`,t)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Dr,ENDPOINTS:{EVENT_REGISTRATIONS:Br}}}}=E,kr={create:async e=>{try{await Vt.post(`${Dr}${Br}`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:jr,ENDPOINTS:{LOGINS:xr,LOGIN_PASSWORDLESS:Mr}}}}=E,Fr=`${jr}${xr}`,qr={update:async e=>{try{await Vt.put(`${Fr}/${encodeURIComponent(e)}${Mr}`)}catch(e){throw await Kt(e),e}}},{APIS:{MANAGEMENT_API:{BASE_URL:Gr}}}=E,Vr={create:async e=>{try{await Vt.post(`${Gr}/users/${e.id}/products`,e)}catch(e){const t=await Kt(e);throw new Error(t)}}},{APIS:{MANAGEMENT_API:{BASE_URL:Kr,ENDPOINTS:{PROFILE:Hr}}}}=E,Yr={accounts:vr,eventRegistrations:kr,passwordless:qr,userProducts:Vr,profile:{update:async e=>{try{const t=["name","jobTitle","organization","location","biography","image"];if(!Object.keys(e).some(e=>t.includes(e)))throw new Error("Profile data should include at least one of 'name', 'jobTitle', 'organization', 'location', 'biography', 'image'");await Vt.put(`${Kr}${Hr}`,e)}catch(e){const t=await Kt(e);throw new Error(`An error occurred while trying to update the user's profile in the management api: ${t}`)}}}},{APIS:{MGMT_API:{BASE_URL:Wr,ENDPOINTS:{REFERRALS:zr}}}}=E,Jr={create:async e=>{try{await Vt.post(`${Wr}${zr}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:Qr,ENDPOINTS:{BULK_REFERRALS:Xr}}}}=E,Zr={create:async e=>{try{await Vt.post(`${Qr}${Xr}`,e)}catch(e){throw await Kt(e),e}}},{APIS:{MGMT_API:{BASE_URL:en,ENDPOINTS:{BULK_ENROLMENTS:tn}}}}=E,rn={referrals:Jr,bulkReferrals:Zr,bulkEnrolments:{create:async e=>{try{await Vt.post(`${en}${tn}`,e)}catch(e){throw await Kt(e),e}}}},{APIS:{PAYMENTS_API:{BASE_URL_V2:nn,ENDPOINTS:{PRODUCTS:on}}}}=E,sn=`${nn}${on}`,an={products:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(sn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_API:{BASE_URL_V2:cn,ENDPOINTS:{BULK_ENROLMENTS:ln}}}}=E,un={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${cn}${ln}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}};var dn=c(606);const{OK:pn,MULTIPLE_CHOICES:hn,NOT_FOUND:fn,FORBIDDEN:En}=dn.StatusCodes,Sn=e=>e>=pn&&e<hn||e===En||e===fn,{APIS:{PEOPLE_API:{BASE_URL_V2:gn,ENDPOINTS:{USERS:mn}}},STATUS_CODES:{INVALID_TOKEN:wn},ERROR_MESSAGES:{INVALID_TOKEN:yn}}=E,In=async e=>{let t=null;try{const{data:r}=await Vt.get(`${gn}${mn}/${encodeURIComponent(e)}`,{validateStatus:Sn});r&&r.id&&(t=r)}catch(e){if(e?.response?.status===wn)throw new Error(yn);await Kt(e)}return t},Rn=async e=>{let t=[];try{if(e&&e.length<2)throw new Error("users list method requires at least two ids");const r=e.map(e=>`ids=${encodeURIComponent(e)}`).join("&"),n=await Vt.get(`${gn}${mn}?${r}`,{validateStatus:Sn});n&&n.length&&(t=n)}catch(e){await Kt(e)}return t},An={read:In,update:async(e,t)=>{let r=!1;try{const{data:n}=await Vt.put(`${gn}${mn}/${encodeURIComponent(e)}`,t);r=!(!n||!n.id)}catch(e){await Kt(e)}return r},list:Rn},{APIS:{PEOPLE_API:{BASE_URL_V2:Tn,ENDPOINTS:{USERS:bn,USER_LIKES:On}}},USERS:{MYSELF:Nn}}=E,Pn=`${Tn}${bn}/${Nn}${On}`,Cn=async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Pn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},Ln={list:Cn},Un={authors:{readQuestionAuthors:async(e,t,r)=>{try{if(e.author=await In(e.authorId),e.answers&&e.answers.length&&!r.ignoreAnswersAuthors){e.answers.sort((e,t)=>new Date(t.updatedAt)-new Date(e.updatedAt)),e.totalAnswers=e.answers.length;let n=e.answers;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.answers.slice(t,t+r.limit)}for(let e of n){e.author=e.authorId&&await In(e.authorId)||{};const[r]=t?await Cn({contentType:E.CONTENTFUL.ANSWERS.TYPE,contentSlug:e.slug}):[null];e.userLiked=!!r}e.answers=n}else e.answers||(e.answers=[]);return e}catch(e){throw await Kt(e),new Error(`Cannot read authors for question: ${e.message}`)}},readAuthors:async(e=[])=>{let t=[];try{if(!1===Array.isArray(e))throw new Error("authorIds is not an array!");if(e&&1===e.length){const r=await In(e[0]);r&&t.push(r)}else if(e&&e.length>1){const r=await Rn(e);r&&r.length>0&&(t=r)}}catch(e){throw await Kt(e),new Error(`Cannot read authors: ${e.message}`)}return t}}},{APIS:{PEOPLE_API:{BASE_URL:$n,ENDPOINTS:{REGISTRATIONS:_n}}}}=E,vn={list:async e=>{let t=[];try{const{data:r}=await Vt.get(`${$n}${_n}`,{params:e});r&&r.length&&(t=r)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:Dn,ENDPOINTS:{COMMUNITIES:Bn,USERS:kn}}}}=E,jn=`${Dn}${kn}`;function xn(e){const t=e["content-range"].split(" ")[1].split("/"),[r,n,o]=[...t[0].split("-"),t[1]].map(e=>parseInt(e,10)||0);return{start:r,end:n,total:o}}const Mn={list:async(e="me",t={})=>{let r={items:[],start:0,end:0,total:0},n=t?{params:t}:{params:{}};try{const{data:t,headers:o}=await Vt.get(`${jn}/${e}${Bn}`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});return t?.length>0&&(r={data:t,pagination:xn(o)}),r}catch(e){await Kt(e)}return r}},{APIS:{PEOPLE_API:{BASE_URL_V2:Fn,ENDPOINTS:{USERS:qn,USER_COURSES:Gn}}},USERS:{MYSELF:Vn}}=E,Kn=`${Fn}${qn}/${Vn}${Gn}`,Hn={create:async e=>{try{await Vt.post(Kn,e)}catch(e){await Kt(e)}},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Kn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${Kn}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:Yn,ENDPOINTS:{USERS:Wn,USER_EVENTS:zn}}},USERS:{MYSELF:Jn}}=E,Qn=`${Yn}${Wn}/${Jn}${zn}`,Xn={list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Qn,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:Zn,ENDPOINTS:{USERS:eo,USER_LESSONS:to}}},USERS:{MYSELF:ro}}=E,no=`${Zn}${eo}/${ro}${to}`,oo={create:async e=>{let t=null;try{t=await Vt.post(no,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(no,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}},{APIS:{PEOPLE_API:{BASE_URL_V2:so,ENDPOINTS:{USERS:ao,USER_PRODUCTS:io}}},USERS:{MYSELF:co}}=E,lo=`${so}${ao}/${co}${io}`,uo={create:async e=>{let t=null;try{t=await Vt.post(lo,e)}catch(e){await Kt(e)}return t},list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(lo,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${lo}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:po,ENDPOINTS:{USERS:ho,USER_RATINGS:fo}}},USERS:{MYSELF:Eo}}=E,So=`${po}${ho}/${Eo}${fo}`,go={create:async e=>{let t=null;try{const{data:r}=await Vt.post(So,e);r?.id&&(t=r)}catch(e){await Kt(e)}return t},update:async(e,t)=>{try{await Vt.put(`${So}/${e}`,t)}catch(e){await Kt(e)}}},{APIS:{PEOPLE_API:{BASE_URL_V2:mo,ENDPOINTS:{USERS:wo,USER_REFERRALS:yo}}},USERS:{MYSELF:Io}}=E,Ro=`${mo}${wo}/${Io}${yo}`,Ao={bulkEnrolments:un,handlers:Un,registrations:vn,users:An,userCommunities:Mn,userCourses:Hn,userEvents:Xn,userLessons:oo,userLikes:Ln,userProducts:uo,userRatings:go,userReferrals:{list:async e=>{let t=[],r=e?{params:e}:{params:{}};try{const{data:e}=await Vt.get(Ro,r);e&&e.length&&(t=e)}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:To,ENDPOINTS:{ENQUIRY_EMAILS:bo}}}}=E,Oo={create:async e=>{let t=null;try{const{data:r}=await Vt.post(`${To}${bo}`,e);r&&(t=r)}catch(e){await Kt(e)}return t}},No={forms:{sendEnquiryEmails:async e=>{let t=null;try{const{emailIds:r}=I();t=await $o.emails.create({...r,...e})}catch(e){await Kt(e)}return t}}},{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Po,ENDPOINTS:{USERS:Co,USER_PROPERTIES:Lo}}},USERS:{MYSELF:Uo}}=E,$o={emails:Oo,handlers:No,userProperties:{update:async(e,t)=>{try{await Vt.put(`${Po}${Co}/${Uo}${Lo}/${e}`,t)}catch(e){await Kt(e)}}}};var _o=c(443);const{APIS:{SEARCH_API:{BASE_URL:vo,ENDPOINTS:{AI_SEARCH:Do}}}}=E,Bo=`${vo}${Do}`,ko={ask:async e=>{try{let t=null;const{data:r}=await Vt.get(Bo,{params:{question:e}});return r?.answer&&r?.references&&r?.version&&(t=r),t}catch(e){const t=await Kt(e);throw new Error(t)}},stream:(e,t,r)=>{const n=(0,_o.io)(void 0,{path:"/api/search-api/web-sockets"});function o(){n.emit("ai-search",{question:e})}function s(e){r(e),a(),n.disconnect()}function a(){n.off("connect",o),n.off("update",t),n.off("result",s)}return n.on("connect",o),n.on("update",t),n.on("result",s),a}},{APIS:{SEARCH_API:{BASE_URL:jo,ENDPOINTS:{CHATBOT:{COURSES:xo}}}}}=E,Mo=`${jo}${xo}`;async function Fo(e,t){try{let r=null;const{data:n}=await Vt.get(`${Mo}/${e}`,{params:{text:t}});return n&&(r=n),r}catch(e){await Kt(e)}}const qo=(e,t,r,n)=>{const o=(0,_o.io)(void 0,{path:"/api/search-api/web-sockets"});function s(){o.emit("chatbot",{text:e,courseSlug:t})}o.on("connect",s),o.on("update",r),o.on("result",function e(t){n(t),o.off("connect",s),o.off("update",r),o.off("result",e),o.disconnect()})};async function Go(e){try{let t=null;const{data:r}=await Vt.delete(`${Mo}/${e}`);return r&&(t=r),t}catch(e){await Kt(e)}}const Vo={...ko,chatbot:{courses:d}},{APIS:{SOCIALS_API:{BASE_URL:Ko,ENDPOINTS:{COMMUNITIES:Ho},PATHS:{ACTIVITIES:Yo}}}}=E,Wo=`${Ko}${Ho}`,zo={read:async(e,t)=>{let r=null;try{const{data:n}=await Vt.get(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`);n&&(r=n)}catch(e){await Kt(e)}return r},list:async(e,t={})=>{let r=null;try{const{data:n}=await Vt.get(`${Wo}/${encodeURIComponent(e)}/${Yo}`,{params:t});n&&(r=n)}catch(e){await Kt(e)}return r},create:async(e,t)=>{let r=null;try{const{data:n}=await Vt.post(`${Wo}/${encodeURIComponent(e)}/${Yo}`,t);(n?.content||n?.title)&&(r=n)}catch(e){await Kt(e)}return r},update:async(e,t,r)=>{let n=null;try{const{data:o}=await Vt.put(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`,r);(o?.content||o?.title)&&(n=o)}catch(e){await Kt(e)}return n},remove:async(e,t)=>{let r=null;try{const{data:n}=await Vt.delete(`${Wo}/${encodeURIComponent(e)}/${Yo}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:Jo,ENDPOINTS:{COMMUNITIES:Qo}}}}=E,Xo=`${Jo}${Qo}`,Zo={read:async e=>{let t=null;try{const{data:r}=await Vt.get(`${Xo}/${encodeURIComponent(e)}`);r?.title?t=r:r?.page?.title&&(t=r?.page)}catch(e){await Kt(e)}return t},join:async(e,t)=>{let r=null;try{const{data:n}=await Vt.post(`${Xo}/${encodeURIComponent(e)}/members`,t);r=n}catch(e){await Kt(e)}return r},leave:async e=>{let t=null;try{const{data:r}=await Vt.delete(`${Xo}/${encodeURIComponent(e)}/members/me`);t=r}catch(e){await Kt(e)}return t}},{APIS:{SOCIALS_API:{BASE_URL:es,ENDPOINTS:{COMMUNITIES:ts},PATHS:{ACTIVITIES:rs,REACTIONS:ns}}}}=E,os=`${es}${ts}`,ss={create:async({slug:e,activityId:t,reactionId:r})=>{let n=null;const o={kind:"like"};let s=`${os}/${encodeURIComponent(e)}`;s=t?`${s}/${rs}/${t}/${ns}`:`${s}/${ns}/${r}/${ns}`;try{const{data:e}=await Vt.post(s,o);n=e}catch(e){await Kt(e)}return n},remove:async({slug:e,reactionId:t})=>{let r=null;try{const{data:n}=await Vt.delete(`${os}/${encodeURIComponent(e)}/${ns}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:as,ENDPOINTS:{COMMUNITIES:is}}}}=E,cs=`${as}${is}`,ls={list:async(e,t)=>{let r={data:[],pagination:{start:0,end:0,total:0}},n=t?{params:t}:{params:{}};try{const{data:t}=await Vt.get(`${cs}/${encodeURIComponent(e)}/members`,{...n,headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});(t?.data?.length>0||t?.pagination)&&(r=t)}catch(e){await Kt(e)}return r},read:async(e,t=!0)=>{let r=null;try{let n=`${cs}/${encodeURIComponent(e)}/members`;t&&(n+="/me");const o=await Vt.get(n,{headers:{"Cache-Control":"no-cache",Pragma:"no-cache",Expires:0}});r=o.data,!r&&o.pagnination&&(r=o.pagnination)}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:us,ENDPOINTS:{COMMUNITIES:ds},PATHS:{ACTIVITIES:ps,REACTIONS:hs}}}}=E,fs=`${us}${ds}`,Es={create:async({slug:e,activityId:t})=>{let r=null;const n={kind:"pin"};let o=`${fs}/${encodeURIComponent(e)}`;o=`${o}/${ps}/${t}/${hs}`;try{const{data:e}=await Vt.post(o,n);r=e}catch(e){await Kt(e)}return r},remove:async({slug:e,reactionId:t})=>{let r=null;try{const{data:n}=await Vt.delete(`${fs}/${encodeURIComponent(e)}/${hs}/${t}`);r=n}catch(e){await Kt(e)}return r}},{APIS:{SOCIALS_API:{BASE_URL:Ss,ENDPOINTS:{COMMUNITIES:gs},PATHS:{ACTIVITIES:ms,REACTIONS:ws}}}}=E,ys=`${Ss}${gs}`,Is={activities:zo,communities:Zo,members:ls,likes:ss,pins:Es,reactions:{create:async(e,t,r,n)=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}/${ws}`:`${s}/${ws}/${r}/${ws}`;try{const{data:e}=await Vt.post(s,n);o=e}catch(e){await Kt(e)}return o},list:async(e,{activityId:t,reactionId:r},n={})=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}/${ws}`:`${s}/${ws}/${r}/${ws}`;try{const{data:e}=await Vt.get(s,{params:n});e&&(o=e)}catch(e){await Kt(e)}return o},remove:async(e,t)=>{let r=null;try{const{data:n}=await Vt.delete(`${ys}/${encodeURIComponent(e)}/${ws}/${t}`);r=n}catch(e){await Kt(e)}return r},update:async(e,t,r,n)=>{let o=null,s=`${ys}/${encodeURIComponent(e)}`;s=t?`${s}/${ms}/${t}`:`${s}/${ws}/${r}`;try{const{data:e}=await Vt.put(s,n);o=e}catch(e){await Kt(e)}return o}}},{CONTENTFUL:Rs}=E,{TYPE:As,ORDER:Ts,SELECT:bs,SKIP:Os,LIMIT:Ns,INCLUDE:Ps}=Rs.BADGES,Cs={list:async()=>{try{return await(0,p.getEntries)({content_type:As,include:Ps,limit:Ns,order:Ts,select:bs,skip:Os})}catch(e){return await Kt(e),[]}}},{CONTENTFUL:Ls}=E,{CARD_TYPES:Us}=Ls.CAROUSELS,$s={read:async(e,t)=>{try{if(!t||!t.sys||!t.sys.id)throw new Error("Invalid link to card");if(!e||!Us[e])throw new Error("Unsupported card content type");const{INCLUDE:r,SELECT:n}=Us[e],o=await(0,p.getEntry)({content_type:e,"sys.id":t.sys.id,include:r,select:n},{assetDetails:!0});if("courseJourney"===e){const e=await(0,p.getEntry)({content_type:"course","fields.journeys.sys.id":t.sys.id,include:1,select:"fields.slug,fields.journeys"});o.courseParent=e}return o}catch(e){throw await Kt(e),new Error(`Cannot read carousel card: ${e.message}`)}}},_s=$s,{CONTENTFUL:vs}=E,{INCLUDE:Ds,SELECT:Bs,TYPE:ks}=vs.EDITORIAL_PAGES,js={read:async e=>{try{return await(0,p.getEntry)({content_type:ks,"fields.slug":e,include:Ds,select:Bs})}catch(e){throw await Kt(e),new Error(`Cannot read editorial page: ${e.message}`)}}},{CONTENTFUL:xs}=E,{TYPE:Ms,ORDER:Fs,SELECT:qs,SKIP:Gs,LIMIT:Vs,INCLUDE:Ks}=xs.QUESTIONS,Hs={read:async e=>{try{return await(0,p.getEntry)({content_type:Ms,"fields.slug":e,include:2,select:qs})}catch(e){throw await Kt(e),new Error(`Cannot read question: ${e.message}`)}},list:async(e={})=>{try{return await(0,p.getEntries)({content_type:Ms,include:Ks,limit:Vs,order:Fs,select:qs,skip:Gs,...e})}catch(e){throw await Kt(e),new Error(`Cannot list questions: ${e.message}`)}}};var Ys=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;0!==o--;){var a=s[o];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r};const Ws="__googleMapsScriptId";var zs;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(zs||(zs={}));class Js{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:n,id:o=Ws,language:s,libraries:a=[],mapIds:i,nonce:c,region:l,retries:u=3,url:d="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=n,this.id=o||Ws,this.language=s,this.libraries=a,this.mapIds=i,this.nonce=c,this.region=l,this.retries=u,this.url=d,this.version=p,Js.instance){if(!Ys(this.options,Js.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Js.instance.options)}`);return Js.instance}Js.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?zs.FAILURE:this.done?zs.SUCCESS:this.loading?zs.LOADING:zs.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`&region=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))return void this.callback();const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(e=>!r[e]&&delete r[e]),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{let t,r,n,o="The Google Maps JavaScript API",s="google",a="importLibrary",i="__ib__",c=document,l=window;l=l[s]||(l[s]={});const u=l.maps||(l.maps={}),d=new Set,p=new URLSearchParams,h=()=>t||(t=new Promise((a,l)=>{return h=this,f=void 0,S=function*(){var h;for(n in yield r=c.createElement("script"),r.id=this.id,p.set("libraries",[...d]+""),e)p.set(n.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase()),e[n]);p.set("callback",s+".maps."+i),r.src=this.url+"?"+p,u[i]=a,r.onerror=()=>t=l(Error(o+" could not load.")),r.nonce=this.nonce||(null===(h=c.querySelector("script[nonce]"))||void 0===h?void 0:h.nonce)||"",c.head.append(r)},new((E=void 0)||(E=Promise))(function(e,t){function r(e){try{o(S.next(e))}catch(e){t(e)}}function n(e){try{o(S.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof E?o:new E(function(e){e(o)})).then(r,n)}o((S=S.apply(h,f||[])).next())});var h,f,E,S}));u[a]?console.warn(o+" only loads once. Ignoring:",e):u[a]=(e,...t)=>d.add(e)&&h().then(()=>u[a](e,...t))})(r);const n=this.libraries.map(e=>this.importLibrary(e));n.length||n.push(this.importLibrary("core")),Promise.all(n).then(()=>this.callback(),e=>{const t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setScript())}}}const{GOOGLE:{MAPS:{LIBRARIES:{GEOCODING:Qs,PLACES:Xs},VERSION:Zs}}}=E,ea=function(e={}){let t=[];const r=I(),n=new Js({apiKey:r?.googleMaps?.apiKey,version:Zs});return{buildLocation:async function(e){try{const r=t.find(t=>t.description===e);if(!r)throw new Error("Place not found");const{place_id:o,description:s}=r,{Geocoder:a}=await n.importLibrary(Qs),i=new a;return new Promise(e=>{i.geocode({placeId:o},(t=[],r)=>{if("OK"===r){const r=t[0].address_components.find(e=>e.types.includes("country")),n=r?r.short_name:null;e({id:o,en:s,code:n})}else e({id:o,en:s,code:null})}).catch(()=>e({id:o,en:s,code:null}))})}catch(e){return await Kt(e),null}},isValidPlace:function(e){return t.some(t=>t.description===e)},predictPlaces:async function(r){try{const{AutocompleteService:o}=await n.importLibrary(Xs),s=new o;return new Promise(n=>{s.getPlacePredictions({...e,input:r,types:["(cities)"]},(e=[],r)=>{"OK"===r?(t=e,n(e)):n([])}).catch(()=>n([]))})}catch(e){return await Kt(e),[]}}}},ta=async(e,t,r={ignoreAnswersAuthors:!1})=>{try{let n={};return n=await Hs.read(e),n=await Ao.handlers.authors.readQuestionAuthors(n,t,r),n}catch(e){throw await Kt(e),new Error(`Cannot build question: ${e.message}`)}},{ARTICLES:{TYPE:ra},COURSES:{TYPE:na},COURSE_JOURNEYS:{TYPE:oa},CUSTOM_CARD:{TYPE:sa},COMMUNITY:{TYPE:aa},EVENTS:{TYPE:ia},LISTS:{TYPE:ca},QUESTIONS:{TYPE:la},LEARNING_HUB:{TYPE:ua}}=E.CONTENTFUL,da={ClosedHidden:"closed-hidden",ClosedVisible:"closed-visible",OpenHidden:"open-hidden",OpenVisible:"open-visible"},pa=e=>e&&e.url?(Object.assign(e,{aspect:"responsiveCard",query:"q=90&fit=fill"}),e):null,ha=e=>e&&e.url?`${e.url}?w=100&h=100&fit=thumb&f=center`:null,fa=e=>e.toLowerCase().split(" ")[0],Ea={[ra]:async e=>{const{authorIds:t,authorTag:r,image:n,coverImage:o,publishedDate:s,readingTime:a,slug:i,title:c}=e;let l=n;o&&(l.url=o.url,l.width=o.width,l.height=o.height,l.color=o.color);const u=await Ao.handlers.authors.readAuthors(t),d=u&&u.length?u:r?[fa(r)]:null;return{banner:pa(l),contributors:d,publishedDate:s,readingTime:a,slug:i,title:c}},[aa]:async e=>{const{title:t,slug:r,image:n,privacy:o,createdAt:s}=e,a=[da.ClosedVisible,da.ClosedHidden].includes(o),i=[da.OpenVisible,da.ClosedVisible].includes(o);return{banner:n?pa(n):null,slug:r,title:t,privacy:o,isPrivate:a,isVisible:i,createdAt:s}},[na]:async(e,t)=>{const{banner:r,freeCourse:n,partnershipDetails:o,slug:s,title:a,registered:i,courseType:c,courseV2:l}=e,u={banner:pa(r),slug:s,title:a,pill:n?"free":"premium",registered:!!i,courseType:c,courseV2:l};if(o){const{partners:e}=o;if(e)if(e.length>1){let t=[];for(let r=0;r<e.length;r++)t.push(e[r].title);u.partner=t}else u.partner=[e[0].title]}if(void 0===i&&t){const[e]=await Ao.userProducts.list({courseSlug:s});u.registered=!!e}return u},[oa]:async(e,t)=>{const{bannerImage:r,slug:n,title:o,courseParent:s,accessPrivacy:a,partnerLogos:i,locale:c}=e;let l,u=!1;if(t){const[e]=await Ao.userProducts.list({courseSlug:s.slug,journeySlug:n});u=!!e}return l=s.journeys&&s.journeys[0]?.slug===n?s.slug:`${s.slug}/${n}`,{banner:pa(r),slug:l,title:o,partner:i?i.map(e=>e.title):[],registered:u,pill:a.includes("open")?"free":"premium",courseType:a.includes("public")?"Public":"Private",customLabel:"Course",locale:c||"en"}},[sa]:e=>{const{authorName:t,authorImage:r,icon:n,image:o,label:s,link:a,primaryText:i}=e;return{...e,banner:o?pa(o):null,customIcon:n?n.toLowerCase():null,customLabel:s,contributors:t?[{name:t,image:r?{thumbnail:ha(r)}:null}]:null,slug:a,text:i}},[ia]:async(e,t)=>{const{bannerImage:r,defaultStartDate:n,isEventOngoing:o,slug:s,speakers:a,title:i,registered:c}=e,l=new Date(n),u=!!l&&l<new Date;if(a&&a.length)for(const e of a)e.image=ha(e.image);const d={banner:pa(r),dateHasPassed:u,title:i,slug:s,isOngoingEvent:o,contributors:a,startDate:l,registered:!!c};if(void 0===c&&t){const[e]=await Ao.userEvents.list({eventSlug:s});d.registered=!!e}return d},[ca]:async e=>{const{hero:t,slug:r,title:n}=e;return{banner:pa(t),slug:r,title:n}},[la]:async e=>{const{answers:t,authorId:r,createdAt:n,slug:o,title:s}=e;let a=null;if(r){const e=await Ao.users.read(r);e&&(a=e)}return{answers:t&&t.length?t.length:0,contributors:a?[a]:[],createdAt:n,slug:o,title:s}},[ua]:e=>{const{bannerSection:t,customLabel:r,slug:n,title:o}=e;return{banner:pa(t.image),slug:n,title:o,customLabel:r}},people:e=>{const{id:t,name:r,jobTitle:n,location:o,image:s,customLink:a}=e;return{profile:s,slug:a?.link||t,title:r,text:n,secondaryText:o,customLinkText:a?.text}}},Sa=async({contentType:e,...t}={},r)=>{try{if(!Ea[e])throw new Error("Content type not supported");if("function"!=typeof Ea[e])throw new Error("No builder function for content type");return"people"!==e&&t.sys&&t.sys.type&&"Link"===t.sys.type&&(t=await _s.read(e,t)),{contentType:e,...await Ea[e](t,r)}}catch(e){throw await Kt(e),new Error(`Cannot build carousel card: ${e.message}`)}},ga=async(e,t,r={})=>{try{if(!e.replies||0===e.replies.length)return e.replies=[],e;e.replies.sort((e,t)=>new Date(e.postedAt)-new Date(t.postedAt)),e.totalReplies=e.totalReplies||e.replies.length;let n=e.replies;if(r.limit&&r.pageNumber){const t=r.limit*(r.pageNumber-1);n=e.replies.slice(t,t+r.limit)}for(const r of n){if(r.authorId===e.authorId){r.author=e.author,r.userLiked=!1;continue}r.author=r.authorId&&await In(r.authorId)||{};const[n]=t?await Cn({contentType:E.CONTENTFUL.REPLIES.TYPE,contentSlug:r.slug}):[null];r.userLiked=!!n}return e.replies=n,e}catch(e){throw await Kt(e),new Error(`Cannot build replies for answer: ${e.message}`)}},ma="success",wa="error",ya=e=>async t=>{const{contentType:r}=t;switch(r){case"event":try{return await Yr.eventRegistrations.create({eventSlug:t.slug,expectation:null,userEmail:e.email,startsAt:new Date(t.startDate).toISOString()}),ma}catch(e){return reportError(new Error(`Error registering for event: ${JSON.stringify(e)}`)),wa}case"microcourse":try{return await Yr.userProducts.create({id:e.id,courseSlug:t.slug,email:e.email,courseType:t.courseType}),ma}catch(e){return reportError(new Error(`Error registering for microcourse: ${JSON.stringify(e)}`)),wa}case"communityPage":try{return await Is.communities.join(t.slug,{...e.image.thumbnail&&{thumbnail:e.image.thumbnail},...e.jobTitle&&{jobTitle:e.jobTitle},...e.location&&{location:{...e.location}},...e.organization&&{organization:e.organization}}),ma}catch(e){return reportError(new Error(`Error joining community: ${JSON.stringify(e)}`)),wa}default:return wa}};var Ia=c(18);const Ra=e=>e&&Ia.Buffer.from(e,"base64").toString("ascii");function Aa({contentContext:e=null,errorsContext:t=null,googleMapsContext:r=null,gtmContext:n=null,origin:o}){try{const s=P(o);return e&&(0,p.setContext)(Object.assign({},e,{environment:s})),t&&(0,h.setContext)(Object.assign({},t,{environment:s})),r&&y(Object.assign({},r,{environment:s})),n&&((0,f.setContext)(Object.assign({},n,{environment:s})),(0,f.setupGTM)()),w(Object.assign({},{environment:s})),s}catch(e){console.warn(`Cannot load SDK: ${e.message}`)}}return l})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/sdk",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "Browser library to interact with Apolitical's APIs",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",