customerio-gist-web 3.9.2 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gist.min.js +10 -1
- package/package.json +2 -2
package/dist/gist.min.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Gist=t():e.Gist=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){"use strict";var r=n(2),s=Object.prototype.toString;function i(e){return"[object Array]"===s.call(e)}function o(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==s.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===s.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===s.call(e)},isFile:function(e){return"[object File]"===s.call(e)},isBlob:function(e){return"[object Blob]"===s.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,s=arguments.length;r<s;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,(function(t,s){e[s]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},,function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var o=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),o.push(s(t)+"="+s(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(0),s=n(18),i={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=n(6)),a),transformRequest:[function(e,t){return s(t,"Accept"),s(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(i)})),e.exports=u}).call(this,n(17))},function(e,t,n){"use strict";var r=n(0),s=n(19),i=n(21),o=n(3),a=n(22),u=n(25),c=n(26),d=n(7);e.exports=function(e){return new Promise((function(t,n){var l=e.data,f=e.headers;r.isFormData(l)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(g+":"+h)}var m=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),o(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};s(t,n,i),p=null}},p.onabort=function(){p&&(n(d("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(d("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(d(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var v=(e.withCredentials||c(m))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}if("setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),l||(l=null),p.send(l)}))}},function(e,t,n){"use strict";var r=n(20);e.exports=function(e,t,n,s,i){var o=new Error(e);return r(o,t,n,s,i)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){t=t||{};var n={},s=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(s){r.isUndefined(t[s])?r.isUndefined(e[s])||(n[s]=u(void 0,e[s])):n[s]=u(e[s],t[s])}r.forEach(s,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(i,c),r.forEach(o,(function(s){r.isUndefined(t[s])?r.isUndefined(e[s])||(n[s]=u(void 0,e[s])):n[s]=u(void 0,t[s])})),r.forEach(a,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var d=s.concat(i).concat(o).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===d.indexOf(e)}));return r.forEach(l,c),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){e.exports=n(12)},function(e,t,n){const r=n(30).default;e.exports=r},function(e,t,n){"use strict";var r=n(0),s=n(2),i=n(13),o=n(8);function a(e){var t=new i(e),n=s(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var u=a(n(5));u.Axios=i,u.create=function(e){return a(o(u.defaults,e))},u.Cancel=n(9),u.CancelToken=n(27),u.isCancel=n(4),u.all=function(e){return Promise.all(e)},u.spread=n(28),u.isAxiosError=n(29),e.exports=u,e.exports.default=u},function(e,t,n){"use strict";var r=n(0),s=n(3),i=n(14),o=n(15),a=n(8);function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[o,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},u.prototype.getUri=function(e){return e=a(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=u},function(e,t,n){"use strict";var r=n(0);function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},function(e,t,n){"use strict";var r=n(0),s=n(16),i=n(4),o=n(5);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return a(e),t.data=s(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t){var n,r,s=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],d=!1,l=-1;function f(){d&&u&&(d=!1,u.length?c=u.concat(c):l=-1,c.length&&p())}function p(){if(!d){var e=a(f);d=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function h(){}s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new g(e,t)),1!==c.length||d||a(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=h,s.addListener=h,s.once=h,s.off=h,s.removeListener=h,s.removeAllListeners=h,s.emit=h,s.prependListener=h,s.prependOnceListener=h,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(7);e.exports=function(e,t,n){var s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,s){return e.config=t,n&&(e.code=n),e.request=r,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,s,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(s)&&a.push("path="+s),r.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(23),s=n(24);e.exports=function(e,t){return e&&!r(t)?s(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(0),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,o={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(o[t]&&s.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function s(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=s(window.location.href),function(t){var n=r.isString(t)?s(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(9);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){"use strict";n.r(t);class r{on(e,t){var n=this[e];n?n.push(t):this[e]=[t]}dispatch(e,t){var n=this[e];n&&n.forEach(e=>e(t))}}function s(e){ie.config.logging&&console.log("Gist: "+e)}function i(e,t,n){const r={value:t,expiry:n};localStorage.setItem(e,JSON.stringify(r))}function o(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date,s=new Date(n.expiry);return r.getTime()>s.getTime()?(localStorage.removeItem(e),null):n.value}function a(e){localStorage.removeItem(e)}var u,c=new Uint8Array(16);function d(){if(!u&&!(u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(c)}var l=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var f=function(e){return"string"==typeof e&&l.test(e)},p=[],g=0;g<256;++g)p.push((g+256).toString(16).substr(1));var h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase();if(!f(n))throw TypeError("Stringified UUID is invalid");return n};var m=function(e,t,n){var r=(e=e||{}).random||(e.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return h(r)};function v(){return o("gist.web.userToken")}function y(){var e=new Date;if(e.setDate(e.getDate()+365),null===v()){var t=o("gist.web.guestUserToken");null==t&&(i("gist.web.guestUserToken",t=m(),e),s(`Set guest user token "${t}" with expiry date set to 1 year from today`)),i("gist.web.userToken",t,e),i("gist.web.usingGuestUserToken",!0,e)}}var w=n(10),b=n.n(w);const x={ENGINE_API_ENDPOINT:{prod:"https://engine.api.gist.build",dev:"https://engine.api.dev.gist.build",local:"http://engine.api.local.gist.build:82"},GIST_QUEUE_API_ENDPOINT:{prod:"https://gist-queue-consumer-api.cloud.gist.build",dev:"https://gist-queue-consumer-api.cloud.dev.gist.build",local:"http://api.local.gist.build:86"},GIST_VIEW_ENDPOINT:{prod:"https://renderer.gist.build/2.0",dev:"https://renderer.gist.build/2.0",local:"http://app.local.gist.build:8080/web"}};function I(){var e={"X-CIO-Site-Id":ie.config.siteId,"X-CIO-Datacenter":ie.config.dataCenter},t=v();return null!=t&&(e["X-Gist-Encoded-User-Token"]=btoa(t)),b.a.create({baseURL:x.GIST_QUEUE_API_ENDPOINT[ie.config.env],timeout:2e4,headers:e})}var T=600,S=!1;async function E(){var e;try{if(!S){var t=(new Date).getTime();S=!0,e=await I().post("/api/v1/users?timestamp="+t,{})}}catch(t){t.response?e=t.response:s("Error getting user queue: "+t)}finally{return S=!1,function(e){if(e&&e.headers){var t=e.headers["x-gist-queue-polling-interval"];t&&t>0&&(T=t)}var n=new Date((new Date).getTime()+1e3*T);i("gist.web.userQueueNextPullCheck",T,n)}(e),e}}function C(e){var t="",n="",r="",s=!1,i=!1,o=!1,a=!1,u=null,c=!1,d="#00000033",l=414,f=!1;return e.properties&&e.properties.gist&&(e.properties.gist.campaignId&&(u=e.properties.gist.campaignId),e.properties.gist.elementId&&(t=e.properties.gist.elementId,s=!0),e.properties.gist.routeRuleWeb&&(n=e.properties.gist.routeRuleWeb,i=!0),e.properties.gist.position&&(r=e.properties.gist.position,o=!0),e.properties.gist.scale&&(a=e.properties.gist.scale),e.properties.gist.overlayColor&&(d=e.properties.gist.overlayColor),e.properties.gist.messageWidth&&e.properties.gist.messageWidth>0&&(l=e.properties.gist.messageWidth,f=!0),e.properties.gist.persistent&&(c=!0)),{isEmbedded:s,elementId:t,hasRouteRule:i,routeRule:n,position:r,hasPosition:o,shouldScale:a,campaignId:u,messageWidth:l,overlayColor:d,persistent:c,hasCustomWidth:f}}var R=["x-gist-top","x-gist-floating-top","x-gist-bottom","x-gist-floating-bottom","x-gist-floating-bottom-left","x-gist-floating-bottom-right","x-gist-floating-top-left","x-gist-floating-top-right"];const k=e=>new Promise(t=>setTimeout(t,e)),O=["x-gist-top","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"];function N(e,t,n){var r=U(e);if(r){var i=C(n),o=i.messageWidth+"px";O.includes(i.elementId)&&!i.hasCustomWidth&&(o="100%"),R.includes(i.elementId)&&(r.style.width=o),D(e)||(r.style.height="0px"),r.innerHTML=function(e,t,n){return function(e,t,n){var r=800;return t.messageWidth>r&&(r=t.messageWidth),`\n <div id="gist-embed">\n <style>\n #x-gist-floating-top, #x-gist-floating-top-left, #x-gist-floating-top-right {\n position: fixed;\n top: 0px;\n z-index: 1000000;\n }\n #x-gist-floating-bottom, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n position: fixed;\n bottom: 0px;\n z-index: 1000000;\n }\n #x-gist-bottom, #x-gist-top, #x-gist-floating-top, #x-gist-floating-bottom {\n left: 50%;\n transform: translate(-50%, 0%);\n }\n #x-gist-floating-top-right, #x-gist-floating-bottom-right {\n right: 0px;\n }\n #gist-embed {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container .gist-frame {\n height: 100%;\n width: 100%;\n border: none;\n }\n @media (max-width: ${r}px) {\n #x-gist-top, #x-gist-bottom, #x-gist-floating-top, #x-gist-floating-bottom, #x-gist-floating-top-left, #x-gist-floating-top-right, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n width: 100% !important;\n }\n }\n </style>\n <div id="gist-embed-container">\n <iframe id="${e}" class="gist-frame" src="${n}"></iframe>\n </div>\n </div>`}(q(t.instanceId),n,e)}(t,n,i)}else s(`Message could not be embedded, elementId ${e} not found.`)}function D(e){var t=U(e);if(t)return t.style&&t.style.height&&"0px"!=t.style.height}function L(e,t){document.body.insertAdjacentHTML("afterbegin",function(e,t){var n=C(t);return function(e,t,n){var r=600;return t.messageWidth>r&&(r=t.messageWidth),`\n <div id="gist-embed-message">\n <style>\n #gist-overlay.background {\n position: fixed;\n z-index: 9999999998;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: ${t.overlayColor};\n visibility: hidden;\n }\n #gist-overlay.background.visible {\n visibility: visible;\n }\n #gist-overlay.background.is-blacked-out {\n display: block;\n }\n .gist-message {\n width: ${t.messageWidth}px;\n position: absolute;\n border: none;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n z-index: 9999999999;\n left: 50%;\n transform: translateX(-50%);\n }\n .gist-message.visible {\n opacity: 1;\n pointer-events: auto;\n }\n .gist-message.center {\n transform: translate(-50%, -50%);\n top: 50%;\n }\n .gist-message.bottom {\n bottom: 0;\n }\n .gist-message.top {\n top: 0;\n }\n @media (max-width: ${r}px) {\n .gist-message {\n width: 100%;\n }\n }\n </style>\n <div id="gist-overlay" class="background">\n <iframe id="${e}" class="gist-message" src="${n}"></iframe>\n </div>\n </div>`}(q(t.instanceId),n,e)}(e,t))}function P(){var e=document.querySelector("#gist-embed-message");e&&e.parentNode.removeChild(e)}function q(e){return"gist-"+e}function j(){var e=document.querySelector(".gist-message");e&&e.classList.add("visible")}function U(e){try{var t=document.querySelector("#"+e);return t||null}catch{return null}}var A=[];async function M(e){if(ie.isDocumentVisible){if(ie.overlayInstanceId)return s(`Message ${ie.overlayInstanceId} already showing.`),null;var t=C(e);return e.instanceId=m(),e.overlay=!0,e.firstLoad=!0,e.shouldResizeHeight=!0,e.shouldScale=t.shouldScale,e.renderStartTime=(new Date).getTime(),ie.overlayInstanceId=e.instanceId,ie.currentMessages.push(e),H(e)}return s("Document hidden, not showing message now."),null}async function $(e,t){return ie.isDocumentVisible?(e.instanceId=m(),e.overlay=!1,e.firstLoad=!0,e.shouldScale=!1,e.elementId=t,e.shouldResizeHeight=!D(t),e.renderStartTime=(new Date).getTime(),ie.currentMessages.push(e),H(e,t)):(s("Document hidden, not showing message now."),null)}async function B(e){e?(ie.messageDismissed(e),e.overlay?await G(!0,e):W(e)):s(`Message with instance id: ${instanceId} not found`)}async function _(e){var t=C(e);e?t.persistent&&(s("Persistent message dismissed, logging view"),await V(e)):s(`Message with instance id: ${instanceId} not found`)}function W(e){var t,n;F(e.instanceId),t=e.elementId,(n=U(t))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function G(e,t){F(t.instanceId),ie.overlayInstanceId=null,e?await async function(){var e=document.querySelector(".gist-message");e&&(e.classList.remove("visible"),await k(300)),P()}():P(),0==ie.currentMessages.length&&(window.removeEventListener("message",Q),window.removeEventListener("touchstart",J))}function H(e,t=null){if(t&&function(e){var t=U(e);return!(!t||!t.classList.contains("gist-visible"))}(t))return s(`Message ${e.messageId} already showing in element ${t}.`),null;var n,r,i={endpoint:x.ENGINE_API_ENDPOINT[ie.config.env],siteId:ie.config.siteId,dataCenter:ie.config.dataCenter,messageId:e.messageId,instanceId:e.instanceId,livePreview:!1,properties:e.properties},o=`${x.GIST_VIEW_ENDPOINT[ie.config.env]}/index.html?options=${n=JSON.stringify(i),r=btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))),encodeURIComponent(r)}`;return window.addEventListener("message",Q),window.addEventListener("touchstart",J),t?(R.includes(t)&&function(e){const t=document.createElement("div");switch(t.id=e,e){case"x-gist-top":document.body.insertBefore(t,document.body.firstChild);break;default:document.body.insertAdjacentElement("beforeend",t)}s("Top & bottom elements injected into page")}(t),N(t,o,e)):L(o,e),e}async function V(e){s("Message shown, logging view for: "+e.messageId);var t={};null!=e.queueId?(!function(e){A.push(e);var t=se();null!=t&&t.length>0&&re(t.filter(t=>t.queueId!==e.queueId))}(e),t=await async function(e){try{return await I().post("/api/v1/logs/queue/"+e)}catch(e){return e.response}}(e.queueId)):t=await async function(e){try{return await I().post("/api/v1/logs/message/"+e)}catch(e){return e.response}}(e.messageId),200===t.status?s("Message view logged"):s("Problem logging message: "+t.status)}function z(e){return ie.currentMessages.find(t=>t.instanceId===e)}function F(e){ie.currentMessages=ie.currentMessages.filter(t=>t.instanceId!==e)}function X(e,t){F(e),ie.currentMessages.push(t)}function J(e){}async function Q(e){if(e.data.gist){var t=e.data.gist.instanceId,n=z(t);if(!n)return;var r=C(n);switch(e.data.gist.method){case"routeLoaded":var i=.001*((new Date).getTime()-n.renderStartTime);s(`Engine render for message: ${n.messageId} timer elapsed in ${i.toFixed(3)} seconds`),n.currentRoute=e.data.gist.parameters.route,n.firstLoad&&(n.overlay?function(e){var t=document.querySelector("#gist-overlay");if(t){t.classList.add("visible");var n=document.querySelector(".gist-message");e.position?n.classList.add(e.position):n.classList.add("center"),setTimeout(j,100)}else P()}(n):(l=n.elementId,(f=U(l))&&f.classList.add("gist-visible")),ie.messageShown(n),r.persistent?s("Persistent message shown, skipping logging view"):await V(n),n.firstLoad=!1),X(t,n);break;case"tap":var o=e.data.gist.parameters.action,a=e.data.gist.parameters.name;if(ie.messageAction(n,o,a),e.data.gist.parameters.system&&!r.persistent){await B(n);break}try{if((d=new URL(o))&&"gist:"===d.protocol)switch(d.href.replace("gist://","").split("?")[0]){case"close":await B(n),await _(n),await te();break;case"showMessage":var u=d.searchParams.get("messageId"),c=d.searchParams.get("properties");u&&(c&&(c=JSON.parse(atob(c))),await ie.showMessage({messageId:u,properties:c}));break;case"loadPage":var d;(d=d.href.substring(d.href.indexOf("?url=")+5))&&(d.startsWith("https://")||d.startsWith("http://")||d.startsWith("/")?window.location.href=d:window.location.href=window.location+d)}}catch(e){}break;case"routeChanged":n.currentRoute=e.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),X(t,n),s("Route changed to: "+n.currentRoute);break;case"sizeChanged":s(`Size Changed Width: ${e.data.gist.parameters.width} - Height: ${e.data.gist.parameters.height}`),n.elementId&&!n.shouldResizeHeight||function(e,t){var n=U(e.elementId?e.elementId:q(e.instanceId));if(n){var r=n.style;if(t.height>0)if(t.height>window.innerHeight){var s=1-(t.height/window.innerHeight-1);e.shouldScale&&s>=.4?(r.height=t.height+"px",r.transform=`translateX(-50%) translateY(-50%) scale(${s})`):r.height=window.innerHeight+"px"}else r.height=t.height+"px"}}(n,e.data.gist.parameters);break;case"titleChanged":s("Overlay title changed to: "+e.data.gist.parameters.title),function(e,t){var n=U(q(e));n&&(n.title=t)}(t,e.data.gist.parameters.title);break;case"eventDispatched":ie.events.dispatch("eventDispatched",{name:e.data.gist.parameters.name,payload:e.data.gist.parameters.payload});break;case"error":case"routeError":ie.messageError(n),ie.overlayInstanceId?G(!1,n):W(n)}}var l,f}var K=(e,t)=>e().then((e=>new Promise(t=>setTimeout(t,e)))(t).then(()=>K(e,t))),Y=!1,Z=[];async function ee(){Y?await te():(!async function(){var e="G"+m().substring(0,8),t=document.createElement("div");t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),await k(5e3),$({messageId:""},e)}(),v()?(s("Queue watcher started"),Y=!0,K(()=>new Promise(()=>async function(){if(v())if(ie.isDocumentVisible)if(null===o("gist.web.userQueueNextPullCheck")){var e=await E(),t=[];e?(200===e.status||204===e.status?(s("200 response, updating local store."),re(t=e.data)):304===e.status&&(s("304 response, using local store."),t=se()),t&&t.length>0?(s(`Message queue checked for user ${v()}, ${t.length} messages found.`),Z=t,await te()):(Z=[],s("No messages for user token."))):s("There was an error while checking message queue.")}else s("Next queue pull scheduled for later");else s("Document not visible, skipping queue check.");else s("User token reset, skipping queue check.")}()),1e3)):s("User token not setup, queue not started."))}async function te(){s("Messages in local queue: "+Z.length);var e=[],t=Z.sort((e,t)=>e.priority-t.priority);for(const i of t){if(!await ne(i)){var n=e.find(e=>e.queueId===i.queueId),r=ie.currentMessages.find(e=>e.queueId===i.queueId);n||r?s(`Message with queueId: ${i.queueId} already in queue, discarding.`):e.push(i)}}Z=e}async function ne(e){if(!function(e){return void 0!==A.find(t=>t.queueId===e.queueId)}(e)){var t=C(e);if(t.hasRouteRule){var n=ie.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var r=t.routeRule;if(s("Verifying route against rule: "+r),!new RegExp(r).test(n))return s(`Route ${n} does not match rule.`),!1}return t.hasPosition&&(e.position=t.position),t.isEmbedded?await $(e,t.elementId):await M(e)}s(`Message with ${e.queueId} has been shown before, skipping.`)}function re(e){i("gist.web.userQueue",e,new Date((new Date).getTime()+36e5))}function se(){return o("gist.web.userQueue")}var ie=t.default=class{static async setup(e){this.events=new r,this.config={useGuestSession:void 0!==e.useGuestSession&&e.useGuestSession,siteId:e.siteId,dataCenter:e.dataCenter,env:void 0===e.env?"prod":e.env,logging:void 0!==e.logging&&e.logging,experiments:void 0!==e.experiments&&e.experiments},this.currentMessages=[],this.overlayInstanceId=null,this.currentRoute=null,this.isDocumentVisible=!0,s(`Setup complete on ${this.config.env} environment.`),this.config.useGuestSession&&y(),await ee(),document.addEventListener("visibilitychange",async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await te())},!1)}static async setCurrentRoute(e){this.currentRoute=e,s("Current route set to: "+e),await te()}static async setUserToken(e,t){!function(e,t){void 0===t&&(t=new Date).setDate(t.getDate()+30),i("gist.web.userToken",e,t),a("gist.web.usingGuestUserToken"),s(`Set user token "${e}" with expiry date set to ${t}`)}(e,t),await ee()}static async clearUserToken(){a("gist.web.userToken"),s("Cleared user token"),this.config.useGuestSession&&y(),await ee()}static async dismissMessage(e){var t=z(e);await B(t),await _(t),await te()}static async embedMessage(e,t){var n=await $(e,t);return n?n.instanceId:null}static async showMessage(e){var t=await M(e);return t?t.instanceId:null}static messageShown(e){s("Message shown: "+e.messageId),this.events.dispatch("messageShown",e)}static messageDismissed(e){null!==e&&(s("Message dismissed: "+e.messageId),this.events.dispatch("messageDismissed",e))}static messageError(e){s("Message error: "+e.messageId),this.events.dispatch("messageError",e)}static messageAction(e,t,n){s(`Message action: ${e.currentRoute}, ${t} with name ${n} on ${e.instanceId}`),this.events.dispatch("messageAction",{message:e,action:t,name:n})}}}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gist=e():t.Gist=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=19)}([function(t,e,n){"use strict";var r,i=n(7),o=Object.prototype.toString,s=(r=Object.create(null),function(t){var e=o.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return s(e)===t}}function u(t){return Array.isArray(t)}function c(t){return void 0===t}var f=a("ArrayBuffer");function l(t){return"number"==typeof t}function h(t){return null!==t&&"object"==typeof t}function p(t){if("object"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var d=a("Date"),g=a("File"),m=a("Blob"),y=a("FileList");function v(t){return"[object Function]"===o.call(t)}var w=a("URLSearchParams");function b(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}var E,R=(E="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return E&&t instanceof E});var x,T=a("HTMLFormElement"),A=(x=Object.prototype.hasOwnProperty,function(t,e){return x.call(t,e)});t.exports={isArray:u,isArrayBuffer:f,isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return t&&("function"==typeof FormData&&t instanceof FormData||"[object FormData]"===o.call(t)||v(t.toString)&&"[object FormData]"===t.toString())},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&f(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:l,isObject:h,isPlainObject:p,isEmptyObject:function(t){return t&&0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype},isUndefined:c,isDate:d,isFile:g,isBlob:m,isFunction:v,isStream:function(t){return h(t)&&v(t.pipe)},isURLSearchParams:w,isStandardBrowserEnv:function(){var t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function t(){var e={};function n(n,r){p(e[r])&&p(n)?e[r]=t(e[r],n):p(n)?e[r]=t({},n):u(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return e},extend:function(t,e,n){return b(e,(function(e,r){t[r]=n&&"function"==typeof e?i(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,s,a={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)s=i[o],r&&!r(s,t,e)||a[s]||(e[s]=t[s],a[s]=!0);t=!1!==n&&Object.getPrototypeOf(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:a,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(u(t))return t;var e=t.length;if(!l(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},isTypedArray:R,isFileList:y,forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:T,hasOwnProperty:A}},function(t,e,n){"use strict";var r=n(0);function i(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){s[t]={value:t}})),Object.defineProperties(i,s),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(t,e,n,s,a,u){var c=Object.create(o);return r.toFlatObject(t,c,(function(t){return t!==Error.prototype})),i.call(c,t.message,e,n,s,a),c.cause=t,c.name=t.name,u&&Object.assign(c,u),c},t.exports=i},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(1),o=n(27);function s(t){return r.isPlainObject(t)||r.isArray(t)}function a(t){return r.endsWith(t,"[]")?t.slice(0,-2):t}function u(t,e,n){return t?t.concat(e).map((function(t,e){return t=a(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}var c=r.toFlatObject(r,{},null,(function(t){return/^is[A-Z]/.test(t)}));t.exports=function(t,n,f){if(!r.isObject(t))throw new TypeError("target must be an object");n=n||new(o||FormData);var l,h=(f=r.toFlatObject(f,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!r.isUndefined(e[t])}))).metaTokens,p=f.visitor||v,d=f.dots,g=f.indexes,m=(f.Blob||"undefined"!=typeof Blob&&Blob)&&((l=n)&&r.isFunction(l.append)&&"FormData"===l[Symbol.toStringTag]&&l[Symbol.iterator]);if(!r.isFunction(p))throw new TypeError("visitor must be a function");function y(t){if(null===t)return"";if(r.isDate(t))return t.toISOString();if(!m&&r.isBlob(t))throw new i("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(t)||r.isTypedArray(t)?m&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function v(t,e,i){var o=t;if(t&&!i&&"object"==typeof t)if(r.endsWith(e,"{}"))e=h?e:e.slice(0,-2),t=JSON.stringify(t);else if(r.isArray(t)&&function(t){return r.isArray(t)&&!t.some(s)}(t)||r.isFileList(t)||r.endsWith(e,"[]")&&(o=r.toArray(t)))return e=a(e),o.forEach((function(t,i){!r.isUndefined(t)&&n.append(!0===g?u([e],i,d):null===g?e:e+"[]",y(t))})),!1;return!!s(t)||(n.append(u(i,e,d),y(t)),!1)}var w=[],b=Object.assign(c,{defaultVisitor:v,convertValue:y,isVisitable:s});if(!r.isObject(t))throw new TypeError("data must be an object");return function t(e,i){if(!r.isUndefined(e)){if(-1!==w.indexOf(e))throw Error("Circular reference detected in "+i.join("."));w.push(e),r.forEach(e,(function(e,o){!0===(!r.isUndefined(e)&&p.call(n,e,r.isString(o)?o.trim():o,i,b))&&t(e,i?i.concat(o):[o])})),w.pop()}}(t),n}}).call(this,n(22).Buffer)},function(t,e,n){"use strict";var r=n(1);function i(t,e,n){r.call(this,null==t?"canceled":t,r.ERR_CANCELED,e,n),this.name="CanceledError"}n(0).inherits(i,r,{__CANCEL__:!0}),t.exports=i},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(10),o=n(1),s=n(11),a=n(2),u=n(33),c=n(5),f=n(12),l={"Content-Type":"application/x-www-form-urlencoded"};function h(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var p,d={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(p=n(13)),p),transformRequest:[function(t,e){i(e,"Accept"),i(e,"Content-Type");var n,o=e&&e["Content-Type"]||"",s=o.indexOf("application/json")>-1,c=r.isObject(t);if(c&&r.isHTMLForm(t)&&(t=new FormData(t)),r.isFormData(t))return s?JSON.stringify(f(t)):t;if(r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t))return t;if(r.isArrayBufferView(t))return t.buffer;if(r.isURLSearchParams(t))return h(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();if(c){if(-1!==o.indexOf("application/x-www-form-urlencoded"))return u(t,this.formSerializer).toString();if((n=r.isFileList(t))||o.indexOf("multipart/form-data")>-1){var l=this.env&&this.env.FormData;return a(n?{"files[]":t}:t,l&&new l,this.formSerializer)}}return c||s?(h(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||d.transitional,n=e&&e.forcedJSONParsing,i="json"===this.responseType;if(t&&r.isString(t)&&(n&&!this.responseType||i)){var s=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw o.from(t,o.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.classes.FormData,Blob:c.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){d.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){d.headers[t]=r.merge(l)})),t.exports=d}).call(this,n(32))},function(t,e,n){"use strict";t.exports=n(34)},,function(t,e,n){"use strict";t.exports=function(t,e){return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(0),i=n(9);function o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s));var a,u=n&&n.encode||o,c=n&&n.serialize;return(a=c?c(e,n):r.isURLSearchParams(e)?e.toString():new i(e,n).toString(u))&&(t+=(-1===t.indexOf("?")?"?":"&")+a),t}},function(t,e,n){"use strict";var r=n(2);function i(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return e[t]}))}function o(t,e){this._pairs=[],t&&r(t,this,e)}var s=o.prototype;s.append=function(t,e){this._pairs.push([t,e])},s.toString=function(t){var e=t?function(e){return t.call(this,e,i)}:i;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")},t.exports=o},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){function e(t,n,i,o){var s=t[o++],a=Number.isFinite(+s),u=o>=t.length;return s=!s&&r.isArray(i)?i.length:s,u?(r.hasOwnProperty(i,s)?i[s]=[i[s],n]:i[s]=n,!a):(i[s]&&r.isObject(i[s])||(i[s]=[]),e(t,n,i[s],o)&&r.isArray(i[s])&&(i[s]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(i[s])),!a)}if(r.isFormData(t)&&r.isFunction(t.entries)){var n={};return r.forEachEntry(t,(function(t,i){e(function(t){return r.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),i,n,0)})),n}return null}},function(t,e,n){"use strict";var r=n(0),i=n(37),o=n(38),s=n(8),a=n(14),u=n(41),c=n(42),f=n(11),l=n(1),h=n(3),p=n(43),d=n(5);t.exports=function(t){return new Promise((function(e,n){var g,m=t.data,y=t.headers,v=t.responseType,w=t.withXSRFToken;function b(){t.cancelToken&&t.cancelToken.unsubscribe(g),t.signal&&t.signal.removeEventListener("abort",g)}r.isFormData(m)&&r.isStandardBrowserEnv()&&delete y["Content-Type"];var E=new XMLHttpRequest;if(t.auth){var R=t.auth.username||"",x=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(R+":"+x)}var T=a(t.baseURL,t.url);function A(){if(E){var r="getAllResponseHeaders"in E?u(E.getAllResponseHeaders()):null,o={data:v&&"text"!==v&&"json"!==v?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:t,request:E};i((function(t){e(t),b()}),(function(t){n(t),b()}),o),E=null}}if(E.open(t.method.toUpperCase(),s(T,t.params,t.paramsSerializer),!0),E.timeout=t.timeout,"onloadend"in E?E.onloadend=A:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(A)},E.onabort=function(){E&&(n(new l("Request aborted",l.ECONNABORTED,t,E)),E=null)},E.onerror=function(){n(new l("Network Error",l.ERR_NETWORK,t,E)),E=null},E.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new l(e,r.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,t,E)),E=null},r.isStandardBrowserEnv()&&(w&&r.isFunction(w)&&(w=w(t)),w||!1!==w&&c(T))){var S=t.xsrfHeaderName&&t.xsrfCookieName&&o.read(t.xsrfCookieName);S&&(y[t.xsrfHeaderName]=S)}"setRequestHeader"in E&&r.forEach(y,(function(t,e){void 0===m&&"content-type"===e.toLowerCase()?delete y[e]:E.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(E.withCredentials=!!t.withCredentials),v&&"json"!==v&&(E.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&E.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&E.upload&&E.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(g=function(e){E&&(n(!e||e.type?new h(null,t,E):e),E.abort(),E=null)},t.cancelToken&&t.cancelToken.subscribe(g),t.signal&&(t.signal.aborted?g():t.signal.addEventListener("abort",g))),m||!1===m||0===m||""===m||(m=null);var O=p(T);O&&-1===d.protocols.indexOf(O)?n(new l("Unsupported protocol "+O+":",l.ERR_BAD_REQUEST,t)):E.send(m)}))}},function(t,e,n){"use strict";var r=n(39),i=n(40);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isEmptyObject(e)?r.merge({},t):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function o(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function s(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function u(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||o,i=e(t);r.isUndefined(i)&&e!==u||(n[t]=i)})),n}},function(t,e){t.exports={version:"0.28.1"}},function(t,e,n){t.exports=n(20)},function(t,e,n){const r=n(48).default;t.exports=r},function(t,e,n){"use strict";var r=n(0),i=n(7),o=n(21),s=n(16),a=n(4),u=n(12);var c=function t(e){var n=new o(e),a=i(o.prototype.request,n);return r.extend(a,o.prototype,n),r.extend(a,n),a.create=function(n){return t(s(e,n))},a}(a);c.Axios=o,c.CanceledError=n(3),c.CancelToken=n(45),c.isCancel=n(15),c.VERSION=n(17).version,c.toFormData=n(2),c.AxiosError=n(1),c.Cancel=c.CanceledError,c.all=function(t){return Promise.all(t)},c.spread=n(46),c.isAxiosError=n(47),c.formToJSON=function(t){return u(r.isHTMLForm(t)?new FormData(t):t)},t.exports=c,t.exports.default=c},function(t,e,n){"use strict";var r=n(0),i=n(8),o=n(29),s=n(30),a=n(16),u=n(14),c=n(44),f=c.validators;function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var i=e.paramsSerializer;void 0!==i&&c.assertOptions(i,{encode:f.function,serialize:f.function},!0),r.isFunction(i)&&(e.paramsSerializer={serialize:i});var o=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,o.unshift(t.fulfilled,t.rejected))}));var l,h=[];if(this.interceptors.response.forEach((function(t){h.push(t.fulfilled,t.rejected)})),!u){var p=[s,void 0];for(Array.prototype.unshift.apply(p,o),p=p.concat(h),l=Promise.resolve(e);p.length;)l=l.then(p.shift(),p.shift());return l}for(var d=e;o.length;){var g=o.shift(),m=o.shift();try{d=g(d)}catch(t){m(t);break}}try{l=s(d)}catch(t){return Promise.reject(t)}for(;h.length;)l=l.then(h.shift(),h.shift());return l},l.prototype.getUri=function(t){t=a(this.defaults,t);var e=u(t.baseURL,t.url);return i(e,t.params,t.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(a(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}l.prototype[t]=e(),l.prototype[t+"Form"]=e(!0)})),t.exports=l},function(t,e,n){"use strict";(function(t){
|
|
2
|
+
/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
var r=n(24),i=n(25),o=n(26);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){l=!1;break}if(l)return o}return-1}function w(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function b(t,e,n,r){return Y(F(e,t.length-n),t,n,r)}function E(t,e,n,r){return Y(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function R(t,e,n,r){return E(t,e,n,r)}function x(t,e,n,r){return Y(q(e),t,n,r)}function T(t,e,n,r){return Y(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,u,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(r,i),f=t.slice(e,n),l=0;l<a;++l)if(c[l]!==f[l]){o=c[l],s=f[l];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return E(this,t,e,n);case"latin1":case"binary":return R(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function _(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=M(t[o]);return i}function P(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function U(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function B(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function k(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||U(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||U(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||U(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||U(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return k(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return k(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=u.isBuffer(t)?t:F(new u(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(23))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),s=r[0],a=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),f=0,l=a>0?s-4:s;for(n=0;n<l;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[f++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(f(t,s,s+16383>a?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
9
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
10
|
+
e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?i-1:0,h=n?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+p]=255&s,p+=d,s/=256,c-=8);t[n+p-d]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){t.exports=n(28)},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,n){"use strict";var r=n(0);function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.clear=function(){this.handlers&&(this.handlers=[])},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(0),i=n(31),o=n(15),s=n(4),a=n(3),u=n(10);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,null,t.transformRequest),u(t.headers,"Accept"),u(t.headers,"Content-Type"),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return c(t),e.data=i.call(t,e.data,e.headers,e.status,t.transformResponse),e}),(function(e){return o(e)||(c(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,e.response.status,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(0),i=n(4);t.exports=function(t,e,n,o){var s=this||i;return r.forEach(o,(function(r){t=r.call(s,t,e,n)})),t}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(5);t.exports=function(t,e){return i(t,new o.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,i){return o.isNode&&r.isBuffer(t)?(this.append(e,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}},function(t,e,n){"use strict";t.exports={isBrowser:!0,classes:{URLSearchParams:n(35),FormData:n(36),Blob:Blob},protocols:["http","https","file","blob","url","data"]}},function(t,e,n){"use strict";var r=n(9);t.exports="undefined"!=typeof URLSearchParams?URLSearchParams:r},function(t,e,n){"use strict";t.exports=FormData},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.slice(0,o)).toLowerCase(),n=r.trim(t.slice(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},function(t,e,n){"use strict";var r=n(17).version,i=n(1),o={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){o[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var s={};o.transitional=function(t,e,n){function o(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new i(o(r," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!s[r]&&(s[r]=!0,console.warn(o(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),o=r.length;o-- >0;){var s=r[o],a=e[s];if(a){var u=t[s],c=void 0===u||a(u,s,t);if(!0!==c)throw new i("option "+s+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},function(t,e,n){"use strict";var r=n(3);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){for(var e=n._listeners.length;e-- >0;)n._listeners[e](t);n._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,i,o){n.reason||(n.reason=new r(t,i,o),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},i.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},function(t,e,n){"use strict";n.r(e);class r{on(t,e){var n=this[t];n?n.push(e):this[t]=[e]}dispatch(t,e){var n=this[t];n&&n.forEach(t=>t(e))}}function i(t){ot.config.logging&&console.log("Gist: "+t)}function o(t,e,n){const r={value:e,expiry:n};localStorage.setItem(t,JSON.stringify(r))}function s(t){const e=localStorage.getItem(t);if(!e)return null;const n=JSON.parse(e),r=new Date,i=new Date(n.expiry);return r.getTime()>i.getTime()?(localStorage.removeItem(t),null):n.value}function a(t){localStorage.removeItem(t)}var u,c=new Uint8Array(16);function f(){if(!u&&!(u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(c)}var l=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var h=function(t){return"string"==typeof t&&l.test(t)},p=[],d=0;d<256;++d)p.push((d+256).toString(16).substr(1));var g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase();if(!h(n))throw TypeError("Stringified UUID is invalid");return n};var m=function(t,e,n){var r=(t=t||{}).random||(t.rng||f)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return g(r)};function y(){return s("gist.web.userToken")}function v(){var t=new Date;if(t.setDate(t.getDate()+365),null===y()){var e=s("gist.web.guestUserToken");null==e&&(o("gist.web.guestUserToken",e=m(),t),i(`Set guest user token "${e}" with expiry date set to 1 year from today`)),o("gist.web.userToken",e,t),o("gist.web.usingGuestUserToken",!0,t)}}var w=n(18),b=n.n(w);const E={ENGINE_API_ENDPOINT:{prod:"https://engine.api.gist.build",dev:"https://engine.api.dev.gist.build",local:"http://engine.api.local.gist.build:82"},GIST_QUEUE_API_ENDPOINT:{prod:"https://gist-queue-consumer-api.cloud.gist.build",dev:"https://gist-queue-consumer-api.cloud.dev.gist.build",local:"http://api.local.gist.build:86"},GIST_VIEW_ENDPOINT:{prod:"https://renderer.gist.build/2.0",dev:"https://renderer.gist.build/2.0",local:"http://app.local.gist.build:8080/web"}};function R(){var t={"X-CIO-Site-Id":ot.config.siteId,"X-CIO-Datacenter":ot.config.dataCenter},e=y();return null!=e&&(t["X-Gist-Encoded-User-Token"]=btoa(e)),b.a.create({baseURL:E.GIST_QUEUE_API_ENDPOINT[ot.config.env],timeout:2e4,headers:t})}var x=600,T=!1;async function A(){var t;try{if(!T){var e=(new Date).getTime();T=!0,t=await R().post("/api/v1/users?timestamp="+e,{})}}catch(e){e.response?t=e.response:i("Error getting user queue: "+e)}finally{return T=!1,function(t){if(t&&t.headers){var e=t.headers["x-gist-queue-polling-interval"];e&&e>0&&(x=e)}var n=new Date((new Date).getTime()+1e3*x);o("gist.web.userQueueNextPullCheck",x,n)}(t),t}}function S(t){var e="",n="",r="",i=!1,o=!1,s=!1,a=!1,u=null,c=!1,f="#00000033",l=414,h=!1;return t.properties&&t.properties.gist&&(t.properties.gist.campaignId&&(u=t.properties.gist.campaignId),t.properties.gist.elementId&&(e=t.properties.gist.elementId,i=!0),t.properties.gist.routeRuleWeb&&(n=t.properties.gist.routeRuleWeb,o=!0),t.properties.gist.position&&(r=t.properties.gist.position,s=!0),t.properties.gist.scale&&(a=t.properties.gist.scale),t.properties.gist.overlayColor&&(f=t.properties.gist.overlayColor),t.properties.gist.messageWidth&&t.properties.gist.messageWidth>0&&(l=t.properties.gist.messageWidth,h=!0),t.properties.gist.persistent&&(c=!0)),{isEmbedded:i,elementId:e,hasRouteRule:o,routeRule:n,position:r,hasPosition:s,shouldScale:a,campaignId:u,messageWidth:l,overlayColor:f,persistent:c,hasCustomWidth:h}}var O=["x-gist-top","x-gist-floating-top","x-gist-bottom","x-gist-floating-bottom","x-gist-floating-bottom-left","x-gist-floating-bottom-right","x-gist-floating-top-left","x-gist-floating-top-right"];const I=t=>new Promise(e=>setTimeout(e,t)),_=["x-gist-top","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"];function P(t,e,n){var r=N(t);if(r){var o=S(n),s=o.messageWidth+"px";_.includes(o.elementId)&&!o.hasCustomWidth&&(s="100%"),O.includes(o.elementId)&&(r.style.width=s),U(t)||(r.style.height="0px"),r.innerHTML=function(t,e,n){return function(t,e,n){var r=800;return e.messageWidth>r&&(r=e.messageWidth),`\n <div id="gist-embed">\n <style>\n #x-gist-floating-top, #x-gist-floating-top-left, #x-gist-floating-top-right {\n position: fixed;\n top: 0px;\n z-index: 1000000;\n }\n #x-gist-floating-bottom, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n position: fixed;\n bottom: 0px;\n z-index: 1000000;\n }\n #x-gist-bottom, #x-gist-top, #x-gist-floating-top, #x-gist-floating-bottom {\n left: 50%;\n transform: translate(-50%, 0%);\n }\n #x-gist-floating-top-right, #x-gist-floating-bottom-right {\n right: 0px;\n }\n #gist-embed {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container .gist-frame {\n height: 100%;\n width: 100%;\n border: none;\n }\n @media (max-width: ${r}px) {\n #x-gist-top, #x-gist-bottom, #x-gist-floating-top, #x-gist-floating-bottom, #x-gist-floating-top-left, #x-gist-floating-top-right, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n width: 100% !important;\n }\n }\n </style>\n <div id="gist-embed-container">\n <iframe id="${t}" class="gist-frame" src="${n}"></iframe>\n </div>\n </div>`}(D(e.instanceId),n,t)}(e,n,o)}else i(`Message could not be embedded, elementId ${t} not found.`)}function U(t){var e=N(t);if(e)return e.style&&e.style.height&&"0px"!=e.style.height}function C(t,e){document.body.insertAdjacentHTML("afterbegin",function(t,e){var n=S(e);return function(t,e,n){var r=600;return e.messageWidth>r&&(r=e.messageWidth),`\n <div id="gist-embed-message">\n <style>\n #gist-overlay.background {\n position: fixed;\n z-index: 9999999998;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: ${e.overlayColor};\n visibility: hidden;\n }\n #gist-overlay.background.visible {\n visibility: visible;\n }\n #gist-overlay.background.is-blacked-out {\n display: block;\n }\n .gist-message {\n width: ${e.messageWidth}px;\n position: absolute;\n border: none;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n z-index: 9999999999;\n left: 50%;\n transform: translateX(-50%);\n }\n .gist-message.visible {\n opacity: 1;\n pointer-events: auto;\n }\n .gist-message.center {\n transform: translate(-50%, -50%);\n top: 50%;\n }\n .gist-message.bottom {\n bottom: 0;\n }\n .gist-message.top {\n top: 0;\n }\n @media (max-width: ${r}px) {\n .gist-message {\n width: 100%;\n }\n }\n </style>\n <div id="gist-overlay" class="background">\n <iframe id="${t}" class="gist-message" src="${n}"></iframe>\n </div>\n </div>`}(D(e.instanceId),n,t)}(t,e))}function B(){var t=document.querySelector("#gist-embed-message");t&&t.parentNode.removeChild(t)}function D(t){return"gist-"+t}function L(){var t=document.querySelector(".gist-message");t&&t.classList.add("visible")}function N(t){try{var e=document.querySelector("#"+t);return e||null}catch{return null}}var k=[];async function j(t){if(ot.isDocumentVisible){if(ot.overlayInstanceId)return i(`Message ${ot.overlayInstanceId} already showing.`),null;var e=S(t);return t.instanceId=m(),t.overlay=!0,t.firstLoad=!0,t.shouldResizeHeight=!0,t.shouldScale=e.shouldScale,t.renderStartTime=(new Date).getTime(),ot.overlayInstanceId=t.instanceId,ot.currentMessages.push(t),z(t)}return i("Document hidden, not showing message now."),null}async function M(t,e){return ot.isDocumentVisible?(t.instanceId=m(),t.overlay=!1,t.firstLoad=!0,t.shouldScale=!1,t.elementId=e,t.shouldResizeHeight=!U(e),t.renderStartTime=(new Date).getTime(),ot.currentMessages.push(t),z(t,e)):(i("Document hidden, not showing message now."),null)}async function F(t){t?(ot.messageDismissed(t),t.overlay?await $(!0,t):Y(t)):i(`Message with instance id: ${instanceId} not found`)}async function q(t){var e=S(t);t?e.persistent&&(i("Persistent message dismissed, logging view"),await W(t)):i(`Message with instance id: ${instanceId} not found`)}function Y(t){var e,n;H(t.instanceId),e=t.elementId,(n=N(e))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function $(t,e){H(e.instanceId),ot.overlayInstanceId=null,t?await async function(){var t=document.querySelector(".gist-message");t&&(t.classList.remove("visible"),await I(300)),B()}():B(),0==ot.currentMessages.length&&(window.removeEventListener("message",X),window.removeEventListener("touchstart",J))}function z(t,e=null){if(e&&function(t){var e=N(t);return!(!e||!e.classList.contains("gist-visible"))}(e))return i(`Message ${t.messageId} already showing in element ${e}.`),null;var n,r,o={endpoint:E.ENGINE_API_ENDPOINT[ot.config.env],siteId:ot.config.siteId,dataCenter:ot.config.dataCenter,messageId:t.messageId,instanceId:t.instanceId,livePreview:!1,properties:t.properties},s=`${E.GIST_VIEW_ENDPOINT[ot.config.env]}/index.html?options=${n=JSON.stringify(o),r=btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode("0x"+e)}))),encodeURIComponent(r)}`;return window.addEventListener("message",X),window.addEventListener("touchstart",J),e?(O.includes(e)&&function(t){const e=document.createElement("div");switch(e.id=t,t){case"x-gist-top":document.body.insertBefore(e,document.body.firstChild);break;default:document.body.insertAdjacentElement("beforeend",e)}i("Top & bottom elements injected into page")}(e),P(e,s,t)):C(s,t),t}async function W(t){i("Message shown, logging view for: "+t.messageId);var e={};null!=t.queueId?(!function(t){k.push(t);var e=it();null!=e&&e.length>0&&rt(e.filter(e=>e.queueId!==t.queueId))}(t),e=await async function(t){try{return await R().post("/api/v1/logs/queue/"+t)}catch(t){return t.response}}(t.queueId)):e=await async function(t){try{return await R().post("/api/v1/logs/message/"+t)}catch(t){return t.response}}(t.messageId),200===e.status?i("Message view logged"):i("Problem logging message: "+e.status)}function V(t){return ot.currentMessages.find(e=>e.instanceId===t)}function H(t){ot.currentMessages=ot.currentMessages.filter(e=>e.instanceId!==t)}function G(t,e){H(t),ot.currentMessages.push(e)}function J(t){}async function X(t){if(t.data.gist){var e=t.data.gist.instanceId,n=V(e);if(!n)return;var r=S(n);switch(t.data.gist.method){case"routeLoaded":var o=.001*((new Date).getTime()-n.renderStartTime);i(`Engine render for message: ${n.messageId} timer elapsed in ${o.toFixed(3)} seconds`),n.currentRoute=t.data.gist.parameters.route,n.firstLoad&&(n.overlay?function(t){var e=document.querySelector("#gist-overlay");if(e){e.classList.add("visible");var n=document.querySelector(".gist-message");t.position?n.classList.add(t.position):n.classList.add("center"),setTimeout(L,100)}else B()}(n):(l=n.elementId,(h=N(l))&&h.classList.add("gist-visible")),ot.messageShown(n),r.persistent?i("Persistent message shown, skipping logging view"):await W(n),n.firstLoad=!1),G(e,n);break;case"tap":var s=t.data.gist.parameters.action,a=t.data.gist.parameters.name;if(ot.messageAction(n,s,a),t.data.gist.parameters.system&&!r.persistent){await F(n);break}try{if((f=new URL(s))&&"gist:"===f.protocol)switch(f.href.replace("gist://","").split("?")[0]){case"close":await F(n),await q(n),await et();break;case"showMessage":var u=f.searchParams.get("messageId"),c=f.searchParams.get("properties");u&&(c&&(c=JSON.parse(atob(c))),await ot.showMessage({messageId:u,properties:c}));break;case"loadPage":var f;(f=f.href.substring(f.href.indexOf("?url=")+5))&&(f.startsWith("https://")||f.startsWith("http://")||f.startsWith("/")?window.location.href=f:window.location.href=window.location+f)}}catch(t){}break;case"routeChanged":n.currentRoute=t.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),G(e,n),i("Route changed to: "+n.currentRoute);break;case"sizeChanged":i(`Size Changed Width: ${t.data.gist.parameters.width} - Height: ${t.data.gist.parameters.height}`),n.elementId&&!n.shouldResizeHeight||function(t,e){var n=N(t.elementId?t.elementId:D(t.instanceId));if(n){var r=n.style;if(e.height>0)if(e.height>window.innerHeight){var i=1-(e.height/window.innerHeight-1);t.shouldScale&&i>=.4?(r.height=e.height+"px",r.transform=`translateX(-50%) translateY(-50%) scale(${i})`):r.height=window.innerHeight+"px"}else r.height=e.height+"px"}}(n,t.data.gist.parameters);break;case"titleChanged":i("Overlay title changed to: "+t.data.gist.parameters.title),function(t,e){var n=N(D(t));n&&(n.title=e)}(e,t.data.gist.parameters.title);break;case"eventDispatched":ot.events.dispatch("eventDispatched",{name:t.data.gist.parameters.name,payload:t.data.gist.parameters.payload});break;case"error":case"routeError":ot.messageError(n),ot.overlayInstanceId?$(!1,n):Y(n)}}var l,h}var Q=(t,e)=>t().then((t=>new Promise(e=>setTimeout(e,t)))(e).then(()=>Q(t,e))),K=!1,Z=[];async function tt(){K?await et():(!async function(){var t="G"+m().substring(0,8),e=document.createElement("div");e.setAttribute("id",t),e.style.display="none",document.body.appendChild(e),await I(5e3),M({messageId:""},t)}(),y()?(i("Queue watcher started"),K=!0,Q(()=>new Promise(()=>async function(){if(y())if(ot.isDocumentVisible)if(null===s("gist.web.userQueueNextPullCheck")){var t=await A(),e=[];t?(200===t.status||204===t.status?(i("200 response, updating local store."),rt(e=t.data)):304===t.status&&(i("304 response, using local store."),e=it()),e&&e.length>0?(i(`Message queue checked for user ${y()}, ${e.length} messages found.`),Z=e,await et()):(Z=[],i("No messages for user token."))):i("There was an error while checking message queue.")}else i("Next queue pull scheduled for later");else i("Document not visible, skipping queue check.");else i("User token reset, skipping queue check.")}()),1e3)):i("User token not setup, queue not started."))}async function et(){i("Messages in local queue: "+Z.length);var t=[],e=Z.sort((t,e)=>t.priority-e.priority);for(const o of e){if(!await nt(o)){var n=t.find(t=>t.queueId===o.queueId),r=ot.currentMessages.find(t=>t.queueId===o.queueId);n||r?i(`Message with queueId: ${o.queueId} already in queue, discarding.`):t.push(o)}}Z=t}async function nt(t){if(!function(t){return void 0!==k.find(e=>e.queueId===t.queueId)}(t)){var e=S(t);if(e.hasRouteRule){var n=ot.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var r=e.routeRule;if(i("Verifying route against rule: "+r),!new RegExp(r).test(n))return i(`Route ${n} does not match rule.`),!1}return e.hasPosition&&(t.position=e.position),e.isEmbedded?await M(t,e.elementId):await j(t)}i(`Message with ${t.queueId} has been shown before, skipping.`)}function rt(t){o("gist.web.userQueue",t,new Date((new Date).getTime()+36e5))}function it(){return s("gist.web.userQueue")}var ot=e.default=class{static async setup(t){this.events=new r,this.config={useGuestSession:void 0!==t.useGuestSession&&t.useGuestSession,siteId:t.siteId,dataCenter:t.dataCenter,env:void 0===t.env?"prod":t.env,logging:void 0!==t.logging&&t.logging,experiments:void 0!==t.experiments&&t.experiments},this.currentMessages=[],this.overlayInstanceId=null,this.currentRoute=null,this.isDocumentVisible=!0,i(`Setup complete on ${this.config.env} environment.`),this.config.useGuestSession&&v(),await tt(),document.addEventListener("visibilitychange",async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await et())},!1)}static async setCurrentRoute(t){this.currentRoute=t,i("Current route set to: "+t),await et()}static async setUserToken(t,e){!function(t,e){void 0===e&&(e=new Date).setDate(e.getDate()+30),o("gist.web.userToken",t,e),a("gist.web.usingGuestUserToken"),i(`Set user token "${t}" with expiry date set to ${e}`)}(t,e),await tt()}static async clearUserToken(){a("gist.web.userToken"),i("Cleared user token"),this.config.useGuestSession&&v(),await tt()}static async dismissMessage(t){var e=V(t);await F(e),await q(e),await et()}static async embedMessage(t,e){var n=await M(t,e);return n?n.instanceId:null}static async showMessage(t){var e=await j(t);return e?e.instanceId:null}static messageShown(t){i("Message shown: "+t.messageId),this.events.dispatch("messageShown",t)}static messageDismissed(t){null!==t&&(i("Message dismissed: "+t.messageId),this.events.dispatch("messageDismissed",t))}static messageError(t){i("Message error: "+t.messageId),this.events.dispatch("messageError",t)}static messageAction(t,e,n){i(`Message action: ${t.currentRoute}, ${e} with name ${n} on ${t.instanceId}`),this.events.dispatch("messageAction",{message:t,action:e,name:n})}}}])}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "customerio-gist-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "Build beautiful in-app flows with no code and deliver them instantly to your app. http://customer.io",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"webpack-cli": "^3.3.12"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"axios": "^0.
|
|
26
|
+
"axios": "^0.28.1",
|
|
27
27
|
"uuid": "^8.3.2"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|