-
Notifications
You must be signed in to change notification settings - Fork 0
/
784.render-page.js.map
1 lines (1 loc) · 258 KB
/
784.render-page.js.map
1
{"version":3,"file":"784.render-page.js","mappings":";;;;;;;AAAA;AACA,EAAE,KAA4D;AAC9D,EAAE,CACuD;AACzD,CAAC,qBAAqB;;AAEtB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oDAAoD,gBAAgB;;AAEpE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,4CAA4C;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,8CAA8C;;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,4BAA4B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,wBAAwB;AAC3B;AACA;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D;AACA;AACA,sCAAsC,qBAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,wBAAwB;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,cAAc;AACpC;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM,WAAW;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW;AACjB;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB;;AAEnB;AACA;AACA;AACA,QAAQ;;;AAGR;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;;AAGR;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;;AAEA,sBAAsB,kBAAkB;AACxC;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB;;AAEnB;AACA;AACA;AACA,QAAQ;;;AAGR;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;;AAGR;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC;;AAEA,sBAAsB,eAAe;AACrC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA,oEAAoE,gEAAgE;AACpI;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gBAAgB;AAChB;;AAEA,cAAc;;AAEd;AACA,gBAAgB;AAChB;;AAEA;AACA,gBAAgB;AAChB;;AAEA;AACA,gBAAgB;AAChB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qCAAqC;AACrC;;AAEA;AACA,KAAK;AACL,KAAK;;;AAGL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,QAAQ;AAC3C;AACA;;AAEA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,uCAAuC;AACvC,6CAA6C;AAC7C,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,8FAA8F;;AAE9F;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,YAAY;AACZ;;;AAGA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,yEAAyE;AACzE,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,cAAc,UAAU;AACxB;AACA,mCAAmC;AACnC;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,2BAA2B;AACxC;AACA,cAAc,UAAU;AACxB;AACA;AACA,mCAAmC;AACnC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,2BAA2B;AACxC;AACA,cAAc,UAAU;AACxB;AACA;AACA,mCAAmC;AACnC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,mCAAmC;AAChD;AACA,cAAc,UAAU;AACxB;AACA,2BAA2B,+BAA+B,GAAG;AAC7D,mCAAmC;AACnC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,mCAAmC;AAChD;AACA,cAAc,UAAU;AACxB;AACA,mCAAmC;AACnC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,UAAU;AACxB;AACA,mCAAmC;AACnC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,2BAA2B;AACxC,eAAe,UAAU;AACzB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,2BAA2B;AACxC,eAAe,UAAU;AACzB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,2BAA2B;AACxC,eAAe,UAAU;AACzB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,aAAa;AAClC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA,kBAAkB,aAAa;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH,GAAG;;AAEH;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,EAAE;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,oBAAoB;;AAE5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB,sCAAsC;AACtC;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C;AAC/C;;AAEA;AACA;;AAEA;;AAEA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA;AACA,sCAAsC,mBAAmB;AACzD;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,IAAI;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,IAAI;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD,gBAAgB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,gDAAgD,GAAG;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wDAAwD;AACxD;;AAEA,wBAAwB;AACxB;;AAEA,iCAAiC;AACjC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC,IAAI;AACxC;;AAEA,gDAAgD;AAChD;;AAEA,yBAAyB;AACzB;;AAEA,iCAAiC,0CAA0C;AAC3E;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD,IAAI,WAAW,IAAI;AACtE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,wBAAwB,SAAS;AACjC;AACA,oCAAoC;AACpC;;AAEA;AACA,0DAA0D,EAAE;AAC5D;AACA,0CAA0C;AAC1C,8BAA8B,IAAI;AAClC;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,4BAA4B,EAAE;AAC9B;;AAEA;AACA;AACA,0BAA0B,EAAE,iBAAiB;AAC7C;;AAEA;AACA,4BAA4B,EAAE,UAAU;AACxC;;AAEA;AACA;AACA;AACA,uCAAuC,IAAI;AAC3C;AACA,kCAAkC,IAAI;AACtC;;AAEA;AACA,kCAAkC,EAAE,gBAAgB,EAAE,GAAG,aAAa,IAAI;AAC1E;AACA;AACA,uBAAuB;AACvB;AACA;;AAEA;AACA;AACA,+DAA+D,EAAE,WAAW,EAAE;AAC9E;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,eAAe,IAAI;AAC3C;;AAEA;AACA,gCAAgC,EAAE,wDAAwD,IAAI;AAC9F;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,EAAE;AAC1B;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,SAAS;AACnC;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA,4CAA4C,MAAM;AAClD;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,IAAI,IAAI;;AAE/B;AACA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;;AAEA;AACA,wBAAwB;AACxB,2BAA2B,GAAG;AAC9B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oCAAoC,IAAI;AACxC,kCAAkC,EAAE;AACpC,kCAAkC,IAAI;AACtC;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA,uBAAuB,EAAE;AACzB;AACA;AACA;AACA,uBAAuB,EAAE;AACzB;AACA,wBAAwB,EAAE;AAC1B;AACA,wBAAwB,EAAE;AAC1B;AACA;AACA;AACA,yBAAyB,EAAE;AAC3B,2CAA2C,EAAE;AAC7C;AACA,yBAAyB,IAAI;AAC7B;AACA,iCAAiC,IAAI;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,EAAE;AAC/B;AACA,wBAAwB;AACxB;AACA,wBAAwB;AACxB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,oCAAoC,WAAW;AAC/C;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,+CAA+C,OAAO,IAAI,IAAI;AAC9D;AACA,uDAAuD;AACvD;;AAEA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA,wBAAwB,QAAQ,IAAI;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0BAA0B,IAAI;AAC9B;AACA,0BAA0B,IAAI;AAC9B;AACA,gCAAgC;AAChC;AACA,iCAAiC;AACjC;AACA,gCAAgC,IAAI,EAAE;AACtC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,IAAI;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,IAAI,6BAA6B;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,wBAAwB;AACxB;AACA,4CAA4C;AAC5C;AACA,8DAA8D,SAAS;AACvE;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,YAAY;;AAEnC;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,iCAAiC,IAAI,mCAAmC,IAAI;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;AACH,GAAG;AACH;;AAEA;AACA,0BAA0B,qCAAqC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,UAAU,kBAAkB;AAC5C,gBAAgB,UAAU,qBAAqB;AAC/C,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,UAAU;AAC1B,gBAAgB,QAAQ,oBAAoB,wNAAwN;AACpQ,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ,YAAY,oDAAoD,gBAAgB;AACxG;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,wCAAwC;AACxC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,uCAAuC;AACvC,KAAK;AACL;AACA,kBAAkB;;AAElB;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,aAAa,UAAU;AACvB,0DAA0D,wCAAwC,eAAe,yBAAyB;AAC1I;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;;;AAGV;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,oCAAoC;;;AAGpC,wBAAwB,0BAA0B;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,aAAa;AACb;AACA;;;AAGA;AACA;AACA,WAAW;AACX;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uCAAuC,4BAA4B;AACnE;AACA;AACA;AACA,WAAW;AACX;;AAEA,iDAAiD;AACjD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAkD;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;;;AAGN,mDAAmD;;AAEnD;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,oBAAoB,kBAAkB;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA,MAAM;AACN;;;AAGA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,MAAM;;;AAGN;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;;;AAGA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,aAAa;AAC1B,qDAAqD;AACrD;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,iDAAiD,6CAA6C;AAC9F;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;;AAGN;;AAEA;AACA;AACA,MAAM;;;AAGN;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,yBAAyB;AACtC;AACA,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;;;AAGN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,SAAS;AACT;AACA,MAAM;AACN;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;;;AAGN;AACA;AACA;;AAEA;AACA;AACA;AACA,kGAAkG;AAClG,QAAQ;AACR;AACA;AACA,SAAS;AACT;AACA,MAAM;AACN;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,2BAA2B;;;AAG3B;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;;AAE5C,sCAAsC,qBAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,yBAAyB;AACtC;AACA,aAAa,yBAAyB;AACtC;AACA;AACA,mEAAmE,qCAAqC;AACxG;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,yBAAyB;AACtC;AACA,aAAa,yBAAyB;AACtC;AACA;AACA,mEAAmE,qCAAqC;AACxG;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,aAAa,yBAAyB;AACtC;AACA,aAAa,yBAAyB;AACtC;AACA;AACA,0EAA0E,YAAY;AACtF;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,QAAQ;;;AAGR;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;AACA;;AAEA,sBAAsB,6BAA6B;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB,mCAAmC;AACvD;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,MAAM;;;AAGN;AACA;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2DAA2D;;AAE3D;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,2EAA2E;;AAE3E;AACA;AACA,YAAY;;;AAGZ,sCAAsC;;AAEtC,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;;;AAGd;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA,QAAQ,WAAW;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,mDAAmD;AACnD,UAAU;AACV;AACA,sDAAsD;AACtD,UAAU;AACV;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA,0BAA0B;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,oBAAoB;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,UAAU;AACzB;AACA,sDAAsD,wCAAwC,eAAe,yBAAyB;AACtI;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,aAAa;AAC5B;AACA,iDAAiD;AACjD;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA,6CAA6C,6CAA6C;AAC1F;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,yBAAyB;AACxC;AACA;AACA,+DAA+D,qCAAqC;AACpG;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,yBAAyB;AACxC;AACA;AACA,sEAAsE,YAAY;AAClF;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA,IAAI;;AAEJ;;AAEA,CAAC","sources":["webpack://lubycon-home/./node_modules/@lubycon/logger/node_modules/amplitude-js/amplitude.umd.js"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('amplitude', factory) :\n (global = global || self, global.amplitude = factory());\n}(this, function () { 'use strict';\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n }\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n }\n\n function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n }\n\n function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }\n\n /**\n * Strings that have special meaning when used as an event's type\n * and have different specifications.\n */\n var SpecialEventType;\n (function (SpecialEventType) {\n SpecialEventType[\"IDENTIFY\"] = \"$identify\";\n })(SpecialEventType || (SpecialEventType = {}));\n\n var IdentifyOperation;\n (function (IdentifyOperation) {\n // Base Operations to set values\n IdentifyOperation[\"SET\"] = \"$set\";\n IdentifyOperation[\"SET_ONCE\"] = \"$setOnce\";\n // Operations around modifying existing values\n IdentifyOperation[\"ADD\"] = \"$add\";\n IdentifyOperation[\"APPEND\"] = \"$append\";\n IdentifyOperation[\"PREPEND\"] = \"$prepend\";\n IdentifyOperation[\"REMOVE\"] = \"$remove\";\n // Operations around appending values *if* they aren't present\n IdentifyOperation[\"PREINSERT\"] = \"$preinsert\";\n IdentifyOperation[\"POSTINSERT\"] = \"$postinsert\";\n // Operations around removing properties/values\n IdentifyOperation[\"UNSET\"] = \"$unset\";\n IdentifyOperation[\"CLEAR_ALL\"] = \"$clearAll\";\n })(IdentifyOperation || (IdentifyOperation = {}));\n\n /** The default identity instance. Needs to match the default instance for the JS SDK */\n\n /** Console logging verbosity for the SDK. */\n var LogLevel;\n (function (LogLevel) {\n /** No logs will be generated. */\n LogLevel[LogLevel[\"None\"] = 0] = \"None\";\n /** Only SDK internal errors will be logged. */\n LogLevel[LogLevel[\"Error\"] = 1] = \"Error\";\n /** Information useful for debugging the SDK will be logged. */\n LogLevel[LogLevel[\"Warn\"] = 2] = \"Warn\";\n /** All SDK actions will be logged. */\n LogLevel[LogLevel[\"Verbose\"] = 3] = \"Verbose\";\n })(LogLevel || (LogLevel = {}));\n\n /** The status of an event. */\n var Status;\n (function (Status) {\n /** The status could not be determined. */\n Status[\"Unknown\"] = \"unknown\";\n /** The event was skipped due to configuration or callbacks. */\n Status[\"Skipped\"] = \"skipped\";\n /** The event was sent successfully. */\n Status[\"Success\"] = \"success\";\n /** A user or device in the payload is currently rate limited and should try again later. */\n Status[\"RateLimit\"] = \"rate_limit\";\n /** The sent payload was too large to be processed. */\n Status[\"PayloadTooLarge\"] = \"payload_too_large\";\n /** The event could not be processed. */\n Status[\"Invalid\"] = \"invalid\";\n /** A server-side error ocurred during submission. */\n Status[\"Failed\"] = \"failed\";\n })(Status || (Status = {}));\n // tslint:disable:completed-docs\n // tslint:disable:no-unnecessary-qualifier no-namespace\n (function (Status) {\n /**\n * Converts a HTTP status code into a {@link Status}.\n *\n * @param code The HTTP response status code.\n * @returns The send status or {@link Status.Unknown}.\n */\n function fromHttpCode(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n if (code === 429) {\n return Status.RateLimit;\n }\n if (code === 413) {\n return Status.PayloadTooLarge;\n }\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n if (code >= 500) {\n return Status.Failed;\n }\n return Status.Unknown;\n }\n Status.fromHttpCode = fromHttpCode;\n })(Status || (Status = {}));\n\n /** The Response to expect if a request might have been sent but it was skipped\n * e.g. no events to flush, user has opted out and nothing should be sent.\n */\n var SKIPPED_RESPONSE = {\n status: Status.Skipped,\n statusCode: 0,\n };\n\n /**\n * Checks whether we're in a Node.js environment\n *\n * @returns Answer to given question\n */\n function isNodeEnv() {\n var _a;\n return typeof process === 'object' && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== undefined;\n }\n /**\n * Checks whether we're in a browser environment\n *\n * @returns Answer to given question\n */\n function isBrowserEnv() {\n return typeof window === 'object' && (window === null || window === void 0 ? void 0 : window.document) !== undefined;\n }\n var fallbackGlobalObject = {};\n /**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\n var getGlobalObject = function () {\n return isNodeEnv()\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject;\n };\n var getGlobalAmplitudeNamespace = function () {\n var global = getGlobalObject();\n global.__AMPLITUDE__ = global.__AMPLITUDE__ || {};\n return global.__AMPLITUDE__;\n };\n /**\n * Fixes browser edge case where Prototype.js injects Array.prototype.toJSON and breaks the built-in JSON.stringify()\n *\n * @returns true if Array.prototype.toJSON was deleted, false if not\n */\n var prototypeJsFix = function () {\n var _a;\n if (isBrowserEnv()) {\n var augmentedWindow = window;\n var augmentedArray = Array;\n if (augmentedWindow.Prototype !== undefined && ((_a = augmentedArray.prototype) === null || _a === void 0 ? void 0 : _a.toJSON) !== undefined) {\n delete augmentedArray.prototype.toJSON;\n return true;\n }\n }\n return false;\n };\n\n // TODO: Type the global constant\n var globalNamespace = getGlobalAmplitudeNamespace();\n /** Prefix for logging strings */\n var PREFIX = 'Amplitude Logger ';\n /** JSDoc */\n var Logger = /** @class */ (function () {\n /** JSDoc */\n function Logger() {\n this._logLevel = 0;\n }\n /** JSDoc */\n Logger.prototype.disable = function () {\n this._logLevel = 0;\n };\n /** JSDoc */\n Logger.prototype.enable = function (logLevel) {\n if (logLevel === void 0) { logLevel = LogLevel.Warn; }\n this._logLevel = logLevel;\n };\n /** JSDoc */\n Logger.prototype.log = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this._logLevel < LogLevel.Verbose) {\n return;\n }\n global.console.log(PREFIX + \"[Log]: \" + args.join(' ')); // tslint:disable-line:no-console\n };\n /** JSDoc */\n Logger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this._logLevel < LogLevel.Warn) {\n return;\n }\n global.console.warn(PREFIX + \"[Warn]: \" + args.join(' ')); // tslint:disable-line:no-console\n };\n /** JSDoc */\n Logger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this._logLevel < LogLevel.Error) {\n return;\n }\n global.console.error(PREFIX + \"[Error]: \" + args.join(' ')); // tslint:disable-line:no-console\n };\n return Logger;\n }());\n // Ensure we only have a single logger instance, even if multiple versions of @amplitude/utils are being used\n var logger = globalNamespace.logger || (globalNamespace.logger = new Logger());\n\n var Constants = {\n DEFAULT_INSTANCE: '$default_instance',\n API_VERSION: 2,\n MAX_STRING_LENGTH: 4096,\n MAX_PROPERTY_KEYS: 1000,\n IDENTIFY_EVENT: '$identify',\n GROUP_IDENTIFY_EVENT: '$groupidentify',\n // localStorageKeys\n LAST_EVENT_ID: 'amplitude_lastEventId',\n LAST_EVENT_TIME: 'amplitude_lastEventTime',\n LAST_IDENTIFY_ID: 'amplitude_lastIdentifyId',\n LAST_SEQUENCE_NUMBER: 'amplitude_lastSequenceNumber',\n SESSION_ID: 'amplitude_sessionId',\n // Used in cookie as well\n DEVICE_ID: 'amplitude_deviceId',\n OPT_OUT: 'amplitude_optOut',\n USER_ID: 'amplitude_userId',\n // indexes of properties in cookie v2 storage format\n DEVICE_ID_INDEX: 0,\n USER_ID_INDEX: 1,\n OPT_OUT_INDEX: 2,\n SESSION_ID_INDEX: 3,\n LAST_EVENT_TIME_INDEX: 4,\n EVENT_ID_INDEX: 5,\n IDENTIFY_ID_INDEX: 6,\n SEQUENCE_NUMBER_INDEX: 7,\n COOKIE_TEST_PREFIX: 'amp_cookie_test',\n COOKIE_PREFIX: 'amp',\n // Storage options\n STORAGE_DEFAULT: '',\n STORAGE_COOKIES: 'cookies',\n STORAGE_NONE: 'none',\n STORAGE_LOCAL: 'localStorage',\n STORAGE_SESSION: 'sessionStorage',\n // revenue keys\n REVENUE_EVENT: 'revenue_amount',\n REVENUE_PRODUCT_ID: '$productId',\n REVENUE_QUANTITY: '$quantity',\n REVENUE_PRICE: '$price',\n REVENUE_REVENUE_TYPE: '$revenueType',\n AMP_DEVICE_ID_PARAM: 'amp_device_id',\n // url param\n REFERRER: 'referrer',\n // UTM Params\n UTM_SOURCE: 'utm_source',\n UTM_MEDIUM: 'utm_medium',\n UTM_CAMPAIGN: 'utm_campaign',\n UTM_TERM: 'utm_term',\n UTM_CONTENT: 'utm_content',\n ATTRIBUTION_EVENT: '[Amplitude] Attribution Captured',\n TRANSPORT_HTTP: 'http',\n TRANSPORT_BEACON: 'beacon'\n };\n\n /*\n * UTF-8 encoder/decoder\n * http://www.webtoolkit.info/\n */\n var UTF8 = {\n encode: function encode(s) {\n var utftext = '';\n\n for (var n = 0; n < s.length; n++) {\n var c = s.charCodeAt(n);\n\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode(c >> 6 | 192);\n utftext += String.fromCharCode(c & 63 | 128);\n } else {\n utftext += String.fromCharCode(c >> 12 | 224);\n utftext += String.fromCharCode(c >> 6 & 63 | 128);\n utftext += String.fromCharCode(c & 63 | 128);\n }\n }\n\n return utftext;\n },\n decode: function decode(utftext) {\n var s = '';\n var i = 0;\n var c = 0,\n c1 = 0,\n c2 = 0;\n\n while (i < utftext.length) {\n c = utftext.charCodeAt(i);\n\n if (c < 128) {\n s += String.fromCharCode(c);\n i++;\n } else if (c > 191 && c < 224) {\n c1 = utftext.charCodeAt(i + 1);\n s += String.fromCharCode((c & 31) << 6 | c1 & 63);\n i += 2;\n } else {\n c1 = utftext.charCodeAt(i + 1);\n c2 = utftext.charCodeAt(i + 2);\n s += String.fromCharCode((c & 15) << 12 | (c1 & 63) << 6 | c2 & 63);\n i += 3;\n }\n }\n\n return s;\n }\n };\n\n /*\n * Base64 encoder/decoder\n * http://www.webtoolkit.info/\n */\n\n var Base64 = {\n _keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n encode: function encode(input) {\n try {\n if (window.btoa && window.atob) {\n return window.btoa(unescape(encodeURIComponent(input)));\n }\n } catch (e) {//log(e);\n }\n\n return Base64._encode(input);\n },\n _encode: function _encode(input) {\n var output = '';\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n input = UTF8.encode(input);\n\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = (chr1 & 3) << 4 | chr2 >> 4;\n enc3 = (chr2 & 15) << 2 | chr3 >> 6;\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output + Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) + Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);\n }\n\n return output;\n },\n decode: function decode(input) {\n try {\n if (window.btoa && window.atob) {\n return decodeURIComponent(escape(window.atob(input)));\n }\n } catch (e) {//log(e);\n }\n\n return Base64._decode(input);\n },\n _decode: function _decode(input) {\n var output = '';\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9+/=]/g, '');\n\n while (i < input.length) {\n enc1 = Base64._keyStr.indexOf(input.charAt(i++));\n enc2 = Base64._keyStr.indexOf(input.charAt(i++));\n enc3 = Base64._keyStr.indexOf(input.charAt(i++));\n enc4 = Base64._keyStr.indexOf(input.charAt(i++));\n chr1 = enc1 << 2 | enc2 >> 4;\n chr2 = (enc2 & 15) << 4 | enc3 >> 2;\n chr3 = (enc3 & 3) << 6 | enc4;\n output = output + String.fromCharCode(chr1);\n\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n\n output = UTF8.decode(output);\n return output;\n }\n };\n\n /**\n * toString ref.\n * @private\n */\n var toString = Object.prototype.toString;\n /**\n * Return the type of `val`.\n * @private\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\n function type (val) {\n switch (toString.call(val)) {\n case '[object Date]':\n return 'date';\n\n case '[object RegExp]':\n return 'regexp';\n\n case '[object Arguments]':\n return 'arguments';\n\n case '[object Array]':\n return 'array';\n\n case '[object Error]':\n return 'error';\n }\n\n if (val === null) {\n return 'null';\n }\n\n if (val === undefined) {\n return 'undefined';\n }\n\n if (val !== val) {\n return 'nan';\n }\n\n if (val && val.nodeType === 1) {\n return 'element';\n }\n\n if (typeof Buffer !== 'undefined' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(val)) {\n return 'buffer';\n }\n\n val = val.valueOf ? val.valueOf() : Object.prototype.valueOf.apply(val);\n return _typeof(val);\n }\n\n var logLevels = {\n DISABLE: 0,\n ERROR: 1,\n WARN: 2,\n INFO: 3\n };\n var logLevel = logLevels.WARN;\n\n var setLogLevel = function setLogLevel(logLevelName) {\n if (Object.prototype.hasOwnProperty.call(logLevels, logLevelName)) {\n logLevel = logLevels[logLevelName];\n }\n };\n\n var getLogLevel = function getLogLevel() {\n return logLevel;\n };\n\n var log = {\n error: function error(s) {\n if (logLevel >= logLevels.ERROR) {\n _log(s);\n }\n },\n warn: function warn(s) {\n if (logLevel >= logLevels.WARN) {\n _log(s);\n }\n },\n info: function info(s) {\n if (logLevel >= logLevels.INFO) {\n _log(s);\n }\n }\n };\n\n var _log = function _log(s) {\n try {\n console.log('[Amplitude] ' + s);\n } catch (e) {// console logging not available\n }\n };\n\n var isEmptyString = function isEmptyString(str) {\n return !str || str.length === 0;\n };\n\n var sessionStorageEnabled = function sessionStorageEnabled() {\n try {\n if (window.sessionStorage) {\n return true;\n }\n } catch (e) {// sessionStorage disabled\n }\n\n return false;\n }; // truncate string values in event and user properties so that request size does not get too large\n\n\n var truncate = function truncate(value) {\n if (type(value) === 'array') {\n for (var i = 0; i < value.length; i++) {\n value[i] = truncate(value[i]);\n }\n } else if (type(value) === 'object') {\n for (var key in value) {\n if (key in value) {\n value[key] = truncate(value[key]);\n }\n }\n } else {\n value = _truncateValue(value);\n }\n\n return value;\n };\n\n var _truncateValue = function _truncateValue(value) {\n if (type(value) === 'string') {\n return value.length > Constants.MAX_STRING_LENGTH ? value.substring(0, Constants.MAX_STRING_LENGTH) : value;\n }\n\n return value;\n };\n\n var validateInput = function validateInput(input, name, expectedType) {\n if (type(input) !== expectedType) {\n log.error('Invalid ' + name + ' input type. Expected ' + expectedType + ' but received ' + type(input));\n return false;\n }\n\n return true;\n };\n\n var validateDeviceId = function validateDeviceId(deviceId) {\n if (!validateInput(deviceId, 'deviceId', 'string')) {\n return false;\n }\n\n if (deviceId.includes('.')) {\n log.error(\"Device IDs may not contain '.' characters. Value will be ignored: \\\"\".concat(deviceId, \"\\\"\"));\n return false;\n }\n\n return true;\n };\n\n var validateTransport = function validateTransport(transport) {\n if (!validateInput(transport, 'transport', 'string')) {\n return false;\n }\n\n if (transport !== Constants.TRANSPORT_HTTP && transport !== Constants.TRANSPORT_BEACON) {\n log.error(\"transport value must be one of '\".concat(Constants.TRANSPORT_BEACON, \"' or '\").concat(Constants.TRANSPORT_HTTP, \"'\"));\n return false;\n }\n\n if (transport !== Constants.TRANSPORT_HTTP && !navigator.sendBeacon) {\n log.error(\"browser does not support sendBeacon, so transport must be HTTP\");\n return false;\n }\n\n return true;\n }; // do some basic sanitization and type checking, also catch property dicts with more than 1000 key/value pairs\n\n\n var validateProperties = function validateProperties(properties) {\n var propsType = type(properties);\n\n if (propsType !== 'object') {\n log.error('Error: invalid properties format. Expecting Javascript object, received ' + propsType + ', ignoring');\n return {};\n }\n\n if (Object.keys(properties).length > Constants.MAX_PROPERTY_KEYS) {\n log.error('Error: too many properties (more than 1000), ignoring');\n return {};\n }\n\n var copy = {}; // create a copy with all of the valid properties\n\n for (var property in properties) {\n if (!Object.prototype.hasOwnProperty.call(properties, property)) {\n continue;\n } // validate key\n\n\n var key = property;\n var keyType = type(key);\n\n if (keyType !== 'string') {\n key = String(key);\n log.warn('WARNING: Non-string property key, received type ' + keyType + ', coercing to string \"' + key + '\"');\n } // validate value\n\n\n var value = validatePropertyValue(key, properties[property]);\n\n if (value === null) {\n continue;\n }\n\n copy[key] = value;\n }\n\n return copy;\n };\n\n var invalidValueTypes = ['nan', 'function', 'arguments', 'regexp', 'element'];\n\n var validatePropertyValue = function validatePropertyValue(key, value) {\n var valueType = type(value);\n\n if (invalidValueTypes.indexOf(valueType) !== -1) {\n log.warn('WARNING: Property key \"' + key + '\" with invalid value type ' + valueType + ', ignoring');\n value = null;\n } else if (valueType === 'undefined') {\n value = null;\n } else if (valueType === 'error') {\n value = String(value);\n log.warn('WARNING: Property key \"' + key + '\" with value type error, coercing to ' + value);\n } else if (valueType === 'array') {\n // check for nested arrays or objects\n var arrayCopy = [];\n\n for (var i = 0; i < value.length; i++) {\n var element = value[i];\n var elemType = type(element);\n\n if (elemType === 'array') {\n log.warn('WARNING: Cannot have ' + elemType + ' nested in an array property value, skipping');\n continue;\n } else if (elemType === 'object') {\n arrayCopy.push(validateProperties(element));\n } else {\n arrayCopy.push(validatePropertyValue(key, element));\n }\n }\n\n value = arrayCopy;\n } else if (valueType === 'object') {\n value = validateProperties(value);\n }\n\n return value;\n };\n\n var validateGroups = function validateGroups(groups) {\n var groupsType = type(groups);\n\n if (groupsType !== 'object') {\n log.error('Error: invalid groups format. Expecting Javascript object, received ' + groupsType + ', ignoring');\n return {};\n }\n\n var copy = {}; // create a copy with all of the valid properties\n\n for (var group in groups) {\n if (!Object.prototype.hasOwnProperty.call(groups, group)) {\n continue;\n } // validate key\n\n\n var key = group;\n var keyType = type(key);\n\n if (keyType !== 'string') {\n key = String(key);\n log.warn('WARNING: Non-string groupType, received type ' + keyType + ', coercing to string \"' + key + '\"');\n } // validate value\n\n\n var value = validateGroupName(key, groups[group]);\n\n if (value === null) {\n continue;\n }\n\n copy[key] = value;\n }\n\n return copy;\n };\n\n var validateGroupName = function validateGroupName(key, groupName) {\n var groupNameType = type(groupName);\n\n if (groupNameType === 'string') {\n return groupName;\n }\n\n if (groupNameType === 'date' || groupNameType === 'number' || groupNameType === 'boolean') {\n groupName = String(groupName);\n log.warn('WARNING: Non-string groupName, received type ' + groupNameType + ', coercing to string \"' + groupName + '\"');\n return groupName;\n }\n\n if (groupNameType === 'array') {\n // check for nested arrays or objects\n var arrayCopy = [];\n\n for (var i = 0; i < groupName.length; i++) {\n var element = groupName[i];\n var elemType = type(element);\n\n if (elemType === 'array' || elemType === 'object') {\n log.warn('WARNING: Skipping nested ' + elemType + ' in array groupName');\n continue;\n } else if (elemType === 'string') {\n arrayCopy.push(element);\n } else if (elemType === 'date' || elemType === 'number' || elemType === 'boolean') {\n element = String(element);\n log.warn('WARNING: Non-string groupName, received type ' + elemType + ', coercing to string \"' + element + '\"');\n arrayCopy.push(element);\n }\n }\n\n return arrayCopy;\n }\n\n log.warn('WARNING: Non-string groupName, received type ' + groupNameType + '. Please use strings or array of strings for groupName');\n }; // parses the value of a url param (for example ?gclid=1234&...)\n\n\n var getQueryParam = function getQueryParam(name, query) {\n name = name.replace(/[[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n var results = regex.exec(query);\n return results === null ? undefined : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n };\n\n var utils = {\n setLogLevel: setLogLevel,\n getLogLevel: getLogLevel,\n logLevels: logLevels,\n log: log,\n isEmptyString: isEmptyString,\n getQueryParam: getQueryParam,\n sessionStorageEnabled: sessionStorageEnabled,\n truncate: truncate,\n validateGroups: validateGroups,\n validateInput: validateInput,\n validateProperties: validateProperties,\n validateDeviceId: validateDeviceId,\n validateTransport: validateTransport\n };\n\n var getLocation = function getLocation() {\n return window.location;\n };\n\n // A URL safe variation on the the list of Base64 characters\n var base64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\n var base64Id = function base64Id() {\n var str = '';\n\n for (var i = 0; i < 22; ++i) {\n str += base64Chars.charAt(Math.floor(Math.random() * 64));\n }\n\n return str;\n };\n\n var get = function get(name) {\n try {\n var ca = document.cookie.split(';');\n var value = null;\n\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length);\n }\n\n if (c.indexOf(name) === 0) {\n value = c.substring(name.length, c.length);\n break;\n }\n }\n\n return value;\n } catch (e) {\n return null;\n }\n };\n\n var getAll = function getAll(name) {\n try {\n var cookieArray = document.cookie.split(';').map(function (c) {\n return c.trimStart();\n });\n var values = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = cookieArray[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var cookie = _step.value;\n\n while (cookie.charAt(0) === ' ') {\n cookie = cookie.substring(1);\n }\n\n if (cookie.indexOf(name) === 0) {\n values.push(cookie.substring(name.length));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return values;\n } catch (e) {\n return [];\n }\n };\n\n var set = function set(name, value, opts) {\n var expires = value !== null ? opts.expirationDays : -1;\n\n if (expires) {\n var date = new Date();\n date.setTime(date.getTime() + expires * 24 * 60 * 60 * 1000);\n expires = date;\n }\n\n var str = name + '=' + value;\n\n if (expires) {\n str += '; expires=' + expires.toUTCString();\n }\n\n str += '; path=/';\n\n if (opts.domain) {\n str += '; domain=' + opts.domain;\n }\n\n if (opts.secure) {\n str += '; Secure';\n }\n\n if (opts.sameSite) {\n str += '; SameSite=' + opts.sameSite;\n }\n\n document.cookie = str;\n };\n\n var getLastEventTime = function getLastEventTime() {\n var cookie = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var strValue = cookie.split('.')[Constants.LAST_EVENT_TIME_INDEX];\n var parsedValue;\n\n if (strValue) {\n parsedValue = parseInt(strValue, 32);\n }\n\n if (parsedValue) {\n return parsedValue;\n } else {\n utils.log.warn(\"unable to parse malformed cookie: \".concat(cookie));\n return 0;\n }\n };\n\n var sortByEventTime = function sortByEventTime(cookies) {\n return _toConsumableArray(cookies).sort(function (c1, c2) {\n var t1 = getLastEventTime(c1);\n var t2 = getLastEventTime(c2); // sort c1 first if its last event time is more recent\n // i.e its event time integer is larger that c2's\n\n return t2 - t1;\n });\n }; // test that cookies are enabled - navigator.cookiesEnabled yields false positives in IE, need to test directly\n\n\n var areCookiesEnabled = function areCookiesEnabled() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var cookieName = Constants.COOKIE_TEST_PREFIX + base64Id();\n var _areCookiesEnabled = false;\n\n try {\n var uid = String(new Date());\n set(cookieName, uid, opts);\n utils.log.info(\"Testing if cookies available\");\n _areCookiesEnabled = get(cookieName + '=') === uid;\n } catch (e) {\n utils.log.warn(\"Error thrown when checking for cookies. Reason: \\\"\".concat(e, \"\\\"\"));\n } finally {\n utils.log.info(\"Cleaning up cookies availability test\");\n set(cookieName, null, opts);\n }\n\n return _areCookiesEnabled;\n };\n\n var baseCookie = {\n set: set,\n get: get,\n getAll: getAll,\n getLastEventTime: getLastEventTime,\n sortByEventTime: sortByEventTime,\n areCookiesEnabled: areCookiesEnabled\n };\n\n var getHost = function getHost(url) {\n var a = document.createElement('a');\n a.href = url;\n return a.hostname || location.hostname;\n };\n\n var topDomain = function topDomain(url) {\n var host = getHost(url);\n var parts = host.split('.');\n var levels = [];\n var cname = '_tldtest_' + base64Id();\n\n for (var i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join('.'));\n }\n\n for (var _i = 0; _i < levels.length; ++_i) {\n var domain = levels[_i];\n var opts = {\n domain: '.' + domain\n };\n baseCookie.set(cname, 1, opts);\n\n if (baseCookie.get(cname)) {\n baseCookie.set(cname, null, opts);\n return domain;\n }\n }\n\n return '';\n };\n\n /*\n * Cookie data\n */\n var _options = {\n expirationDays: undefined,\n domain: undefined\n };\n\n var reset = function reset() {\n _options = {\n expirationDays: undefined,\n domain: undefined\n };\n };\n\n var options = function options(opts) {\n if (arguments.length === 0) {\n return _options;\n }\n\n opts = opts || {};\n _options.expirationDays = opts.expirationDays;\n _options.secure = opts.secure;\n _options.sameSite = opts.sameSite;\n var domain = !utils.isEmptyString(opts.domain) ? opts.domain : '.' + topDomain(getLocation().href);\n var token = Math.random();\n _options.domain = domain;\n set$1('amplitude_test', token);\n var stored = get$1('amplitude_test');\n\n if (!stored || stored !== token) {\n domain = null;\n }\n\n remove('amplitude_test');\n _options.domain = domain;\n return _options;\n };\n\n var _domainSpecific = function _domainSpecific(name) {\n // differentiate between cookies on different domains\n var suffix = '';\n\n if (_options.domain) {\n suffix = _options.domain.charAt(0) === '.' ? _options.domain.substring(1) : _options.domain;\n }\n\n return name + suffix;\n };\n\n var get$1 = function get(name) {\n var nameEq = _domainSpecific(name) + '=';\n var value = baseCookie.get(nameEq);\n\n try {\n if (value) {\n return JSON.parse(Base64.decode(value));\n }\n } catch (e) {\n return null;\n }\n\n return null;\n };\n\n var set$1 = function set(name, value) {\n try {\n baseCookie.set(_domainSpecific(name), Base64.encode(JSON.stringify(value)), _options);\n return true;\n } catch (e) {\n return false;\n }\n };\n\n var setRaw = function setRaw(name, value) {\n try {\n baseCookie.set(_domainSpecific(name), value, _options);\n return true;\n } catch (e) {\n return false;\n }\n };\n\n var getRaw = function getRaw(name) {\n var nameEq = _domainSpecific(name) + '=';\n return baseCookie.get(nameEq);\n };\n\n var remove = function remove(name) {\n try {\n baseCookie.set(_domainSpecific(name), null, _options);\n return true;\n } catch (e) {\n return false;\n }\n };\n\n var Cookie = {\n reset: reset,\n options: options,\n get: get$1,\n set: set$1,\n remove: remove,\n setRaw: setRaw,\n getRaw: getRaw\n };\n\n /*\n * Implement localStorage to support Firefox 2-3 and IE 5-7\n */\n var localStorage;\n\n {\n // test that Window.localStorage is available and works\n var windowLocalStorageAvailable = function windowLocalStorageAvailable() {\n var uid = new Date();\n var result;\n\n try {\n window.localStorage.setItem(uid, uid);\n result = window.localStorage.getItem(uid) === String(uid);\n window.localStorage.removeItem(uid);\n return result;\n } catch (e) {// localStorage not available\n }\n\n return false;\n };\n\n if (windowLocalStorageAvailable()) {\n localStorage = window.localStorage;\n } else if (window.globalStorage) {\n // Firefox 2-3 use globalStorage\n // See https://developer.mozilla.org/en/dom/storage#globalStorage\n try {\n localStorage = window.globalStorage[window.location.hostname];\n } catch (e) {// Something bad happened...\n }\n } else if (typeof document !== 'undefined') {\n // IE 5-7 use userData\n // See http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx\n var div = document.createElement('div'),\n attrKey = 'localStorage';\n div.style.display = 'none';\n document.getElementsByTagName('head')[0].appendChild(div);\n\n if (div.addBehavior) {\n div.addBehavior('#default#userdata');\n localStorage = {\n length: 0,\n setItem: function setItem(k, v) {\n div.load(attrKey);\n\n if (!div.getAttribute(k)) {\n this.length++;\n }\n\n div.setAttribute(k, v);\n div.save(attrKey);\n },\n getItem: function getItem(k) {\n div.load(attrKey);\n return div.getAttribute(k);\n },\n removeItem: function removeItem(k) {\n div.load(attrKey);\n\n if (div.getAttribute(k)) {\n this.length--;\n }\n\n div.removeAttribute(k);\n div.save(attrKey);\n },\n clear: function clear() {\n div.load(attrKey);\n var i = 0;\n var attr;\n\n while (attr = div.XMLDocument.documentElement.attributes[i++]) {\n div.removeAttribute(attr.name);\n }\n\n div.save(attrKey);\n this.length = 0;\n },\n key: function key(k) {\n div.load(attrKey);\n return div.XMLDocument.documentElement.attributes[k];\n }\n };\n div.load(attrKey);\n localStorage.length = div.XMLDocument.documentElement.attributes.length;\n }\n }\n\n if (!localStorage) {\n /* eslint-disable no-unused-vars */\n localStorage = {\n length: 0,\n setItem: function setItem(k, v) {},\n getItem: function getItem(k) {},\n removeItem: function removeItem(k) {},\n clear: function clear() {},\n key: function key(k) {}\n };\n /* eslint-enable no-unused-vars */\n }\n }\n\n var ampLocalStorage = localStorage;\n\n /*\n * Abstraction layer for cookie storage.\n * Uses cookie if available, otherwise fallback to localstorage.\n */\n\n var cookieStorage = function cookieStorage() {\n this.storage = null;\n };\n\n cookieStorage.prototype.getStorage = function () {\n if (this.storage !== null) {\n return this.storage;\n }\n\n if (baseCookie.areCookiesEnabled()) {\n this.storage = Cookie;\n } else {\n // if cookies disabled, fallback to localstorage\n // note: localstorage does not persist across subdomains\n var keyPrefix = 'amp_cookiestore_';\n this.storage = {\n _options: {\n expirationDays: undefined,\n domain: undefined,\n secure: false\n },\n reset: function reset() {\n this._options = {\n expirationDays: undefined,\n domain: undefined,\n secure: false\n };\n },\n options: function options(opts) {\n if (arguments.length === 0) {\n return this._options;\n }\n\n opts = opts || {};\n this._options.expirationDays = opts.expirationDays || this._options.expirationDays; // localStorage is specific to subdomains\n\n this._options.domain = opts.domain || this._options.domain || window && window.location && window.location.hostname;\n return this._options.secure = opts.secure || false;\n },\n get: function get(name) {\n try {\n return JSON.parse(ampLocalStorage.getItem(keyPrefix + name));\n } catch (e) {}\n /* eslint-disable-line no-empty */\n\n\n return null;\n },\n set: function set(name, value) {\n try {\n ampLocalStorage.setItem(keyPrefix + name, JSON.stringify(value));\n return true;\n } catch (e) {}\n /* eslint-disable-line no-empty */\n\n\n return false;\n },\n remove: function remove(name) {\n try {\n ampLocalStorage.removeItem(keyPrefix + name);\n } catch (e) {\n return false;\n }\n }\n };\n }\n\n return this.storage;\n };\n\n var _storageOptionExists;\n var storageOptionExists = (_storageOptionExists = {}, _defineProperty(_storageOptionExists, Constants.STORAGE_COOKIES, true), _defineProperty(_storageOptionExists, Constants.STORAGE_NONE, true), _defineProperty(_storageOptionExists, Constants.STORAGE_LOCAL, true), _defineProperty(_storageOptionExists, Constants.STORAGE_SESSION, true), _storageOptionExists);\n /**\n * MetadataStorage involves SDK data persistance\n * storage priority: cookies -> localStorage -> in memory\n * This priority can be overriden by setting the storage options.\n * if in localStorage, unable track users between subdomains\n * if in memory, then memory can't be shared between different tabs\n */\n\n var MetadataStorage =\n /*#__PURE__*/\n function () {\n function MetadataStorage(_ref) {\n var storageKey = _ref.storageKey,\n disableCookies = _ref.disableCookies,\n domain = _ref.domain,\n secure = _ref.secure,\n sameSite = _ref.sameSite,\n expirationDays = _ref.expirationDays,\n storage = _ref.storage;\n\n _classCallCheck(this, MetadataStorage);\n\n this.storageKey = storageKey;\n this.domain = domain;\n this.secure = secure;\n this.sameSite = sameSite;\n this.expirationDays = expirationDays;\n this.cookieDomain = '';\n var writableTopDomain = topDomain(getLocation().href);\n this.cookieDomain = domain || (writableTopDomain ? '.' + writableTopDomain : null);\n\n if (storageOptionExists[storage]) {\n this.storage = storage;\n } else {\n var disableCookieStorage = disableCookies || !baseCookie.areCookiesEnabled({\n domain: this.cookieDomain,\n secure: this.secure,\n sameSite: this.sameSite,\n expirationDays: this.expirationDays\n });\n\n if (disableCookieStorage) {\n this.storage = Constants.STORAGE_LOCAL;\n } else {\n this.storage = Constants.STORAGE_COOKIES;\n }\n }\n }\n\n _createClass(MetadataStorage, [{\n key: \"getCookieStorageKey\",\n value: function getCookieStorageKey() {\n if (!this.domain) {\n return this.storageKey;\n }\n\n var suffix = this.domain.charAt(0) === '.' ? this.domain.substring(1) : this.domain;\n return \"\".concat(this.storageKey).concat(suffix ? \"_\".concat(suffix) : '');\n }\n /*\n * Data is saved as delimited values rather than JSO to minimize cookie space\n * Should not change order of the items\n */\n\n }, {\n key: \"save\",\n value: function save(_ref2) {\n var deviceId = _ref2.deviceId,\n userId = _ref2.userId,\n optOut = _ref2.optOut,\n sessionId = _ref2.sessionId,\n lastEventTime = _ref2.lastEventTime,\n eventId = _ref2.eventId,\n identifyId = _ref2.identifyId,\n sequenceNumber = _ref2.sequenceNumber;\n\n if (this.storage === Constants.STORAGE_NONE) {\n return;\n }\n\n var value = [deviceId, Base64.encode(userId || ''), // used to convert not unicode to alphanumeric since cookies only use alphanumeric\n optOut ? '1' : '', sessionId ? sessionId.toString(32) : '0', // generated when instantiated, timestamp (but re-uses session id in cookie if not expired) @TODO clients may want custom session id\n lastEventTime ? lastEventTime.toString(32) : '0', // last time an event was set\n eventId ? eventId.toString(32) : '0', identifyId ? identifyId.toString(32) : '0', sequenceNumber ? sequenceNumber.toString(32) : '0'].join('.');\n\n switch (this.storage) {\n case Constants.STORAGE_SESSION:\n if (window.sessionStorage) {\n window.sessionStorage.setItem(this.storageKey, value);\n }\n\n break;\n\n case Constants.STORAGE_LOCAL:\n ampLocalStorage.setItem(this.storageKey, value);\n break;\n\n case Constants.STORAGE_COOKIES:\n this.saveCookie(value);\n break;\n }\n }\n }, {\n key: \"saveCookie\",\n value: function saveCookie(value) {\n baseCookie.set(this.getCookieStorageKey(), value, {\n domain: this.cookieDomain,\n secure: this.secure,\n sameSite: this.sameSite,\n expirationDays: this.expirationDays\n });\n }\n }, {\n key: \"load\",\n value: function load() {\n var _this = this;\n\n var str;\n\n if (this.storage === Constants.STORAGE_COOKIES) {\n var cookieKey = this.getCookieStorageKey() + '=';\n var allCookies = baseCookie.getAll(cookieKey);\n\n if (allCookies.length === 0 || allCookies.length === 1) {\n str = allCookies[0];\n } else {\n // dedup cookies by deleting them all and restoring\n // the one with the most recent event time\n var latestCookie = baseCookie.sortByEventTime(allCookies)[0];\n allCookies.forEach(function () {\n return baseCookie.set(_this.getCookieStorageKey(), null, {});\n });\n this.saveCookie(latestCookie);\n str = baseCookie.get(cookieKey);\n }\n }\n\n if (!str) {\n str = ampLocalStorage.getItem(this.storageKey);\n }\n\n if (!str) {\n try {\n str = window.sessionStorage && window.sessionStorage.getItem(this.storageKey);\n } catch (e) {\n utils.log.info(\"window.sessionStorage unavailable. Reason: \\\"\".concat(e, \"\\\"\"));\n }\n }\n\n if (!str) {\n return null;\n }\n\n var values = str.split('.');\n var userId = null;\n\n if (values[Constants.USER_ID_INDEX]) {\n try {\n userId = Base64.decode(values[Constants.USER_ID_INDEX]);\n } catch (e) {\n userId = null;\n }\n }\n\n return {\n deviceId: values[Constants.DEVICE_ID_INDEX],\n userId: userId,\n optOut: values[Constants.OPT_OUT_INDEX] === '1',\n sessionId: parseInt(values[Constants.SESSION_ID_INDEX], 32),\n lastEventTime: parseInt(values[Constants.LAST_EVENT_TIME_INDEX], 32),\n eventId: parseInt(values[Constants.EVENT_ID_INDEX], 32),\n identifyId: parseInt(values[Constants.IDENTIFY_ID_INDEX], 32),\n sequenceNumber: parseInt(values[Constants.SEQUENCE_NUMBER_INDEX], 32)\n };\n }\n /**\n * Clears any saved metadata storage\n * @constructor AmplitudeClient\n * @public\n * @return {boolean} True if metadata was cleared, false if none existed\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n var str;\n\n if (this.storage === Constants.STORAGE_COOKIES) {\n str = baseCookie.get(this.getCookieStorageKey() + '=');\n baseCookie.set(this.getCookieStorageKey(), null, {\n domain: this.cookieDomain,\n secure: this.secure,\n sameSite: this.sameSite,\n expirationDays: 0\n });\n }\n\n if (!str) {\n str = ampLocalStorage.getItem(this.storageKey);\n ampLocalStorage.clear();\n }\n\n if (!str) {\n try {\n str = window.sessionStorage && window.sessionStorage.getItem(this.storageKey);\n window.sessionStorage.clear();\n } catch (e) {\n utils.log.info(\"window.sessionStorage unavailable. Reason: \\\"\".concat(e, \"\\\"\"));\n }\n }\n\n return !!str;\n }\n }]);\n\n return MetadataStorage;\n }();\n\n var getUtmData = function getUtmData(rawCookie, query) {\n // Translate the utmz cookie format into url query string format.\n var cookie = rawCookie ? '?' + rawCookie.split('.').slice(-1)[0].replace(/\\|/g, '&') : '';\n\n var fetchParam = function fetchParam(queryName, query, cookieName, cookie) {\n return utils.getQueryParam(queryName, query) || utils.getQueryParam(cookieName, cookie);\n };\n\n var utmSource = fetchParam(Constants.UTM_SOURCE, query, 'utmcsr', cookie);\n var utmMedium = fetchParam(Constants.UTM_MEDIUM, query, 'utmcmd', cookie);\n var utmCampaign = fetchParam(Constants.UTM_CAMPAIGN, query, 'utmccn', cookie);\n var utmTerm = fetchParam(Constants.UTM_TERM, query, 'utmctr', cookie);\n var utmContent = fetchParam(Constants.UTM_CONTENT, query, 'utmcct', cookie);\n var utmData = {};\n\n var addIfNotNull = function addIfNotNull(key, value) {\n if (!utils.isEmptyString(value)) {\n utmData[key] = value;\n }\n };\n\n addIfNotNull(Constants.UTM_SOURCE, utmSource);\n addIfNotNull(Constants.UTM_MEDIUM, utmMedium);\n addIfNotNull(Constants.UTM_CAMPAIGN, utmCampaign);\n addIfNotNull(Constants.UTM_TERM, utmTerm);\n addIfNotNull(Constants.UTM_CONTENT, utmContent);\n return utmData;\n };\n\n /*\n * Wrapper for a user properties JSON object that supports operations.\n * Note: if a user property is used in multiple operations on the same Identify object,\n * only the first operation will be saved, and the rest will be ignored.\n */\n\n var AMP_OP_ADD = '$add';\n var AMP_OP_APPEND = '$append';\n var AMP_OP_CLEAR_ALL = '$clearAll';\n var AMP_OP_PREPEND = '$prepend';\n var AMP_OP_SET = '$set';\n var AMP_OP_SET_ONCE = '$setOnce';\n var AMP_OP_UNSET = '$unset';\n var AMP_OP_PREINSERT = '$preInsert';\n var AMP_OP_POSTINSERT = '$postInsert';\n var AMP_OP_REMOVE = '$remove';\n /**\n * Identify API - instance constructor. Identify objects are a wrapper for user property operations.\n * Each method adds a user property operation to the Identify object, and returns the same Identify object,\n * allowing you to chain multiple method calls together.\n * Note: if the same user property is used in multiple operations on a single Identify object,\n * only the first operation on that property will be saved, and the rest will be ignored.\n * @constructor Identify\n * @public\n * @example var identify = new amplitude.Identify();\n */\n\n var Identify = function Identify() {\n this.userPropertiesOperations = {};\n this.properties = []; // keep track of keys that have been added\n };\n /**\n * Increment a user property by a given value (can also be negative to decrement).\n * If the user property does not have a value set yet, it will be initialized to 0 before being incremented.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string} value - The amount by which to increment the user property. Allows numbers as strings (ex: '123').\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().add('karma', 1).add('friends', 1);\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.add = function (property, value) {\n if (type(value) === 'number' || type(value) === 'string') {\n this._addOperation(AMP_OP_ADD, property, value);\n } else {\n utils.log.error('Unsupported type for value: ' + type(value) + ', expecting number or string');\n }\n\n return this;\n };\n /**\n * Append a value or values to a user property.\n * If the user property does not have a value set yet,\n * it will be initialized to an empty list before the new values are appended.\n * If the user property has an existing value and it is not a list,\n * the existing value will be converted into a list with the new values appended.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string|list|object} value - A value or values to append.\n * Values can be numbers, strings, lists, or object (key:value dict will be flattened).\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().append('ab-tests', 'new-user-tests');\n * identify.append('some_list', [1, 2, 3, 4, 'values']);\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.append = function (property, value) {\n this._addOperation(AMP_OP_APPEND, property, value);\n\n return this;\n };\n /**\n * Clear all user properties for the current user.\n * SDK user should instead call amplitude.clearUserProperties() instead of using this.\n * $clearAll needs to be sent on its own Identify object. If there are already other operations, then don't add $clearAll.\n * If $clearAll already in an Identify object, don't allow other operations to be added.\n * @private\n */\n\n\n Identify.prototype.clearAll = function () {\n if (Object.keys(this.userPropertiesOperations).length > 0) {\n if (!Object.prototype.hasOwnProperty.call(this.userPropertiesOperations, AMP_OP_CLEAR_ALL)) {\n utils.log.error('Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll');\n }\n\n return this;\n }\n\n this.userPropertiesOperations[AMP_OP_CLEAR_ALL] = '-';\n return this;\n };\n /**\n * Prepend a value or values to a user property.\n * Prepend means inserting the value or values at the front of a list.\n * If the user property does not have a value set yet,\n * it will be initialized to an empty list before the new values are prepended.\n * If the user property has an existing value and it is not a list,\n * the existing value will be converted into a list with the new values prepended.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string|list|object} value - A value or values to prepend.\n * Values can be numbers, strings, lists, or object (key:value dict will be flattened).\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().prepend('ab-tests', 'new-user-tests');\n * identify.prepend('some_list', [1, 2, 3, 4, 'values']);\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.prepend = function (property, value) {\n this._addOperation(AMP_OP_PREPEND, property, value);\n\n return this;\n };\n /**\n * Sets the value of a given user property. If a value already exists, it will be overwriten with the new value.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string|list|boolean|object} value - A value or values to set.\n * Values can be numbers, strings, lists, or object (key:value dict will be flattened).\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().set('user_type', 'beta');\n * identify.set('name', {'first': 'John', 'last': 'Doe'}); // dict is flattened and becomes name.first: John, name.last: Doe\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.set = function (property, value) {\n this._addOperation(AMP_OP_SET, property, value);\n\n return this;\n };\n /**\n * Sets the value of a given user property only once. Subsequent setOnce operations on that user property will be ignored;\n * however, that user property can still be modified through any of the other operations.\n * Useful for capturing properties such as 'initial_signup_date', 'initial_referrer', etc.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string|list|boolean|object} value - A value or values to set once.\n * Values can be numbers, strings, lists, or object (key:value dict will be flattened).\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().setOnce('sign_up_date', '2016-04-01');\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.setOnce = function (property, value) {\n this._addOperation(AMP_OP_SET_ONCE, property, value);\n\n return this;\n };\n /**\n * Unset and remove a user property. This user property will no longer show up in a user's profile.\n * @public\n * @param {string} property - The user property key.\n * @return {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n * @example var identify = new amplitude.Identify().unset('user_type').unset('age');\n * amplitude.identify(identify); // send the Identify call\n */\n\n\n Identify.prototype.unset = function (property) {\n this._addOperation(AMP_OP_UNSET, property, '-');\n\n return this;\n };\n /**\n * Preinsert a value or values to a user property, if it does not exist in the user property already.\n * Preinsert means inserting the value or values to the beginning of the specified user property.\n * If the item already exists in the user property, it will be a no-op.\n * @public\n * @param {string} property - The user property key.\n * @param {number|string|list|object} value - A value or values to insert.\n * @returns {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n */\n\n\n Identify.prototype.preInsert = function (property, value) {\n this._addOperation(AMP_OP_PREINSERT, property, value);\n\n return this;\n };\n /**\n * Postinsert a value or values to a user property, if it does not exist in the user property already.\n * Postinsert means inserting the value or values to the beginning of the specified user property.\n * If the item already exists in the user property, it will be a no-op.\n * @param {string} property - The user property key.\n * @param {number|string|list|object} value - A value or values to insert.\n * @returns {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n */\n\n\n Identify.prototype.postInsert = function (property, value) {\n this._addOperation(AMP_OP_POSTINSERT, property, value);\n\n return this;\n };\n /**\n * Remove a value or values to a user property, if it does exist in the user property.\n * If the item does not exist in the user property, it will be a no-op.\n * @param {string} property - The user property key.\n * @param {number|string|list|object} value - A value or values to remove.\n * @returns {Identify} Returns the same Identify object, allowing you to chain multiple method calls together.\n */\n\n\n Identify.prototype.remove = function (property, value) {\n this._addOperation(AMP_OP_REMOVE, property, value);\n\n return this;\n };\n /**\n * Helper function that adds operation to the Identify's object\n * Handle's filtering of duplicate user property keys, and filtering for clearAll.\n * @private\n */\n\n\n Identify.prototype._addOperation = function (operation, property, value) {\n // check that the identify doesn't already contain a clearAll\n if (Object.prototype.hasOwnProperty.call(this.userPropertiesOperations, AMP_OP_CLEAR_ALL)) {\n utils.log.error('This identify already contains a $clearAll operation, skipping operation ' + operation);\n return;\n } // check that property wasn't already used in this Identify\n\n\n if (this.properties.indexOf(property) !== -1) {\n utils.log.error('User property \"' + property + '\" already used in this identify, skipping operation ' + operation);\n return;\n }\n\n if (!Object.prototype.hasOwnProperty.call(this.userPropertiesOperations, operation)) {\n this.userPropertiesOperations[operation] = {};\n }\n\n this.userPropertiesOperations[operation][property] = value;\n this.properties.push(property);\n };\n\n var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n var md5 = createCommonjsModule(function (module) {\n (function ($) {\n\n /*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n function safeAdd (x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xffff)\n }\n\n /*\n * Bitwise rotate a 32-bit number to the left.\n */\n function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }\n\n /*\n * These functions implement the four basic operations the algorithm uses.\n */\n function md5cmn (q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)\n }\n function md5ff (a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t)\n }\n function md5gg (a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t)\n }\n function md5hh (a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t)\n }\n function md5ii (a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t)\n }\n\n /*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n function binlMD5 (x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << (len % 32);\n x[((len + 64) >>> 9 << 4) + 14] = len;\n\n var i;\n var olda;\n var oldb;\n var oldc;\n var oldd;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (i = 0; i < x.length; i += 16) {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n return [a, b, c, d]\n }\n\n /*\n * Convert an array of little-endian words to a string\n */\n function binl2rstr (input) {\n var i;\n var output = '';\n var length32 = input.length * 32;\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);\n }\n return output\n }\n\n /*\n * Convert a raw string to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n function rstr2binl (input) {\n var i;\n var output = [];\n output[(input.length >> 2) - 1] = undefined;\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0;\n }\n var length8 = input.length * 8;\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);\n }\n return output\n }\n\n /*\n * Calculate the MD5 of a raw string\n */\n function rstrMD5 (s) {\n return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))\n }\n\n /*\n * Calculate the HMAC-MD5, of a key and some data (raw strings)\n */\n function rstrHMACMD5 (key, data) {\n var i;\n var bkey = rstr2binl(key);\n var ipad = [];\n var opad = [];\n var hash;\n ipad[15] = opad[15] = undefined;\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8);\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5c5c5c5c;\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }\n\n /*\n * Convert a raw string to a hex string\n */\n function rstr2hex (input) {\n var hexTab = '0123456789abcdef';\n var output = '';\n var x;\n var i;\n for (i = 0; i < input.length; i += 1) {\n x = input.charCodeAt(i);\n output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);\n }\n return output\n }\n\n /*\n * Encode a string as utf-8\n */\n function str2rstrUTF8 (input) {\n return unescape(encodeURIComponent(input))\n }\n\n /*\n * Take string arguments and return either raw or hex encoded strings\n */\n function rawMD5 (s) {\n return rstrMD5(str2rstrUTF8(s))\n }\n function hexMD5 (s) {\n return rstr2hex(rawMD5(s))\n }\n function rawHMACMD5 (k, d) {\n return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))\n }\n function hexHMACMD5 (k, d) {\n return rstr2hex(rawHMACMD5(k, d))\n }\n\n function md5 (string, key, raw) {\n if (!key) {\n if (!raw) {\n return hexMD5(string)\n }\n return rawMD5(string)\n }\n if (!raw) {\n return hexHMACMD5(key, string)\n }\n return rawHMACMD5(key, string)\n }\n\n if (module.exports) {\n module.exports = md5;\n } else {\n $.md5 = md5;\n }\n })(commonjsGlobal);\n });\n\n var strictUriEncode = function (str) {\n \treturn encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n \t\treturn '%' + c.charCodeAt(0).toString(16).toUpperCase();\n \t});\n };\n\n /*\n object-assign\n (c) Sindre Sorhus\n @license MIT\n */\n /* eslint-disable no-unused-vars */\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\n function toObject(val) {\n \tif (val === null || val === undefined) {\n \t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n \t}\n\n \treturn Object(val);\n }\n\n function shouldUseNative() {\n \ttry {\n \t\tif (!Object.assign) {\n \t\t\treturn false;\n \t\t}\n\n \t\t// Detect buggy property enumeration order in older V8 versions.\n\n \t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n \t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n \t\ttest1[5] = 'de';\n \t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n \t\t\treturn false;\n \t\t}\n\n \t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n \t\tvar test2 = {};\n \t\tfor (var i = 0; i < 10; i++) {\n \t\t\ttest2['_' + String.fromCharCode(i)] = i;\n \t\t}\n \t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n \t\t\treturn test2[n];\n \t\t});\n \t\tif (order2.join('') !== '0123456789') {\n \t\t\treturn false;\n \t\t}\n\n \t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n \t\tvar test3 = {};\n \t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n \t\t\ttest3[letter] = letter;\n \t\t});\n \t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n \t\t\t\t'abcdefghijklmnopqrst') {\n \t\t\treturn false;\n \t\t}\n\n \t\treturn true;\n \t} catch (err) {\n \t\t// We don't expect any of the above to throw, but better to be safe.\n \t\treturn false;\n \t}\n }\n\n var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {\n \tvar from;\n \tvar to = toObject(target);\n \tvar symbols;\n\n \tfor (var s = 1; s < arguments.length; s++) {\n \t\tfrom = Object(arguments[s]);\n\n \t\tfor (var key in from) {\n \t\t\tif (hasOwnProperty.call(from, key)) {\n \t\t\t\tto[key] = from[key];\n \t\t\t}\n \t\t}\n\n \t\tif (getOwnPropertySymbols) {\n \t\t\tsymbols = getOwnPropertySymbols(from);\n \t\t\tfor (var i = 0; i < symbols.length; i++) {\n \t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n \t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n\n \treturn to;\n };\n\n var token = '%[a-f0-9]{2}';\n var singleMatcher = new RegExp(token, 'gi');\n var multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\n function decodeComponents(components, split) {\n \ttry {\n \t\t// Try to decode the entire string first\n \t\treturn decodeURIComponent(components.join(''));\n \t} catch (err) {\n \t\t// Do nothing\n \t}\n\n \tif (components.length === 1) {\n \t\treturn components;\n \t}\n\n \tsplit = split || 1;\n\n \t// Split the array in 2 parts\n \tvar left = components.slice(0, split);\n \tvar right = components.slice(split);\n\n \treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n }\n\n function decode(input) {\n \ttry {\n \t\treturn decodeURIComponent(input);\n \t} catch (err) {\n \t\tvar tokens = input.match(singleMatcher);\n\n \t\tfor (var i = 1; i < tokens.length; i++) {\n \t\t\tinput = decodeComponents(tokens, i).join('');\n\n \t\t\ttokens = input.match(singleMatcher);\n \t\t}\n\n \t\treturn input;\n \t}\n }\n\n function customDecodeURIComponent(input) {\n \t// Keep track of all the replacements and prefill the map with the `BOM`\n \tvar replaceMap = {\n \t\t'%FE%FF': '\\uFFFD\\uFFFD',\n \t\t'%FF%FE': '\\uFFFD\\uFFFD'\n \t};\n\n \tvar match = multiMatcher.exec(input);\n \twhile (match) {\n \t\ttry {\n \t\t\t// Decode as big chunks as possible\n \t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n \t\t} catch (err) {\n \t\t\tvar result = decode(match[0]);\n\n \t\t\tif (result !== match[0]) {\n \t\t\t\treplaceMap[match[0]] = result;\n \t\t\t}\n \t\t}\n\n \t\tmatch = multiMatcher.exec(input);\n \t}\n\n \t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n \treplaceMap['%C2'] = '\\uFFFD';\n\n \tvar entries = Object.keys(replaceMap);\n\n \tfor (var i = 0; i < entries.length; i++) {\n \t\t// Replace all decoded components\n \t\tvar key = entries[i];\n \t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n \t}\n\n \treturn input;\n }\n\n var decodeUriComponent = function (encodedURI) {\n \tif (typeof encodedURI !== 'string') {\n \t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n \t}\n\n \ttry {\n \t\tencodedURI = encodedURI.replace(/\\+/g, ' ');\n\n \t\t// Try the built in decoder first\n \t\treturn decodeURIComponent(encodedURI);\n \t} catch (err) {\n \t\t// Fallback to a more advanced decoder\n \t\treturn customDecodeURIComponent(encodedURI);\n \t}\n };\n\n function encoderForArrayFormat(opts) {\n \tswitch (opts.arrayFormat) {\n \t\tcase 'index':\n \t\t\treturn function (key, value, index) {\n \t\t\t\treturn value === null ? [\n \t\t\t\t\tencode(key, opts),\n \t\t\t\t\t'[',\n \t\t\t\t\tindex,\n \t\t\t\t\t']'\n \t\t\t\t].join('') : [\n \t\t\t\t\tencode(key, opts),\n \t\t\t\t\t'[',\n \t\t\t\t\tencode(index, opts),\n \t\t\t\t\t']=',\n \t\t\t\t\tencode(value, opts)\n \t\t\t\t].join('');\n \t\t\t};\n\n \t\tcase 'bracket':\n \t\t\treturn function (key, value) {\n \t\t\t\treturn value === null ? encode(key, opts) : [\n \t\t\t\t\tencode(key, opts),\n \t\t\t\t\t'[]=',\n \t\t\t\t\tencode(value, opts)\n \t\t\t\t].join('');\n \t\t\t};\n\n \t\tdefault:\n \t\t\treturn function (key, value) {\n \t\t\t\treturn value === null ? encode(key, opts) : [\n \t\t\t\t\tencode(key, opts),\n \t\t\t\t\t'=',\n \t\t\t\t\tencode(value, opts)\n \t\t\t\t].join('');\n \t\t\t};\n \t}\n }\n\n function parserForArrayFormat(opts) {\n \tvar result;\n\n \tswitch (opts.arrayFormat) {\n \t\tcase 'index':\n \t\t\treturn function (key, value, accumulator) {\n \t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n \t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n \t\t\t\tif (!result) {\n \t\t\t\t\taccumulator[key] = value;\n \t\t\t\t\treturn;\n \t\t\t\t}\n\n \t\t\t\tif (accumulator[key] === undefined) {\n \t\t\t\t\taccumulator[key] = {};\n \t\t\t\t}\n\n \t\t\t\taccumulator[key][result[1]] = value;\n \t\t\t};\n\n \t\tcase 'bracket':\n \t\t\treturn function (key, value, accumulator) {\n \t\t\t\tresult = /(\\[\\])$/.exec(key);\n \t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n \t\t\t\tif (!result) {\n \t\t\t\t\taccumulator[key] = value;\n \t\t\t\t\treturn;\n \t\t\t\t} else if (accumulator[key] === undefined) {\n \t\t\t\t\taccumulator[key] = [value];\n \t\t\t\t\treturn;\n \t\t\t\t}\n\n \t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n \t\t\t};\n\n \t\tdefault:\n \t\t\treturn function (key, value, accumulator) {\n \t\t\t\tif (accumulator[key] === undefined) {\n \t\t\t\t\taccumulator[key] = value;\n \t\t\t\t\treturn;\n \t\t\t\t}\n\n \t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n \t\t\t};\n \t}\n }\n\n function encode(value, opts) {\n \tif (opts.encode) {\n \t\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\n \t}\n\n \treturn value;\n }\n\n function keysSorter(input) {\n \tif (Array.isArray(input)) {\n \t\treturn input.sort();\n \t} else if (typeof input === 'object') {\n \t\treturn keysSorter(Object.keys(input)).sort(function (a, b) {\n \t\t\treturn Number(a) - Number(b);\n \t\t}).map(function (key) {\n \t\t\treturn input[key];\n \t\t});\n \t}\n\n \treturn input;\n }\n\n function extract(str) {\n \tvar queryStart = str.indexOf('?');\n \tif (queryStart === -1) {\n \t\treturn '';\n \t}\n \treturn str.slice(queryStart + 1);\n }\n\n function parse(str, opts) {\n \topts = objectAssign({arrayFormat: 'none'}, opts);\n\n \tvar formatter = parserForArrayFormat(opts);\n\n \t// Create an object with no prototype\n \t// https://github.com/sindresorhus/query-string/issues/47\n \tvar ret = Object.create(null);\n\n \tif (typeof str !== 'string') {\n \t\treturn ret;\n \t}\n\n \tstr = str.trim().replace(/^[?#&]/, '');\n\n \tif (!str) {\n \t\treturn ret;\n \t}\n\n \tstr.split('&').forEach(function (param) {\n \t\tvar parts = param.replace(/\\+/g, ' ').split('=');\n \t\t// Firefox (pre 40) decodes `%3D` to `=`\n \t\t// https://github.com/sindresorhus/query-string/pull/37\n \t\tvar key = parts.shift();\n \t\tvar val = parts.length > 0 ? parts.join('=') : undefined;\n\n \t\t// missing `=` should be `null`:\n \t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n \t\tval = val === undefined ? null : decodeUriComponent(val);\n\n \t\tformatter(decodeUriComponent(key), val, ret);\n \t});\n\n \treturn Object.keys(ret).sort().reduce(function (result, key) {\n \t\tvar val = ret[key];\n \t\tif (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {\n \t\t\t// Sort object keys, not values\n \t\t\tresult[key] = keysSorter(val);\n \t\t} else {\n \t\t\tresult[key] = val;\n \t\t}\n\n \t\treturn result;\n \t}, Object.create(null));\n }\n\n var extract_1 = extract;\n var parse_1 = parse;\n\n var stringify = function (obj, opts) {\n \tvar defaults = {\n \t\tencode: true,\n \t\tstrict: true,\n \t\tarrayFormat: 'none'\n \t};\n\n \topts = objectAssign(defaults, opts);\n\n \tif (opts.sort === false) {\n \t\topts.sort = function () {};\n \t}\n\n \tvar formatter = encoderForArrayFormat(opts);\n\n \treturn obj ? Object.keys(obj).sort(opts.sort).map(function (key) {\n \t\tvar val = obj[key];\n\n \t\tif (val === undefined) {\n \t\t\treturn '';\n \t\t}\n\n \t\tif (val === null) {\n \t\t\treturn encode(key, opts);\n \t\t}\n\n \t\tif (Array.isArray(val)) {\n \t\t\tvar result = [];\n\n \t\t\tval.slice().forEach(function (val2) {\n \t\t\t\tif (val2 === undefined) {\n \t\t\t\t\treturn;\n \t\t\t\t}\n\n \t\t\t\tresult.push(formatter(key, val2, result.length));\n \t\t\t});\n\n \t\t\treturn result.join('&');\n \t\t}\n\n \t\treturn encode(key, opts) + '=' + encode(val, opts);\n \t}).filter(function (x) {\n \t\treturn x.length > 0;\n \t}).join('&') : '';\n };\n\n var parseUrl = function (str, opts) {\n \treturn {\n \t\turl: str.split('?')[0] || '',\n \t\tquery: parse(extract(str), opts)\n \t};\n };\n\n var queryString = {\n \textract: extract_1,\n \tparse: parse_1,\n \tstringify: stringify,\n \tparseUrl: parseUrl\n };\n\n /*\n * Simple AJAX request object\n */\n\n var Request = function Request(url, data, headers) {\n this.url = url;\n this.data = data || {};\n this.headers = headers;\n };\n\n function setHeaders(xhr, headers) {\n for (var header in headers) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n\n Request.prototype.send = function (callback) {\n var isIE = window.XDomainRequest ? true : false;\n\n if (isIE) {\n var xdr = new window.XDomainRequest();\n xdr.open('POST', this.url, true);\n\n xdr.onload = function () {\n callback(200, xdr.responseText);\n };\n\n xdr.onerror = function () {\n // status code not available from xdr, try string matching on responseText\n if (xdr.responseText === 'Request Entity Too Large') {\n callback(413, xdr.responseText);\n } else {\n callback(500, xdr.responseText);\n }\n };\n\n xdr.ontimeout = function () {};\n\n xdr.onprogress = function () {};\n\n xdr.send(queryString.stringify(this.data));\n } else {\n var xhr = new XMLHttpRequest();\n xhr.open('POST', this.url, true);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n callback(xhr.status, xhr.responseText);\n }\n };\n\n setHeaders(xhr, this.headers);\n xhr.send(queryString.stringify(this.data));\n } //log('sent request to ' + this.url + ' with data ' + decodeURIComponent(queryString(this.data)));\n\n };\n\n /**\n * Revenue API - instance constructor. Wrapper for logging Revenue data. Revenue objects get passed to amplitude.logRevenueV2 to send to Amplitude servers.\n * Each method updates a revenue property in the Revenue object, and returns the same Revenue object,\n * allowing you to chain multiple method calls together.\n *\n * Note: price is a required field to log revenue events.\n * If quantity is not specified then defaults to 1.\n * @constructor Revenue\n * @public\n * @example var revenue = new amplitude.Revenue();\n */\n\n var Revenue = function Revenue() {\n // required fields\n this._price = null; // optional fields\n\n this._productId = null;\n this._quantity = 1;\n this._revenueType = null;\n this._properties = null;\n };\n /**\n * Set a value for the product identifer.\n * @public\n * @param {string} productId - The value for the product identifier. Empty and invalid strings are ignored.\n * @return {Revenue} Returns the same Revenue object, allowing you to chain multiple method calls together.\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Revenue.prototype.setProductId = function setProductId(productId) {\n if (type(productId) !== 'string') {\n utils.log.error('Unsupported type for productId: ' + type(productId) + ', expecting string');\n } else if (utils.isEmptyString(productId)) {\n utils.log.error('Invalid empty productId');\n } else {\n this._productId = productId;\n }\n\n return this;\n };\n /**\n * Set a value for the quantity. Note revenue amount is calculated as price * quantity.\n * @public\n * @param {number} quantity - Integer value for the quantity. If not set, quantity defaults to 1.\n * @return {Revenue} Returns the same Revenue object, allowing you to chain multiple method calls together.\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setQuantity(5);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Revenue.prototype.setQuantity = function setQuantity(quantity) {\n if (type(quantity) !== 'number') {\n utils.log.error('Unsupported type for quantity: ' + type(quantity) + ', expecting number');\n } else {\n this._quantity = parseInt(quantity);\n }\n\n return this;\n };\n /**\n * Set a value for the price. This field is required for all revenue being logged.\n *\n * Note: revenue amount is calculated as price * quantity.\n * @public\n * @param {number} price - Double value for the quantity.\n * @return {Revenue} Returns the same Revenue object, allowing you to chain multiple method calls together.\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Revenue.prototype.setPrice = function setPrice(price) {\n if (type(price) !== 'number') {\n utils.log.error('Unsupported type for price: ' + type(price) + ', expecting number');\n } else {\n this._price = price;\n }\n\n return this;\n };\n /**\n * Set a value for the revenueType (for example purchase, cost, tax, refund, etc).\n * @public\n * @param {string} revenueType - RevenueType to designate.\n * @return {Revenue} Returns the same Revenue object, allowing you to chain multiple method calls together.\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setRevenueType('purchase');\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Revenue.prototype.setRevenueType = function setRevenueType(revenueType) {\n if (type(revenueType) !== 'string') {\n utils.log.error('Unsupported type for revenueType: ' + type(revenueType) + ', expecting string');\n } else {\n this._revenueType = revenueType;\n }\n\n return this;\n };\n /**\n * Set event properties for the revenue event.\n * @public\n * @param {object} eventProperties - Revenue event properties to set.\n * @return {Revenue} Returns the same Revenue object, allowing you to chain multiple method calls together.\n * @example var event_properties = {'city': 'San Francisco'};\n * var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setEventProperties(event_properties);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Revenue.prototype.setEventProperties = function setEventProperties(eventProperties) {\n if (type(eventProperties) !== 'object') {\n utils.log.error('Unsupported type for eventProperties: ' + type(eventProperties) + ', expecting object');\n } else {\n this._properties = utils.validateProperties(eventProperties);\n }\n\n return this;\n };\n /**\n * @private\n */\n\n\n Revenue.prototype._isValidRevenue = function _isValidRevenue() {\n if (type(this._price) !== 'number') {\n utils.log.error('Invalid revenue, need to set price field');\n return false;\n }\n\n return true;\n };\n /**\n * @private\n */\n\n\n Revenue.prototype._toJSONObject = function _toJSONObject() {\n var obj = type(this._properties) === 'object' ? this._properties : {};\n\n if (this._productId !== null) {\n obj[Constants.REVENUE_PRODUCT_ID] = this._productId;\n }\n\n if (this._quantity !== null) {\n obj[Constants.REVENUE_QUANTITY] = this._quantity;\n }\n\n if (this._price !== null) {\n obj[Constants.REVENUE_PRICE] = this._price;\n }\n\n if (this._revenueType !== null) {\n obj[Constants.REVENUE_REVENUE_TYPE] = this._revenueType;\n }\n\n return obj;\n };\n\n var uaParser = createCommonjsModule(function (module, exports) {\n /////////////////////////////////////////////////////////////////////////////////\n /* UAParser.js v0.7.28\n Copyright © 2012-2021 Faisal Salman <f@faisalman.com>\n MIT License *//*\n Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.\n Supports browser & node.js environment. \n Demo : https://faisalman.github.io/ua-parser-js\n Source : https://github.com/faisalman/ua-parser-js */\n /////////////////////////////////////////////////////////////////////////////////\n\n (function (window, undefined$1) {\n\n //////////////\n // Constants\n /////////////\n\n\n var LIBVERSION = '0.7.28',\n EMPTY = '',\n UNKNOWN = '?',\n FUNC_TYPE = 'function',\n UNDEF_TYPE = 'undefined',\n OBJ_TYPE = 'object',\n STR_TYPE = 'string',\n MAJOR = 'major',\n MODEL = 'model',\n NAME = 'name',\n TYPE = 'type',\n VENDOR = 'vendor',\n VERSION = 'version',\n ARCHITECTURE= 'architecture',\n CONSOLE = 'console',\n MOBILE = 'mobile',\n TABLET = 'tablet',\n SMARTTV = 'smarttv',\n WEARABLE = 'wearable',\n EMBEDDED = 'embedded',\n UA_MAX_LENGTH = 255;\n\n var AMAZON = 'Amazon',\n APPLE = 'Apple',\n ASUS = 'ASUS',\n BLACKBERRY = 'BlackBerry',\n BROWSER = 'Browser',\n CHROME = 'Chrome',\n EDGE = 'Edge',\n FIREFOX = 'Firefox',\n GOOGLE = 'Google',\n HUAWEI = 'Huawei',\n LG = 'LG',\n MICROSOFT = 'Microsoft',\n MOTOROLA = 'Motorola',\n OPERA = 'Opera',\n SAMSUNG = 'Samsung',\n SONY = 'Sony',\n XIAOMI = 'Xiaomi',\n ZEBRA = 'Zebra';\n\n ///////////\n // Helper\n //////////\n\n var extend = function (regexes, extensions) {\n var mergedRegexes = {};\n for (var i in regexes) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes[i]);\n } else {\n mergedRegexes[i] = regexes[i];\n }\n }\n return mergedRegexes;\n },\n enumerize = function (arr) {\n var enums = {};\n for (var i in arr) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n },\n has = function (str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n },\n lowerize = function (str) {\n return str.toLowerCase();\n },\n majorize = function (version) {\n return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split('.')[0] : undefined$1;\n },\n trim = function (str, len) {\n if (typeof(str) === STR_TYPE) {\n str = str.replace(/^\\s+|\\s+$/g, EMPTY);\n return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n\n ///////////////\n // Map helper\n //////////////\n\n var rgxMapper = function (ua, arrays) {\n\n var i = 0, j, k, p, q, matches, match;\n\n // loop through all regexes maps\n while (i < arrays.length && !matches) {\n\n var regex = arrays[i], // even sequence (0,2,4,..)\n props = arrays[i + 1]; // odd sequence (1,3,5,..)\n j = k = 0;\n\n // try matching uastring with regexes\n while (j < regex.length && !matches) {\n\n matches = regex[j++].exec(ua);\n\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n // check if given property is actually array\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length == 2) {\n if (typeof q[1] == FUNC_TYPE) {\n // assign modified match\n this[q[0]] = q[1].call(this, match);\n } else {\n // assign given value, ignore regex match\n this[q[0]] = q[1];\n }\n } else if (q.length == 3) {\n // check whether function or regex\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n // call function (usually string mapper)\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined$1;\n } else {\n // sanitize match using given regex\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined$1;\n }\n } else if (q.length == 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined$1;\n }\n } else {\n this[q] = match ? match : undefined$1;\n }\n }\n }\n }\n i += 2;\n }\n },\n\n strMapper = function (str, map) {\n\n for (var i in map) {\n // check if current value is array\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return (i === UNKNOWN) ? undefined$1 : i;\n }\n }\n } else if (has(map[i], str)) {\n return (i === UNKNOWN) ? undefined$1 : i;\n }\n }\n return str;\n };\n\n ///////////////\n // String map\n //////////////\n\n // Safari < 3.0\n var oldSafariMap = {\n '1.0' : '/8',\n '1.2' : '/1',\n '1.3' : '/3',\n '2.0' : '/412',\n '2.0.2' : '/416',\n '2.0.3' : '/417',\n '2.0.4' : '/419',\n '?' : '/'\n },\n windowsVersionMap = {\n 'ME' : '4.90',\n 'NT 3.11' : 'NT3.51',\n 'NT 4.0' : 'NT4.0',\n '2000' : 'NT 5.0',\n 'XP' : ['NT 5.1', 'NT 5.2'],\n 'Vista' : 'NT 6.0',\n '7' : 'NT 6.1',\n '8' : 'NT 6.2',\n '8.1' : 'NT 6.3',\n '10' : ['NT 6.4', 'NT 10.0'],\n 'RT' : 'ARM'\n };\n\n //////////////\n // Regex map\n /////////////\n\n var regexes = {\n\n browser : [[\n\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i // Chrome for Android/iOS\n ], [VERSION, [NAME, 'Chrome']], [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i // Microsoft Edge\n ], [VERSION, [NAME, 'Edge']], [\n\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i, // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i, // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i // Opera\n ], [NAME, VERSION], [\n /opios[\\/ ]+([\\w\\.]+)/i // Opera mini on iphone >= 8.0\n ], [VERSION, [NAME, OPERA+' Mini']], [\n /\\bopr\\/([\\w\\.]+)/i // Opera Webkit\n ], [VERSION, [NAME, OPERA]], [\n\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i, // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i, // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(weibo)__([\\d\\.]+)/i // Weibo\n ], [NAME, VERSION], [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i // UCBrowser\n ], [VERSION, [NAME, 'UC'+BROWSER]], [\n /\\bqbcore\\/([\\w\\.]+)/i // WeChat Desktop for Windows Built-in Browser\n ], [VERSION, [NAME, 'WeChat(Win) Desktop']], [\n /micromessenger\\/([\\w\\.]+)/i // WeChat\n ], [VERSION, [NAME, 'WeChat']], [\n /konqueror\\/([\\w\\.]+)/i // Konqueror\n ], [VERSION, [NAME, 'Konqueror']], [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i // IE11\n ], [VERSION, [NAME, 'IE']], [\n /yabrowser\\/([\\w\\.]+)/i // Yandex\n ], [VERSION, [NAME, 'Yandex']], [\n /(avast|avg)\\/([\\w\\.]+)/i // Avast/AVG Secure Browser\n ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [\n /\\bfocus\\/([\\w\\.]+)/i // Firefox Focus\n ], [VERSION, [NAME, FIREFOX+' Focus']], [\n /\\bopt\\/([\\w\\.]+)/i // Opera Touch\n ], [VERSION, [NAME, OPERA+' Touch']], [\n /coc_coc\\w+\\/([\\w\\.]+)/i // Coc Coc Browser\n ], [VERSION, [NAME, 'Coc Coc']], [\n /dolfin\\/([\\w\\.]+)/i // Dolphin\n ], [VERSION, [NAME, 'Dolphin']], [\n /coast\\/([\\w\\.]+)/i // Opera Coast\n ], [VERSION, [NAME, OPERA+' Coast']], [\n /miuibrowser\\/([\\w\\.]+)/i // MIUI Browser\n ], [VERSION, [NAME, 'MIUI '+BROWSER]], [\n /fxios\\/([-\\w\\.]+)/i // Firefox for iOS\n ], [VERSION, [NAME, FIREFOX]], [\n /\\bqihu|(qi?ho?o?|360)browser/i // 360\n ], [[NAME, '360 '+BROWSER]], [\n /(oculus|samsung|sailfish)browser\\/([\\w\\.]+)/i\n ], [[NAME, /(.+)/, '$1 '+BROWSER], VERSION], [ // Oculus/Samsung/Sailfish Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i // Comodo Dragon\n ], [[NAME, /_/g, ' '], VERSION], [\n /(electron)\\/([\\w\\.]+) safari/i, // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i, // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i // QQBrowser/Baidu App/2345 Browser\n ], [NAME, VERSION], [\n /(metasr)[\\/ ]?([\\w\\.]+)/i, // SouGouBrowser\n /(lbbrowser)/i // LieBao Browser\n ], [NAME], [\n\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i // Facebook App for iOS & Android\n ], [[NAME, 'Facebook'], VERSION], [\n /safari (line)\\/([\\w\\.]+)/i, // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i, // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i // Chromium/Instagram\n ], [NAME, VERSION], [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i // Google Search Appliance on iOS\n ], [VERSION, [NAME, 'GSA']], [\n\n /headlesschrome(?:\\/([\\w\\.]+)| )/i // Chrome Headless\n ], [VERSION, [NAME, CHROME+' Headless']], [\n\n / wv\\).+(chrome)\\/([\\w\\.]+)/i // Chrome WebView\n ], [[NAME, CHROME+' WebView'], VERSION], [\n\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i // Android Browser\n ], [VERSION, [NAME, 'Android '+BROWSER]], [\n\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia\n ], [NAME, VERSION], [\n\n /version\\/([\\w\\.]+) .*mobile\\/\\w+ (safari)/i // Mobile Safari\n ], [VERSION, [NAME, 'Mobile Safari']], [\n /version\\/([\\w\\.]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile\n ], [VERSION, NAME], [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i // Safari < 3.0\n ], [NAME, [VERSION, strMapper, oldSafariMap]], [\n\n /(webkit|khtml)\\/([\\w\\.]+)/i\n ], [NAME, VERSION], [\n\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i // Netscape\n ], [[NAME, 'Netscape'], VERSION], [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i // Firefox Reality\n ], [VERSION, [NAME, FIREFOX+' Reality']], [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i, // Flow\n /(swiftfox)/i, // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i, // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i // Links\n ], [NAME, VERSION]\n ],\n\n cpu : [[\n\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i // AMD64 (x64)\n ], [[ARCHITECTURE, 'amd64']], [\n\n /(ia32(?=;))/i // IA32 (quicktime)\n ], [[ARCHITECTURE, lowerize]], [\n\n /((?:i[346]|x)86)[;\\)]/i // IA32 (x86)\n ], [[ARCHITECTURE, 'ia32']], [\n\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i // ARM64\n ], [[ARCHITECTURE, 'arm64']], [\n\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i // ARMHF\n ], [[ARCHITECTURE, 'armhf']], [\n\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ], [[ARCHITECTURE, 'arm']], [\n\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i // PowerPC\n ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [\n\n /(sun4\\w)[;\\)]/i // SPARC\n ], [[ARCHITECTURE, 'sparc']], [\n\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ], [[ARCHITECTURE, lowerize]]\n ],\n\n device : [[\n\n //////////////////////////\n // MOBILES & TABLETS\n // Ordered by popularity\n /////////////////////////\n\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[pt]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [\n\n // Apple\n /((ipod|iphone)\\d+,\\d+)/i // iPod/iPhone model\n ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [\n /(ipad\\d+,\\d+)/i // iPad model\n ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [\n /\\((ip(?:hone|od)[\\w ]*);/i // iPod/iPhone\n ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [\n /\\((ipad);[-\\w\\),; ]+apple/i, // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [\n\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}-[atu]?[ln][01259x][012359][an]?)\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [\n\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i, // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i, // Xiaomi Hongmi 'numeric' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i, // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i, // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i // Xiaomi Mi\n ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i // Mi Pad tablets\n ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [\n\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007)\\b/i\n ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [\n\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [\n\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [\n\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [\n /\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [\n\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [\n\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [\n\n // Google\n /(pixel c)\\b/i // Google Pixel C\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i // Google Pixel\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [\n\n // Sony\n /droid.+ ([c-g]\\d{4}|so[-l]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [\n /sony tablet [ps]/i,\n /\\b(?:sony)?sgp\\w+(?: bui|\\))/i\n ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [\n\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi)( bui|\\))/i, // Kindle Fire without Silk\n /(kf[a-z]+)( bui|\\)).+silk\\//i // Kindle Fire HD\n ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i // Fire Phone\n ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [\n\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i // BlackBerry PlayBook\n ], [MODEL, VENDOR, [TYPE, TABLET]], [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i // BlackBerry 10\n ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [\n\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [\n / (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [\n\n // HTC\n /(nexus 9)/i // HTC Nexus 9\n ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i, // HTC\n\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [\n\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ], [MODEL, [VENDOR, 'Sharp'], [TYPE, MOBILE]], [\n\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i, // HP iPAQ\n /(asus)-?(\\w+)/i, // Asus\n /(microsoft); (lumia[\\w ]+)/i, // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i, // Lenovo\n /(jolla)/i, // Jolla\n /(oppo) ?([\\w ]+) bui/i // OPPO\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /(archos) (gamepad2?)/i, // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i, // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i, // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i, // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i, // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i, // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i // Vodafone\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(surface duo)/i // Surface Duo\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i // Fairphone\n ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [\n /(u304aa)/i // AT&T\n ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [\n /\\bsie-(\\w*)/i // Siemens\n ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n /\\b(rct\\w+) b/i // RCA Tablets\n ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n /\\b(venue[\\d ]{2,7}) b/i // Dell Venue Tablets\n ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n /\\b(q(?:mv|ta)\\w+) b/i // Verizon Tablet\n ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i // Barnes & Noble Tablet\n ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [\n /\\b(tm\\d{3}\\w+) b/i\n ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n /\\b(k88) b/i // ZTE K Series Tablet\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [\n /\\b(nx\\d{3}j) b/i // ZTE Nubia\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [\n /\\b(gen\\d{3}) b.+49h/i // Swiss GEN Mobile\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n /\\b(zur\\d{3}) b/i // Swiss ZUR Tablet\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n /\\b((zeki)?tb.*\\b) b/i // Zeki Tablets\n ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i // Dragon Touch Tablet\n ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n /\\b(ns-?\\w{0,9}) b/i // Insignia Tablets\n ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n /\\b((nxa|next)-?\\w{0,9}) b/i // NextBook Tablets\n ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones\n ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [\n /\\b(lvtel\\-)?(v1[12]) b/i // LvTel Phones\n ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n /\\b(ph-1) /i // Essential PH-1\n ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i // Envizen Tablets\n ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n /\\b(trio[-\\w\\. ]+) b/i // MachSpeed Tablets\n ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n /\\btu_(1491) b/i // Rotor Tablets\n ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n /(shield[\\w ]+) b/i // Nvidia Shield Tablets\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [\n /(sprint) (\\w+)/i // Sprint Phones\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /(kin\\.[onetw]{3})/i // Microsoft Kin\n ], [[MODEL, /\\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i // Zebra\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [\n /droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [\n\n ///////////////////\n // CONSOLES\n ///////////////////\n\n /(ouya)/i, // Ouya\n /(nintendo) ([wids3utch]+)/i // Nintendo\n ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n /droid.+; (shield) bui/i // Nvidia\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n /(playstation [345portablevi]+)/i // Playstation\n ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i // Microsoft Xbox\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [\n\n ///////////////////\n // SMARTTVS\n ///////////////////\n\n /smart-tv.+(samsung)/i // Samsung\n ], [VENDOR, [TYPE, SMARTTV]], [\n /hbbtv.+maple;(\\d+)/i\n ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i // LG SmartTV\n ], [[VENDOR, LG], [TYPE, SMARTTV]], [\n /(apple) ?tv/i // Apple TV\n ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [\n /crkey/i // Google Chromecast\n ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [\n /droid.+aft(\\w)( bui|\\))/i // Fire TV\n ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [\n /\\(dtv[\\);].+(aquos)/i // Sharp\n ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i, // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i // HbbTV devices\n ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i // SmartTV from Unidentified Vendors\n ], [[TYPE, SMARTTV]], [\n\n ///////////////////\n // WEARABLES\n ///////////////////\n\n /((pebble))app/i // Pebble\n ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n /droid.+; (glass) \\d/i // Google Glass\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [\n /droid.+; (wt63?0{2,3})\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [\n\n ///////////////////\n // EMBEDDED\n ///////////////////\n\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i // Tesla\n ], [VENDOR, [TYPE, EMBEDDED]], [\n\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors\n ], [MODEL, [TYPE, MOBILE]], [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors\n ], [MODEL, [TYPE, TABLET]], [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i // Unidentifiable Tablet\n ], [[TYPE, TABLET]], [\n /(phone|mobile(?:[;\\/]| safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile\n ], [[TYPE, MOBILE]], [\n /(android[-\\w\\. ]{0,9});.+buil/i // Generic Android Device\n ], [MODEL, [VENDOR, 'Generic']]\n ],\n\n engine : [[\n\n /windows.+ edge\\/([\\w\\.]+)/i // EdgeHTML\n ], [VERSION, [NAME, EDGE+'HTML']], [\n\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i // Blink\n ], [VERSION, [NAME, 'Blink']], [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i, // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i, // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i // iCab\n ], [NAME, VERSION], [\n\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i // Gecko\n ], [VERSION, NAME]\n ],\n\n os : [[\n\n // Windows\n /microsoft (windows) (vista|xp)/i // Windows (iTunes)\n ], [NAME, VERSION], [\n /(windows) nt 6\\.2; (arm)/i, // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i, // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ], [NAME, [VERSION, strMapper, windowsVersionMap]], [\n /(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i\n ], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [\n\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i, // iOS\n /cfnetwork\\/.+darwin/i\n ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i // Mac OS\n ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [\n\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86)/i // Android-x86\n ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i, // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i, // Tizen/KaiOS\n /\\((series40);/i // Series 40\n ], [NAME, VERSION], [\n /\\(bb(10);/i // BlackBerry 10\n ], [VERSION, [NAME, BLACKBERRY]], [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i // Symbian\n ], [VERSION, [NAME, 'Symbian']], [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i // Firefox OS\n ], [VERSION, [NAME, FIREFOX+' OS']], [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i // WebOS\n ], [VERSION, [NAME, 'webOS']], [\n\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i // Google Chromecast\n ], [VERSION, [NAME, CHROME+'cast']], [\n /(cros) [\\w]+ ([\\w\\.]+\\w)/i // Chromium OS\n ], [[NAME, 'Chromium OS'], VERSION],[\n\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S)\n\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i, // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i, // Mint\n /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i, // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i, // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i // Haiku\n ], [NAME, VERSION], [\n /(sunos) ?([\\w\\.\\d]*)/i // Solaris\n ], [[NAME, 'Solaris'], VERSION], [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i, // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i, // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n /(unix) ?([\\w\\.]*)/i // UNIX\n ], [NAME, VERSION]\n ]\n };\n\n /////////////////\n // Constructor\n ////////////////\n\n var UAParser = function (ua, extensions) {\n\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined$1;\n }\n\n if (!(this instanceof UAParser)) {\n return new UAParser(ua, extensions).getResult();\n }\n\n var _ua = ua || ((typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n\n this.getBrowser = function () {\n var _browser = {};\n _browser[NAME] = undefined$1;\n _browser[VERSION] = undefined$1;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser.major = majorize(_browser.version);\n return _browser;\n };\n this.getCPU = function () {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined$1;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function () {\n var _device = {};\n _device[VENDOR] = undefined$1;\n _device[MODEL] = undefined$1;\n _device[TYPE] = undefined$1;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n return _device;\n };\n this.getEngine = function () {\n var _engine = {};\n _engine[NAME] = undefined$1;\n _engine[VERSION] = undefined$1;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function () {\n var _os = {};\n _os[NAME] = undefined$1;\n _os[VERSION] = undefined$1;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n return _os;\n };\n this.getResult = function () {\n return {\n ua : this.getUA(),\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice(),\n cpu : this.getCPU()\n };\n };\n this.getUA = function () {\n return _ua;\n };\n this.setUA = function (ua) {\n _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n\n UAParser.VERSION = LIBVERSION;\n UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]);\n UAParser.CPU = enumerize([ARCHITECTURE]);\n UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);\n UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);\n\n ///////////\n // Export\n //////////\n\n // check js environment\n {\n // nodejs env\n if (module.exports) {\n exports = module.exports = UAParser;\n }\n exports.UAParser = UAParser;\n }\n\n // jQuery/Zepto specific (optional)\n // Note:\n // In AMD env the global scope should be kept clean, but jQuery is an exception.\n // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n // and we should catch that.\n var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser();\n $.ua = parser.getResult();\n $.ua.get = function () {\n return parser.getUA();\n };\n $.ua.set = function (ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n\n })(typeof window === 'object' ? window : commonjsGlobal);\n });\n var uaParser_1 = uaParser.UAParser;\n\n /**\n * Source: [jed's gist]{@link https://gist.github.com/982883}.\n * Returns a random v4 UUID of the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx,\n * where each x is replaced with a random hexadecimal digit from 0 to f, and\n * y is replaced with a random hexadecimal digit from 8 to b.\n * Used to generate UUIDs for deviceIds.\n * @private\n */\n var uuid = function uuid(a) {\n return a // if the placeholder was passed, return\n ? // a random number from 0 to 15\n (a ^ // unless b is 8,\n Math.random() * // in which case\n 16 >> // a random number from\n a / 4). // 8 to 11\n toString(16) // in hexadecimal\n : // or otherwise a concatenated string:\n ([1e7] + // 10000000 +\n -1e3 + // -1000 +\n -4e3 + // -4000 +\n -8e3 + // -80000000 +\n -1e11). // -100000000000,\n replace( // replacing\n /[018]/g, // zeroes, ones, and eights with\n uuid // random hex digits\n );\n };\n\n var version = \"8.8.0\";\n\n var getLanguage = function getLanguage() {\n return navigator && (navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage) || '';\n };\n\n var language = {\n getLanguage: getLanguage\n };\n\n /**\n * Options used when initializing Amplitude\n * @typedef {Object} Options\n * @property {string} [apiEndpoint=`api.amplitude.com`] - Endpoint to send amplitude event requests to.\n * @property {boolean} [batchEvents=`false`] - If `true`, then events are batched together and uploaded only when the number of unsent events is greater than or equal to eventUploadThreshold or after eventUploadPeriodMillis milliseconds have passed since the first unsent event was logged.\n * @property {number} [cookieExpiration=`365`] - The number of days after which the Amplitude cookie will expire. 12 months is for GDPR compliance.\n * @property {string} [cookieName=`amplitude_id`] - *DEPRECATED*\n * @property {string} [sameSiteCookie='None'] - Sets the SameSite flag on the amplitude cookie. Decides cookie privacy policy.\n * @property {boolean} [cookieForceUpgrade=`false`] - Forces pre-v6.0.0 instances to adopt post-v6.0.0 compat cookie formats.\n * @property {boolean} [deferInitialization=`null`] - If `true`, disables the core functionality of the sdk, including saving a cookie and all logging, until explicitly enabled. To enable tracking, please call `amplitude.getInstance().enableTracking()` *Note: This will not affect users who already have an amplitude cookie. The decision to track events is determined by whether or not a user has an amplitude analytics cookie. If the `cookieExpiration</code> is manually defined to be a short lifespan, you may need to run `amplitude.getInstance().enableTracking()` upon the cookie expiring or upon logging in.*\n * @property {boolean} [disableCookies=`false`] - Disable Ampllitude cookies altogether.\n * @property {string} [deviceId=A randomly generated UUID.] - The custom Device ID to set. *Note: This is not recommended unless you know what you are doing (e.g. you have your own system for tracking user devices).*\n * @property {boolean} [deviceIdFromUrlParam=`false`] - If `true`, then the SDK will parse Device ID values from the URL parameter amp_device_id if available. Device IDs defined in the configuration options during init will take priority over Device IDs from URL parameters.\n * @property {string} [domain=The top domain of the current page's URL. ('https://amplitude.com')] - Set a custom domain for the Amplitude cookie. To include subdomains, add a preceding period, eg: `.amplitude.com`.\n * @property {number} [eventUploadPeriodMillis=`30000` (30 sec)] - Amount of time in milliseconds that the SDK waits before uploading events if batchEvents is true.\n * @property {number} [eventUploadThreshold=`30`] - Minimum number of events to batch together per request if batchEvents is true.\n * @property {boolean} [forceHttps=`true`] - If `true`, the events will always be uploaded to HTTPS endpoint. Otherwise, it will use the embedding site's protocol.\n * @property {boolean} [includeFbclid=`false`] - If `true`, captures the fbclid URL parameter as well as the user's initial_fbclid via a setOnce operation.\n * @property {boolean} [includeGclid=`false`] - If `true`, captures the gclid URL parameter as well as the user's initial_gclid via a setOnce operation.\n * @property {boolean} [includeReferrer=`false`] - If `true`, captures the referrer and referring_domain for each session, as well as the user's initial_referrer and initial_referring_domain via a setOnce operation.\n * @property {boolean} [includeUtm=`false`] - If `true`, finds UTM parameters in the query string or the _utmz cookie, parses, and includes them as user properties on all events uploaded. This also captures initial UTM parameters for each session via a setOnce operation.\n * @property {string} [language=The language determined by the browser] - Custom language to set.\n * @property {string} [logLevel=`WARN`] - Level of logs to be printed in the developer console. Valid values are 'DISABLE', 'ERROR', 'WARN', 'INFO'. To learn more about the different options, see below.\n * @property {boolean} [logAttributionCapturedEvent=`false`] - If `true`, the SDK will log an Amplitude event anytime new attribution values are captured from the user. **Note: These events count towards your event volume.** Event name being logged: [Amplitude] Attribution Captured. Event Properties that can be logged: `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `referrer`, `referring_domain`, `gclid`, `fbclid`. For UTM properties to be logged, `includeUtm` must be set to `true`. For the `referrer` and `referring_domain` properties to be logged, `includeReferrer` must be set to `true`. For the `gclid` property to be logged, `includeGclid` must be set to `true`. For the `fbclid` property to be logged, `includeFbclid` must be set to `true`.\n * @property {boolean} [optOut=`false`] - Whether or not to disable tracking for the current user.\n * @property {function} [onError=`() => {}`] - Function to call on error.\n * @property {function} [onExitPage=`() => {}`] - Function called when the user exits the browser. Useful logging on page exit.\n * @property {Object} [plan] Tracking plan properties\n * @property {string} [plan.branch] The tracking plan branch name e.g. \"main\"\n * @property {string} [plan.source] The tracking plan source e.g. \"web\"\n * @property {string} [plan.version] The tracking plan version e.g. \"1\", \"15\"\n * @property {string} [platform=`Web`] - Platform device is running on. Defaults to `Web` (browser, including mobile browsers).\n * @property {number} [savedMaxCount=`1000`] - Maximum number of events to save in localStorage. If more events are logged while offline, then old events are removed.\n * @property {boolean} [saveEvents=`true`] - If `true`, saves events to localStorage and removes them upon successful upload. *Note: Without saving events, events may be lost if the user navigates to another page before the events are uploaded.*\n * @property {boolean} [saveParamsReferrerOncePerSession=`true`] - If `true`, then includeGclid, includeFbclid, includeReferrer, and includeUtm will only track their respective properties once per session. New values that come in during the middle of the user's session will be ignored. Set to false to always capture new values.\n * @property {boolean} [secureCookie=`false`] - If `true`, the amplitude cookie will be set with the Secure flag.\n * @property {number} [sessionTimeout=`30*60*1000` (30 min)] - The time between logged events before a new session starts in milliseconds.\n * @property {string[]} [storage=`''`] - Sets storage strategy. Options are 'cookies', 'localStorage', 'sessionStorage', or `none`. Will override `disableCookies` option\n * @property {Object} [trackingOptions=`{ city: true, country: true, carrier: true, device_manufacturer: true, device_model: true, dma: true, ip_address: true, language: true, os_name: true, os_version: true, platform: true, region: true, version_name: true}`] - Type of data associated with a user.\n * @property {string} [transport=`http`] - Network transport mechanism used to send events. Options are 'http' and 'beacon'.\n * @property {boolean} [unsetParamsReferrerOnNewSession=`false`] - If `false`, the existing `referrer` and `utm_parameter` values will be carried through each new session. If set to `true`, the `referrer` and `utm_parameter` user properties, which include `referrer`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, and `utm_content`, will be set to `null` upon instantiating a new session. Note: This only works if `includeReferrer` or `includeUtm` is set to `true`.\n * @property {string} [unsentKey=`amplitude_unsent`] - localStorage key that stores unsent events.\n * @property {string} [unsentIdentifyKey=`amplitude_unsent_identify`] - localStorage key that stores unsent identifies.\n * @property {number} [uploadBatchSize=`100`] - The maximum number of events to send to the server per request.\n * @property {Object} [headers=`{ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }`] - Headers attached to an event(s) upload network request. Custom header properties are merged with this object.\n */\n\n var DEFAULT_OPTIONS = {\n apiEndpoint: 'api.amplitude.com',\n batchEvents: false,\n cookieExpiration: 365,\n // 12 months is for GDPR compliance\n cookieName: 'amplitude_id',\n // this is a deprecated option\n sameSiteCookie: 'Lax',\n // cookie privacy policy\n cookieForceUpgrade: false,\n deferInitialization: false,\n disableCookies: false,\n // this is a deprecated option\n deviceIdFromUrlParam: false,\n domain: '',\n eventUploadPeriodMillis: 30 * 1000,\n // 30s\n eventUploadThreshold: 30,\n forceHttps: true,\n includeFbclid: false,\n includeGclid: false,\n includeReferrer: false,\n includeUtm: false,\n language: language.getLanguage(),\n logLevel: 'WARN',\n logAttributionCapturedEvent: false,\n optOut: false,\n onError: function onError() {},\n onExitPage: function onExitPage() {},\n plan: {\n branch: '',\n source: '',\n version: ''\n },\n platform: 'Web',\n savedMaxCount: 1000,\n saveEvents: true,\n saveParamsReferrerOncePerSession: true,\n secureCookie: false,\n sessionTimeout: 30 * 60 * 1000,\n storage: Constants.STORAGE_DEFAULT,\n trackingOptions: {\n city: true,\n country: true,\n carrier: true,\n device_manufacturer: true,\n device_model: true,\n dma: true,\n ip_address: true,\n language: true,\n os_name: true,\n os_version: true,\n platform: true,\n region: true,\n version_name: true\n },\n transport: Constants.TRANSPORT_HTTP,\n unsetParamsReferrerOnNewSession: false,\n unsentKey: 'amplitude_unsent',\n unsentIdentifyKey: 'amplitude_unsent_identify',\n uploadBatchSize: 100,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n 'Cross-Origin-Resource-Policy': 'cross-origin'\n }\n };\n\n /**\n * AmplitudeClient SDK API - instance constructor.\n * The Amplitude class handles creation of client instances, all you need to do is call amplitude.getInstance()\n * @constructor AmplitudeClient\n * @public\n * @example var amplitudeClient = new AmplitudeClient();\n */\n\n var AmplitudeClient = function AmplitudeClient(instanceName) {\n if (!isBrowserEnv()) {\n utils.log.warn('amplitude-js will not work in a non-browser environment. If you are planning to add Amplitude to a node environment, please use @amplitude/node');\n }\n\n this._instanceName = utils.isEmptyString(instanceName) ? Constants.DEFAULT_INSTANCE : instanceName.toLowerCase();\n this._unsentEvents = [];\n this._unsentIdentifys = [];\n this._ua = new uaParser(navigator.userAgent).getResult();\n this.options = _objectSpread({}, DEFAULT_OPTIONS, {\n trackingOptions: _objectSpread({}, DEFAULT_OPTIONS.trackingOptions)\n });\n this.cookieStorage = new cookieStorage().getStorage();\n this._q = []; // queue for proxied functions before script load\n\n this._sending = false;\n this._updateScheduled = false;\n this._onInit = []; // event meta data\n\n this._eventId = 0;\n this._identifyId = 0;\n this._lastEventTime = null;\n this._newSession = false; // sequence used for by frontend for prioritizing event send retries\n\n this._sequenceNumber = 0;\n this._sessionId = null;\n this._isInitialized = false;\n this._userAgent = navigator && navigator.userAgent || null;\n };\n\n AmplitudeClient.prototype.Identify = Identify;\n AmplitudeClient.prototype.Revenue = Revenue;\n /**\n * Initializes the Amplitude Javascript SDK with your apiKey and any optional configurations.\n * This is required before any other methods can be called.\n * @public\n * @param {string} apiKey - The API key for your app.\n * @param {string} opt_userId - (optional) An identifier for this user.\n * @param {object} opt_config - (optional) Configuration options.\n * See [options.js](https://amplitude.github.io/Amplitude-JavaScript/Options) for a list of options and default values.\n * @param {function} opt_callback - (optional) Provide a callback function to run after initialization is complete.\n * @example amplitudeClient.init('API_KEY', 'USER_ID', {includeReferrer: true, includeUtm: true}, function() { alert('init complete'); });\n */\n\n AmplitudeClient.prototype.init = function init(apiKey, opt_userId, opt_config, opt_callback) {\n var _this = this;\n\n if (type(apiKey) !== 'string' || utils.isEmptyString(apiKey)) {\n utils.log.error('Invalid apiKey. Please re-initialize with a valid apiKey');\n return;\n }\n\n try {\n _parseConfig(this.options, opt_config);\n\n if (isBrowserEnv() && window.Prototype !== undefined && Array.prototype.toJSON) {\n prototypeJsFix();\n utils.log.warn('Prototype.js injected Array.prototype.toJSON. Deleting Array.prototype.toJSON to prevent double-stringify');\n }\n\n if (this.options.cookieName !== DEFAULT_OPTIONS.cookieName) {\n utils.log.warn('The cookieName option is deprecated. We will be ignoring it for newer cookies');\n }\n\n this.options.apiKey = apiKey;\n this._storageSuffix = '_' + apiKey + (this._instanceName === Constants.DEFAULT_INSTANCE ? '' : '_' + this._instanceName);\n this._storageSuffixV5 = apiKey.slice(0, 6);\n this._oldCookiename = this.options.cookieName + this._storageSuffix;\n this._unsentKey = this.options.unsentKey + this._storageSuffix;\n this._unsentIdentifyKey = this.options.unsentIdentifyKey + this._storageSuffix;\n this._cookieName = Constants.COOKIE_PREFIX + '_' + this._storageSuffixV5;\n this.cookieStorage.options({\n expirationDays: this.options.cookieExpiration,\n domain: this.options.domain,\n secure: this.options.secureCookie,\n sameSite: this.options.sameSiteCookie\n });\n this._metadataStorage = new MetadataStorage({\n storageKey: this._cookieName,\n disableCookies: this.options.disableCookies,\n expirationDays: this.options.cookieExpiration,\n domain: this.options.domain,\n secure: this.options.secureCookie,\n sameSite: this.options.sameSiteCookie,\n storage: this.options.storage\n });\n var hasOldCookie = !!this.cookieStorage.get(this._oldCookiename);\n var hasNewCookie = !!this._metadataStorage.load();\n this._useOldCookie = !hasNewCookie && hasOldCookie && !this.options.cookieForceUpgrade;\n var hasCookie = hasNewCookie || hasOldCookie;\n this.options.domain = this.cookieStorage.options().domain;\n\n if (this.options.deferInitialization && !hasCookie) {\n this._deferInitialization(apiKey, opt_userId, opt_config, opt_callback);\n\n return;\n }\n\n if (type(this.options.logLevel) === 'string') {\n utils.setLogLevel(this.options.logLevel);\n }\n\n var trackingOptions = _generateApiPropertiesTrackingConfig(this);\n\n this._apiPropertiesTrackingOptions = Object.keys(trackingOptions).length > 0 ? {\n tracking_options: trackingOptions\n } : {};\n\n if (this.options.cookieForceUpgrade && hasOldCookie) {\n if (!hasNewCookie) {\n _upgradeCookieData(this);\n }\n\n this.cookieStorage.remove(this._oldCookiename);\n }\n\n _loadCookieData(this);\n\n this._pendingReadStorage = true;\n\n var initFromStorage = function initFromStorage(storedDeviceId) {\n if (opt_config && opt_config.deviceId && !utils.validateDeviceId(opt_config.deviceId)) {\n utils.log.error(\"Invalid device ID rejected. Randomly generated UUID will be used instead of \\\"\".concat(opt_config.deviceId, \"\\\"\"));\n delete opt_config.deviceId;\n }\n\n _this.options.deviceId = _this._getInitialDeviceId(opt_config && opt_config.deviceId, storedDeviceId);\n _this.options.userId = type(opt_userId) === 'string' && !utils.isEmptyString(opt_userId) && opt_userId || type(opt_userId) === 'number' && opt_userId.toString() || _this.options.userId || null;\n var now = new Date().getTime();\n\n if (!_this._sessionId || !_this._lastEventTime || now - _this._lastEventTime > _this.options.sessionTimeout) {\n if (_this.options.unsetParamsReferrerOnNewSession) {\n _this._unsetUTMParams();\n }\n\n _this._newSession = true;\n _this._sessionId = now; // only capture UTM params and referrer if new session\n\n if (_this.options.saveParamsReferrerOncePerSession) {\n _this._trackParamsAndReferrer();\n }\n }\n\n if (!_this.options.saveParamsReferrerOncePerSession) {\n _this._trackParamsAndReferrer();\n } // load unsent events and identifies before any attempt to log new ones\n\n\n if (_this.options.saveEvents) {\n _validateUnsentEventQueue(_this._unsentEvents);\n\n _validateUnsentEventQueue(_this._unsentIdentifys);\n }\n\n _this._lastEventTime = now;\n\n _saveCookieData(_this);\n\n _this._pendingReadStorage = false;\n\n _this._sendEventsIfReady(); // try sending unsent events\n\n\n for (var i = 0; i < _this._onInit.length; i++) {\n _this._onInit[i](_this);\n }\n\n _this._onInit = [];\n _this._isInitialized = true;\n };\n\n if (this.options.saveEvents) {\n this._unsentEvents = this._loadSavedUnsentEvents(this.options.unsentKey).map(function (event) {\n return {\n event: event\n };\n }).concat(this._unsentEvents);\n this._unsentIdentifys = this._loadSavedUnsentEvents(this.options.unsentIdentifyKey).map(function (event) {\n return {\n event: event\n };\n }).concat(this._unsentIdentifys);\n }\n\n initFromStorage();\n this.runQueuedFunctions();\n\n if (type(opt_callback) === 'function') {\n opt_callback(this);\n }\n\n var onExitPage = this.options.onExitPage;\n\n if (type(onExitPage) === 'function') {\n if (!this.pageHandlersAdded) {\n this.pageHandlersAdded = true;\n\n var handleVisibilityChange = function handleVisibilityChange() {\n var prevTransport = _this.options.transport;\n\n _this.setTransport(Constants.TRANSPORT_BEACON);\n\n onExitPage();\n\n _this.setTransport(prevTransport);\n }; // Monitoring just page exits because that is the most requested feature for now\n // \"If you're specifically trying to detect page unload events, the pagehide event is the best option.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event\n\n\n window.addEventListener('pagehide', function () {\n handleVisibilityChange();\n }, false);\n }\n }\n } catch (err) {\n utils.log.error(err);\n\n if (type(opt_config.onError) === 'function') {\n opt_config.onError(err);\n }\n }\n };\n\n AmplitudeClient.prototype.deleteLowerLevelDomainCookies = function () {\n var host = getHost();\n var cookieHost = this.options.domain && this.options.domain[0] === '.' ? this.options.domain.slice(1) : this.options.domain;\n\n if (!cookieHost) {\n return;\n }\n\n if (host !== cookieHost) {\n if (new RegExp(cookieHost + '$').test(host)) {\n var hostParts = host.split('.');\n var cookieHostParts = cookieHost.split('.');\n\n for (var i = hostParts.length; i > cookieHostParts.length; --i) {\n var deleteDomain = hostParts.slice(hostParts.length - i).join('.');\n baseCookie.set(this._cookieName, null, {\n domain: '.' + deleteDomain\n });\n }\n\n baseCookie.set(this._cookieName, null, {});\n }\n }\n };\n\n AmplitudeClient.prototype._getInitialDeviceId = function (configDeviceId, storedDeviceId) {\n if (configDeviceId) {\n return configDeviceId;\n }\n\n if (this.options.deviceIdFromUrlParam) {\n var deviceIdFromUrlParam = this._getDeviceIdFromUrlParam(this._getUrlParams());\n\n if (deviceIdFromUrlParam) {\n return deviceIdFromUrlParam;\n }\n }\n\n if (this.options.deviceId) {\n return this.options.deviceId;\n }\n\n if (storedDeviceId) {\n return storedDeviceId;\n }\n\n return base64Id();\n }; // validate properties for unsent events\n\n\n var _validateUnsentEventQueue = function _validateUnsentEventQueue(queue) {\n for (var i = 0; i < queue.length; i++) {\n var userProperties = queue[i].event.user_properties;\n var eventProperties = queue[i].event.event_properties;\n var groups = queue[i].event.groups;\n queue[i].event.user_properties = utils.validateProperties(userProperties);\n queue[i].event.event_properties = utils.validateProperties(eventProperties);\n queue[i].event.groups = utils.validateGroups(groups);\n }\n };\n /**\n * @private\n */\n\n\n AmplitudeClient.prototype._trackParamsAndReferrer = function _trackParamsAndReferrer() {\n var utmProperties;\n var referrerProperties;\n var gclidProperties;\n var fbclidProperties;\n\n if (this.options.includeUtm) {\n utmProperties = this._initUtmData();\n }\n\n if (this.options.includeReferrer) {\n referrerProperties = this._saveReferrer(this._getReferrer());\n }\n\n if (this.options.includeGclid) {\n gclidProperties = this._saveGclid(this._getUrlParams());\n }\n\n if (this.options.includeFbclid) {\n fbclidProperties = this._saveFbclid(this._getUrlParams());\n }\n\n if (this.options.logAttributionCapturedEvent) {\n var attributionProperties = _objectSpread({}, utmProperties, referrerProperties, gclidProperties, fbclidProperties);\n\n if (Object.keys(attributionProperties).length > 0) {\n this.logEvent(Constants.ATTRIBUTION_EVENT, attributionProperties);\n }\n }\n };\n /**\n * Parse and validate user specified config values and overwrite existing option value\n * DEFAULT_OPTIONS provides list of all config keys that are modifiable, as well as expected types for values\n * @private\n */\n\n\n var _parseConfig = function _parseConfig(options, config) {\n if (type(config) !== 'object') {\n return;\n } // Add exception in headers\n\n\n var freeFormObjectKeys = new Set(['headers']); // validates config value is defined, is the correct type, and some additional value sanity checks\n\n var parseValidateAndLoad = function parseValidateAndLoad(key) {\n if (!Object.prototype.hasOwnProperty.call(options, key)) {\n return; // skip bogus config values\n }\n\n var inputValue = config[key];\n var expectedType = type(options[key]);\n\n if (key === 'transport' && !utils.validateTransport(inputValue)) {\n return;\n } else if (!utils.validateInput(inputValue, key + ' option', expectedType)) {\n return;\n }\n\n if (expectedType === 'boolean') {\n options[key] = !!inputValue;\n } else if (expectedType === 'string' && !utils.isEmptyString(inputValue) || expectedType === 'number' && inputValue > 0 || expectedType === 'function') {\n options[key] = inputValue;\n } else if (expectedType === 'object') {\n _parseConfig(options[key], inputValue);\n }\n };\n\n for (var key in config) {\n if (freeFormObjectKeys.has(key)) {\n options[key] = _objectSpread({}, options[key], config[key]);\n } else if (Object.prototype.hasOwnProperty.call(config, key)) {\n parseValidateAndLoad(key);\n }\n }\n };\n /**\n * Run functions queued up by proxy loading snippet\n * @private\n */\n\n\n AmplitudeClient.prototype.runQueuedFunctions = function () {\n var queue = this._q;\n this._q = [];\n\n for (var i = 0; i < queue.length; i++) {\n var fn = this[queue[i][0]];\n\n if (type(fn) === 'function') {\n fn.apply(this, queue[i].slice(1));\n }\n }\n };\n /**\n * Check that the apiKey is set before calling a function. Logs a warning message if not set.\n * @private\n */\n\n\n AmplitudeClient.prototype._apiKeySet = function _apiKeySet(methodName) {\n if (utils.isEmptyString(this.options.apiKey)) {\n utils.log.error('Invalid apiKey. Please set a valid apiKey with init() before calling ' + methodName);\n return false;\n }\n\n return true;\n };\n /**\n * Load saved events from localStorage. JSON deserializes event array. Handles case where string is corrupted.\n * @private\n */\n\n\n AmplitudeClient.prototype._loadSavedUnsentEvents = function _loadSavedUnsentEvents(unsentKey) {\n var savedUnsentEventsString = this._getFromStorage(ampLocalStorage, unsentKey);\n\n var unsentEvents = this._parseSavedUnsentEventsString(savedUnsentEventsString, unsentKey);\n\n this._setInStorage(ampLocalStorage, unsentKey, JSON.stringify(unsentEvents));\n\n return unsentEvents;\n };\n /**\n * Load saved events from localStorage. JSON deserializes event array. Handles case where string is corrupted.\n * @private\n */\n\n\n AmplitudeClient.prototype._parseSavedUnsentEventsString = function _parseSavedUnsentEventsString(savedUnsentEventsString, unsentKey) {\n if (utils.isEmptyString(savedUnsentEventsString)) {\n return []; // new app, does not have any saved events\n }\n\n if (type(savedUnsentEventsString) === 'string') {\n try {\n var events = JSON.parse(savedUnsentEventsString);\n\n if (type(events) === 'array') {\n // handle case where JSON dumping of unsent events is corrupted\n return events;\n }\n } catch (e) {}\n /* eslint-disable-line no-empty */\n\n }\n\n utils.log.error('Unable to load ' + unsentKey + ' events. Restart with a new empty queue.');\n return [];\n };\n /**\n * Returns true if a new session was created during initialization, otherwise false.\n * @public\n * @return {boolean} Whether a new session was created during initialization.\n */\n\n\n AmplitudeClient.prototype.isNewSession = function isNewSession() {\n return this._newSession;\n };\n /**\n * Add callbacks to call after init. Useful for users who load Amplitude through a snippet.\n * @public\n */\n\n\n AmplitudeClient.prototype.onInit = function (callback) {\n if (this._isInitialized) {\n callback(this);\n } else {\n this._onInit.push(callback);\n }\n };\n /**\n * Returns the id of the current session.\n * @public\n * @return {number} Id of the current session.\n */\n\n\n AmplitudeClient.prototype.getSessionId = function getSessionId() {\n return this._sessionId;\n };\n /**\n * Increments the eventId and returns it.\n * @private\n */\n\n\n AmplitudeClient.prototype.nextEventId = function nextEventId() {\n this._eventId++;\n return this._eventId;\n };\n /**\n * Increments the identifyId and returns it.\n * @private\n */\n\n\n AmplitudeClient.prototype.nextIdentifyId = function nextIdentifyId() {\n this._identifyId++;\n return this._identifyId;\n };\n /**\n * Increments the sequenceNumber and returns it.\n * @private\n */\n\n\n AmplitudeClient.prototype.nextSequenceNumber = function nextSequenceNumber() {\n this._sequenceNumber++;\n return this._sequenceNumber;\n };\n /**\n * Returns the total count of unsent events and identifys\n * @private\n */\n\n\n AmplitudeClient.prototype._unsentCount = function _unsentCount() {\n return this._unsentEvents.length + this._unsentIdentifys.length;\n };\n /**\n * Send events if ready. Returns true if events are sent.\n * @private\n */\n\n\n AmplitudeClient.prototype._sendEventsIfReady = function _sendEventsIfReady() {\n if (this._unsentCount() === 0) {\n return false;\n } // if batching disabled, send any unsent events immediately\n\n\n if (!this.options.batchEvents) {\n this.sendEvents();\n return true;\n } // if batching enabled, check if min threshold met for batch size\n\n\n if (this._unsentCount() >= this.options.eventUploadThreshold) {\n this.sendEvents();\n return true;\n } // if beacon transport is activated, send events immediately\n // because there is no way to retry them later\n\n\n if (this.options.transport === Constants.TRANSPORT_BEACON) {\n this.sendEvents();\n return true;\n } // otherwise schedule an upload after 30s\n\n\n if (!this._updateScheduled) {\n // make sure we only schedule 1 upload\n this._updateScheduled = true;\n setTimeout(function () {\n this._updateScheduled = false;\n this.sendEvents();\n }.bind(this), this.options.eventUploadPeriodMillis);\n }\n\n return false; // an upload was scheduled, no events were uploaded\n };\n /**\n * Clears any stored events and metadata. Storage is then re-created on next event sending.\n * @public\n * @return {boolean} True if metadata was cleared, false if none existed\n */\n\n\n AmplitudeClient.prototype.clearStorage = function clearStorage() {\n return this._metadataStorage.clear();\n };\n /**\n * Helper function to fetch values from storage\n * Storage argument allows for localStoraoge and sessionStoraoge\n * @private\n */\n\n\n AmplitudeClient.prototype._getFromStorage = function _getFromStorage(storage, key) {\n return storage.getItem(key + this._storageSuffix);\n };\n /**\n * Helper function to set values in storage\n * Storage argument allows for localStoraoge and sessionStoraoge\n * @private\n */\n\n\n AmplitudeClient.prototype._setInStorage = function _setInStorage(storage, key, value) {\n storage.setItem(key + this._storageSuffix, value);\n };\n /**\n * Fetches deviceId, userId, event meta data from amplitude cookie\n * @private\n */\n\n\n var _loadCookieData = function _loadCookieData(scope) {\n if (!scope._useOldCookie) {\n var props = scope._metadataStorage.load();\n\n if (type(props) === 'object') {\n _loadCookieDataProps(scope, props);\n }\n\n return;\n }\n\n var cookieData = scope.cookieStorage.get(scope._oldCookiename);\n\n if (type(cookieData) === 'object') {\n _loadCookieDataProps(scope, cookieData);\n\n return;\n }\n };\n\n var _upgradeCookieData = function _upgradeCookieData(scope) {\n var cookieData = scope.cookieStorage.get(scope._oldCookiename);\n\n if (type(cookieData) === 'object') {\n _loadCookieDataProps(scope, cookieData);\n\n _saveCookieData(scope);\n }\n };\n\n var _loadCookieDataProps = function _loadCookieDataProps(scope, cookieData) {\n if (cookieData.deviceId) {\n scope.options.deviceId = cookieData.deviceId;\n }\n\n if (cookieData.userId) {\n scope.options.userId = cookieData.userId;\n }\n\n if (cookieData.optOut !== null && cookieData.optOut !== undefined) {\n // Do not clobber config opt out value if cookieData has optOut as false\n if (cookieData.optOut !== false) {\n scope.options.optOut = cookieData.optOut;\n }\n }\n\n if (cookieData.sessionId) {\n scope._sessionId = parseInt(cookieData.sessionId, 10);\n }\n\n if (cookieData.lastEventTime) {\n scope._lastEventTime = parseInt(cookieData.lastEventTime, 10);\n }\n\n if (cookieData.eventId) {\n scope._eventId = parseInt(cookieData.eventId, 10);\n }\n\n if (cookieData.identifyId) {\n scope._identifyId = parseInt(cookieData.identifyId, 10);\n }\n\n if (cookieData.sequenceNumber) {\n scope._sequenceNumber = parseInt(cookieData.sequenceNumber, 10);\n }\n };\n /**\n * Saves deviceId, userId, event meta data to amplitude cookie\n * @private\n */\n\n\n var _saveCookieData = function _saveCookieData(scope) {\n var cookieData = {\n deviceId: scope.options.deviceId,\n userId: scope.options.userId,\n optOut: scope.options.optOut,\n sessionId: scope._sessionId,\n lastEventTime: scope._lastEventTime,\n eventId: scope._eventId,\n identifyId: scope._identifyId,\n sequenceNumber: scope._sequenceNumber\n };\n\n if (scope._useOldCookie) {\n scope.cookieStorage.set(scope.options.cookieName + scope._storageSuffix, cookieData);\n } else {\n scope._metadataStorage.save(cookieData);\n }\n };\n /**\n * Parse the utm properties out of cookies and query for adding to user properties.\n * @private\n */\n\n\n AmplitudeClient.prototype._initUtmData = function _initUtmData(queryParams, cookieParams) {\n queryParams = queryParams || this._getUrlParams();\n cookieParams = cookieParams || this.cookieStorage.get('__utmz');\n var utmProperties = getUtmData(cookieParams, queryParams);\n\n _sendParamsReferrerUserProperties(this, utmProperties);\n\n return utmProperties;\n };\n /**\n * Unset the utm params from the Amplitude instance and update the identify.\n * @private\n */\n\n\n AmplitudeClient.prototype._unsetUTMParams = function _unsetUTMParams() {\n var identify = new Identify();\n identify.unset(Constants.REFERRER);\n identify.unset(Constants.UTM_SOURCE);\n identify.unset(Constants.UTM_MEDIUM);\n identify.unset(Constants.UTM_CAMPAIGN);\n identify.unset(Constants.UTM_TERM);\n identify.unset(Constants.UTM_CONTENT);\n this.identify(identify);\n };\n /**\n * The calling function should determine when it is appropriate to send these user properties. This function\n * will no longer contain any session storage checking logic.\n * @private\n */\n\n\n var _sendParamsReferrerUserProperties = function _sendParamsReferrerUserProperties(scope, userProperties) {\n if (type(userProperties) !== 'object' || Object.keys(userProperties).length === 0) {\n return;\n } // setOnce the initial user properties\n\n\n var identify = new Identify();\n\n for (var key in userProperties) {\n if (Object.prototype.hasOwnProperty.call(userProperties, key)) {\n identify.setOnce('initial_' + key, userProperties[key]);\n identify.set(key, userProperties[key]);\n }\n }\n\n scope.identify(identify);\n };\n /**\n * @private\n */\n\n\n AmplitudeClient.prototype._getReferrer = function _getReferrer() {\n return document.referrer;\n };\n /**\n * @private\n */\n\n\n AmplitudeClient.prototype._getUrlParams = function _getUrlParams() {\n return location.search;\n };\n /**\n * Try to fetch Google Gclid from url params.\n * @private\n */\n\n\n AmplitudeClient.prototype._saveGclid = function _saveGclid(urlParams) {\n var gclid = utils.getQueryParam('gclid', urlParams);\n\n if (utils.isEmptyString(gclid)) {\n return;\n }\n\n var gclidProperties = {\n gclid: gclid\n };\n\n _sendParamsReferrerUserProperties(this, gclidProperties);\n\n return gclidProperties;\n };\n /**\n * Try to fetch Facebook Fbclid from url params.\n * @private\n */\n\n\n AmplitudeClient.prototype._saveFbclid = function _saveFbclid(urlParams) {\n var fbclid = utils.getQueryParam('fbclid', urlParams);\n\n if (utils.isEmptyString(fbclid)) {\n return;\n }\n\n var fbclidProperties = {\n fbclid: fbclid\n };\n\n _sendParamsReferrerUserProperties(this, fbclidProperties);\n\n return fbclidProperties;\n };\n /**\n * Try to fetch Amplitude device id from url params.\n * @private\n */\n\n\n AmplitudeClient.prototype._getDeviceIdFromUrlParam = function _getDeviceIdFromUrlParam(urlParams) {\n return utils.getQueryParam(Constants.AMP_DEVICE_ID_PARAM, urlParams);\n };\n /**\n * Parse the domain from referrer info\n * @private\n */\n\n\n AmplitudeClient.prototype._getReferringDomain = function _getReferringDomain(referrer) {\n if (utils.isEmptyString(referrer)) {\n return null;\n }\n\n var parts = referrer.split('/');\n\n if (parts.length >= 3) {\n return parts[2];\n }\n\n return null;\n };\n /**\n * Fetch the referrer information, parse the domain and send.\n * Since user properties are propagated on the server, only send once per session, don't need to send with every event\n * @private\n */\n\n\n AmplitudeClient.prototype._saveReferrer = function _saveReferrer(referrer) {\n if (utils.isEmptyString(referrer)) {\n return;\n }\n\n var referrerInfo = {\n referrer: referrer,\n referring_domain: this._getReferringDomain(referrer)\n };\n\n _sendParamsReferrerUserProperties(this, referrerInfo);\n\n return referrerInfo;\n };\n /**\n * Saves unsent events and identifies to localStorage. JSON stringifies event queues before saving.\n * Note: this is called automatically every time events are logged, unless you explicitly set option saveEvents to false.\n * @private\n */\n\n\n AmplitudeClient.prototype.saveEvents = function saveEvents() {\n try {\n var serializedUnsentEvents = JSON.stringify(this._unsentEvents.map(function (_ref) {\n var event = _ref.event;\n return event;\n }));\n\n this._setInStorage(ampLocalStorage, this.options.unsentKey, serializedUnsentEvents);\n } catch (e) {}\n /* eslint-disable-line no-empty */\n\n\n try {\n var serializedIdentifys = JSON.stringify(this._unsentIdentifys.map(function (unsentIdentify) {\n return unsentIdentify.event;\n }));\n\n this._setInStorage(ampLocalStorage, this.options.unsentIdentifyKey, serializedIdentifys);\n } catch (e) {}\n /* eslint-disable-line no-empty */\n\n };\n /**\n * Sets a customer domain for the amplitude cookie. Useful if you want to support cross-subdomain tracking.\n * @public\n * @param {string} domain to set.\n * @example amplitudeClient.setDomain('.amplitude.com');\n */\n\n\n AmplitudeClient.prototype.setDomain = function setDomain(domain) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setDomain'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!utils.validateInput(domain, 'domain', 'string')) {\n return;\n }\n\n try {\n this.cookieStorage.options({\n expirationDays: this.options.cookieExpiration,\n secure: this.options.secureCookie,\n domain: domain,\n sameSite: this.options.sameSiteCookie\n });\n this.options.domain = this.cookieStorage.options().domain;\n\n _loadCookieData(this);\n\n _saveCookieData(this);\n } catch (e) {\n utils.log.error(e);\n }\n };\n /**\n * Sets an identifier for the current user.\n * @public\n * @param {string} userId - identifier to set. Can be null.\n * @example amplitudeClient.setUserId('joe@gmail.com');\n */\n\n\n AmplitudeClient.prototype.setUserId = function setUserId(userId) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setUserId'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n try {\n this.options.userId = userId !== undefined && userId !== null && '' + userId || null;\n\n _saveCookieData(this);\n } catch (e) {\n utils.log.error(e);\n }\n };\n /**\n * Add user to a group or groups. You need to specify a groupType and groupName(s).\n *\n * For example you can group people by their organization.\n * In that case, groupType is \"orgId\" and groupName would be the actual ID(s).\n * groupName can be a string or an array of strings to indicate a user in multiple gruups.\n * You can also call setGroup multiple times with different groupTypes to track multiple types of groups (up to 5 per app).\n *\n * Note: this will also set groupType: groupName as a user property.\n * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information.\n * @public\n * @param {string} groupType - the group type (ex: orgId)\n * @param {string|list} groupName - the name of the group (ex: 15), or a list of names of the groups\n * @example amplitudeClient.setGroup('orgId', 15); // this adds the current user to orgId 15.\n */\n\n\n AmplitudeClient.prototype.setGroup = function (groupType, groupName) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setGroup'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('setGroup()') || !utils.validateInput(groupType, 'groupType', 'string') || utils.isEmptyString(groupType)) {\n return;\n }\n\n var groups = {};\n groups[groupType] = groupName;\n var identify = new Identify().set(groupType, groupName);\n\n this._logEvent(Constants.IDENTIFY_EVENT, null, null, identify.userPropertiesOperations, groups, null, null, null);\n };\n /**\n * Sets whether to opt current user out of tracking.\n * @public\n * @param {boolean} enable - if true then no events will be logged or sent.\n * @example: amplitude.setOptOut(true);\n */\n\n\n AmplitudeClient.prototype.setOptOut = function setOptOut(enable) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setOptOut'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!utils.validateInput(enable, 'enable', 'boolean')) {\n return;\n }\n\n try {\n this.options.optOut = enable;\n\n _saveCookieData(this);\n } catch (e) {\n utils.log.error(e);\n }\n };\n /**\n * Set a custom Session ID for the current session.\n * Note: This is not recommended unless you know what you are doing because the Session ID of a session is utilized for all session metrics in Amplitude.\n * The Session ID to set for the current session must be in milliseconds since epoch (Unix Timestamp).\n * @public\n * @param {int} sessionId to set.\n * @example amplitudeClient.setSessionId(1622158968000);\n */\n\n\n AmplitudeClient.prototype.setSessionId = function setSessionId(sessionId) {\n if (!utils.validateInput(sessionId, 'sessionId', 'number')) {\n return;\n }\n\n try {\n this._sessionId = sessionId;\n\n _saveCookieData(this);\n } catch (e) {\n utils.log.error(e);\n }\n };\n\n AmplitudeClient.prototype.resetSessionId = function resetSessionId() {\n this.setSessionId(new Date().getTime());\n };\n /**\n * Regenerates a new random deviceId for current user. Note: this is not recommended unless you know what you\n * are doing. This can be used in conjunction with `setUserId(null)` to anonymize users after they log out.\n * With a null userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n * This uses src/uuid.js to regenerate the deviceId.\n * @public\n */\n\n\n AmplitudeClient.prototype.regenerateDeviceId = function regenerateDeviceId() {\n if (this._shouldDeferCall()) {\n return this._q.push(['regenerateDeviceId'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n this.setDeviceId(base64Id());\n };\n /**\n * Sets a custom deviceId for current user. **Values may not have `.` inside them**\n * Note: this is not recommended unless you know what you are doing (like if you have your own system for managing deviceIds).\n * Make sure the deviceId you set is sufficiently unique\n * (we recommend something like a UUID - see src/uuid.js for an example of how to generate) to prevent conflicts with other devices in our system.\n * @public\n * @param {string} deviceId - custom deviceId for current user.\n * @example amplitudeClient.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0');\n */\n\n\n AmplitudeClient.prototype.setDeviceId = function setDeviceId(deviceId) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setDeviceId'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!utils.validateDeviceId(deviceId)) {\n return;\n }\n\n try {\n if (!utils.isEmptyString(deviceId)) {\n this.options.deviceId = '' + deviceId;\n\n _saveCookieData(this);\n }\n } catch (e) {\n utils.log.error(e);\n }\n };\n /**\n * Sets the network transport type for events. Typically used to set to 'beacon'\n * on an end-of-lifecycle event handler such as `onpagehide` or `onvisibilitychange`\n * @public\n * @param {string} transport - transport mechanism to use for events. Must be one of `http` or `beacon`.\n * @example amplitudeClient.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0');\n */\n\n\n AmplitudeClient.prototype.setTransport = function setTransport(transport) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setTransport'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!utils.validateTransport(transport)) {\n return;\n }\n\n this.options.transport = transport;\n };\n /**\n * Sets user properties for the current user.\n * @public\n * @param {object} - object with string keys and values for the user properties to set.\n * @param {boolean} - DEPRECATED opt_replace: in earlier versions of the JS SDK the user properties object was kept in\n * memory and replace = true would replace the object in memory. Now the properties are no longer stored in memory, so replace is deprecated.\n * @example amplitudeClient.setUserProperties({'gender': 'female', 'sign_up_complete': true})\n */\n\n\n AmplitudeClient.prototype.setUserProperties = function setUserProperties(userProperties) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setUserProperties'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('setUserProperties()') || !utils.validateInput(userProperties, 'userProperties', 'object')) {\n return;\n } // sanitize the userProperties dict before converting into identify\n\n\n var sanitized = utils.truncate(utils.validateProperties(userProperties));\n\n if (Object.keys(sanitized).length === 0) {\n return;\n } // convert userProperties into an identify call\n\n\n var identify = new Identify();\n\n for (var property in sanitized) {\n if (Object.prototype.hasOwnProperty.call(sanitized, property)) {\n identify.set(property, sanitized[property]);\n }\n }\n\n this.identify(identify);\n };\n /**\n * Clear all of the user properties for the current user. Note: clearing user properties is irreversible!\n * @public\n * @example amplitudeClient.clearUserProperties();\n */\n\n\n AmplitudeClient.prototype.clearUserProperties = function clearUserProperties() {\n if (this._shouldDeferCall()) {\n return this._q.push(['clearUserProperties'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('clearUserProperties()')) {\n return;\n }\n\n var identify = new Identify();\n identify.clearAll();\n this.identify(identify);\n };\n /**\n * Applies the proxied functions on the proxied object to an instance of the real object.\n * Used to convert proxied Identify and Revenue objects.\n * @private\n */\n\n\n var _convertProxyObjectToRealObject = function _convertProxyObjectToRealObject(instance, proxy) {\n for (var i = 0; i < proxy._q.length; i++) {\n var fn = instance[proxy._q[i][0]];\n\n if (type(fn) === 'function') {\n fn.apply(instance, proxy._q[i].slice(1));\n }\n }\n\n return instance;\n };\n /**\n * Send an identify call containing user property operations to Amplitude servers.\n * See the [Identify](https://amplitude.github.io/Amplitude-JavaScript/Identify/)\n * reference page for more information on the Identify API and user property operations.\n * @param {Identify} identify_obj - the Identify object containing the user property operations to send.\n * @param {Amplitude~eventCallback} opt_callback - (optional) callback function to run when the identify event has been sent.\n * Note: the server response code and response body from the identify event upload are passed to the callback function.\n * @param {Amplitude~eventCallback} opt_error_callback - (optional) a callback function to run after the event logging\n * fails. The failure can be from the request being malformed or from a network failure\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @example\n * var identify = new amplitude.Identify().set('colors', ['rose', 'gold']).add('karma', 1).setOnce('sign_up_date', '2016-03-31');\n * amplitude.identify(identify);\n */\n\n\n AmplitudeClient.prototype.identify = function (identify_obj, opt_callback, opt_error_callback) {\n if (this._shouldDeferCall()) {\n return this._q.push(['identify'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('identify()')) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'API key is not set'\n });\n\n return;\n } // if identify input is a proxied object created by the async loading snippet, convert it into an identify object\n\n\n if (type(identify_obj) === 'object' && Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {\n identify_obj = _convertProxyObjectToRealObject(new Identify(), identify_obj);\n }\n\n if (identify_obj instanceof Identify) {\n // only send if there are operations\n if (Object.keys(identify_obj.userPropertiesOperations).length > 0) {\n return this._logEvent(Constants.IDENTIFY_EVENT, null, null, identify_obj.userPropertiesOperations, null, null, null, opt_callback, opt_error_callback);\n } else {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'No user property operations'\n });\n }\n } else {\n utils.log.error('Invalid identify input type. Expected Identify object but saw ' + type(identify_obj));\n\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Invalid identify input type'\n });\n }\n };\n\n AmplitudeClient.prototype.groupIdentify = function (group_type, group_name, identify_obj, opt_callback, opt_error_callback) {\n if (this._shouldDeferCall()) {\n return this._q.push(['groupIdentify'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('groupIdentify()')) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'API key is not set'\n });\n\n return;\n }\n\n if (!utils.validateInput(group_type, 'group_type', 'string') || utils.isEmptyString(group_type)) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Invalid group type'\n });\n\n return;\n }\n\n if (group_name === null || group_name === undefined) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Invalid group name'\n });\n\n return;\n } // if identify input is a proxied object created by the async loading snippet, convert it into an identify object\n\n\n if (type(identify_obj) === 'object' && Object.prototype.hasOwnProperty.call(identify_obj, '_q')) {\n identify_obj = _convertProxyObjectToRealObject(new Identify(), identify_obj);\n }\n\n if (identify_obj instanceof Identify) {\n // only send if there are operations\n if (Object.keys(identify_obj.userPropertiesOperations).length > 0) {\n return this._logEvent(Constants.GROUP_IDENTIFY_EVENT, null, null, null, _defineProperty({}, group_type, group_name), identify_obj.userPropertiesOperations, null, opt_callback, opt_error_callback);\n } else {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'No group property operations'\n });\n }\n } else {\n utils.log.error('Invalid identify input type. Expected Identify object but saw ' + type(identify_obj));\n\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Invalid identify input type'\n });\n }\n };\n /**\n * Set a versionName for your application.\n * @public\n * @param {string} versionName - The version to set for your application.\n * @example amplitudeClient.setVersionName('1.12.3');\n */\n\n\n AmplitudeClient.prototype.setVersionName = function setVersionName(versionName) {\n if (this._shouldDeferCall()) {\n return this._q.push(['setVersionName'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!utils.validateInput(versionName, 'versionName', 'string')) {\n return;\n }\n\n this.options.versionName = versionName;\n };\n /**\n * Private logEvent method. Keeps apiProperties from being publicly exposed.\n * @private\n */\n\n\n AmplitudeClient.prototype._logEvent = function _logEvent(eventType, eventProperties, apiProperties, userProperties, groups, groupProperties, timestamp, callback, errorCallback) {\n _loadCookieData(this); // reload cookie before each log event to sync event meta-data between windows and tabs\n\n\n if (!eventType) {\n _logErrorsWithCallbacks(callback, errorCallback, 0, 'No request sent', {\n reason: 'Missing eventType'\n });\n\n return;\n }\n\n if (this.options.optOut) {\n _logErrorsWithCallbacks(callback, errorCallback, 0, 'No request sent', {\n reason: 'optOut is set to true'\n });\n\n return;\n }\n\n try {\n var eventId;\n\n if (eventType === Constants.IDENTIFY_EVENT || eventType === Constants.GROUP_IDENTIFY_EVENT) {\n eventId = this.nextIdentifyId();\n } else {\n eventId = this.nextEventId();\n }\n\n var sequenceNumber = this.nextSequenceNumber();\n var eventTime = type(timestamp) === 'number' ? timestamp : new Date().getTime();\n\n if (!this._sessionId || !this._lastEventTime || eventTime - this._lastEventTime > this.options.sessionTimeout) {\n this._sessionId = eventTime;\n }\n\n this._lastEventTime = eventTime;\n\n _saveCookieData(this);\n\n var osName = this._ua.browser.name;\n var osVersion = this._ua.browser.major;\n var deviceModel = this._ua.device.model || this._ua.os.name;\n var deviceVendor = this._ua.device.vendor;\n userProperties = userProperties || {};\n\n var trackingOptions = _objectSpread({}, this._apiPropertiesTrackingOptions);\n\n apiProperties = _objectSpread({}, apiProperties || {}, trackingOptions);\n eventProperties = eventProperties || {};\n groups = groups || {};\n groupProperties = groupProperties || {};\n var event = {\n device_id: this.options.deviceId,\n user_id: this.options.userId,\n timestamp: eventTime,\n event_id: eventId,\n session_id: this._sessionId || -1,\n event_type: eventType,\n version_name: this.options.versionName || null,\n platform: _shouldTrackField(this, 'platform') ? this.options.platform : null,\n os_name: _shouldTrackField(this, 'os_name') ? osName || null : null,\n os_version: _shouldTrackField(this, 'os_version') ? osVersion || null : null,\n device_model: _shouldTrackField(this, 'device_model') ? deviceModel || null : null,\n device_manufacturer: _shouldTrackField(this, 'device_manufacturer') ? deviceVendor || null : null,\n language: _shouldTrackField(this, 'language') ? this.options.language : null,\n api_properties: apiProperties,\n event_properties: utils.truncate(utils.validateProperties(eventProperties)),\n user_properties: utils.truncate(utils.validateProperties(userProperties)),\n uuid: uuid(),\n library: {\n name: 'amplitude-js',\n version: version\n },\n sequence_number: sequenceNumber,\n // for ordering events and identifys\n groups: utils.truncate(utils.validateGroups(groups)),\n group_properties: utils.truncate(utils.validateProperties(groupProperties)),\n user_agent: this._userAgent\n };\n\n if (_isObservePlanSet(this)) {\n event.plan = {\n branch: this.options.plan.branch || undefined,\n source: this.options.plan.source || undefined,\n version: this.options.plan.version || undefined\n };\n }\n\n if (eventType === Constants.IDENTIFY_EVENT || eventType === Constants.GROUP_IDENTIFY_EVENT) {\n this._unsentIdentifys.push({\n event: event,\n callback: callback,\n errorCallback: errorCallback\n });\n\n this._limitEventsQueued(this._unsentIdentifys);\n } else {\n this._unsentEvents.push({\n event: event,\n callback: callback,\n errorCallback: errorCallback\n });\n\n this._limitEventsQueued(this._unsentEvents);\n }\n\n if (this.options.saveEvents) {\n this.saveEvents();\n }\n\n this._sendEventsIfReady();\n\n return eventId;\n } catch (e) {\n utils.log.error(e);\n }\n };\n\n var _isObservePlanSet = function _isObservePlanSet(scope) {\n return scope.options.plan && (scope.options.plan.source || scope.options.plan.branch || scope.options.plan.version);\n };\n\n var _shouldTrackField = function _shouldTrackField(scope, field) {\n return !!scope.options.trackingOptions[field];\n };\n\n var _generateApiPropertiesTrackingConfig = function _generateApiPropertiesTrackingConfig(scope) {\n // to limit size of config payload, only send fields that have been disabled\n var fields = ['city', 'country', 'dma', 'ip_address', 'region'];\n var config = {};\n\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n\n if (!_shouldTrackField(scope, field)) {\n config[field] = false;\n }\n }\n\n return config;\n };\n /**\n * Remove old events from the beginning of the array if too many have accumulated. Default limit is 1000 events.\n * @private\n */\n\n\n AmplitudeClient.prototype._limitEventsQueued = function _limitEventsQueued(queue) {\n if (queue.length > this.options.savedMaxCount) {\n var deletedEvents = queue.splice(0, queue.length - this.options.savedMaxCount);\n deletedEvents.forEach(function (event) {\n _logErrorsWithCallbacks(event.callback, event.errorCallback, 0, 'No request sent', {\n reason: 'Event dropped because options.savedMaxCount exceeded. User may be offline or have a content blocker'\n });\n });\n }\n };\n /**\n * This is the callback for logEvent and identify calls. It gets called after the event/identify is uploaded,\n * and the server response code and response body from the upload request are passed to the callback function.\n * @callback Amplitude~eventCallback\n * @param {number} responseCode - Server response code for the event / identify upload request.\n * @param {string} responseBody - Server response body for the event / identify upload request.\n * @param {object} details - (optional) Additional information associated with sending event.\n */\n\n /**\n * Log an event with eventType and eventProperties\n * @public\n * @param {string} eventType - name of event\n * @param {object} eventProperties - (optional) an object with string keys and values for the event properties.\n * @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @param {Amplitude~eventCallback} opt_error_callback - (optional) a callback function to run after the event logging\n * fails. The failure can be from the request being malformed or from a network failure\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @example amplitudeClient.logEvent('Clicked Homepage Button', {'finished_flow': false, 'clicks': 15});\n */\n\n\n AmplitudeClient.prototype.logEvent = function logEvent(eventType, eventProperties, opt_callback, opt_error_callback) {\n if (this._shouldDeferCall()) {\n return this._q.push(['logEvent'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n return this.logEventWithTimestamp(eventType, eventProperties, null, opt_callback, opt_error_callback);\n };\n /**\n * Log an event with eventType and eventProperties and a custom timestamp\n * @public\n * @param {string} eventType - name of event\n * @param {object} eventProperties - (optional) an object with string keys and values for the event properties.\n * @param {number} timestamp - (optional) the custom timestamp as milliseconds since epoch.\n * @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @param {Amplitude~eventCallback} opt_error_callback - (optional) a callback function to run after the event logging\n * fails. The failure can be from the request being malformed or from a network failure\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @example amplitudeClient.logEvent('Clicked Homepage Button', {'finished_flow': false, 'clicks': 15});\n */\n\n\n AmplitudeClient.prototype.logEventWithTimestamp = function logEvent(eventType, eventProperties, timestamp, opt_callback, opt_error_callback) {\n if (this._shouldDeferCall()) {\n return this._q.push(['logEventWithTimestamp'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('logEvent()')) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'API key not set'\n });\n\n return -1;\n }\n\n if (!utils.validateInput(eventType, 'eventType', 'string')) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Invalid type for eventType'\n });\n\n return -1;\n }\n\n if (utils.isEmptyString(eventType)) {\n _logErrorsWithCallbacks(opt_callback, opt_error_callback, 0, 'No request sent', {\n reason: 'Missing eventType'\n });\n\n return -1;\n }\n\n return this._logEvent(eventType, eventProperties, null, null, null, null, timestamp, opt_callback, opt_error_callback);\n };\n /**\n * Log an event with eventType, eventProperties, and groups. Use this to set event-level groups.\n * Note: the group(s) set only apply for the specific event type being logged and does not persist on the user\n * (unless you explicitly set it with setGroup).\n *\n * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information.\n * about groups and Count by Distinct on the Amplitude platform.\n * @public\n * @param {string} eventType - name of event\n * @param {object} eventProperties - (optional) an object with string keys and values for the event properties.\n * @param {object} groups - (optional) an object with string groupType: groupName values for the event being logged.\n * groupName can be a string or an array of strings.\n * @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @param {Amplitude~eventCallback} opt_error_callback - (optional) a callback function to run after the event logging\n * fails. The failure can be from the request being malformed or from a network failure\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @example amplitudeClient.logEventWithGroups('Clicked Button', null, {'orgId': 24});\n */\n\n\n AmplitudeClient.prototype.logEventWithGroups = function (eventType, eventProperties, groups, opt_callback, opt_error_callback) {\n if (this._shouldDeferCall()) {\n return this._q.push(['logEventWithGroups'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('logEventWithGroups()')) {\n _logErrorsWithCallbacks(event.callback, event.errorCallback, 0, 'No request sent', {\n reason: 'API key not set'\n });\n\n return -1;\n }\n\n if (!utils.validateInput(eventType, 'eventType', 'string')) {\n _logErrorsWithCallbacks(event.callback, event.errorCallback, 0, 'No request sent', {\n reason: 'Invalid type for eventType'\n });\n\n return -1;\n }\n\n return this._logEvent(eventType, eventProperties, null, null, groups, null, null, opt_callback, opt_error_callback);\n };\n /**\n * Test that n is a number or a numeric value.\n * @private\n */\n\n\n var _isNumber = function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n };\n /**\n * Handles errors that are sent to both callbacks\n * @private\n */\n\n\n var _logErrorsWithCallbacks = function _logErrorsWithCallbacks(opt_callback, opt_error_callback, status, response, details) {\n if (type(opt_callback) === 'function') {\n opt_callback(status, response, details);\n }\n\n if (type(opt_error_callback) === 'function') {\n opt_error_callback(status, response, details);\n }\n };\n /**\n * Log revenue with Revenue interface. The new revenue interface allows for more revenue fields like\n * revenueType and event properties.\n *\n * See the [Revenue](https://amplitude.github.io/Amplitude-JavaScript/Revenue/)\n * reference page for more information on the Revenue interface and logging revenue.\n * @public\n * @param {Revenue} revenue_obj - the revenue object containing the revenue data being logged.\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n AmplitudeClient.prototype.logRevenueV2 = function logRevenueV2(revenue_obj) {\n if (this._shouldDeferCall()) {\n return this._q.push(['logRevenueV2'].concat(Array.prototype.slice.call(arguments, 0)));\n }\n\n if (!this._apiKeySet('logRevenueV2()')) {\n return;\n } // if revenue input is a proxied object created by the async loading snippet, convert it into an revenue object\n\n\n if (type(revenue_obj) === 'object' && Object.prototype.hasOwnProperty.call(revenue_obj, '_q')) {\n revenue_obj = _convertProxyObjectToRealObject(new Revenue(), revenue_obj);\n }\n\n if (revenue_obj instanceof Revenue) {\n // only send if revenue is valid\n if (revenue_obj && revenue_obj._isValidRevenue()) {\n return this.logEvent(Constants.REVENUE_EVENT, revenue_obj._toJSONObject());\n }\n } else {\n utils.log.error('Invalid revenue input type. Expected Revenue object but saw ' + type(revenue_obj));\n }\n };\n\n {\n /**\n * Log revenue event with a price, quantity, and product identifier. DEPRECATED - use logRevenueV2\n * @public\n * @deprecated\n * @param {number} price - price of revenue event\n * @param {number} quantity - (optional) quantity of products in revenue event. If no quantity specified default to 1.\n * @param {string} product - (optional) product identifier\n * @example amplitudeClient.logRevenue(3.99, 1, 'product_1234');\n */\n AmplitudeClient.prototype.logRevenue = function logRevenue(price, quantity, product) {\n if (this._shouldDeferCall()) {\n return this._q.push(['logRevenue'].concat(Array.prototype.slice.call(arguments, 0)));\n } // Test that the parameters are of the right type.\n\n\n if (!this._apiKeySet('logRevenue()') || !_isNumber(price) || quantity !== undefined && !_isNumber(quantity)) {\n // utils.log('Price and quantity arguments to logRevenue must be numbers');\n return -1;\n }\n\n return this._logEvent(Constants.REVENUE_EVENT, {}, {\n productId: product,\n special: 'revenue_amount',\n quantity: quantity || 1,\n price: price\n }, null, null, null, null, null);\n };\n }\n /**\n * Calls error callback on unsent events\n * @private\n */\n\n\n AmplitudeClient.prototype._logErrorsOnEvents = function _logErrorsOnEvents(maxEventId, maxIdentifyId, status, response) {\n var queues = ['_unsentEvents', '_unsentIdentifys'];\n\n for (var j = 0; j < queues.length; j++) {\n var queue = queues[j];\n var maxId = queue === '_unsentEvents' ? maxEventId : maxIdentifyId;\n\n for (var i = 0; i < this[queue].length || 0; i++) {\n var unsentEvent = this[queue][i];\n\n if (unsentEvent.event.event_id <= maxId) {\n if (unsentEvent.errorCallback) {\n unsentEvent.errorCallback(status, response);\n }\n }\n }\n }\n };\n /**\n * Remove events in storage with event ids up to and including maxEventId.\n * @private\n */\n\n\n AmplitudeClient.prototype.removeEvents = function removeEvents(maxEventId, maxIdentifyId, status, response) {\n _removeEvents(this, '_unsentEvents', maxEventId, status, response);\n\n _removeEvents(this, '_unsentIdentifys', maxIdentifyId, status, response);\n };\n /**\n * Helper function to remove events up to maxId from a single queue.\n * Does a true filter in case events get out of order or old events are removed.\n * @private\n */\n\n\n var _removeEvents = function _removeEvents(scope, eventQueue, maxId, status, response) {\n if (maxId < 0) {\n return;\n }\n\n var filteredEvents = [];\n\n for (var i = 0; i < scope[eventQueue].length || 0; i++) {\n var unsentEvent = scope[eventQueue][i];\n\n if (unsentEvent.event.event_id > maxId) {\n filteredEvents.push(unsentEvent);\n } else {\n if (unsentEvent.callback) {\n unsentEvent.callback(status, response);\n }\n }\n }\n\n scope[eventQueue] = filteredEvents;\n };\n /**\n * Send unsent events. Note: this is called automatically after events are logged if option batchEvents is false.\n * If batchEvents is true, then events are only sent when batch criterias are met.\n * @private\n */\n\n\n AmplitudeClient.prototype.sendEvents = function sendEvents() {\n if (!this._apiKeySet('sendEvents()')) {\n this.removeEvents(Infinity, Infinity, 0, 'No request sent', {\n reason: 'API key not set'\n });\n return;\n }\n\n if (this.options.optOut) {\n this.removeEvents(Infinity, Infinity, 0, 'No request sent', {\n reason: 'Opt out is set to true'\n });\n return;\n } // How is it possible to get into this state?\n\n\n if (this._unsentCount() === 0) {\n return;\n } // We only make one request at a time. sendEvents will be invoked again once\n // the last request completes.\n // beacon data is sent synchronously, so don't pause for it\n\n\n if (this.options.transport !== Constants.TRANSPORT_BEACON) {\n if (this._sending) {\n return;\n }\n\n this._sending = true;\n }\n\n var protocol = this.options.forceHttps ? 'https' : 'https:' === window.location.protocol ? 'https' : 'http';\n var url = protocol + '://' + this.options.apiEndpoint; // fetch events to send\n\n var numEvents = Math.min(this._unsentCount(), this.options.uploadBatchSize);\n\n var mergedEvents = this._mergeEventsAndIdentifys(numEvents);\n\n var maxEventId = mergedEvents.maxEventId;\n var maxIdentifyId = mergedEvents.maxIdentifyId;\n var events = JSON.stringify(mergedEvents.eventsToSend.map(function (_ref2) {\n var event = _ref2.event;\n return event;\n }));\n var uploadTime = new Date().getTime();\n var data = {\n client: this.options.apiKey,\n e: events,\n v: Constants.API_VERSION,\n upload_time: uploadTime,\n checksum: md5(Constants.API_VERSION + this.options.apiKey + events + uploadTime)\n };\n\n if (this.options.transport === Constants.TRANSPORT_BEACON) {\n var success = navigator.sendBeacon(url, new URLSearchParams(data));\n\n if (success) {\n this.removeEvents(maxEventId, maxIdentifyId, 200, 'success');\n\n if (this.options.saveEvents) {\n this.saveEvents();\n }\n } else {\n this._logErrorsOnEvents(maxEventId, maxIdentifyId, 0, '');\n }\n\n return;\n }\n\n var scope = this;\n new Request(url, data, this.options.headers).send(function (status, response) {\n scope._sending = false;\n\n try {\n if (status === 200 && response === 'success') {\n scope.removeEvents(maxEventId, maxIdentifyId, status, response); // Update the event cache after the removal of sent events.\n\n if (scope.options.saveEvents) {\n scope.saveEvents();\n } // Send more events if any queued during previous send.\n\n\n scope._sendEventsIfReady(); // handle payload too large\n\n } else {\n scope._logErrorsOnEvents(maxEventId, maxIdentifyId, status, response);\n\n if (status === 413) {\n // utils.log('request too large');\n // Can't even get this one massive event through. Drop it, even if it is an identify.\n if (scope.options.uploadBatchSize === 1) {\n scope.removeEvents(maxEventId, maxIdentifyId, status, response);\n } // The server complained about the length of the request. Backoff and try again.\n\n\n scope.options.uploadBatchSize = Math.ceil(numEvents / 2);\n scope.sendEvents();\n }\n } // else {\n // all the events are still queued, and will be retried when the next\n // event is sent In the interest of debugging, it would be nice to have\n // something like an event emitter for a better debugging experince\n // here.\n // }\n\n } catch (e) {// utils.log.error('failed upload');\n }\n });\n };\n /**\n * Merge unsent events and identifys together in sequential order based on their sequence number, for uploading.\n * Identifys given higher priority than Events. Also earlier sequence given priority\n * @private\n */\n\n\n AmplitudeClient.prototype._mergeEventsAndIdentifys = function _mergeEventsAndIdentifys(numEvents) {\n // coalesce events from both queues\n var eventsToSend = [];\n var eventIndex = 0;\n var maxEventId = -1;\n var identifyIndex = 0;\n var maxIdentifyId = -1;\n\n while (eventsToSend.length < numEvents) {\n var unsentEvent = void 0;\n var noIdentifys = identifyIndex >= this._unsentIdentifys.length;\n var noEvents = eventIndex >= this._unsentEvents.length; // case 0: no events or identifys left\n // note this should not happen, this means we have less events and identifys than expected\n\n if (noEvents && noIdentifys) {\n utils.log.error('Merging Events and Identifys, less events and identifys than expected');\n break;\n } // case 1: no identifys - grab from events\n else if (noIdentifys) {\n unsentEvent = this._unsentEvents[eventIndex++];\n maxEventId = unsentEvent.event.event_id; // case 2: no events - grab from identifys\n } else if (noEvents) {\n unsentEvent = this._unsentIdentifys[identifyIndex++];\n maxIdentifyId = unsentEvent.event.event_id; // case 3: need to compare sequence numbers\n } else {\n // events logged before v2.5.0 won't have a sequence number, put those first\n if (!('sequence_number' in this._unsentEvents[eventIndex].event) || this._unsentEvents[eventIndex].event.sequence_number < this._unsentIdentifys[identifyIndex].event.sequence_number) {\n unsentEvent = this._unsentEvents[eventIndex++];\n maxEventId = unsentEvent.event.event_id;\n } else {\n unsentEvent = this._unsentIdentifys[identifyIndex++];\n maxIdentifyId = unsentEvent.event.event_id;\n }\n }\n\n eventsToSend.push(unsentEvent);\n }\n\n return {\n eventsToSend: eventsToSend,\n maxEventId: maxEventId,\n maxIdentifyId: maxIdentifyId\n };\n };\n\n {\n /**\n * Set global user properties. Note this is deprecated, and we recommend using setUserProperties\n * @public\n * @deprecated\n */\n AmplitudeClient.prototype.setGlobalUserProperties = function setGlobalUserProperties(userProperties) {\n this.setUserProperties(userProperties);\n };\n }\n /**\n * Get the current version of Amplitude's Javascript SDK.\n * @public\n * @returns {number} version number\n * @example var amplitudeVersion = amplitude.__VERSION__;\n */\n\n\n AmplitudeClient.prototype.__VERSION__ = version;\n /**\n * Determines whether or not to push call to this._q or invoke it\n * @private\n */\n\n AmplitudeClient.prototype._shouldDeferCall = function _shouldDeferCall() {\n return this._pendingReadStorage || this._initializationDeferred;\n };\n /**\n * Defers Initialization by putting all functions into storage until users\n * have accepted terms for tracking\n * @private\n */\n\n\n AmplitudeClient.prototype._deferInitialization = function _deferInitialization() {\n this._initializationDeferred = true;\n\n this._q.push(['init'].concat(Array.prototype.slice.call(arguments, 0)));\n };\n /**\n * Enable tracking via logging events and dropping a cookie\n * Intended to be used with the deferInitialization configuration flag\n * This will drop a cookie and reset initialization deferred\n * @public\n */\n\n\n AmplitudeClient.prototype.enableTracking = function enableTracking() {\n // This will call init (which drops the cookie) and will run any pending tasks\n this._initializationDeferred = false;\n\n _saveCookieData(this);\n\n this.runQueuedFunctions();\n };\n\n /**\n * Deprecated legacy API of the Amplitude JS SDK - instance manager.\n *\n * Wraps around the current [AmplitudeClient](https://amplitude.github.io/Amplitude-JavaScript/) which provides more features\n * Function calls directly on amplitude have been deprecated. Please call methods on the default shared instance: amplitude.getInstance() instead.\n *\n * See the [3.0.0 changelog](https://github.com/amplitude/Amplitude-JavaScript/blob/ed405afb5f06d5cf5b72539a5d09179abcf7e1fe/README.md#300-update-and-logging-events-to-multiple-amplitude-apps) for more information about this change.\n * @constructor Amplitude\n * @public\n * @deprecated\n * @example var amplitude = new Amplitude();\n */\n\n var Amplitude = function Amplitude() {\n this.options = _objectSpread({}, DEFAULT_OPTIONS);\n this._q = [];\n this._instances = {}; // mapping of instance names to instances\n };\n\n Amplitude.prototype.Identify = Identify;\n Amplitude.prototype.Revenue = Revenue;\n\n Amplitude.prototype.getInstance = function getInstance(instance) {\n instance = utils.isEmptyString(instance) ? Constants.DEFAULT_INSTANCE : instance.toLowerCase();\n var client = this._instances[instance];\n\n if (client === undefined) {\n client = new AmplitudeClient(instance);\n this._instances[instance] = client;\n }\n\n return client;\n };\n\n {\n /**\n * Run functions queued up by proxy loading snippet\n * @private\n */\n Amplitude.prototype.runQueuedFunctions = function () {\n // run queued up old versions of functions\n for (var i = 0; i < this._q.length; i++) {\n var fn = this[this._q[i][0]];\n\n if (type(fn) === 'function') {\n fn.apply(this, this._q[i].slice(1));\n }\n }\n\n this._q = []; // clear function queue after running\n // run queued up functions on instances\n\n for (var instance in this._instances) {\n if (Object.prototype.hasOwnProperty.call(this._instances, instance)) {\n this._instances[instance].runQueuedFunctions();\n }\n }\n };\n }\n\n {\n /**\n * Initializes the Amplitude Javascript SDK with your apiKey and any optional configurations.\n * This is required before any other methods can be called.\n * @public\n * @param {string} apiKey - The API key for your app.\n * @param {string} opt_userId - (optional) An identifier for this user.\n * @param {object} opt_config - (optional) Configuration options.\n * See [options.js](https://github.com/amplitude/Amplitude-JavaScript/blob/master/src/options.js#L14) for list of options and default values.\n * @param {function} opt_callback - (optional) Provide a callback function to run after initialization is complete.\n * @deprecated Please use amplitude.getInstance().init(apiKey, opt_userId, opt_config, opt_callback);\n * @example amplitude.init('API_KEY', 'USER_ID', {includeReferrer: true, includeUtm: true}, function() { alert('init complete'); });\n */\n Amplitude.prototype.init = function init(apiKey, opt_userId, opt_config, opt_callback) {\n this.getInstance().init(apiKey, opt_userId, opt_config, function (instance) {\n // make options such as deviceId available for callback functions\n this.options = instance.options;\n\n if (type(opt_callback) === 'function') {\n opt_callback(instance);\n }\n }.bind(this));\n };\n /**\n * Returns true if a new session was created during initialization, otherwise false.\n * @public\n * @return {boolean} Whether a new session was created during initialization.\n * @deprecated Please use amplitude.getInstance().isNewSession();\n */\n\n\n Amplitude.prototype.isNewSession = function isNewSession() {\n return this.getInstance().isNewSession();\n };\n /**\n * Returns the id of the current session.\n * @public\n * @return {number} Id of the current session.\n * @deprecated Please use amplitude.getInstance().getSessionId();\n */\n\n\n Amplitude.prototype.getSessionId = function getSessionId() {\n return this.getInstance().getSessionId();\n };\n /**\n * Increments the eventId and returns it.\n * @private\n */\n\n\n Amplitude.prototype.nextEventId = function nextEventId() {\n return this.getInstance().nextEventId();\n };\n /**\n * Increments the identifyId and returns it.\n * @private\n */\n\n\n Amplitude.prototype.nextIdentifyId = function nextIdentifyId() {\n return this.getInstance().nextIdentifyId();\n };\n /**\n * Increments the sequenceNumber and returns it.\n * @private\n */\n\n\n Amplitude.prototype.nextSequenceNumber = function nextSequenceNumber() {\n return this.getInstance().nextSequenceNumber();\n };\n /**\n * Saves unsent events and identifies to localStorage. JSON stringifies event queues before saving.\n * Note: this is called automatically every time events are logged, unless you explicitly set option saveEvents to false.\n * @private\n */\n\n\n Amplitude.prototype.saveEvents = function saveEvents() {\n this.getInstance().saveEvents();\n };\n /**\n * Sets a customer domain for the amplitude cookie. Useful if you want to support cross-subdomain tracking.\n * @public\n * @param {string} domain to set.\n * @deprecated Please use amplitude.getInstance().setDomain(domain);\n * @example amplitude.setDomain('.amplitude.com');\n */\n\n\n Amplitude.prototype.setDomain = function setDomain(domain) {\n this.getInstance().setDomain(domain);\n };\n /**\n * Sets an identifier for the current user.\n * @public\n * @param {string} userId - identifier to set. Can be null.\n * @deprecated Please use amplitude.getInstance().setUserId(userId);\n * @example amplitude.setUserId('joe@gmail.com');\n */\n\n\n Amplitude.prototype.setUserId = function setUserId(userId) {\n this.getInstance().setUserId(userId);\n };\n /**\n * Add user to a group or groups. You need to specify a groupType and groupName(s).\n * For example you can group people by their organization.\n * In that case groupType is \"orgId\" and groupName would be the actual ID(s).\n * groupName can be a string or an array of strings to indicate a user in multiple gruups.\n * You can also call setGroup multiple times with different groupTypes to track multiple types of groups (up to 5 per app).\n * Note: this will also set groupType: groupName as a user property.\n * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information.\n * @public\n * @param {string} groupType - the group type (ex: orgId)\n * @param {string|list} groupName - the name of the group (ex: 15), or a list of names of the groups\n * @deprecated Please use amplitude.getInstance().setGroup(groupType, groupName);\n * @example amplitude.setGroup('orgId', 15); // this adds the current user to orgId 15.\n */\n\n\n Amplitude.prototype.setGroup = function (groupType, groupName) {\n this.getInstance().setGroup(groupType, groupName);\n };\n /**\n * Sets whether to opt current user out of tracking.\n * @public\n * @param {boolean} enable - if true then no events will be logged or sent.\n * @deprecated Please use amplitude.getInstance().setOptOut(enable);\n * @example: amplitude.setOptOut(true);\n */\n\n\n Amplitude.prototype.setOptOut = function setOptOut(enable) {\n this.getInstance().setOptOut(enable);\n };\n /**\n * Regenerates a new random deviceId for current user. Note: this is not recommended unless you know what you\n * are doing. This can be used in conjunction with `setUserId(null)` to anonymize users after they log out.\n * With a null userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n * This uses src/uuid.js to regenerate the deviceId.\n * @public\n * @deprecated Please use amplitude.getInstance().regenerateDeviceId();\n */\n\n\n Amplitude.prototype.regenerateDeviceId = function regenerateDeviceId() {\n this.getInstance().regenerateDeviceId();\n };\n /**\n * Sets a custom deviceId for current user. Note: this is not recommended unless you know what you are doing\n * (like if you have your own system for managing deviceIds).\n *\n * Make sure the deviceId you set is sufficiently unique\n * (we recommend something like a UUID - see src/uuid.js for an example of how to generate) to prevent conflicts with other devices in our system.\n * @public\n * @param {string} deviceId - custom deviceId for current user.\n * @deprecated Please use amplitude.getInstance().setDeviceId(deviceId);\n * @example amplitude.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0');\n */\n\n\n Amplitude.prototype.setDeviceId = function setDeviceId(deviceId) {\n this.getInstance().setDeviceId(deviceId);\n };\n /**\n * Sets user properties for the current user.\n * @public\n * @param {object} userProperties - object with string keys and values for the user properties to set.\n * @param {boolean} opt_replace - Deprecated. In earlier versions of the JS SDK the user properties object was kept in\n * memory and replace = true would replace the object in memory. Now the properties are no longer stored in memory, so replace is deprecated.\n * @deprecated Please use amplitude.getInstance().setUserProperties(userProperties);\n * @example amplitude.setUserProperties({'gender': 'female', 'sign_up_complete': true})\n */\n\n\n Amplitude.prototype.setUserProperties = function setUserProperties(userProperties) {\n this.getInstance().setUserProperties(userProperties);\n };\n /**\n * Clear all of the user properties for the current user. Note: clearing user properties is irreversible!\n * @public\n * @deprecated Please use amplitude.getInstance().clearUserProperties();\n * @example amplitude.clearUserProperties();\n */\n\n\n Amplitude.prototype.clearUserProperties = function clearUserProperties() {\n this.getInstance().clearUserProperties();\n };\n /**\n * Send an identify call containing user property operations to Amplitude servers.\n * See the [Identify](https://amplitude.github.io/Amplitude-JavaScript/Identify/)\n * reference page for more information on the Identify API and user property operations.\n * @param {Identify} identify_obj - the Identify object containing the user property operations to send.\n * @param {Amplitude~eventCallback} opt_callback - (optional) callback function to run when the identify event has been sent.\n * Note: the server response code and response body from the identify event upload are passed to the callback function.\n * @deprecated Please use amplitude.getInstance().identify(identify);\n * @example\n * var identify = new amplitude.Identify().set('colors', ['rose', 'gold']).add('karma', 1).setOnce('sign_up_date', '2016-03-31');\n * amplitude.identify(identify);\n */\n\n\n Amplitude.prototype.identify = function (identify_obj, opt_callback) {\n this.getInstance().identify(identify_obj, opt_callback);\n };\n /**\n * Set a versionName for your application.\n * @public\n * @param {string} versionName - The version to set for your application.\n * @deprecated Please use amplitude.getInstance().setVersionName(versionName);\n * @example amplitude.setVersionName('1.12.3');\n */\n\n\n Amplitude.prototype.setVersionName = function setVersionName(versionName) {\n this.getInstance().setVersionName(versionName);\n };\n /**\n * This is the callback for logEvent and identify calls. It gets called after the event/identify is uploaded,\n * and the server response code and response body from the upload request are passed to the callback function.\n * @callback Amplitude~eventCallback\n * @param {number} responseCode - Server response code for the event / identify upload request.\n * @param {string} responseBody - Server response body for the event / identify upload request.\n */\n\n /**\n * Log an event with eventType and eventProperties\n * @public\n * @param {string} eventType - name of event\n * @param {object} eventProperties - (optional) an object with string keys and values for the event properties.\n * @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @deprecated Please use amplitude.getInstance().logEvent(eventType, eventProperties, opt_callback);\n * @example amplitude.logEvent('Clicked Homepage Button', {'finished_flow': false, 'clicks': 15});\n */\n\n\n Amplitude.prototype.logEvent = function logEvent(eventType, eventProperties, opt_callback) {\n return this.getInstance().logEvent(eventType, eventProperties, opt_callback);\n };\n /**\n * Log an event with eventType, eventProperties, and groups. Use this to set event-level groups.\n *\n * Note: the group(s) set only apply for the specific event type being logged and does not persist on the user\n * (unless you explicitly set it with setGroup).\n *\n * See the [advanced topics article](https://developers.amplitude.com/docs/setting-user-groups) for more information.\n * about groups and Count by Distinct on the Amplitude platform.\n * @public\n * @param {string} eventType - name of event\n * @param {object} eventProperties - (optional) an object with string keys and values for the event properties.\n * @param {object} groups - (optional) an object with string groupType: groupName values for the event being logged.\n * groupName can be a string or an array of strings.\n * @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.\n * Note: the server response code and response body from the event upload are passed to the callback function.\n * @deprecated Please use amplitude.getInstance().logEventWithGroups(eventType, eventProperties, groups, opt_callback);\n * @example amplitude.logEventWithGroups('Clicked Button', null, {'orgId': 24});\n */\n\n\n Amplitude.prototype.logEventWithGroups = function (eventType, eventProperties, groups, opt_callback) {\n return this.getInstance().logEventWithGroups(eventType, eventProperties, groups, opt_callback);\n };\n /**\n * Log revenue with Revenue interface. The new revenue interface allows for more revenue fields like\n * revenueType and event properties.\n *\n * See the [Revenue](https://amplitude.github.io/Amplitude-JavaScript/Revenue/)\n * reference page for more information on the Revenue interface and logging revenue.\n * @public\n * @param {Revenue} revenue_obj - the revenue object containing the revenue data being logged.\n * @deprecated Please use amplitude.getInstance().logRevenueV2(revenue_obj);\n * @example var revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99);\n * amplitude.logRevenueV2(revenue);\n */\n\n\n Amplitude.prototype.logRevenueV2 = function logRevenueV2(revenue_obj) {\n return this.getInstance().logRevenueV2(revenue_obj);\n };\n /**\n * Log revenue event with a price, quantity, and product identifier.\n * @public\n * @param {number} price - price of revenue event\n * @param {number} quantity - (optional) quantity of products in revenue event. If no quantity specified default to 1.\n * @param {string} product - (optional) product identifier\n * @deprecated Please use amplitude.getInstance().logRevenueV2(revenue_obj);\n * @example amplitude.logRevenue(3.99, 1, 'product_1234');\n */\n\n\n Amplitude.prototype.logRevenue = function logRevenue(price, quantity, product) {\n return this.getInstance().logRevenue(price, quantity, product);\n };\n /**\n * Remove events in storage with event ids up to and including maxEventId.\n * @private\n */\n\n\n Amplitude.prototype.removeEvents = function removeEvents(maxEventId, maxIdentifyId) {\n this.getInstance().removeEvents(maxEventId, maxIdentifyId);\n };\n /**\n * Send unsent events. Note: this is called automatically after events are logged if option batchEvents is false.\n * If batchEvents is true, then events are only sent when batch criterias are met.\n * @private\n * @param {Amplitude~eventCallback} callback - (optional) callback to run after events are sent.\n * Note the server response code and response body are passed to the callback as input arguments.\n */\n\n\n Amplitude.prototype.sendEvents = function sendEvents(callback) {\n this.getInstance().sendEvents(callback);\n };\n /**\n * Set global user properties.\n * @public\n * @deprecated Please use amplitudeClient.setUserProperties\n */\n\n\n Amplitude.prototype.setGlobalUserProperties = function setGlobalUserProperties(userProperties) {\n this.getInstance().setUserProperties(userProperties);\n };\n }\n /**\n * Get the current version of Amplitude's Javascript SDK.\n * @public\n * @returns {number} version number\n * @example var amplitudeVersion = amplitude.__VERSION__;\n */\n\n\n Amplitude.prototype.__VERSION__ = version;\n\n // Entry point\n var old = window.amplitude || {};\n var newInstance = new Amplitude();\n newInstance._q = old._q || [];\n /**\n * Instantiates Amplitude object and runs all queued function logged by stubbed methods provided by snippets\n * Event queue allows async loading of SDK to not blocking client's app\n */\n\n for (var instance in old._iq) {\n // migrate each instance's queue\n if (Object.prototype.hasOwnProperty.call(old._iq, instance)) {\n newInstance.getInstance(instance)._q = old._iq[instance]._q || [];\n }\n } // If SDK is enabled as snippet, process the events queued by stubbed function\n\n\n {\n newInstance.runQueuedFunctions();\n } // export the instance\n\n return newInstance;\n\n}));\n"],"names":[],"sourceRoot":""}