New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@foxford/foxford-js-sdk

Package Overview
Dependencies
Maintainers
11
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxford/foxford-js-sdk - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

165

foxford.cjs.d.ts

@@ -5,2 +5,3 @@ import { AxiosInstance } from 'axios'

host?: string;
widgetsVersion?: 'latest' | string;
}

@@ -20,2 +21,119 @@

export type Course = {
id: number,
name: string,
subtitle: string,
showRating: boolean,
trainer: boolean,
purchaseMode: string,
webinar: boolean,
timingTitle: string,
timingDescription: string,
asynchronous: boolean,
url: string,
isAgentCourse: boolean,
isKpk: boolean,
isKpp: boolean,
isSimpleCourse: boolean,
lessonsDay: string,
dayTemplates: Array<string>,
fullTitle: string,
levels: Array<{ id: number, name: string }>,
discipline: {
id: number,
name: string,
color: string,
darkColor: string,
image: string,
svgImage: string,
},
teacher: {
id: number,
aliasUrl: string,
university: string,
shortName: string,
url: string,
photoUrl: string,
},
gradesRange: string,
grades: Array<{ id: number, name: string }>,
courseType: { id: number, name: string },
cartItem: {
fullAccessFinishDate: string,
type: string,
price: number,
priceWithDiscount: number,
pricePerHour: number,
pricePerMonth: number,
pricePerMonthWithDiscount: number,
creditAvailable: boolean,
},
usersCourse: {
accessExpiredAt: null,
active: boolean,
entireCoursePurchased: boolean,
purchaseState: string,
accessReason: null,
},
}
export type ProductTypeItem = {
type: string,
id: number,
description: string,
title: string,
discipline: { id: number, name: string },
teacher: {
id: number,
long_name: string,
description: string,
experience: number,
photo_url: string,
photo_large_url: string,
},
levels: Array<{ id: number, name: string }>,
}
export type ProductPack = {
name: string,
description: string,
meta_title: string,
meta_description: string,
published: true,
content_description: string,
disciplines_scope: string,
guaranteed_admission: true,
grade_names: string,
is_purchased: false,
learning_flow: {
title: string,
steps: Array<{
header: string,
description: string,
}>,
},
offers: {
intro: string,
items: Array<{
title: string,
description: string,
}>,
},
price_block: {
price: number,
initial_price: number,
title: string,
description: string,
points: Array<string>,
price_per_month: number,
initial_price_per_month: number,
},
product_pack_items: Array<ProductTypeItem>,
faq_items: Array<{
question: string,
answer: string,
}>,
landing_image_urls: Array<string>,
}
export interface UserData {

@@ -79,2 +197,6 @@ id: number;

export interface CourseServiceI {
getCourse(id: number): Promise<Course>;
}
export interface CartServiceI {

@@ -85,5 +207,4 @@ createCartItem(id: number, type: string): CartItem;

export interface CartItem {
resource_id: number;
cart_item_type: string;
export interface ProductPackServiceI {
getProductPack(id: number): Promise<ProductPack>;
}

@@ -101,4 +222,31 @@

export class Foxford {
constructor(config?: FoxfordConfig): void;
export interface CartItem {
resource_id: number;
cart_item_type: string;
}
export type FoxfordWidgetsConfig = {
analyticContext?: {
prefix: string,
module: string,
payload?: {},
},
rootColors?: boolean,
loadFonts?: boolean,
widgets: Array<{
name: 'menu' | 'reviews' | 'featuredCoaches' | 'coachEnrollment' | 'shortForm' | 'userTypePrompt',
options: {},
container?: HTMLElement,
}>,
}
export interface FoxfordWidgets {
create(config: FoxfordWidgetsConfig): void;
}
export interface WidgetsI {
create(config: FoxfordWidgetsConfig): Promise<void>;
}
export interface FoxfordI {
api: AxiosInstance;

@@ -108,5 +256,12 @@ user: UserServiceI;

leadrequest: LeadRequestServiceI;
course: CourseServiceI;
productPack: ProductPackServiceI;
tag: TagServiceI;
cart: CartServiceI;
widgets: WidgetsI;
shortURL(url: string): Promise<unknown>;
}
export class Foxford implements FoxfordI {
constructor(config?: FoxfordConfig);
}

2

foxford.cjs.js

@@ -1,2 +0,2 @@

'use strict';Object.defineProperty(exports,'__esModule',{value:1});var r=require('axios');var e=require('axios-retry');function t(r){return r&&'object'==typeof r&&'default'in r?r:{default:r}}var a=t(r);var o=t(e);function n(r,e,t,a,o,n,i){try{var s=r[n](i);var v=s.value}catch(r){return void t(r)}s.done?e(v):Promise.resolve(v).then(a,o)}function i(r){return function(){var e=this,t=arguments;return new Promise(((a,o)=>{var i=r.apply(e,t);function s(r){n(i,a,o,s,v,"next",r)}function v(r){n(i,a,o,s,v,"throw",r)}s(void 0)}))}}var s='https://foxford.ru';var v=r=>{try{return!!r()}catch(r){return 1}};var c={}.toString;var u=it=>c.call(it).slice(8,-1);var l=''.split;var f=v((()=>!Object('z').propertyIsEnumerable(0)))?it=>'String'==u(it)?l.call(it,''):Object(it):Object;var p=it=>{if(null==it)throw TypeError("Can't call method on "+it);return it};var d=it=>f(p(it));var h='undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:'undefined'!=typeof global?global:'undefined'!=typeof self?self:{};function y(r){var e={exports:{}};return r(e,e.exports),e.exports}var g=it=>it&&it.Math==Math&&it;var m=g('object'==typeof globalThis&&globalThis)||g('object'==typeof window&&window)||g('object'==typeof self&&self)||g('object'==typeof h&&h)||function(){return this}()||Function("","return this")();var b=!v((()=>7!=Object.defineProperty({},1,{get:()=>7})[1]));var w=it=>'object'==typeof it?null!==it:'function'==typeof it;var j=m.document;var O=w(j)&&w(j.createElement);var S=it=>O?j.createElement(it):{};var P=!b&&!v((()=>7!=Object.defineProperty(S('div'),'a',{get:()=>7}).a));var E=it=>{if(!w(it))throw TypeError(String(it)+' is not an object');return it};var T=(r,e)=>{if(!w(r))return r;var t,a;if(e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;if('function'==typeof(t=r.valueOf)&&!w(a=t.call(r)))return a;if(!e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;throw TypeError("Can't convert object to primitive value")};var C=Object.defineProperty;var _={f:b?C:(r,e,t)=>{if(E(r),e=T(e,1),E(t),P)try{return C(r,e,t)}catch(r){}if('get'in t||'set'in t)throw TypeError('Accessors not supported');return'value'in t&&(r[e]=t.value),r}};var x=(r,e)=>({enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:e});var k=b?(r,e,t)=>_.f(r,e,x(1,t)):(r,e,t)=>(r[e]=t,r);var L=(r,e)=>{try{k(m,r,e)}catch(t){m[r]=e}return e};var A=m["__core-js_shared__"]||L("__core-js_shared__",{});var R=y((r=>{(r.exports=(r,e)=>A[r]||(A[r]=void 0!==e?e:{}))('versions',[]).push({version:'3.8.2',mode:'global',copyright:'© 2021 Denis Pushkarev (zloirock.ru)'})}));var I={}.hasOwnProperty;var U=(it,r)=>I.call(it,r);var M=0;var N=Math.random();var F=r=>'Symbol('+String(void 0===r?'':r)+')_'+(++M+N).toString(36);var D=!!Object.getOwnPropertySymbols&&!v((()=>!String(Symbol())));var q=D&&!Symbol.sham&&'symbol'==typeof Symbol.iterator;var G=R('wks');var z=m.Symbol;var V=q?z:z&&z.withoutSetter||F;var H=r=>(U(G,r)||(G[r]=D&&U(z,r)?z[r]:V('Symbol.'+r)),G[r]);var W=Math.ceil;var B=Math.floor;var X=r=>isNaN(r=+r)?0:(r>0?B:W)(r);var Y=Math.min;var K=r=>r>0?Y(X(r),9007199254740991):0;var J=Math.max;var Z=Math.min;var $=r=>(e,t,a)=>{var o=d(e);var n=K(o.length);var i=((r,e)=>{var t=X(r);return t<0?J(t+e,0):Z(t,e)})(a,n);var s;if(r&&t!=t){for(;n>i;)if((s=o[i++])!=s)return 1}else for(;n>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1};var Q={includes:$(1),indexOf:$(0)};var rr={};var er=Q.indexOf;var tr=(r,e)=>{var t=d(r);var a=0;var o=[];var n;for(n in t)!U(rr,n)&&U(t,n)&&o.push(n);for(;e.length>a;)U(t,n=e[a++])&&(~er(o,n)||o.push(n));return o};var ar=['constructor','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toLocaleString','toString','valueOf'];var or=Object.keys||(r=>tr(r,ar));var nr=b?Object.defineProperties:(r,e)=>{E(r);var t=or(e);var a=t.length;var o=0;var n;for(;a>o;)_.f(r,n=t[o++],e[n]);return r};var ir=m;var sr=r=>'function'==typeof r?r:void 0;var vr=function(r,e){return arguments.length<2?sr(ir[r])||sr(m[r]):ir[r]&&ir[r][e]||m[r]&&m[r][e]};var cr=vr('document','documentElement');var ur=R('keys');var lr=r=>ur[r]||(ur[r]=F(r));var fr=lr('IE_PROTO');var pr=()=>{};var dr=r=>"<script>"+r+"</script>";var hr;var yr=()=>{try{hr=document.domain&&new ActiveXObject('htmlfile')}catch(r){}var r,e;yr=hr?(r=>{r.write(dr('')),r.close();var e=r.parentWindow.Object;return r=null,e})(hr):((r=S('iframe')).style.display='none',cr.appendChild(r),r.src=String("javascript:"),(e=r.contentWindow.document).open(),e.write(dr('document.F=Object')),e.close(),e.F);var t=ar.length;for(;t--;)delete yr.prototype[ar[t]];return yr()};rr[fr]=1;var gr=Object.create||((r,e)=>{var t;return null!==r?(pr.prototype=E(r),t=new pr,pr.prototype=null,t[fr]=r):t=yr(),void 0===e?t:nr(t,e)});var mr=H('unscopables');var br=Array.prototype;null==br[mr]&&_.f(br,mr,{configurable:1,value:gr(null)});var wr=r=>{br[mr][r]=1};var jr={};var Or=Function.toString;'function'!=typeof A.inspectSource&&(A.inspectSource=it=>Or.call(it));var Sr=A.inspectSource;var Pr=m.WeakMap;var Er,Tr,Cr;if('function'==typeof Pr&&/native code/.test(Sr(Pr))){var _r=A.state||(A.state=new(0,m.WeakMap));var xr=_r.get;var kr=_r.has;var Lr=_r.set;Er=(it,r)=>(r.facade=it,Lr.call(_r,it,r),r),Tr=it=>xr.call(_r,it)||{},Cr=it=>kr.call(_r,it)}else{var Ar=lr('state');rr[Ar]=1,Er=(it,r)=>(r.facade=it,k(it,Ar,r),r),Tr=it=>U(it,Ar)?it[Ar]:{},Cr=it=>U(it,Ar)}var Rr={set:Er,get:Tr,has:Cr,enforce:it=>Cr(it)?Tr(it):Er(it,{}),getterFor:r=>it=>{var e;if(!w(it)||(e=Tr(it)).type!==r)throw TypeError('Incompatible receiver, '+r+' required');return e}};var Ir={}.propertyIsEnumerable;var Ur=Object.getOwnPropertyDescriptor;var Mr={f:Ur&&!Ir.call({1:2},1)?function(r){var e=Ur(this,r);return!!e&&e.enumerable}:Ir};var Nr=Object.getOwnPropertyDescriptor;var Fr={f:b?Nr:(r,e)=>{if(r=d(r),e=T(e,1),P)try{return Nr(r,e)}catch(r){}if(U(r,e))return x(!Mr.f.call(r,e),r[e])}};var Dr=y((function(r){var e=Rr.get;var t=Rr.enforce;var a=String(String).split('String');(r.exports=(r,e,o,n)=>{var i=n?!!n.unsafe:0;var s=n?!!n.enumerable:0;var v=n?!!n.noTargetGet:0;var c;'function'==typeof o&&('string'!=typeof e||U(o,'name')||k(o,'name',e),(c=t(o)).source||(c.source=a.join('string'==typeof e?e:''))),r!==m?(i?!v&&r[e]&&(s=1):delete r[e],s?r[e]=o:k(r,e,o)):s?r[e]=o:L(e,o)})(Function.prototype,'toString',(function(){return'function'==typeof this&&e(this).source||Sr(this)}))}));var qr=ar.concat('length','prototype');var Gr={f:Object.getOwnPropertyNames||(r=>tr(r,qr))};var zr={f:Object.getOwnPropertySymbols};var Vr=vr('Reflect','ownKeys')||(it=>{var r=Gr.f(E(it));var e=zr.f;return e?r.concat(e(it)):r});var Hr=(r,e)=>{var t=Vr(e);var a=_.f;var o=Fr.f;for(var n=0;n<t.length;n++){var i=t[n];U(r,i)||a(r,i,o(e,i))}};var Wr=/#|\.prototype\./;var Br=(r,e)=>{var t=Yr[Xr(r)];return t==Jr?1:t==Kr?0:'function'==typeof e?v(e):!!e};var Xr=Br.normalize=r=>String(r).replace(Wr,'.').toLowerCase();var Yr=Br.data={};var Kr=Br.NATIVE='N';var Jr=Br.POLYFILL='P';var Zr=Br;var $r=Fr.f;var Qr=(r,e)=>{var t=r.target;var a=r.global;var o=r.stat;var n,i,s,v,c;if(n=a?m:o?m[t]||L(t,{}):(m[t]||{}).prototype)for(i in e){if(v=e[i],s=r.noTargetGet?(c=$r(n,i))&&c.value:n[i],!Zr(a?i:t+(o?'.':'#')+i,r.forced)&&void 0!==s){if(typeof v==typeof s)continue;Hr(v,s)}(r.sham||s&&s.sham)&&k(v,'sham',1),Dr(n,i,v,r)}};var re=r=>Object(p(r));var ee=!v((()=>{function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}));var te=lr('IE_PROTO');var ae=Object.prototype;var oe=ee?Object.getPrototypeOf:r=>(r=re(r),U(r,te)?r[te]:'function'==typeof r.constructor&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?ae:null);var ne=H('iterator');var ie=0;var se,ve,ce;[].keys&&('next'in(ce=[].keys())?(ve=oe(oe(ce)))!==Object.prototype&&(se=ve):ie=1),null==se&&(se={}),U(se,ne)||k(se,ne,(function(){return this}));var ue={IteratorPrototype:se,BUGGY_SAFARI_ITERATORS:ie};var le=_.f;var fe=H('toStringTag');var pe=(it,r,e)=>{it&&!U(it=e?it:it.prototype,fe)&&le(it,fe,{configurable:1,value:r})};var de=ue.IteratorPrototype;var he=function(){return this};var ye=Object.setPrototypeOf||('__proto__'in{}?(()=>{var r=0;var test={};var e;try{(e=Object.getOwnPropertyDescriptor(Object.prototype,'__proto__').set).call(test,[]),r=test instanceof Array}catch(r){}return(t,a)=>(E(t),(it=>{if(!w(it)&&null!==it)throw TypeError("Can't set "+String(it)+' as a prototype')})(a),r?e.call(t,a):t.__proto__=a,t)})():void 0);var ge=ue.IteratorPrototype;var me=ue.BUGGY_SAFARI_ITERATORS;var be=H('iterator');var we=function(){return this};var je=Rr.set;var Oe=Rr.getterFor("Array Iterator");var Se=function(r,e,t,a,o){(r=>{var e="Array Iterator";r.prototype=gr(de,{next:x(1,(function(){var r=Oe(this);var e=r.target;var t=r.kind;var a=r.index++;return!e||a>=e.length?(r.target=void 0,{value:void 0,done:1}):'keys'==t?{value:a,done:0}:'values'==t?{value:e[a],done:0}:{value:[a,e[a]],done:0}}))}),pe(r,e,0),jr[e]=he})(t);var n=function(r){if(r===o&&c)return c;if(!me&&r in s)return s[r];switch(r){case"keys":case"values":case"entries":return function(){return new t(this,r)}}return function(){return new t(this)}};var i=0;var s=r.prototype;var v=s[be]||s['@@iterator']||s.values;var c=!me&&v||n(o);var u=s.entries||v;var l,f,p;if(u&&(l=oe(u.call(new r)),ge!==Object.prototype&&l.next&&(oe(l)!==ge&&(ye?ye(l,ge):'function'!=typeof l[be]&&k(l,be,we)),pe(l,"Array Iterator",1))),v&&"values"!==v.name&&(i=1,c=function(){return v.call(this)}),s[be]!==c&&k(s,be,c),jr.Array=c,void(f={values:n("values"),keys:n("keys"),entries:n("entries")}))for(p in f)(me||i||!(p in s))&&Dr(s,p,f[p]);else Qr({target:'Array',proto:1,forced:me||i},f);return f}(Array,0,(function(r,e){je(this,{type:"Array Iterator",target:d(r),index:0,kind:e})}),0,'values');jr.Arguments=jr.Array,wr('keys'),wr('values'),wr('entries');var Pe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};var Ee=H('iterator');var Te=H('toStringTag');var Ce=Se.values;for(var _e in Pe){var xe=m[_e];var ke=xe&&xe.prototype;if(ke){if(ke[Ee]!==Ce)try{k(ke,Ee,Ce)}catch(r){ke[Ee]=Ce}if(ke[Te]||k(ke,Te,_e),Pe[_e])for(var Le in Se)if(ke[Le]!==Se[Le])try{k(ke,Le,Se[Le])}catch(r){ke[Le]=Se[Le]}}}function Ae(r){var e=0;for(var t=0;t<r.length;t++){var a=r.charAt(t);e&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(r=r.substr(0,t)+'-'+r.substr(t),e=0,t++):e=a.toLowerCase()===a}return r}var Re=function r(e){return e?e instanceof Date?e:Array.isArray(e)?e.map((e=>r(e))):"object"==typeof e?((r,e)=>{var t={};var a=Object.keys(r);for(var o=0;o<a.length;o++){var n=a[o];var i=e(n,r[n]);t[i[0]]=i[1]}return t})(e,((t,a)=>{var o=function(){var r=[].map.call(arguments,(r=>r.trim())).filter((r=>r.length)).join('-');return r.length?1===r.length?r:/[_.\- ]+/.test(r)?(r=Ae(r)).replace(/^[_.\- ]+/,'').toLowerCase().replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())):r===r.toUpperCase()?r.toLowerCase():r[0]!==r[0].toLowerCase()?r[0].toLowerCase()+r.slice(1):r:''}(t);if(t!==o&&o in e)throw new Error("Camelcased key `"+o+"` would overwrite existing key of the given JSON object");return[o,r(a)]})):e:e};var Ie=m.Promise;var Ue=H('species');var Me=it=>{if('function'!=typeof it)throw TypeError(String(it)+' is not a function');return it};var Ne=H('iterator');var Fe=Array.prototype;var De=(r,e,t)=>{if(Me(r),void 0===e)return r;switch(t){case 0:return()=>r.call(e);case 1:return t=>r.call(e,t);case 2:return(t,a)=>r.call(e,t,a);case 3:return(t,a,o)=>r.call(e,t,a,o)}return function(){return r.apply(e,arguments)}};var test={};test[H('toStringTag')]='z';var qe='[object z]'===String(test);var Ge=H('toStringTag');var ze='Arguments'==u(function(){return arguments}());var Ve=qe?u:it=>{var r,e,t;return void 0===it?'Undefined':null===it?'Null':'string'==typeof(e=((it,r)=>{try{return it[r]}catch(r){}})(r=Object(it),Ge))?e:ze?u(r):'Object'==(t=u(r))&&'function'==typeof r.callee?'Arguments':t};var He=H('iterator');var We=r=>{var e=r.return;if(void 0!==e)return E(e.call(r)).value};var Be=function(r,e){this.stopped=r,this.result=e};var Xe=(r,e,t)=>{var a=!(!t||!t.AS_ENTRIES);var o=!(!t||!t.IS_ITERATOR);var n=!(!t||!t.INTERRUPTED);var i=De(e,t&&t.that,1+a+n);var s,v,c,u,l,f,p;var d=r=>(s&&We(s),new Be(1,r));var h=r=>a?(E(r),n?i(r[0],r[1],d):i(r[0],r[1])):n?i(r,d):i(r);if(o)s=r;else{if('function'!=typeof(v=(it=>{if(null!=it)return it[He]||it['@@iterator']||jr[Ve(it)]})(r)))throw TypeError('Target is not iterable');if(void 0!==(it=v)&&(jr.Array===it||Fe[Ne]===it)){for(c=0,u=K(r.length);u>c;c++)if((l=h(r[c]))&&l instanceof Be)return l;return new Be(0)}s=v.call(r)}var it;for(f=s.next;!(p=f.call(s)).done;){try{l=h(p.value)}catch(r){throw We(s),r}if('object'==typeof l&&l&&l instanceof Be)return l}return new Be(0)};var Ye=H('iterator');var Ke=0;try{var Je=0;var Ze={next:()=>({done:!!Je++}),return:()=>{Ke=1}};Ze[Ye]=function(){return this},Array.from(Ze,(()=>{throw 2}))}catch(r){}var $e=H('species');var Qe=vr('navigator','userAgent')||'';var rt=/(iphone|ipod|ipad).*applewebkit/i.test(Qe);var et='process'==u(m.process);var tt=m.location;var at=m.setImmediate;var ot=m.clearImmediate;var nt=m.process;var st=m.MessageChannel;var vt=m.Dispatch;var ct=0;var ut={};var lt,ft,pt;var dt=r=>{if(ut.hasOwnProperty(r)){var e=ut[r];delete ut[r],e()}};var ht=r=>()=>{dt(r)};var yt=r=>{dt(r.data)};var gt=r=>{m.postMessage(r+'',tt.protocol+'//'+tt.host)};at&&ot||(at=function(r){var e=[];var t=1;for(;arguments.length>t;)e.push(arguments[t++]);return ut[++ct]=()=>{('function'==typeof r?r:Function(r)).apply(void 0,e)},lt(ct),ct},ot=r=>{delete ut[r]},et?lt=r=>{nt.nextTick(ht(r))}:vt&&vt.now?lt=r=>{vt.now(ht(r))}:st&&!rt?(pt=(ft=new st).port2,ft.port1.onmessage=yt,lt=De(pt.postMessage,pt,1)):m.addEventListener&&'function'==typeof postMessage&&!m.importScripts&&tt&&'file:'!==tt.protocol&&!v(gt)?(lt=gt,m.addEventListener('message',yt,0)):lt="onreadystatechange"in S('script')?function(r){cr.appendChild(S('script')).onreadystatechange=function(){cr.removeChild(this),dt(r)}}:r=>{setTimeout(ht(r),0)});var mt={set:at,clear:ot};var bt=/web0s(?!.*chrome)/i.test(Qe);var wt=mt.set;var jt=m.MutationObserver||m.WebKitMutationObserver;var Ot=m.document;var St=m.process;var Pt=m.Promise;var Et=(0,Fr.f)(m,'queueMicrotask');var Tt=Et&&Et.value;var Ct,_t,xt,kt,Lt,At,Rt,It;Tt||(Ct=()=>{var r,e;for(et&&(r=St.domain)&&r.exit();_t;){e=_t.fn,_t=_t.next;try{e()}catch(r){throw _t?kt():xt=void 0,r}}xt=void 0,r&&r.enter()},rt||et||bt||!jt||!Ot?Pt&&Pt.resolve?(Rt=Pt.resolve(void 0),It=Rt.then,kt=()=>{It.call(Rt,Ct)}):kt=et?()=>{St.nextTick(Ct)}:()=>{wt.call(m,Ct)}:(Lt=1,At=Ot.createTextNode(''),new jt(Ct).observe(At,{characterData:1}),kt=()=>{At.data=Lt=!Lt}));var Ut=Tt||(r=>{var e={fn:r,next:void 0};xt&&(xt.next=e),_t||(_t=e,kt()),xt=e});var Mt=function(r){var e,t;this.promise=new r(((r,a)=>{if(void 0!==e||void 0!==t)throw TypeError('Bad Promise constructor');e=r,t=a})),this.resolve=Me(e),this.reject=Me(t)};var Nt={f:r=>new Mt(r)};var Ft=(r,e)=>{if(E(r),w(e)&&e.constructor===r)return e;var t=Nt.f(r);return(0,t.resolve)(e),t.promise};var Dt=r=>{try{return{error:0,value:r()}}catch(r){return{error:1,value:r}}};var qt=m.process;var Gt=qt&&qt.versions;var zt=Gt&&Gt.v8;var Vt,Ht;zt?Ht=(Vt=zt.split('.'))[0]+Vt[1]:Qe&&(!(Vt=Qe.match(/Edge\/(\d+)/))||Vt[1]>=74)&&(Vt=Qe.match(/Chrome\/(\d+)/))&&(Ht=Vt[1]);var Wt=Ht&&+Ht;var Bt=mt.set;var Xt=H('species');var Yt=Rr.get;var Kt=Rr.set;var Jt=Rr.getterFor("Promise");var Zt=Ie;var $t=m.TypeError;var Qt=m.document;var ra=m.process;var ea=vr('fetch');var ta=Nt.f;var aa=ta;var oa=!!(Qt&&Qt.createEvent&&m.dispatchEvent);var na='function'==typeof PromiseRejectionEvent;var ia,sa,va,ca;var ua=Zr("Promise",(()=>{if(Sr(Zt)===String(Zt)){if(66===Wt)return 1;if(!et&&!na)return 1}if(Wt>=51&&/native code/.test(Zt))return 0;var r=Zt.resolve(1);var e=r=>{r((()=>{}),(()=>{}))};return(r.constructor={})[Xt]=e,!(r.then((()=>{}))instanceof e)}));var la=ua||!(()=>{if(!Ke)return 0;var r=0;try{var e={};e[Ye]=()=>({next:()=>({done:r=1})}),Zt.all(e).catch((()=>{}))}catch(r){}return r})();var fa=it=>{var r;return w(it)&&'function'==typeof(r=it.then)?r:0};var pa=(r,e)=>{if(!r.notified){r.notified=1;var t=r.reactions;Ut((()=>{var a=r.value;var o=1==r.state;var n=0;for(;t.length>n;){var i=t[n++];var s=o?i.ok:i.fail;var v=i.resolve;var c=i.reject;var u=i.domain;var l,f,p;try{s?(o||(2===r.rejection&&ga(r),r.rejection=1),1==s?l=a:(u&&u.enter(),l=s(a),u&&(u.exit(),p=1)),l===i.promise?c($t('Promise-chain cycle')):(f=fa(l))?f.call(l,v,c):v(l)):c(a)}catch(r){u&&!p&&u.exit(),c(r)}}r.reactions=[],r.notified=0,e&&!r.rejection&&ha(r)}))}};var da=(r,e,t)=>{var a,o;oa?((a=Qt.createEvent('Event')).promise=e,a.reason=t,a.initEvent(r,0,1),m.dispatchEvent(a)):a={promise:e,reason:t},!na&&(o=m['on'+r])?o(a):"unhandledrejection"===r&&function(r,e){var t=m.console;t&&t.error&&(1===arguments.length?t.error(r):t.error(r,e))}('Unhandled promise rejection',t)};var ha=r=>{Bt.call(m,(()=>{var e=r.facade;var t=r.value;var a;if(ya(r)&&(a=Dt((()=>{et?ra.emit('unhandledRejection',t,e):da("unhandledrejection",e,t)})),r.rejection=et||ya(r)?2:1,a.error))throw a.value}))};var ya=r=>1!==r.rejection&&!r.parent;var ga=r=>{Bt.call(m,(()=>{var e=r.facade;et?ra.emit('rejectionHandled',e):da("rejectionhandled",e,r.value)}))};var ma=(r,e,t)=>a=>{r(e,a,t)};var ba=(r,e,t)=>{r.done||(r.done=1,t&&(r=t),r.value=e,r.state=2,pa(r,1))};var wa=(r,e,t)=>{if(!r.done){r.done=1,t&&(r=t);try{if(r.facade===e)throw $t("Promise can't be resolved itself");var a=fa(e);a?Ut((()=>{var t={done:0};try{a.call(e,ma(wa,t,r),ma(ba,t,r))}catch(e){ba(t,e,r)}})):(r.value=e,r.state=1,pa(r,0))}catch(e){ba({done:0},e,r)}}};var ja;ua&&(Zt=function(r){(()=>{if(!(this instanceof Zt))throw TypeError("Incorrect Promise invocation")})(),Me(r),ia.call(this);var e=Yt(this);try{r(ma(wa,e),ma(ba,e))}catch(r){ba(e,r)}},(ia=function(){Kt(this,{type:"Promise",done:0,notified:0,parent:0,reactions:[],rejection:0,state:0,value:void 0})}).prototype=((r,e)=>{for(var t in e)Dr(r,t,e[t],void 0);return r})(Zt.prototype,{then:function(r,e){var t=Jt(this);var a=ta((o=Zt,void 0===(n=E(this).constructor)||null==(i=E(n)[$e])?o:Me(i)));var o,n,i;return a.ok='function'==typeof r?r:1,a.fail='function'==typeof e&&e,a.domain=et?ra.domain:void 0,t.parent=1,t.reactions.push(a),0!=t.state&&pa(t,0),a.promise},catch:function(r){return this.then(void 0,r)}}),sa=function(){var r=new ia;var e=Yt(r);this.promise=r,this.resolve=ma(wa,e),this.reject=ma(ba,e)},Nt.f=ta=r=>r===Zt||r===va?new sa(r):aa(r),'function'==typeof Ie&&(ca=Ie.prototype.then,Dr(Ie.prototype,'then',(function(r,e){var t=this;return new Zt(((r,e)=>{ca.call(t,r,e)})).then(r,e)}),{unsafe:1}),'function'==typeof ea&&Qr({global:1,enumerable:1,forced:1},{fetch:function(){return Ft(Zt,ea.apply(m,arguments))}}))),Qr({global:1,wrap:1,forced:ua},{Promise:Zt}),pe(Zt,"Promise",0),ja=vr("Promise"),b&&ja&&!ja[Ue]&&(0,_.f)(ja,Ue,{configurable:1,get:function(){return this}}),va=vr("Promise"),Qr({target:"Promise",stat:1,forced:ua},{reject:function(r){var e=ta(this);return e.reject.call(void 0,r),e.promise}}),Qr({target:"Promise",stat:1,forced:ua},{resolve:function(r){return Ft(this,r)}}),Qr({target:"Promise",stat:1,forced:la},{all:function(r){var e=this;var t=ta(e);var a=t.resolve;var o=t.reject;var n=Dt((()=>{var t=Me(e.resolve);var n=[];var i=0;var s=1;Xe(r,(r=>{var v=i++;var c=0;n.push(void 0),s++,t.call(e,r).then((r=>{c||(c=1,n[v]=r,--s||a(n))}),o)})),--s||a(n)}));return n.error&&o(n.value),t.promise},race:function(r){var e=this;var t=ta(e);var a=t.reject;var o=Dt((()=>{var o=Me(e.resolve);Xe(r,(r=>{o.call(e,r).then(t.resolve,a)}))}));return o.error&&a(o.value),t.promise}});var Oa=function(){var r=E(this);var e='';return r.global&&(e+='g'),r.ignoreCase&&(e+='i'),r.multiline&&(e+='m'),r.dotAll&&(e+='s'),r.unicode&&(e+='u'),r.sticky&&(e+='y'),e};var Sa=RegExp.prototype;var Pa=Sa.toString;function Ea(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:1,configurable:1,writable:1}):r[e]=t,r}function Ta(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter((e=>Object.getOwnPropertyDescriptor(r,e).enumerable))),t.push.apply(t,a)}return t}(v((()=>'/a/b'!=Pa.call({source:'a',flags:'b'})))||"toString"!=Pa.name)&&Dr(RegExp.prototype,"toString",(function(){var r=E(this);var e=String(r.source);var t=r.flags;return'/'+e+'/'+String(void 0===t&&r instanceof RegExp&&!('flags'in Sa)?Oa.call(r):t)}),{unsafe:1});var Ca=[422,401];var _a=a.default.create({timeout:1e4,baseURL:s,withCredentials:1,xsrfCookieName:'_csrf_token',xsrfHeaderName:'X-CSRF-Token',headers:{'X-Requested-With':'XMLHttpRequest'}});_a.interceptors.request.use((r=>{var e='boolean'==typeof r.camelize?r.camelize:1;if(r.headers?r.headers['Content-Type']='application/json':r.headers={'Content-Type':'application/json'},e){var t=a.default.defaults.transformResponse||[];var o=r=>Re(r);var n=Array.isArray(t)?[...t,o]:[t,o];r.transformResponse=n}return r})),_a.interceptors.response.use((r=>r),(r=>{var{config:e=null,response:t=null}=r;if(null===e||null===t)return Promise.reject(r);var a=e;Ca.includes(t.status)&&(a._retry=1);var o=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ta(Object(t),1).forEach((e=>{Ea(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ta(Object(t)).forEach((e=>{Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({status:t.status,statusText:t.statusText,errorText:r.toString(),headers:t.headers},'object'==typeof t.data?t.data:{data:t.data});return Promise.reject(o)})),o.default(_a,{retries:3,retryDelay:o.default.exponentialDelay});class xa{constructor(r){if(this.id=void 0,this.email=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.phone=void 0,this.parent=void 0,this.fakeUser=void 0,this.isCustomer=void 0,this.emailConfirmed=void 0,this.fakeEmail=void 0,this.phoneConfirmed=void 0,this.createdAt=void 0,this.recentRegistration=void 0,this.profileEnriched=void 0,this.skype=void 0,this.graduate=void 0,this.type=void 0,this.avatarUrl=void 0,this.bonusAmount=void 0,this.grade=void 0,this.gradeChecked=void 0,this.tags=void 0,this.hasChats=void 0,this.hasReferrals=void 0,this.onboardingFinished=void 0,this.externshipUser=void 0,'object'!=typeof r)throw new Error('data is wrong');this.id=r.id,this.gradeChecked=r.gradeChecked,this.email=r.email||'',this.firstName=r.firstName,this.middleName=r.middleName||'',this.lastName=r.lastName,this.phone=r.phone||'',this.parent=r.parent,this.fakeUser=r.fakeUser,this.isCustomer=r.isCustomer,this.emailConfirmed=r.emailConfirmed,this.fakeEmail=r.fakeEmail,this.phoneConfirmed=r.phoneConfirmed,this.createdAt=r.createdAt||'',this.recentRegistration=r.recentRegistration,this.profileEnriched=r.profileEnriched,this.skype=r.skype||'',this.graduate=r.graduate,this.type=r.type,this.avatarUrl=r.avatarUrl||'',this.bonusAmount=r.bonusAmount,this.grade=r.grade,this.tags=r.tags,this.hasChats=r.hasChats,this.hasReferrals=r.hasReferrals,this.onboardingFinished=r.onboardingFinished,this.externshipUser=r.externshipUser}isLoggedIn(){return this.id>0?1:0}}var ka={id:0,gradeChecked:0,email:'',firstName:'',middleName:'',lastName:'',phone:'',parent:0,fakeUser:0,isCustomer:0,emailConfirmed:0,fakeEmail:0,phoneConfirmed:0,createdAt:'',recentRegistration:0,profileEnriched:0,skype:'',graduate:0,type:'pupil',avatarUrl:'',bonusAmount:0,grade:{id:0,index:0},tags:[],hasChats:0,hasReferrals:0,onboardingFinished:0,externshipUser:0};class La{getUser(){return i((function*(){try{var r=yield _a.get('/api/user/me').then((r=>{var{data:e}=r;return e}));return new xa(r)}catch(r){return new xa(ka)}}))()}createUser(r){return new xa(r)}purchases(r){return i((function*(){var{resourceId:e,resourceType:t}=r;if(e&&'number'!=typeof e)throw new Error('resourceId must be a number');if(t&&'string'!=typeof t)throw new Error('resourceType must be a string');var a=[];e&&a.push("resource_id=".concat(encodeURIComponent(e))),t&&a.push("resource_type=".concat(encodeURIComponent(t)));var o=a.length?"?".concat(a.join('&')):'';var{data:n}=yield _a.get("/api/user/purchases".concat(o));return n}))()}signIn(r){var{redirectUrl:e}=r;if(e&&'string'!=typeof e)throw new Error('redirectUrl must be a string');var t="".concat(s,"/user/registration?redirect_url=");e&&(t+=encodeURIComponent(document.location.href)),document.location.href=t}signOut(){var r=arguments;return i((function*(){var e=r.length>0&&void 0!==r[0]?r[0]:1;var t=yield _a.delete("/user/log_out");return e&&window.location.reload(),t}))()}}class Aa{checkPromocode(r){return i((function*(){var{data:e}=yield _a.get("/api/promo_codes/invite/".concat(r));return e}))()}}var Ra=Object.assign;var Ia=Object.defineProperty;var Ua=!Ra||v((function(){if(b&&1!==Ra({b:1},Ra(Ia({},'a',{enumerable:1,get:function(){Ia(this,'b',{value:3,enumerable:0})}}),{b:2})).b)return 1;var r={};var e={};var t=Symbol();var a='abcdefghijklmnopqrst';return r[t]=7,a.split('').forEach((r=>{e[r]=r})),7!=Ra({},r)[t]||or(Ra({},e)).join('')!=a}))?function(r){var e=re(r);var t=arguments.length;var a=1;var o=zr.f;var n=Mr.f;for(;t>a;){var i=f(arguments[a++]);var s=o?or(i).concat(o(i)):or(i);var v=s.length;var c=0;var u;for(;v>c;)u=s[c++],b&&!n.call(i,u)||(e[u]=i[u])}return e}:Ra;var Ma;Qr({target:'Object',stat:1,forced:Object.assign!==Ua},{assign:Ua}),(Ma||(Ma={})).External="LeadRequests::External";class Na{createLeadRequest(r,e){return{type:r,agreement:1,context:e}}send(r,e){var t=arguments,a=this;return i((function*(){var o=t.length>2&&void 0!==t[2]?t[2]:'';var n=a.createLeadRequest(t.length>3&&void 0!==t[3]?t[3]:Ma.External,e);var i=Object.assign(n,r);var{data:s}=yield _a.post("/api/lead_requests".concat(o),{data:{lead_request:i}});return s}))()}}class Fa{addTag(r){return i((function*(){var{data:e}=yield _a.post("/api/user/tag?id=".concat(r));return e}))()}}class Da{createCartItem(r,e){return{resource_id:r,cart_item_type:e}}addCartItemToCart(r){return i((function*(){var{data:e}=yield _a.post("/api/cart_items",{cart_item:r});return e}))()}}var qa={host:s};exports.Foxford=class{constructor(r){var e=arguments.length>0&&void 0!==r?r:qa;this.api=void 0,this.user=void 0,this.tag=void 0,this.cart=void 0,this.promo=void 0,this.leadrequest=void 0,this._config=void 0,this._config=e,this._config.host&&(_a.defaults.baseURL=this._config.host),this.user=new La,this.promo=new Aa,this.tag=new Fa,this.cart=new Da,this.leadrequest=new Na,this.api=_a}shortURL(r){return _a.post("/api/short_urls",{link:r}).then((r=>r))}};
'use strict';Object.defineProperty(exports,'__esModule',{value:1});var r=require('axios');var e=require('axios-retry');function t(r){return r&&'object'==typeof r&&'default'in r?r:{default:r}}var a=t(r);var o=t(e);function n(r,e,t,a,o,n,i){try{var s=r[n](i);var v=s.value}catch(r){return void t(r)}s.done?e(v):Promise.resolve(v).then(a,o)}function i(r){return function(){var e=this,t=arguments;return new Promise(((a,o)=>{var i=r.apply(e,t);function s(r){n(i,a,o,s,v,"next",r)}function v(r){n(i,a,o,s,v,"throw",r)}s(void 0)}))}}var s='https://foxford.ru';var v=r=>{try{return!!r()}catch(r){return 1}};var c={}.toString;var u=it=>c.call(it).slice(8,-1);var l=''.split;var f=v((()=>!Object('z').propertyIsEnumerable(0)))?it=>'String'==u(it)?l.call(it,''):Object(it):Object;var d=it=>{if(null==it)throw TypeError("Can't call method on "+it);return it};var p=it=>f(d(it));var h='undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:'undefined'!=typeof global?global:'undefined'!=typeof self?self:{};function y(r){var e={exports:{}};return r(e,e.exports),e.exports}var g=it=>it&&it.Math==Math&&it;var m=g('object'==typeof globalThis&&globalThis)||g('object'==typeof window&&window)||g('object'==typeof self&&self)||g('object'==typeof h&&h)||function(){return this}()||Function("","return this")();var b=!v((()=>7!=Object.defineProperty({},1,{get:()=>7})[1]));var w=it=>'object'==typeof it?null!==it:'function'==typeof it;var j=m.document;var O=w(j)&&w(j.createElement);var S=it=>O?j.createElement(it):{};var P=!b&&!v((()=>7!=Object.defineProperty(S('div'),'a',{get:()=>7}).a));var E=it=>{if(!w(it))throw TypeError(String(it)+' is not an object');return it};var T=(r,e)=>{if(!w(r))return r;var t,a;if(e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;if('function'==typeof(t=r.valueOf)&&!w(a=t.call(r)))return a;if(!e&&'function'==typeof(t=r.toString)&&!w(a=t.call(r)))return a;throw TypeError("Can't convert object to primitive value")};var x=Object.defineProperty;var C={f:b?x:(r,e,t)=>{if(E(r),e=T(e,1),E(t),P)try{return x(r,e,t)}catch(r){}if('get'in t||'set'in t)throw TypeError('Accessors not supported');return'value'in t&&(r[e]=t.value),r}};var _=(r,e)=>({enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:e});var k=b?(r,e,t)=>C.f(r,e,_(1,t)):(r,e,t)=>(r[e]=t,r);var A=(r,e)=>{try{k(m,r,e)}catch(t){m[r]=e}return e};var L=m["__core-js_shared__"]||A("__core-js_shared__",{});var R=y((r=>{(r.exports=(r,e)=>L[r]||(L[r]=void 0!==e?e:{}))('versions',[]).push({version:'3.8.2',mode:'global',copyright:'© 2021 Denis Pushkarev (zloirock.ru)'})}));var I={}.hasOwnProperty;var U=(it,r)=>I.call(it,r);var M=0;var N=Math.random();var F=r=>'Symbol('+String(void 0===r?'':r)+')_'+(++M+N).toString(36);var D=!!Object.getOwnPropertySymbols&&!v((()=>!String(Symbol())));var q=D&&!Symbol.sham&&'symbol'==typeof Symbol.iterator;var G=R('wks');var W=m.Symbol;var V=q?W:W&&W.withoutSetter||F;var z=r=>(U(G,r)||(G[r]=D&&U(W,r)?W[r]:V('Symbol.'+r)),G[r]);var H=Math.ceil;var B=Math.floor;var X=r=>isNaN(r=+r)?0:(r>0?B:H)(r);var Y=Math.min;var K=r=>r>0?Y(X(r),9007199254740991):0;var J=Math.max;var Z=Math.min;var $=r=>(e,t,a)=>{var o=p(e);var n=K(o.length);var i=((r,e)=>{var t=X(r);return t<0?J(t+e,0):Z(t,e)})(a,n);var s;if(r&&t!=t){for(;n>i;)if((s=o[i++])!=s)return 1}else for(;n>i;i++)if((r||i in o)&&o[i]===t)return r||i||0;return!r&&-1};var Q={includes:$(1),indexOf:$(0)};var rr={};var er=Q.indexOf;var tr=(r,e)=>{var t=p(r);var a=0;var o=[];var n;for(n in t)!U(rr,n)&&U(t,n)&&o.push(n);for(;e.length>a;)U(t,n=e[a++])&&(~er(o,n)||o.push(n));return o};var ar=['constructor','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','toLocaleString','toString','valueOf'];var or=Object.keys||(r=>tr(r,ar));var nr=b?Object.defineProperties:(r,e)=>{E(r);var t=or(e);var a=t.length;var o=0;var n;for(;a>o;)C.f(r,n=t[o++],e[n]);return r};var ir=m;var sr=r=>'function'==typeof r?r:void 0;var vr=function(r,e){return arguments.length<2?sr(ir[r])||sr(m[r]):ir[r]&&ir[r][e]||m[r]&&m[r][e]};var cr=vr('document','documentElement');var ur=R('keys');var lr=r=>ur[r]||(ur[r]=F(r));var fr=lr('IE_PROTO');var dr=()=>{};var pr=r=>"<script>"+r+"</script>";var hr;var yr=()=>{try{hr=document.domain&&new ActiveXObject('htmlfile')}catch(r){}var r,e;yr=hr?(r=>{r.write(pr('')),r.close();var e=r.parentWindow.Object;return r=null,e})(hr):((r=S('iframe')).style.display='none',cr.appendChild(r),r.src=String("javascript:"),(e=r.contentWindow.document).open(),e.write(pr('document.F=Object')),e.close(),e.F);var t=ar.length;for(;t--;)delete yr.prototype[ar[t]];return yr()};rr[fr]=1;var gr=Object.create||((r,e)=>{var t;return null!==r?(dr.prototype=E(r),t=new dr,dr.prototype=null,t[fr]=r):t=yr(),void 0===e?t:nr(t,e)});var mr=z('unscopables');var br=Array.prototype;null==br[mr]&&C.f(br,mr,{configurable:1,value:gr(null)});var wr=r=>{br[mr][r]=1};var jr={};var Or=Function.toString;'function'!=typeof L.inspectSource&&(L.inspectSource=it=>Or.call(it));var Sr=L.inspectSource;var Pr=m.WeakMap;var Er,Tr,xr;if('function'==typeof Pr&&/native code/.test(Sr(Pr))){var Cr=L.state||(L.state=new(0,m.WeakMap));var _r=Cr.get;var kr=Cr.has;var Ar=Cr.set;Er=(it,r)=>(r.facade=it,Ar.call(Cr,it,r),r),Tr=it=>_r.call(Cr,it)||{},xr=it=>kr.call(Cr,it)}else{var Lr=lr('state');rr[Lr]=1,Er=(it,r)=>(r.facade=it,k(it,Lr,r),r),Tr=it=>U(it,Lr)?it[Lr]:{},xr=it=>U(it,Lr)}var Rr={set:Er,get:Tr,has:xr,enforce:it=>xr(it)?Tr(it):Er(it,{}),getterFor:r=>it=>{var e;if(!w(it)||(e=Tr(it)).type!==r)throw TypeError('Incompatible receiver, '+r+' required');return e}};var Ir={}.propertyIsEnumerable;var Ur=Object.getOwnPropertyDescriptor;var Mr={f:Ur&&!Ir.call({1:2},1)?function(r){var e=Ur(this,r);return!!e&&e.enumerable}:Ir};var Nr=Object.getOwnPropertyDescriptor;var Fr={f:b?Nr:(r,e)=>{if(r=p(r),e=T(e,1),P)try{return Nr(r,e)}catch(r){}if(U(r,e))return _(!Mr.f.call(r,e),r[e])}};var Dr=y((function(r){var e=Rr.get;var t=Rr.enforce;var a=String(String).split('String');(r.exports=(r,e,o,n)=>{var i=n?!!n.unsafe:0;var s=n?!!n.enumerable:0;var v=n?!!n.noTargetGet:0;var c;'function'==typeof o&&('string'!=typeof e||U(o,'name')||k(o,'name',e),(c=t(o)).source||(c.source=a.join('string'==typeof e?e:''))),r!==m?(i?!v&&r[e]&&(s=1):delete r[e],s?r[e]=o:k(r,e,o)):s?r[e]=o:A(e,o)})(Function.prototype,'toString',(function(){return'function'==typeof this&&e(this).source||Sr(this)}))}));var qr=ar.concat('length','prototype');var Gr={f:Object.getOwnPropertyNames||(r=>tr(r,qr))};var Wr={f:Object.getOwnPropertySymbols};var Vr=vr('Reflect','ownKeys')||(it=>{var r=Gr.f(E(it));var e=Wr.f;return e?r.concat(e(it)):r});var zr=(r,e)=>{var t=Vr(e);var a=C.f;var o=Fr.f;for(var n=0;n<t.length;n++){var i=t[n];U(r,i)||a(r,i,o(e,i))}};var Hr=/#|\.prototype\./;var Br=(r,e)=>{var t=Yr[Xr(r)];return t==Jr?1:t==Kr?0:'function'==typeof e?v(e):!!e};var Xr=Br.normalize=r=>String(r).replace(Hr,'.').toLowerCase();var Yr=Br.data={};var Kr=Br.NATIVE='N';var Jr=Br.POLYFILL='P';var Zr=Br;var $r=Fr.f;var Qr=(r,e)=>{var t=r.target;var a=r.global;var o=r.stat;var n,i,s,v,c;if(n=a?m:o?m[t]||A(t,{}):(m[t]||{}).prototype)for(i in e){if(v=e[i],s=r.noTargetGet?(c=$r(n,i))&&c.value:n[i],!Zr(a?i:t+(o?'.':'#')+i,r.forced)&&void 0!==s){if(typeof v==typeof s)continue;zr(v,s)}(r.sham||s&&s.sham)&&k(v,'sham',1),Dr(n,i,v,r)}};var re=r=>Object(d(r));var ee=!v((()=>{function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}));var te=lr('IE_PROTO');var ae=Object.prototype;var oe=ee?Object.getPrototypeOf:r=>(r=re(r),U(r,te)?r[te]:'function'==typeof r.constructor&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?ae:null);var ne=z('iterator');var ie=0;var se,ve,ce;[].keys&&('next'in(ce=[].keys())?(ve=oe(oe(ce)))!==Object.prototype&&(se=ve):ie=1),null==se&&(se={}),U(se,ne)||k(se,ne,(function(){return this}));var ue={IteratorPrototype:se,BUGGY_SAFARI_ITERATORS:ie};var le=C.f;var fe=z('toStringTag');var de=(it,r,e)=>{it&&!U(it=e?it:it.prototype,fe)&&le(it,fe,{configurable:1,value:r})};var pe=ue.IteratorPrototype;var he=function(){return this};var ye=Object.setPrototypeOf||('__proto__'in{}?(()=>{var r=0;var test={};var e;try{(e=Object.getOwnPropertyDescriptor(Object.prototype,'__proto__').set).call(test,[]),r=test instanceof Array}catch(r){}return(t,a)=>(E(t),(it=>{if(!w(it)&&null!==it)throw TypeError("Can't set "+String(it)+' as a prototype')})(a),r?e.call(t,a):t.__proto__=a,t)})():void 0);var ge=ue.IteratorPrototype;var me=ue.BUGGY_SAFARI_ITERATORS;var be=z('iterator');var we=function(){return this};var je=Rr.set;var Oe=Rr.getterFor("Array Iterator");var Se=function(r,e,t,a,o){(r=>{var e="Array Iterator";r.prototype=gr(pe,{next:_(1,(function(){var r=Oe(this);var e=r.target;var t=r.kind;var a=r.index++;return!e||a>=e.length?(r.target=void 0,{value:void 0,done:1}):'keys'==t?{value:a,done:0}:'values'==t?{value:e[a],done:0}:{value:[a,e[a]],done:0}}))}),de(r,e,0),jr[e]=he})(t);var n=function(r){if(r===o&&c)return c;if(!me&&r in s)return s[r];switch(r){case"keys":case"values":case"entries":return function(){return new t(this,r)}}return function(){return new t(this)}};var i=0;var s=r.prototype;var v=s[be]||s['@@iterator']||s.values;var c=!me&&v||n(o);var u=s.entries||v;var l,f,d;if(u&&(l=oe(u.call(new r)),ge!==Object.prototype&&l.next&&(oe(l)!==ge&&(ye?ye(l,ge):'function'!=typeof l[be]&&k(l,be,we)),de(l,"Array Iterator",1))),v&&"values"!==v.name&&(i=1,c=function(){return v.call(this)}),s[be]!==c&&k(s,be,c),jr.Array=c,void(f={values:n("values"),keys:n("keys"),entries:n("entries")}))for(d in f)(me||i||!(d in s))&&Dr(s,d,f[d]);else Qr({target:'Array',proto:1,forced:me||i},f);return f}(Array,0,(function(r,e){je(this,{type:"Array Iterator",target:p(r),index:0,kind:e})}),0,'values');jr.Arguments=jr.Array,wr('keys'),wr('values'),wr('entries');var Pe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};var Ee=z('iterator');var Te=z('toStringTag');var xe=Se.values;for(var Ce in Pe){var _e=m[Ce];var ke=_e&&_e.prototype;if(ke){if(ke[Ee]!==xe)try{k(ke,Ee,xe)}catch(r){ke[Ee]=xe}if(ke[Te]||k(ke,Te,Ce),Pe[Ce])for(var Ae in Se)if(ke[Ae]!==Se[Ae])try{k(ke,Ae,Se[Ae])}catch(r){ke[Ae]=Se[Ae]}}}function Le(r){var e=0;for(var t=0;t<r.length;t++){var a=r.charAt(t);e&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(r=r.substr(0,t)+'-'+r.substr(t),e=0,t++):e=a.toLowerCase()===a}return r}var Re=function r(e){return e?e instanceof Date?e:Array.isArray(e)?e.map((e=>r(e))):"object"==typeof e?((r,e)=>{var t={};var a=Object.keys(r);for(var o=0;o<a.length;o++){var n=a[o];var i=e(n,r[n]);t[i[0]]=i[1]}return t})(e,((t,a)=>{var o=function(){var r=[].map.call(arguments,(r=>r.trim())).filter((r=>r.length)).join('-');return r.length?1===r.length?r:/[_.\- ]+/.test(r)?(r=Le(r)).replace(/^[_.\- ]+/,'').toLowerCase().replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())):r===r.toUpperCase()?r.toLowerCase():r[0]!==r[0].toLowerCase()?r[0].toLowerCase()+r.slice(1):r:''}(t);if(t!==o&&o in e)throw new Error("Camelcased key `"+o+"` would overwrite existing key of the given JSON object");return[o,r(a)]})):e:e};var Ie=m.Promise;var Ue=z('species');var Me=it=>{if('function'!=typeof it)throw TypeError(String(it)+' is not a function');return it};var Ne=z('iterator');var Fe=Array.prototype;var De=(r,e,t)=>{if(Me(r),void 0===e)return r;switch(t){case 0:return()=>r.call(e);case 1:return t=>r.call(e,t);case 2:return(t,a)=>r.call(e,t,a);case 3:return(t,a,o)=>r.call(e,t,a,o)}return function(){return r.apply(e,arguments)}};var test={};test[z('toStringTag')]='z';var qe='[object z]'===String(test);var Ge=z('toStringTag');var We='Arguments'==u(function(){return arguments}());var Ve=qe?u:it=>{var r,e,t;return void 0===it?'Undefined':null===it?'Null':'string'==typeof(e=((it,r)=>{try{return it[r]}catch(r){}})(r=Object(it),Ge))?e:We?u(r):'Object'==(t=u(r))&&'function'==typeof r.callee?'Arguments':t};var ze=z('iterator');var He=r=>{var e=r.return;if(void 0!==e)return E(e.call(r)).value};var Be=function(r,e){this.stopped=r,this.result=e};var Xe=(r,e,t)=>{var a=!(!t||!t.AS_ENTRIES);var o=!(!t||!t.IS_ITERATOR);var n=!(!t||!t.INTERRUPTED);var i=De(e,t&&t.that,1+a+n);var s,v,c,u,l,f,d;var p=r=>(s&&He(s),new Be(1,r));var h=r=>a?(E(r),n?i(r[0],r[1],p):i(r[0],r[1])):n?i(r,p):i(r);if(o)s=r;else{if('function'!=typeof(v=(it=>{if(null!=it)return it[ze]||it['@@iterator']||jr[Ve(it)]})(r)))throw TypeError('Target is not iterable');if(void 0!==(it=v)&&(jr.Array===it||Fe[Ne]===it)){for(c=0,u=K(r.length);u>c;c++)if((l=h(r[c]))&&l instanceof Be)return l;return new Be(0)}s=v.call(r)}var it;for(f=s.next;!(d=f.call(s)).done;){try{l=h(d.value)}catch(r){throw He(s),r}if('object'==typeof l&&l&&l instanceof Be)return l}return new Be(0)};var Ye=z('iterator');var Ke=0;try{var Je=0;var Ze={next:()=>({done:!!Je++}),return:()=>{Ke=1}};Ze[Ye]=function(){return this},Array.from(Ze,(()=>{throw 2}))}catch(r){}var $e=z('species');var Qe=vr('navigator','userAgent')||'';var rt=/(iphone|ipod|ipad).*applewebkit/i.test(Qe);var et='process'==u(m.process);var tt=m.location;var at=m.setImmediate;var ot=m.clearImmediate;var nt=m.process;var st=m.MessageChannel;var vt=m.Dispatch;var ct=0;var ut={};var lt,ft,dt;var pt=r=>{if(ut.hasOwnProperty(r)){var e=ut[r];delete ut[r],e()}};var ht=r=>()=>{pt(r)};var yt=r=>{pt(r.data)};var gt=r=>{m.postMessage(r+'',tt.protocol+'//'+tt.host)};at&&ot||(at=function(r){var e=[];var t=1;for(;arguments.length>t;)e.push(arguments[t++]);return ut[++ct]=()=>{('function'==typeof r?r:Function(r)).apply(void 0,e)},lt(ct),ct},ot=r=>{delete ut[r]},et?lt=r=>{nt.nextTick(ht(r))}:vt&&vt.now?lt=r=>{vt.now(ht(r))}:st&&!rt?(dt=(ft=new st).port2,ft.port1.onmessage=yt,lt=De(dt.postMessage,dt,1)):m.addEventListener&&'function'==typeof postMessage&&!m.importScripts&&tt&&'file:'!==tt.protocol&&!v(gt)?(lt=gt,m.addEventListener('message',yt,0)):lt="onreadystatechange"in S('script')?function(r){cr.appendChild(S('script')).onreadystatechange=function(){cr.removeChild(this),pt(r)}}:r=>{setTimeout(ht(r),0)});var mt={set:at,clear:ot};var bt=/web0s(?!.*chrome)/i.test(Qe);var wt=mt.set;var jt=m.MutationObserver||m.WebKitMutationObserver;var Ot=m.document;var St=m.process;var Pt=m.Promise;var Et=(0,Fr.f)(m,'queueMicrotask');var Tt=Et&&Et.value;var xt,Ct,_t,kt,At,Lt,Rt,It;Tt||(xt=()=>{var r,e;for(et&&(r=St.domain)&&r.exit();Ct;){e=Ct.fn,Ct=Ct.next;try{e()}catch(r){throw Ct?kt():_t=void 0,r}}_t=void 0,r&&r.enter()},rt||et||bt||!jt||!Ot?Pt&&Pt.resolve?(Rt=Pt.resolve(void 0),It=Rt.then,kt=()=>{It.call(Rt,xt)}):kt=et?()=>{St.nextTick(xt)}:()=>{wt.call(m,xt)}:(At=1,Lt=Ot.createTextNode(''),new jt(xt).observe(Lt,{characterData:1}),kt=()=>{Lt.data=At=!At}));var Ut=Tt||(r=>{var e={fn:r,next:void 0};_t&&(_t.next=e),Ct||(Ct=e,kt()),_t=e});var Mt=function(r){var e,t;this.promise=new r(((r,a)=>{if(void 0!==e||void 0!==t)throw TypeError('Bad Promise constructor');e=r,t=a})),this.resolve=Me(e),this.reject=Me(t)};var Nt={f:r=>new Mt(r)};var Ft=(r,e)=>{if(E(r),w(e)&&e.constructor===r)return e;var t=Nt.f(r);return(0,t.resolve)(e),t.promise};var Dt=r=>{try{return{error:0,value:r()}}catch(r){return{error:1,value:r}}};var qt=m.process;var Gt=qt&&qt.versions;var Wt=Gt&&Gt.v8;var Vt,zt;Wt?zt=(Vt=Wt.split('.'))[0]+Vt[1]:Qe&&(!(Vt=Qe.match(/Edge\/(\d+)/))||Vt[1]>=74)&&(Vt=Qe.match(/Chrome\/(\d+)/))&&(zt=Vt[1]);var Ht=zt&&+zt;var Bt=mt.set;var Xt=z('species');var Yt=Rr.get;var Kt=Rr.set;var Jt=Rr.getterFor("Promise");var Zt=Ie;var $t=m.TypeError;var Qt=m.document;var ra=m.process;var ea=vr('fetch');var ta=Nt.f;var aa=ta;var oa=!!(Qt&&Qt.createEvent&&m.dispatchEvent);var na='function'==typeof PromiseRejectionEvent;var ia,sa,va,ca;var ua=Zr("Promise",(()=>{if(Sr(Zt)===String(Zt)){if(66===Ht)return 1;if(!et&&!na)return 1}if(Ht>=51&&/native code/.test(Zt))return 0;var r=Zt.resolve(1);var e=r=>{r((()=>{}),(()=>{}))};return(r.constructor={})[Xt]=e,!(r.then((()=>{}))instanceof e)}));var la=ua||!(()=>{if(!Ke)return 0;var r=0;try{var e={};e[Ye]=()=>({next:()=>({done:r=1})}),Zt.all(e).catch((()=>{}))}catch(r){}return r})();var fa=it=>{var r;return w(it)&&'function'==typeof(r=it.then)?r:0};var da=(r,e)=>{if(!r.notified){r.notified=1;var t=r.reactions;Ut((()=>{var a=r.value;var o=1==r.state;var n=0;for(;t.length>n;){var i=t[n++];var s=o?i.ok:i.fail;var v=i.resolve;var c=i.reject;var u=i.domain;var l,f,d;try{s?(o||(2===r.rejection&&ga(r),r.rejection=1),1==s?l=a:(u&&u.enter(),l=s(a),u&&(u.exit(),d=1)),l===i.promise?c($t('Promise-chain cycle')):(f=fa(l))?f.call(l,v,c):v(l)):c(a)}catch(r){u&&!d&&u.exit(),c(r)}}r.reactions=[],r.notified=0,e&&!r.rejection&&ha(r)}))}};var pa=(r,e,t)=>{var a,o;oa?((a=Qt.createEvent('Event')).promise=e,a.reason=t,a.initEvent(r,0,1),m.dispatchEvent(a)):a={promise:e,reason:t},!na&&(o=m['on'+r])?o(a):"unhandledrejection"===r&&function(r,e){var t=m.console;t&&t.error&&(1===arguments.length?t.error(r):t.error(r,e))}('Unhandled promise rejection',t)};var ha=r=>{Bt.call(m,(()=>{var e=r.facade;var t=r.value;var a;if(ya(r)&&(a=Dt((()=>{et?ra.emit('unhandledRejection',t,e):pa("unhandledrejection",e,t)})),r.rejection=et||ya(r)?2:1,a.error))throw a.value}))};var ya=r=>1!==r.rejection&&!r.parent;var ga=r=>{Bt.call(m,(()=>{var e=r.facade;et?ra.emit('rejectionHandled',e):pa("rejectionhandled",e,r.value)}))};var ma=(r,e,t)=>a=>{r(e,a,t)};var ba=(r,e,t)=>{r.done||(r.done=1,t&&(r=t),r.value=e,r.state=2,da(r,1))};var wa=(r,e,t)=>{if(!r.done){r.done=1,t&&(r=t);try{if(r.facade===e)throw $t("Promise can't be resolved itself");var a=fa(e);a?Ut((()=>{var t={done:0};try{a.call(e,ma(wa,t,r),ma(ba,t,r))}catch(e){ba(t,e,r)}})):(r.value=e,r.state=1,da(r,0))}catch(e){ba({done:0},e,r)}}};var ja;ua&&(Zt=function(r){(()=>{if(!(this instanceof Zt))throw TypeError("Incorrect Promise invocation")})(),Me(r),ia.call(this);var e=Yt(this);try{r(ma(wa,e),ma(ba,e))}catch(r){ba(e,r)}},(ia=function(){Kt(this,{type:"Promise",done:0,notified:0,parent:0,reactions:[],rejection:0,state:0,value:void 0})}).prototype=((r,e)=>{for(var t in e)Dr(r,t,e[t],void 0);return r})(Zt.prototype,{then:function(r,e){var t=Jt(this);var a=ta((o=Zt,void 0===(n=E(this).constructor)||null==(i=E(n)[$e])?o:Me(i)));var o,n,i;return a.ok='function'==typeof r?r:1,a.fail='function'==typeof e&&e,a.domain=et?ra.domain:void 0,t.parent=1,t.reactions.push(a),0!=t.state&&da(t,0),a.promise},catch:function(r){return this.then(void 0,r)}}),sa=function(){var r=new ia;var e=Yt(r);this.promise=r,this.resolve=ma(wa,e),this.reject=ma(ba,e)},Nt.f=ta=r=>r===Zt||r===va?new sa(r):aa(r),'function'==typeof Ie&&(ca=Ie.prototype.then,Dr(Ie.prototype,'then',(function(r,e){var t=this;return new Zt(((r,e)=>{ca.call(t,r,e)})).then(r,e)}),{unsafe:1}),'function'==typeof ea&&Qr({global:1,enumerable:1,forced:1},{fetch:function(){return Ft(Zt,ea.apply(m,arguments))}}))),Qr({global:1,wrap:1,forced:ua},{Promise:Zt}),de(Zt,"Promise",0),ja=vr("Promise"),b&&ja&&!ja[Ue]&&(0,C.f)(ja,Ue,{configurable:1,get:function(){return this}}),va=vr("Promise"),Qr({target:"Promise",stat:1,forced:ua},{reject:function(r){var e=ta(this);return e.reject.call(void 0,r),e.promise}}),Qr({target:"Promise",stat:1,forced:ua},{resolve:function(r){return Ft(this,r)}}),Qr({target:"Promise",stat:1,forced:la},{all:function(r){var e=this;var t=ta(e);var a=t.resolve;var o=t.reject;var n=Dt((()=>{var t=Me(e.resolve);var n=[];var i=0;var s=1;Xe(r,(r=>{var v=i++;var c=0;n.push(void 0),s++,t.call(e,r).then((r=>{c||(c=1,n[v]=r,--s||a(n))}),o)})),--s||a(n)}));return n.error&&o(n.value),t.promise},race:function(r){var e=this;var t=ta(e);var a=t.reject;var o=Dt((()=>{var o=Me(e.resolve);Xe(r,(r=>{o.call(e,r).then(t.resolve,a)}))}));return o.error&&a(o.value),t.promise}});var Oa=function(){var r=E(this);var e='';return r.global&&(e+='g'),r.ignoreCase&&(e+='i'),r.multiline&&(e+='m'),r.dotAll&&(e+='s'),r.unicode&&(e+='u'),r.sticky&&(e+='y'),e};var Sa=RegExp.prototype;var Pa=Sa.toString;function Ea(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:1,configurable:1,writable:1}):r[e]=t,r}function Ta(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter((e=>Object.getOwnPropertyDescriptor(r,e).enumerable))),t.push.apply(t,a)}return t}(v((()=>'/a/b'!=Pa.call({source:'a',flags:'b'})))||"toString"!=Pa.name)&&Dr(RegExp.prototype,"toString",(function(){var r=E(this);var e=String(r.source);var t=r.flags;return'/'+e+'/'+String(void 0===t&&r instanceof RegExp&&!('flags'in Sa)?Oa.call(r):t)}),{unsafe:1});var xa=[422,401];var Ca=a.default.create({timeout:1e4,baseURL:s,withCredentials:1,xsrfCookieName:'_csrf_token',xsrfHeaderName:'X-CSRF-Token',headers:{'X-Requested-With':'XMLHttpRequest'}});Ca.interceptors.request.use((r=>{var e='boolean'==typeof r.camelize?r.camelize:1;if(r.headers?r.headers['Content-Type']='application/json':r.headers={'Content-Type':'application/json'},e){var t=a.default.defaults.transformResponse||[];var o=r=>Re(r);var n=Array.isArray(t)?[...t,o]:[t,o];r.transformResponse=n}return r})),Ca.interceptors.response.use((r=>r),(r=>{var{config:e=null,response:t=null}=r;if(null===e||null===t)return Promise.reject(r);var a=e;xa.includes(t.status)&&(a._retry=1);var o=function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ta(Object(t),1).forEach((e=>{Ea(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ta(Object(t)).forEach((e=>{Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({status:t.status,statusText:t.statusText,errorText:r.toString(),headers:t.headers},'object'==typeof t.data?t.data:{data:t.data});return Promise.reject(o)})),o.default(Ca,{retries:3,retryDelay:o.default.exponentialDelay});class _a{constructor(r){if(this.id=void 0,this.email=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.phone=void 0,this.parent=void 0,this.fakeUser=void 0,this.isCustomer=void 0,this.emailConfirmed=void 0,this.fakeEmail=void 0,this.phoneConfirmed=void 0,this.createdAt=void 0,this.recentRegistration=void 0,this.profileEnriched=void 0,this.skype=void 0,this.graduate=void 0,this.type=void 0,this.avatarUrl=void 0,this.bonusAmount=void 0,this.grade=void 0,this.gradeChecked=void 0,this.tags=void 0,this.hasChats=void 0,this.hasReferrals=void 0,this.onboardingFinished=void 0,this.externshipUser=void 0,'object'!=typeof r)throw new Error('data is wrong');this.id=r.id,this.gradeChecked=r.gradeChecked,this.email=r.email||'',this.firstName=r.firstName,this.middleName=r.middleName||'',this.lastName=r.lastName,this.phone=r.phone||'',this.parent=r.parent,this.fakeUser=r.fakeUser,this.isCustomer=r.isCustomer,this.emailConfirmed=r.emailConfirmed,this.fakeEmail=r.fakeEmail,this.phoneConfirmed=r.phoneConfirmed,this.createdAt=r.createdAt||'',this.recentRegistration=r.recentRegistration,this.profileEnriched=r.profileEnriched,this.skype=r.skype||'',this.graduate=r.graduate,this.type=r.type,this.avatarUrl=r.avatarUrl||'',this.bonusAmount=r.bonusAmount,this.grade=r.grade,this.tags=r.tags,this.hasChats=r.hasChats,this.hasReferrals=r.hasReferrals,this.onboardingFinished=r.onboardingFinished,this.externshipUser=r.externshipUser}isLoggedIn(){return this.id>0?1:0}}var ka={id:0,gradeChecked:0,email:'',firstName:'',middleName:'',lastName:'',phone:'',parent:0,fakeUser:0,isCustomer:0,emailConfirmed:0,fakeEmail:0,phoneConfirmed:0,createdAt:'',recentRegistration:0,profileEnriched:0,skype:'',graduate:0,type:'pupil',avatarUrl:'',bonusAmount:0,grade:{id:0,index:0},tags:[],hasChats:0,hasReferrals:0,onboardingFinished:0,externshipUser:0};class Aa{getUser(){return i((function*(){try{var r=yield Ca.get('/api/user/me').then((r=>{var{data:e}=r;return e}));return new _a(r)}catch(r){return new _a(ka)}}))()}createUser(r){return new _a(r)}purchases(r){return i((function*(){var{resourceId:e,resourceType:t}=r;if(e&&'number'!=typeof e)throw new Error('resourceId must be a number');if(t&&'string'!=typeof t)throw new Error('resourceType must be a string');var a=[];e&&a.push("resource_id=".concat(encodeURIComponent(e))),t&&a.push("resource_type=".concat(encodeURIComponent(t)));var o=a.length?"?".concat(a.join('&')):'';var{data:n}=yield Ca.get("/api/user/purchases".concat(o));return n}))()}signIn(r){var{redirectUrl:e}=r;if(e&&'string'!=typeof e)throw new Error('redirectUrl must be a string');var t="".concat(s,"/user/registration?redirect_url=");e&&(t+=encodeURIComponent(document.location.href)),document.location.href=t}signOut(){var r=arguments;return i((function*(){var e=r.length>0&&void 0!==r[0]?r[0]:1;var t=yield Ca.delete("/user/log_out");return e&&window.location.reload(),t}))()}}class La{checkPromocode(r){return i((function*(){var{data:e}=yield Ca.get("/api/promo_codes/invite/".concat(r));return e}))()}}var Ra=Object.assign;var Ia=Object.defineProperty;var Ua=!Ra||v((function(){if(b&&1!==Ra({b:1},Ra(Ia({},'a',{enumerable:1,get:function(){Ia(this,'b',{value:3,enumerable:0})}}),{b:2})).b)return 1;var r={};var e={};var t=Symbol();var a='abcdefghijklmnopqrst';return r[t]=7,a.split('').forEach((r=>{e[r]=r})),7!=Ra({},r)[t]||or(Ra({},e)).join('')!=a}))?function(r){var e=re(r);var t=arguments.length;var a=1;var o=Wr.f;var n=Mr.f;for(;t>a;){var i=f(arguments[a++]);var s=o?or(i).concat(o(i)):or(i);var v=s.length;var c=0;var u;for(;v>c;)u=s[c++],b&&!n.call(i,u)||(e[u]=i[u])}return e}:Ra;var Ma;Qr({target:'Object',stat:1,forced:Object.assign!==Ua},{assign:Ua}),(Ma||(Ma={})).External="LeadRequests::External";class Na{createLeadRequest(r,e){return{type:r,agreement:1,context:e}}send(r,e){var t=arguments,a=this;return i((function*(){var o=t.length>2&&void 0!==t[2]?t[2]:'';var n=a.createLeadRequest(t.length>3&&void 0!==t[3]?t[3]:Ma.External,e);var i=Object.assign(n,r);var{data:s}=yield Ca.post("/api/lead_requests".concat(o),{data:{lead_request:i}});return s}))()}}class Fa{addTag(r){return i((function*(){var{data:e}=yield Ca.post("/api/user/tag?id=".concat(r));return e}))()}}class Da{createCartItem(r,e){return{resource_id:r,cart_item_type:e}}addCartItemToCart(r){return i((function*(){var{data:e}=yield Ca.post("/api/cart_items",{cart_item:r});return e}))()}}class qa{getCourse(r){return i((function*(){if('number'!=typeof r)throw new TypeError('id is wrong');var{data:e}=yield Ca.get("/api/courses/".concat(r));return e}))()}}class Ga{getProductPack(r){return i((function*(){if('number'!=typeof r)throw new TypeError('id is wrong');var{data:e}=yield Ca.get("/api/product_packs/".concat(r));return e}))()}}class Wa{constructor(r){var e=arguments.length>0&&void 0!==r?r:'latest';this.version=void 0,this.version=e}create(r){var e=this;return i((function*(){if(!r)throw new Error('You must specify config for creating widgets');if(yield e.loadAssets(),!window.FoxfordWidgets)throw new Error('FoxfordWidgets not found in global scope');if('function'!=typeof window.FoxfordWidgets.create)throw new Error('Not found function create in FoxfordWidgets library');window.FoxfordWidgets.create(r)}))()}loadAssets(){var r=this;return i((function*(){return r.version||(r.version='latest'),new Promise(((e,t)=>{var a="https://dist.ngcdn.ru/libs/foxford-widgets/".concat(r.version,"/foxford-widgets.js");var o=document.createElement('script');o.type='text/javascript',o.async=1,o.onload=()=>e(1),o.onerror=r=>t(r),o.src=a,document.body.appendChild(o)}))}))()}}var Va={host:s,widgetsVersion:'latest'};exports.Foxford=class{constructor(r){var e=arguments.length>0&&void 0!==r?r:Va;this.api=void 0,this.user=void 0,this.tag=void 0,this.cart=void 0,this.promo=void 0,this.course=void 0,this.productPack=void 0,this.leadrequest=void 0,this.widgets=void 0,this._config=void 0,this._config=e,this._config.host&&(Ca.defaults.baseURL=this._config.host),this.user=new Aa,this.promo=new La,this.tag=new Fa,this.cart=new Da,this.course=new qa,this.widgets=new Wa(e.widgetsVersion),this.productPack=new Ga,this.leadrequest=new Na,this.api=Ca}shortURL(r){return Ca.post("/api/short_urls",{link:r}).then((r=>r))}};
//# sourceMappingURL=foxford.cjs.js.map

@@ -5,2 +5,3 @@ import { AxiosInstance } from 'axios'

host?: string;
widgetsVersion?: 'latest' | string;
}

@@ -20,2 +21,119 @@

export type Course = {
id: number,
name: string,
subtitle: string,
showRating: boolean,
trainer: boolean,
purchaseMode: string,
webinar: boolean,
timingTitle: string,
timingDescription: string,
asynchronous: boolean,
url: string,
isAgentCourse: boolean,
isKpk: boolean,
isKpp: boolean,
isSimpleCourse: boolean,
lessonsDay: string,
dayTemplates: Array<string>,
fullTitle: string,
levels: Array<{ id: number, name: string }>,
discipline: {
id: number,
name: string,
color: string,
darkColor: string,
image: string,
svgImage: string,
},
teacher: {
id: number,
aliasUrl: string,
university: string,
shortName: string,
url: string,
photoUrl: string,
},
gradesRange: string,
grades: Array<{ id: number, name: string }>,
courseType: { id: number, name: string },
cartItem: {
fullAccessFinishDate: string,
type: string,
price: number,
priceWithDiscount: number,
pricePerHour: number,
pricePerMonth: number,
pricePerMonthWithDiscount: number,
creditAvailable: boolean,
},
usersCourse: {
accessExpiredAt: null,
active: boolean,
entireCoursePurchased: boolean,
purchaseState: string,
accessReason: null,
},
}
export type ProductTypeItem = {
type: string,
id: number,
description: string,
title: string,
discipline: { id: number, name: string },
teacher: {
id: number,
long_name: string,
description: string,
experience: number,
photo_url: string,
photo_large_url: string,
},
levels: Array<{ id: number, name: string }>,
}
export type ProductPack = {
name: string,
description: string,
meta_title: string,
meta_description: string,
published: true,
content_description: string,
disciplines_scope: string,
guaranteed_admission: true,
grade_names: string,
is_purchased: false,
learning_flow: {
title: string,
steps: Array<{
header: string,
description: string,
}>,
},
offers: {
intro: string,
items: Array<{
title: string,
description: string,
}>,
},
price_block: {
price: number,
initial_price: number,
title: string,
description: string,
points: Array<string>,
price_per_month: number,
initial_price_per_month: number,
},
product_pack_items: Array<ProductTypeItem>,
faq_items: Array<{
question: string,
answer: string,
}>,
landing_image_urls: Array<string>,
}
export interface UserData {

@@ -79,2 +197,6 @@ id: number;

export interface CourseServiceI {
getCourse(id: number): Promise<Course>;
}
export interface CartServiceI {

@@ -85,5 +207,4 @@ createCartItem(id: number, type: string): CartItem;

export interface CartItem {
resource_id: number;
cart_item_type: string;
export interface ProductPackServiceI {
getProductPack(id: number): Promise<ProductPack>;
}

@@ -101,4 +222,31 @@

export class Foxford {
constructor(config?: FoxfordConfig): void;
export interface CartItem {
resource_id: number;
cart_item_type: string;
}
export type FoxfordWidgetsConfig = {
analyticContext?: {
prefix: string,
module: string,
payload?: {},
},
rootColors?: boolean,
loadFonts?: boolean,
widgets: Array<{
name: 'menu' | 'reviews' | 'featuredCoaches' | 'coachEnrollment' | 'shortForm' | 'userTypePrompt',
options: {},
container?: HTMLElement,
}>,
}
export interface FoxfordWidgets {
create(config: FoxfordWidgetsConfig): void;
}
export interface WidgetsI {
create(config: FoxfordWidgetsConfig): Promise<void>;
}
export interface FoxfordI {
api: AxiosInstance;

@@ -108,5 +256,12 @@ user: UserServiceI;

leadrequest: LeadRequestServiceI;
course: CourseServiceI;
productPack: ProductPackServiceI;
tag: TagServiceI;
cart: CartServiceI;
widgets: WidgetsI;
shortURL(url: string): Promise<unknown>;
}
export class Foxford implements FoxfordI {
constructor(config?: FoxfordConfig);
}

@@ -5,2 +5,3 @@ import { AxiosInstance } from 'axios'

host?: string;
widgetsVersion?: 'latest' | string;
}

@@ -20,2 +21,119 @@

export type Course = {
id: number,
name: string,
subtitle: string,
showRating: boolean,
trainer: boolean,
purchaseMode: string,
webinar: boolean,
timingTitle: string,
timingDescription: string,
asynchronous: boolean,
url: string,
isAgentCourse: boolean,
isKpk: boolean,
isKpp: boolean,
isSimpleCourse: boolean,
lessonsDay: string,
dayTemplates: Array<string>,
fullTitle: string,
levels: Array<{ id: number, name: string }>,
discipline: {
id: number,
name: string,
color: string,
darkColor: string,
image: string,
svgImage: string,
},
teacher: {
id: number,
aliasUrl: string,
university: string,
shortName: string,
url: string,
photoUrl: string,
},
gradesRange: string,
grades: Array<{ id: number, name: string }>,
courseType: { id: number, name: string },
cartItem: {
fullAccessFinishDate: string,
type: string,
price: number,
priceWithDiscount: number,
pricePerHour: number,
pricePerMonth: number,
pricePerMonthWithDiscount: number,
creditAvailable: boolean,
},
usersCourse: {
accessExpiredAt: null,
active: boolean,
entireCoursePurchased: boolean,
purchaseState: string,
accessReason: null,
},
}
export type ProductTypeItem = {
type: string,
id: number,
description: string,
title: string,
discipline: { id: number, name: string },
teacher: {
id: number,
long_name: string,
description: string,
experience: number,
photo_url: string,
photo_large_url: string,
},
levels: Array<{ id: number, name: string }>,
}
export type ProductPack = {
name: string,
description: string,
meta_title: string,
meta_description: string,
published: true,
content_description: string,
disciplines_scope: string,
guaranteed_admission: true,
grade_names: string,
is_purchased: false,
learning_flow: {
title: string,
steps: Array<{
header: string,
description: string,
}>,
},
offers: {
intro: string,
items: Array<{
title: string,
description: string,
}>,
},
price_block: {
price: number,
initial_price: number,
title: string,
description: string,
points: Array<string>,
price_per_month: number,
initial_price_per_month: number,
},
product_pack_items: Array<ProductTypeItem>,
faq_items: Array<{
question: string,
answer: string,
}>,
landing_image_urls: Array<string>,
}
export interface UserData {

@@ -79,2 +197,6 @@ id: number;

export interface CourseServiceI {
getCourse(id: number): Promise<Course>;
}
export interface CartServiceI {

@@ -85,5 +207,4 @@ createCartItem(id: number, type: string): CartItem;

export interface CartItem {
resource_id: number;
cart_item_type: string;
export interface ProductPackServiceI {
getProductPack(id: number): Promise<ProductPack>;
}

@@ -101,4 +222,31 @@

export class Foxford {
constructor(config?: FoxfordConfig): void;
export interface CartItem {
resource_id: number;
cart_item_type: string;
}
export type FoxfordWidgetsConfig = {
analyticContext?: {
prefix: string,
module: string,
payload?: {},
},
rootColors?: boolean,
loadFonts?: boolean,
widgets: Array<{
name: 'menu' | 'reviews' | 'featuredCoaches' | 'coachEnrollment' | 'shortForm' | 'userTypePrompt',
options: {},
container?: HTMLElement,
}>,
}
export interface FoxfordWidgets {
create(config: FoxfordWidgetsConfig): void;
}
export interface WidgetsI {
create(config: FoxfordWidgetsConfig): Promise<void>;
}
export interface FoxfordI {
api: AxiosInstance;

@@ -108,5 +256,12 @@ user: UserServiceI;

leadrequest: LeadRequestServiceI;
course: CourseServiceI;
productPack: ProductPackServiceI;
tag: TagServiceI;
cart: CartServiceI;
widgets: WidgetsI;
shortURL(url: string): Promise<unknown>;
}
export class Foxford implements FoxfordI {
constructor(config?: FoxfordConfig);
}
{
"name": "@foxford/foxford-js-sdk",
"version": "2.0.2",
"version": "2.0.3",
"description": "Foxford sdk for external projects",

@@ -5,0 +5,0 @@ "main": "foxford.cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc