@microsoft/ocsdk 0.5.21-main.cc89d16 → 0.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/SDK.js +56865 -7599
  2. package/dist/SDK.min.js +2 -10
  3. package/dist/SDK.min.js.LICENSE.txt +3 -0
  4. package/lib/Common/Constants.js +4 -10
  5. package/lib/Common/Enums.js +28 -49
  6. package/lib/Common/EventNames.js +3 -11
  7. package/lib/Common/Locales.js +4 -9
  8. package/lib/Common/Mappings.js +1 -1
  9. package/lib/Common/OCSDKLogger.js +3 -14
  10. package/lib/Common/OmnichannelEndpoints.js +4 -9
  11. package/lib/Common/OmnichannelHTTPHeaders.js +4 -9
  12. package/lib/Common/RequestTimeoutConfig.js +1 -1
  13. package/lib/Interfaces/IAxiosRetryOptions.js +1 -1
  14. package/lib/Interfaces/IDataMaskingInfo.js +1 -1
  15. package/lib/Interfaces/IEmailTranscriptOptionalParams.js +1 -1
  16. package/lib/Interfaces/IGetChatTokenOptionalParams.js +1 -1
  17. package/lib/Interfaces/IGetChatTranscriptsOptionalParams.js +1 -1
  18. package/lib/Interfaces/IGetLWIDetailsOptionalParams.js +1 -1
  19. package/lib/Interfaces/IGetPersistentChatHistoryOptionalParams.js +1 -1
  20. package/lib/Interfaces/IGetQueueAvailabilityOptionalParams.js +1 -1
  21. package/lib/Interfaces/IGetSurveyInviteLinkOptionalParams.js +1 -1
  22. package/lib/Interfaces/IOCSDKLogger.js +1 -1
  23. package/lib/Interfaces/IOmnichannelConfiguration.js +1 -1
  24. package/lib/Interfaces/IPosition.js +1 -1
  25. package/lib/Interfaces/IReconnectAvailabilityOptionalParams.js +1 -1
  26. package/lib/Interfaces/IReconnectableChatsParams.js +1 -1
  27. package/lib/Interfaces/ISDK.js +1 -1
  28. package/lib/Interfaces/ISDKConfiguration.js +1 -1
  29. package/lib/Interfaces/ISecondaryChannelEventOptionalParams.js +1 -1
  30. package/lib/Interfaces/ISendTypingIndicatorOptionalParams.js +1 -1
  31. package/lib/Interfaces/ISessionCloseOptionalParams.js +1 -1
  32. package/lib/Interfaces/ISessionInitOptionalParams.js +1 -1
  33. package/lib/Interfaces/ISubmitPostChatResponseOptionalParams.js +1 -1
  34. package/lib/Interfaces/ITimer.js +1 -1
  35. package/lib/Interfaces/IValidateAuthChatRecordOptionalParams.js +1 -1
  36. package/lib/Interfaces/OmnichannelQueryParameter.js +1 -1
  37. package/lib/Model/FetchChatTokenResponse.js +4 -9
  38. package/lib/Model/ILogger.js +1 -1
  39. package/lib/Model/IOCSDKLogData.js +1 -1
  40. package/lib/Model/InitContext.js +5 -9
  41. package/lib/Model/Location.js +4 -8
  42. package/lib/Model/LogLevel.js +4 -6
  43. package/lib/Model/QueueAvailability.js +28 -9
  44. package/lib/Model/ReconnectAvailability.js +13 -9
  45. package/lib/Model/ReconnectMappingRecord.js +22 -9
  46. package/lib/SDK.d.ts +1 -1
  47. package/lib/SDK.js +1893 -2411
  48. package/lib/SDK.js.map +1 -1
  49. package/lib/SDKProvider.js +3 -14
  50. package/lib/Utils/BrowserInfo.js +6 -36
  51. package/lib/Utils/CustomContextData.js +7 -17
  52. package/lib/Utils/DeviceInfo.js +3 -15
  53. package/lib/Utils/EventManager.js +4 -15
  54. package/lib/Utils/LocationInfo.js +27 -47
  55. package/lib/Utils/LoggingSanitizer.js +14 -45
  56. package/lib/Utils/OSInfo.js +3 -21
  57. package/lib/Utils/SessionInitRetryHandler.js +5 -17
  58. package/lib/Utils/TelemetryHelper.js +3 -12
  59. package/lib/Utils/Timer.js +3 -12
  60. package/lib/Utils/axiosRetryHandler.js +14 -43
  61. package/lib/Utils/endpointsCreators.js +4 -16
  62. package/lib/Utils/httpHeadersUtils.js +2 -10
  63. package/lib/Utils/isExpectedAxiosError.js +2 -8
  64. package/lib/Utils/setAuthCodeNonce.js +1 -1
  65. package/lib/Utils/sleep.js +2 -5
  66. package/lib/Utils/throwClientHTTPError.js +2 -6
  67. package/lib/Utils/uuid.js +3 -6
  68. package/lib/Utils/waitTimeBetweenRetriesConfigs.js +2 -3
  69. package/lib/index.js +4 -14
  70. package/package.json +20 -14
package/dist/SDK.min.js CHANGED
@@ -1,10 +1,2 @@
1
- !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=23)}([function(e,t,n){"use strict";(function(e,r,o){var i=n(11);const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:u,toStringTag:c}=Symbol,l=(d=Object.create(null),e=>{const t=a.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const f=e=>(e=e.toLowerCase(),t=>l(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,g=h("undefined");function v(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=f("ArrayBuffer");const E=h("string"),T=h("function"),y=h("number"),C=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==l(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||u in e)},S=f("Date"),R=f("File"),b=f("Blob"),O=f("FileList"),I=f("URLSearchParams"),[A,L,D,P]=["ReadableStream","Request","Response","Headers"].map(f);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(v(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function x(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e,_=e=>!g(e)&&e!==k;const U=(M="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>M&&e instanceof M);var M;const F=f("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),j=f("RegExp"),G=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const H=f("AsyncFunction"),q=(V="function"==typeof r,W=T(k.postMessage),V?r:W?(K="axios@"+Math.random(),Y=[],k.addEventListener("message",({source:e,data:t})=>{e===k&&t===K&&Y.length&&Y.shift()()},!1),e=>{Y.push(e),k.postMessage(K,"*")}):e=>setTimeout(e));var V,W,K,Y;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(k):void 0!==o&&o.nextTick||q;t.a={isArray:p,isArrayBuffer:m,isBuffer:v,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||T(e.append)&&("formdata"===(t=l(e))||"object"===t&&T(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:E,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:C,isPlainObject:w,isEmptyObject:e=>{if(!C(e)||v(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:L,isResponse:D,isHeaders:P,isUndefined:g,isDate:S,isFile:R,isBlob:b,isRegExp:j,isFunction:T,isStream:e=>C(e)&&T(e.pipe),isURLSearchParams:I,isTypedArray:U,isFileList:O,forEach:N,merge:function e(){const{caseless:t,skipUndefined:n}=_(this)&&this||{},r={},o=(o,i)=>{const a=t&&x(r,i)||i;w(r[a])&&w(o)?r[a]=e(r[a],o):w(o)?r[a]=e({},o):p(o)?r[a]=o.slice():n&&g(o)||(r[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(N(t,(t,r)=>{n&&T(t)?e[r]=Object(i.a)(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!y(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[u]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:G,freezeMethods:e=>{G(e,(t,n)=>{if(T(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];T(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:k,isContextDefined:_,isSpecCompliantForm:function(e){return!!(e&&T(e.append)&&"FormData"===e[c]&&e[u])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(C(e)){if(t.indexOf(e)>=0)return;if(v(e))return e;if(!("toJSON"in e)){t[r]=e;const o=p(e)?[]:{};return N(e,(e,t)=>{const i=n(e,r+1);!g(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(C(e)||T(e))&&T(e.then)&&T(e.catch),setImmediate:q,asap:z,isIterable:e=>null!=e&&T(e[u])}}).call(this,n(7),n(33).setImmediate,n(14))},function(e,t,n){"use strict";var r=n(0);function o(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}r.a.inherits(o,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:r.a.toJSONObject(this.config),code:this.code,status:this.status}}});const i=o.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{a[e]={value:e}}),Object.defineProperties(o,a),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=(e,t,n,a,s,u)=>{const c=Object.create(i);r.a.toFlatObject(e,c,(function(e){return e!==Error.prototype}),e=>"isAxiosError"!==e);const l=e&&e.message?e.message:"Error",d=null==t&&e?e.code:t;return o.call(c,l,d,n,a,s),e&&null==c.cause&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",u&&Object.assign(c,u),c},t.a=o},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(1),i=n(12);function a(e){return r.a.isPlainObject(e)||r.a.isArray(e)}function s(e){return r.a.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,n){return e?e.concat(t).map((function(e,t){return e=s(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const c=r.a.toFlatObject(r.a,{},null,(function(e){return/^is[A-Z]/.test(e)}));t.a=function(t,n,l){if(!r.a.isObject(t))throw new TypeError("target must be an object");n=n||new(i.a||FormData);const d=(l=r.a.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.a.isUndefined(t[e])}))).metaTokens,f=l.visitor||m,h=l.dots,p=l.indexes,g=(l.Blob||"undefined"!=typeof Blob&&Blob)&&r.a.isSpecCompliantForm(n);if(!r.a.isFunction(f))throw new TypeError("visitor must be a function");function v(t){if(null===t)return"";if(r.a.isDate(t))return t.toISOString();if(r.a.isBoolean(t))return t.toString();if(!g&&r.a.isBlob(t))throw new o.a("Blob is not supported. Use a Buffer instead.");return r.a.isArrayBuffer(t)||r.a.isTypedArray(t)?g&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function m(e,t,o){let i=e;if(e&&!o&&"object"==typeof e)if(r.a.endsWith(t,"{}"))t=d?t:t.slice(0,-2),e=JSON.stringify(e);else if(r.a.isArray(e)&&function(e){return r.a.isArray(e)&&!e.some(a)}(e)||(r.a.isFileList(e)||r.a.endsWith(t,"[]"))&&(i=r.a.toArray(e)))return t=s(t),i.forEach((function(e,o){!r.a.isUndefined(e)&&null!==e&&n.append(!0===p?u([t],o,h):null===p?t:t+"[]",v(e))})),!1;return!!a(e)||(n.append(u(o,t,h),v(e)),!1)}const E=[],T=Object.assign(c,{defaultVisitor:m,convertValue:v,isVisitable:a});if(!r.a.isObject(t))throw new TypeError("data must be an object");return function e(t,o){if(!r.a.isUndefined(t)){if(-1!==E.indexOf(t))throw Error("Circular reference detected in "+o.join("."));E.push(t),r.a.forEach(t,(function(t,i){!0===(!(r.a.isUndefined(t)||null===t)&&f.call(n,t,r.a.isString(i)?i.trim():i,o,T))&&e(t,o?o.concat(i):[i])})),E.pop()}}(t),n}}).call(this,n(35).Buffer)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.LiveChatVersion=t.OCSDKTelemetryEvent=t.ChannelId=t.OperatingSystem=t.DeviceType=t.Browser=t.BrowserVendor=void 0,t.BrowserVendor=r,function(e){e.IE="IE",e.CHROME="Chrome",e.FIREFOX="Firefox",e.SAFARI="Safari",e.EDGE="Edge",e.EDGE_CHROMIUM="Edg",e.OPERA="Opera",e.UNKNOWN="Unknown"}(r||(t.BrowserVendor=r={})),t.Browser=o,function(e){e[e.Chrome=0]="Chrome",e[e.Firefox=1]="Firefox",e[e.Ie=2]="Ie",e[e.Edge=3]="Edge",e[e.Safari=4]="Safari",e[e.None=5]="None"}(o||(t.Browser=o={})),t.DeviceType=i,function(e){e.Desktop="Desktop",e.Mobile="Mobile",e.Tablet="Tablet"}(i||(t.DeviceType=i={})),t.OperatingSystem=a,function(e){e.WINDOWS="Windows",e.MACOSX="Mac OS X",e.WINDOWS_PHONE="Windows Phone",e.WINDOWS_RT="Windows RT",e.IOS="iOS",e.ANDROID="Android",e.LINUX="Linux",e.UNKNOWN="Unknown"}(a||(t.OperatingSystem=a={})),t.ChannelId=s,function(e){e.LCW="lcw",e.SMS="sms",e.FACEBOOK="facebook",e.WECHAT="wechat"}(s||(t.ChannelId=s={})),t.OCSDKTelemetryEvent=u,function(e){e.GETLCWFCSDETAILSSTARTED="GetLcwFcsDetailsStarted",e.GETLCWFCSDETAILSSUCCEEDED="GetLcwFcsDetailsSucceeded",e.GETLCWFCSDETAILSFAILED="GetLcwFcsDetailsFailed",e.GETCHATCONFIGFSTARTED="GetChatConfig",e.GETCHATCONFIGSUCCEEDED="GetChatConfigSucceeded",e.GETCHATCONFIGFAILED="GetChatConfigFailed",e.GETRECONNECTABLECHATSSTARTED="GetReconnnectableChatsStarted",e.GETRECONNECTABLECHATSSUCCEEDED="GetReconnnectableChatsSucceeded",e.GETRECONNECTABLECHATSFAILED="GetReconnnectableChatsFailed",e.GETRECONNECTAVAILABILITYSUCCEEDED="GetReconnnectableAvailabilitySucceeded",e.GETRECONNECTAVAILABILITYSTARTED="GetReconnnectableAvailabilityStarted",e.GETRECONNECTAVAILABILITYFAILED="GetReconnnectableAvailabilityFailed",e.GETCHATTOKENSTARTED="GetChatTokenStarted",e.GETCHATTOKENSUCCEEDED="GetChatTokenSucceeded",e.GETCHATTOKENFAILED="GetChatTokenFailed",e.GETLWISTATUSSTARTED="GetLwiStatusStarted",e.GETLWISTATUSSUCCEEDED="GetLwiStatusSucceeded",e.GETLWISTATUSFAILED="GetLwiStatusFailed",e.SESSIONINITSTARTED="SessionInitStarted",e.SESSIONINITSUCCEEDED="SessionInitSucceeded",e.SESSIONINITFAILED="SessionInitFailed",e.CREATESESSIONSTARTED="CreateSessionStarted",e.CREATESESSIONSUCCEEDED="CreateSessionSucceeded",e.CREATESESSIONFAILED="CreateSessionFailed",e.SESSIONCLOSESTARTED="SessionCloseStarted",e.SESSIONCLOSESUCCEEDED="SessionCloseSucceeded",e.SESSIONCLOSEFAILED="SessionCloseFailed",e.SUBMITPOSTCHATSTARTED="SubmitPostChatStarted",e.SUBMITPOSTCHATSUCCEEDED="SubmitPostChatSucceeded",e.SUBMITPOSTCHATFAILED="SubmitPostChatFailed",e.GETCHATTRANSCRIPTSTARTED="GetChatTranscriptStarted",e.GETCHATTRANSCRIPTSUCCEEDED="GetChatTranscriptSucceeded",e.GETCHATTRANSCRIPTFAILED="GetChatTranscriptFailed",e.EMAILTRANSCRIPTSTARTED="EmailTranscriptStarted",e.EMAILTRANSCRIPTSUCCEEDED="EmailTranscriptSucceeded",e.EMAILTRANSCRIPTFAILED="EmailTranscriptFailed",e.FETCHDATAMASKINGSTARTED="FetchDataMaskingStarted",e.FETCHDATAMASKINGSUCCEEDED="FetchDataMaskingSucceeded",e.FETCHDATAMASKINGFAILED="FetchDataMaskingFailed",e.SECONDARYCHANNELEVENTREQUESTSTARTED="SecondaryChannelEventRequestStarted",e.SECONDARYCHANNELEVENTREQUESTSUCCEEDED="SecondaryChannelEventRequestSucceeded",e.SECONDARYCHANNELEVENTREQUESTFAILED="SecondaryChannelEventRequestFailed",e.GETSURVEYINVITELINKSTARTED="GetSurveyInviteLinkStarted",e.GETSURVEYINVITELINKSUCCEEDED="GetSurveyInviteLinkSucceeded",e.GETSURVEYINVITELINKFAILED="GetSurveyInviteLinkFailed",e.VALIDATEAUTHCHATRECORDSTARTED="ValidateAuthChatRecordStarted",e.VALIDATEAUTHCHATRECORDSUCCEEDED="ValidateAuthChatRecordSucceeded",e.VALIDATEAUTHCHATRECORDFAILED="ValidateAuthChatRecordFailed",e.GETAGENTAVAILABILITYSTARTED="GetAgentAvailabilityStarted",e.GETAGENTAVAILABILITYSUCCEEDED="GetAgentAvailabilitySucceeded",e.GETAGENTAVAILABILITYFAILED="GetAgentAvailabilityFailed",e.SENDTYPINGINDICATORFAILED="SendTypingIndicatorFailed",e.SENDTYPINGINDICATORSUCCEEDED="SendTypingIndicatorSucceeded",e.GETPERSISTENTCHATHISTORYSTARTED="GetPersistentChatHistoryStarted",e.GETPERSISTENTCHATHISTORYSUCCEEDED="GetPersistentChatHistorySucceeded",e.GETPERSISTENTCHATHISTORYFAILED="GetPersistentChatHistoryFailed"}(u||(t.OCSDKTelemetryEvent=u={})),t.LiveChatVersion=c,function(e){e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3"}(c||(t.LiveChatVersion=c={})),t.SDKError=l,function(e){e.ClientHTTPTimeoutErrorName="ClientHTTPTimeoutError",e.ClientHTTPTimeoutErrorMessage="Server took too long to respond"}(l||(t.SDKError=l={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=n(8),s=function e(){(0,o.default)(this,e)};t.default=s,(0,i.default)(s,"requiredOmnichannelConfigurationParameters",["orgUrl","orgId","widgetId"]),(0,i.default)(s,"defaultHeaders",{"Content-Type":"application/json"}),(0,i.default)(s,"bypassCacheHeaders",{"Cache-Control":"no-store, must-revalidate, no-cache","X-Cache-Control":"no-store"}),(0,i.default)(s,"defaultChannelId",a.ChannelId.LCW),(0,i.default)(s,"defaultLocale","en-us"),(0,i.default)(s,"noContentStatusCode",204),(0,i.default)(s,"tooManyRequestsStatusCode",429),(0,i.default)(s,"notFoundStatusCode",404),(0,i.default)(s,"badRequestStatusCode",400),(0,i.default)(s,"outOfOfficeErrorCode",705),(0,i.default)(s,"sensitiveProperties",["AuthenticatedUserToken"]),(0,i.default)(s,"transactionid","transaction-id"),(0,i.default)(s,"customerDisplayName","customerDisplayName"),(0,i.default)(s,"hiddenContentPlaceholder","*content hidden*"),(0,i.default)(s,"axiosTimeoutErrorCode","ECONNABORTED")},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=null},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"authenticatedUserToken","AuthenticatedUserToken"),(0,i.default)(a,"authorization","Authorization"),(0,i.default)(a,"organizationId","OrganizationId"),(0,i.default)(a,"widgetAppId","widgetAppId"),(0,i.default)(a,"requestId","Request-Id"),(0,i.default)(a,"authCodeNonce","AuthCodeNonce"),(0,i.default)(a,"ocSessionId","Oc-Sessionid"),(0,i.default)(a,"ocUserAgent","Ms-Oc-User-Agent"),(0,i.default)(a,"correlationId","x-ms-client-request-id"),(0,i.default)(a,"pageToken","PageToken")},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(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:a}catch(e){r=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!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 p(e,t){this.fun=e,this.array=t}function g(){}o.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 p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.isRetryableError=f,t.axiosRetryHandlerWithNotFound=function(e,t){d(e,{retries:t.retries,waitTimeInMsBetweenRetries:t.waitTimeInMsBetweenRetries,shouldRetry:function(e){var n;return l(e,t.retryOn429)||(null===(n=e.response)||void 0===n?void 0:n.status)===a.default.notFoundStatusCode}})},t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(16)),a=r(n(9));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(e,t){var n,r,o;return!((null===(n=e.response)||void 0===n?void 0:n.status)===a.default.tooManyRequestsStatusCode&&!t)&&(f(e)||(0,i.isNetworkError)(e)||0===(null===(r=e.response)||void 0===r?void 0:r.status)||!(null!==(o=e.response)&&void 0!==o&&o.status))},d=function(e,t){void 0!==t.retryOn429&&null!==t.retryOn429||(t.retryOn429=!1),t.shouldRetry||(t.shouldRetry=function(e){return l(e,t.retryOn429)}),(0,i.default)(e,{retries:t.retries,retryCondition:t.shouldRetry,onRetry:function(e,n,r){var o=n.response,i=t.headerOverwrites;if(i&&null!=o&&o.headers){var a,s=u(i);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=null==o?void 0:o.headers[c.toLocaleLowerCase()];l&&r.headers&&(r.headers[c]=l)}}catch(e){s.e(e)}finally{s.f()}}},retryDelay:function(e,n){var r,o,i,s=t.waitTimeInMsBetweenRetries,u=null==n||null===(r=n.response)||void 0===r||null===(o=r.headers)||void 0===o?void 0:o["retry-after"],c=s;if(u){var l=parseInt(u);if(isNaN(l)){var d=new Date(u),f=(new Date).getTime();d&&d instanceof Date&&isFinite(d.getTime())&&(c=Math.max(0,d.getTime()-f))}else c=l*s;return c}return(null===(i=n.response)||void 0===i?void 0:i.status)===a.default.tooManyRequestsStatusCode?5e3:Math.pow(2,e)*s}})};function f(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}var h=d;t.default=h},function(e,t,n){"use strict";n.r(t),n.d(t,"namespace",(function(){return l})),n.d(t,"isNetworkError",(function(){return d})),n.d(t,"isRetryableError",(function(){return p})),n.d(t,"isSafeRequestError",(function(){return g})),n.d(t,"isIdempotentRequestError",(function(){return v})),n.d(t,"isNetworkOrIdempotentRequestError",(function(){return m})),n.d(t,"exponentialDelay",(function(){return E})),n.d(t,"DEFAULT_OPTIONS",(function(){return T})),n.d(t,"default",(function(){return w}));var r=n(22),o=n.n(r);function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l="axios-retry";function d(e){return!e.response&&Boolean(e.code)&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&o()(e)}var f=["get","head","options"],h=f.concat(["put","delete"]);function p(e){return"ECONNABORTED"!==e.code&&(!e.response||e.response.status>=500&&e.response.status<=599)}function g(e){return!!e.config&&(p(e)&&-1!==f.indexOf(e.config.method))}function v(e){return!!e.config&&(p(e)&&-1!==h.indexOf(e.config.method))}function m(e){return d(e)||v(e)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,n=Math.pow(2,e)*t,r=.2*n*Math.random();return n+r}var T={retries:3,retryCondition:m,retryDelay:function(){return 0},shouldResetTimeout:!1,onRetry:()=>{}};function y(e,t){var n=function(e,t){return u(u(u({},T),t),e[l])}(e,t);return n.retryCount=n.retryCount||0,e[l]=n,n}function C(){return(C=a((function*(e,t){var{retries:n,retryCondition:r}=e,o=e.retryCount<n&&r(t);if("object"==typeof o)try{return!1!==(yield o)}catch(e){return!1}return o}))).apply(this,arguments)}function w(e,t){return{requestInterceptorId:e.interceptors.request.use(e=>(y(e,t).lastRequestTime=Date.now(),e)),responseInterceptorId:e.interceptors.response.use(null,function(){var n=a((function*(n){var{config:r}=n;if(!r)return Promise.reject(n);var o=y(r,t);if(yield function(e,t){return C.apply(this,arguments)}(o,n)){o.retryCount+=1;var{retryDelay:i,shouldResetTimeout:a,onRetry:s}=o,u=i(o.retryCount,n);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,r),!a&&r.timeout&&o.lastRequestTime){var c=Date.now()-o.lastRequestTime,l=r.timeout-c-u;if(l<=0)return Promise.reject(n);r.timeout=l}return r.transformRequest=[e=>e],yield s(o.retryCount,n,r),new Promise(t=>setTimeout(()=>t(e(r)),u))}return Promise.reject(n)}));return function(e){return n.apply(this,arguments)}}())}}w.isNetworkError=d,w.isSafeRequestError=g,w.isIdempotentRequestError=v,w.isNetworkOrIdempotentRequestError=m,w.exponentialDelay=E,w.isRetryableError=p},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==t&&t.crypto&&(o=t.crypto),!o)try{o=n(43)}catch(e){}var i=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},c=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),d=s.enc={},f=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},g=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);n=o.splice(0,u),r.sigBytes-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),v=(u.Hasher=g.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"LiveChatConnectorPath","livechatconnector/organization"),(0,i.default)(a,"LiveChatConnectorAuthPath","livechatconnector/auth/organization"),(0,i.default)(a,"LcwFcsDetailsPath","livechatconnector/v2/lcwfcsdetails"),(0,i.default)(a,"LiveChatConfigPath","livechatconnector/config"),(0,i.default)(a,"LiveChatSessionInitPath","livechatconnector/sessioninit"),(0,i.default)(a,"LiveChatAuthSessionInitPath","livechatconnector/auth/sessioninit"),(0,i.default)(a,"LiveChatGetChatTokenPath","livechatconnector/getchattoken"),(0,i.default)(a,"LiveChatv2GetChatTokenPath","livechatconnector/v2/getchattoken"),(0,i.default)(a,"LiveChatv3GetChatTokenPath","livechatconnector/v3/getchattoken"),(0,i.default)(a,"LiveChatv4GetChatTokenPath","livechatconnector/v4/getchattoken"),(0,i.default)(a,"LiveChatv4AuthGetChatTokenPath","livechatconnector/v4/auth/getchattoken"),(0,i.default)(a,"LiveChatAuthGetChatTokenPath","livechatconnector/auth/getchattoken"),(0,i.default)(a,"LiveChatv2AuthGetChatTokenPath","livechatconnector/v2/auth/getchattoken"),(0,i.default)(a,"LiveChatv3AuthGetChatTokenPath","livechatconnector/v3/auth/getchattoken"),(0,i.default)(a,"LiveChatSessionClosePath","livechatconnector/sessionclose"),(0,i.default)(a,"LiveChatAuthSessionClosePath","livechatconnector/auth/sessionclose"),(0,i.default)(a,"LiveChatSubmitPostChatPath","survey/submitpostchat"),(0,i.default)(a,"LiveChatAuthSubmitPostChatPath","survey/auth/submitpostchat"),(0,i.default)(a,"LiveChatGetSurveyInviteLinkPath","livechatconnector/getsurveyinvite"),(0,i.default)(a,"LiveChatAuthGetSurveyInviteLinkPath","livechatconnector/auth/getsurveyinvite"),(0,i.default)(a,"LiveChatGetChatTranscriptPath","livechatconnector/getchattranscripts"),(0,i.default)(a,"LiveChatv2GetChatTranscriptPath","livechatconnector/v2/getchattranscripts"),(0,i.default)(a,"LiveChatAuthGetChatTranscriptPath","livechatconnector/auth/getchattranscripts"),(0,i.default)(a,"LiveChatv2AuthGetChatTranscriptPath","livechatconnector/v2/auth/getchattranscripts"),(0,i.default)(a,"LiveChatTranscriptEmailRequestPath","livechatconnector/createemailrequest"),(0,i.default)(a,"LiveChatAuthTranscriptEmailRequestPath","livechatconnector/auth/createemailrequest"),(0,i.default)(a,"LiveChatFetchDataMaskingInfoPath","livechatconnector/fetchdatamaskinginfo"),(0,i.default)(a,"LiveChatSecondaryChannelEventPath","livechatconnector/secondarychannelevent"),(0,i.default)(a,"LiveChatAuthSecondaryChannelEventPath","livechatconnector/auth/secondarychannelevent"),(0,i.default)(a,"LiveChatLiveWorkItemDetailsPath","livechatconnector/getliveworkitemdetails"),(0,i.default)(a,"LiveChatAuthLiveWorkItemDetailsPath","livechatconnector/auth/getliveworkitemdetails"),(0,i.default)(a,"LiveChatGetReconnectableChatsPath","livechatconnector/auth/reconnectablechats"),(0,i.default)(a,"LiveChatReconnectAvailabilityPath","livechatconnector/reconnect"),(0,i.default)(a,"LiveChatValidateAuthChatMapRecordPath","livechatconnector/auth/validateauthchatmaprecord"),(0,i.default)(a,"GetAgentAvailabilityPath","livechatconnector/auth/getagentavailability"),(0,i.default)(a,"SendTypingIndicatorPath","inbound/typingindicator/livechat/sendtypingindicator"),(0,i.default)(a,"LiveChatAuthGetPersistentChatHistoryPath","livechatconnector/auth/organization")},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0;t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Ae})),n.d(t,"Axios",(function(){return Le})),n.d(t,"AxiosError",(function(){return De})),n.d(t,"CanceledError",(function(){return Pe})),n.d(t,"isCancel",(function(){return Ne})),n.d(t,"CancelToken",(function(){return xe})),n.d(t,"VERSION",(function(){return ke})),n.d(t,"all",(function(){return _e})),n.d(t,"Cancel",(function(){return Ue})),n.d(t,"isAxiosError",(function(){return Me})),n.d(t,"spread",(function(){return Fe})),n.d(t,"toFormData",(function(){return Be})),n.d(t,"AxiosHeaders",(function(){return je})),n.d(t,"HttpStatusCode",(function(){return Ge})),n.d(t,"formToJSON",(function(){return He})),n.d(t,"getAdapter",(function(){return qe})),n.d(t,"mergeConfig",(function(){return Ve}));var r={};n.r(r),n.d(r,"hasBrowserEnv",(function(){return m})),n.d(r,"hasStandardBrowserWebWorkerEnv",(function(){return y})),n.d(r,"hasStandardBrowserEnv",(function(){return T})),n.d(r,"navigator",(function(){return E})),n.d(r,"origin",(function(){return C}));var o=n(0),i=n(11),a=n(6);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function u(e,t){this._pairs=[],e&&Object(a.a)(e,this,t)}const c=u.prototype;c.append=function(e,t){this._pairs.push([e,t])},c.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var l=u;function d(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function f(e,t,n){if(!t)return e;const r=n&&n.encode||d;o.a.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let a;if(a=i?i(t,n):o.a.isURLSearchParams(t)?t.toString():new l(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}var h=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){o.a.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},p=n(1),g={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:l,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const m="undefined"!=typeof window&&"undefined"!=typeof document,E="object"==typeof navigator&&navigator||void 0,T=m&&(!E||["ReactNative","NativeScript","NS"].indexOf(E.product)<0),y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,C=m&&window.location.href||"http://localhost";var w={...r,...v};var S=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),u=i>=e.length;if(a=!a&&o.a.isArray(r)?r.length:a,u)return o.a.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!s;r[a]&&o.a.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&o.a.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[a])),!s}if(o.a.isFormData(e)&&o.a.isFunction(e.entries)){const n={};return o.a.forEachEntry(e,(e,r)=>{t(function(e){return o.a.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const R={transitional:g,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=o.a.isObject(e);i&&o.a.isHTMLForm(e)&&(e=new FormData(e));if(o.a.isFormData(e))return r?JSON.stringify(S(e)):e;if(o.a.isArrayBuffer(e)||o.a.isBuffer(e)||o.a.isStream(e)||o.a.isFile(e)||o.a.isBlob(e)||o.a.isReadableStream(e))return e;if(o.a.isArrayBufferView(e))return e.buffer;if(o.a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Object(a.a)(e,new w.classes.URLSearchParams,{visitor:function(e,t,n,r){return w.isNode&&o.a.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=o.a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Object(a.a)(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(o.a.isString(e))try{return(t||JSON.parse)(e),o.a.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||R.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(o.a.isResponse(e)||o.a.isReadableStream(e))return e;if(e&&o.a.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw p.a.from(e,p.a.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};o.a.forEach(["delete","get","head","post","put","patch"],e=>{R.headers[e]={}});var b=R;const O=o.a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const I=Symbol("internals");function A(e){return e&&String(e).trim().toLowerCase()}function L(e){return!1===e||null==e?e:o.a.isArray(e)?e.map(L):String(e)}function D(e,t,n,r,i){return o.a.isFunction(r)?r.call(this,t,n):(i&&(t=n),o.a.isString(t)?o.a.isString(r)?-1!==t.indexOf(r):o.a.isRegExp(r)?r.test(t):void 0:void 0)}class P{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=A(t);if(!i)throw new Error("header name must be a non-empty string");const a=o.a.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=L(e))}const a=(e,t)=>o.a.forEach(e,(e,n)=>i(e,n,t));if(o.a.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(o.a.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&O[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(o.a.isObject(e)&&o.a.isIterable(e)){let n,r,i={};for(const t of e){if(!o.a.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?o.a.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=A(e)){const n=o.a.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(o.a.isFunction(t))return t.call(this,e,n);if(o.a.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=A(e)){const n=o.a.findKey(this,e);return!(!n||void 0===this[n]||t&&!D(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=A(e)){const i=o.a.findKey(n,e);!i||t&&!D(0,n[i],i,t)||(delete n[i],r=!0)}}return o.a.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!D(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return o.a.forEach(this,(r,i)=>{const a=o.a.findKey(n,i);if(a)return t[a]=L(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=L(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return o.a.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&o.a.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[I]=this[I]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=A(e);t[r]||(!function(e,t){const n=o.a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return o.a.isArray(e)?e.forEach(r):r(e),this}}P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),o.a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),o.a.freezeMethods(P);var N=P;function x(e,t){const n=this||b,r=t||n,i=N.from(r.headers);let a=r.data;return o.a.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function k(e){return!(!e||!e.__CANCEL__)}function _(e,t,n){p.a.call(this,null==e?"canceled":e,p.a.ERR_CANCELED,t,n),this.name="CanceledError"}o.a.inherits(_,p.a,{__CANCEL__:!0});var U=_,M=n(12);function F(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new p.a("Request failed with status code "+n.status,[p.a.ERR_BAD_REQUEST,p.a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}var B=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];o||(o=u),n[i]=s,r[i]=u;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}};var j=function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]};const G=(e,t,n=3)=>{let r=0;const o=B(50,250);return j(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,u=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},H=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},q=e=>(...t)=>o.a.asap(()=>e(...t));var V,W,K=w.hasStandardBrowserEnv?(V=new URL(w.origin),W=w.navigator&&/(msie|trident)/i.test(w.navigator.userAgent),e=>(e=new URL(e,w.origin),V.protocol===e.protocol&&V.host===e.host&&(W||V.port===e.port))):()=>!0,Y=w.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const s=[e+"="+encodeURIComponent(t)];o.a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),o.a.isString(r)&&s.push("path="+r),o.a.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function z(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const J=e=>e instanceof N?{...e}:e;function X(e,t){t=t||{};const n={};function r(e,t,n,r){return o.a.isPlainObject(e)&&o.a.isPlainObject(t)?o.a.merge.call({caseless:r},e,t):o.a.isPlainObject(t)?o.a.merge({},t):o.a.isArray(t)?t.slice():t}function i(e,t,n,i){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!o.a.isUndefined(t))return r(void 0,t)}function s(e,t){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(e,t,n)=>i(J(e),J(t),0,!0)};return o.a.forEach(Object.keys({...e,...t}),(function(r){const a=c[r]||i,s=a(e[r],t[r],r);o.a.isUndefined(s)&&a!==u||(n[r]=s)})),n}var $=e=>{const t=X({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:u}=t;if(t.headers=s=N.from(s),t.url=f(z(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),o.a.isFormData(n))if(w.hasStandardBrowserEnv||w.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(o.a.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(w.hasStandardBrowserEnv&&(r&&o.a.isFunction(r)&&(r=r(t)),r||!1!==r&&K(t.url))){const e=i&&a&&Y.read(a);e&&s.set(i,e)}return t};var Q="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=$(e);let i=r.data;const a=N.from(r.headers).normalize();let s,u,c,l,d,{responseType:f,onUploadProgress:h,onDownloadProgress:v}=r;function m(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let E=new XMLHttpRequest;function T(){if(!E)return;const r=N.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());F((function(e){t(e),m()}),(function(e){n(e),m()}),{data:f&&"text"!==f&&"json"!==f?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:e,request:E}),E=null}E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout,"onloadend"in E?E.onloadend=T:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(T)},E.onabort=function(){E&&(n(new p.a("Request aborted",p.a.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new p.a(r,p.a.ERR_NETWORK,e,E);o.event=t||null,n(o),E=null},E.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||g;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new p.a(t,o.clarifyTimeoutError?p.a.ETIMEDOUT:p.a.ECONNABORTED,e,E)),E=null},void 0===i&&a.setContentType(null),"setRequestHeader"in E&&o.a.forEach(a.toJSON(),(function(e,t){E.setRequestHeader(t,e)})),o.a.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),f&&"json"!==f&&(E.responseType=r.responseType),v&&([c,d]=G(v,!0),E.addEventListener("progress",c)),h&&E.upload&&([u,l]=G(h),E.upload.addEventListener("progress",u),E.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{E&&(n(!t||t.type?new U(null,e,E):t),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===w.protocols.indexOf(y)?n(new p.a("Unsupported protocol "+y+":",p.a.ERR_BAD_REQUEST,e)):E.send(i||null)}))};var Z=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof p.a?t:new U(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new p.a(`timeout ${t} of ms exceeded`,p.a.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>o.a.asap(s),u}};const ee=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},te=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ne=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of te(e))yield*ee(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:re}=o.a,oe=(({Request:e,Response:t})=>({Request:e,Response:t}))(o.a.global),{ReadableStream:ie,TextEncoder:ae}=o.a.global,se=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ue=e=>{e=o.a.merge.call({skipUndefined:!0},oe,e);const{fetch:t,Request:n,Response:r}=e,i=t?re(t):"function"==typeof fetch,a=re(n),s=re(r);if(!i)return!1;const u=i&&re(ie),c=i&&("function"==typeof ae?(l=new ae,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const d=a&&u&&se(()=>{let e=!1;const t=new n(w.origin,{body:new ie,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=s&&u&&se(()=>o.a.isReadableStream(new r("").body)),h={stream:f&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new p.a(`Response type '${e}' is not supported`,p.a.ERR_NOT_SUPPORT,n)})});const g=async(e,t)=>{const r=o.a.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(o.a.isBlob(e))return e.size;if(o.a.isSpecCompliantForm(e)){const t=new n(w.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return o.a.isArrayBufferView(e)||o.a.isArrayBuffer(e)?e.byteLength:(o.a.isURLSearchParams(e)&&(e+=""),o.a.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:u,signal:c,cancelToken:l,timeout:v,onDownloadProgress:m,onUploadProgress:E,responseType:T,headers:y,withCredentials:C="same-origin",fetchOptions:w}=$(e),S=t||fetch;T=T?(T+"").toLowerCase():"text";let R=Z([c,l&&l.toAbortSignal()],v),b=null;const O=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let I;try{if(E&&d&&"get"!==s&&"head"!==s&&0!==(I=await g(y,u))){let e,t=new n(i,{method:"POST",body:u,duplex:"half"});if(o.a.isFormData(u)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=H(I,G(q(E)));u=ne(t.body,65536,e,n)}}o.a.isString(C)||(C=C?"include":"omit");const t=a&&"credentials"in n.prototype,c={...w,signal:R,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:u,duplex:"half",credentials:t?C:void 0};b=a&&new n(i,c);let l=await(a?S(b,w):S(i,c));const p=f&&("stream"===T||"response"===T);if(f&&(m||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=o.a.toFiniteNumber(l.headers.get("content-length")),[n,i]=m&&H(t,G(q(m),!0))||[];l=new r(ne(l.body,65536,n,()=>{i&&i(),O&&O()}),e)}T=T||"text";let v=await h[o.a.findKey(h,T)||"text"](l,e);return!p&&O&&O(),await new Promise((t,n)=>{F(t,n,{data:v,headers:N.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:b})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new p.a("Network Error",p.a.ERR_NETWORK,e,b),{cause:t.cause||t});throw p.a.from(t,t&&t.code,e,b)}}},ce=new Map,le=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,u=i.length,c=ce;for(;u--;)a=i[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:ue(t)),c=s;return s};le();const de={http:M.a,xhr:Q,fetch:{get:le}};o.a.forEach(de,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const fe=e=>"- "+e,he=e=>o.a.isFunction(e)||null===e||!1===e;var pe=(e,t)=>{e=o.a.isArray(e)?e:[e];const{length:n}=e;let r,i;const a={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!he(r)&&(i=de[(n=String(r)).toLowerCase()],void 0===i))throw new p.a(`Unknown adapter '${n}'`);if(i&&(o.a.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(fe).join("\n"):" "+fe(e[0]):"as no adapter specified";throw new p.a("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i};function ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new U(null,e)}function ve(e){ge(e),e.headers=N.from(e.headers),e.data=x.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return pe(e.adapter||b.adapter,e)(e).then((function(t){return ge(e),t.data=x.call(e,e.transformResponse,t),t.headers=N.from(t.headers),t}),(function(t){return k(t)||(ge(e),t&&t.response&&(t.response.data=x.call(e,e.transformResponse,t.response),t.response.headers=N.from(t.response.headers))),Promise.reject(t)}))}const me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ee={};me.transitional=function(e,t,n){function r(e,t){return"[Axios v1.12.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new p.a(r(o," has been removed"+(t?" in "+t:"")),p.a.ERR_DEPRECATED);return t&&!Ee[o]&&(Ee[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},me.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new p.a("options must be an object",p.a.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new p.a("option "+i+" must be "+n,p.a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new p.a("Unknown option "+i,p.a.ERR_BAD_OPTION)}},validators:me};const ye=Te.validators;class Ce{constructor(e){this.defaults=e||{},this.interceptors={request:new h,response:new h}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=X(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Te.assertOptions(n,{silentJSONParsing:ye.transitional(ye.boolean),forcedJSONParsing:ye.transitional(ye.boolean),clarifyTimeoutError:ye.transitional(ye.boolean)},!1),null!=r&&(o.a.isFunction(r)?t.paramsSerializer={serialize:r}:Te.assertOptions(r,{encode:ye.function,serialize:ye.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Te.assertOptions(t,{baseUrl:ye.spelling("baseURL"),withXsrfToken:ye.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&o.a.merge(i.common,i[t.method]);i&&o.a.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=N.concat(a,i);const s=[];let u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,f=0;if(!u){const e=[ve.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,l=Promise.resolve(t);f<d;)l=l.then(e[f++],e[f++]);return l}d=s.length;let h=t;for(;f<d;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{l=ve.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,d=c.length;f<d;)l=l.then(c[f++],c[f++]);return l}getUri(e){return f(z((e=X(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}o.a.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(X(n||{},{method:e,url:t,data:(n||{}).data}))}})),o.a.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(X(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var we=Ce;class Se{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new U(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Se((function(t){e=t})),cancel:e}}}var Re=Se;const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach(([e,t])=>{be[t]=e});var Oe=be;const Ie=function e(t){const n=new we(t),r=Object(i.a)(we.prototype.request,n);return o.a.extend(r,we.prototype,n,{allOwnKeys:!0}),o.a.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(X(t,n))},r}(b);Ie.Axios=we,Ie.CanceledError=U,Ie.CancelToken=Re,Ie.isCancel=k,Ie.VERSION="1.12.2",Ie.toFormData=a.a,Ie.AxiosError=p.a,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return o.a.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=X,Ie.AxiosHeaders=N,Ie.formToJSON=e=>S(o.a.isHTMLForm(e)?new FormData(e):e),Ie.getAdapter=pe,Ie.HttpStatusCode=Oe,Ie.default=Ie;var Ae=Ie;const{Axios:Le,AxiosError:De,CanceledError:Pe,isCancel:Ne,CancelToken:xe,VERSION:ke,all:_e,Cancel:Ue,isAxiosError:Me,spread:Fe,toFormData:Be,AxiosHeaders:je,HttpStatusCode:Ge,formToJSON:He,getAdapter:qe,mergeConfig:Ve}=Ae},function(e,t,n){"use strict";const r=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!r.has(e&&e.code)},function(e,t,n){"use strict";(function(e){var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"SDKProvider",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"uuidv4",{enumerable:!0,get:function(){return s.uuidv4}});var o=r(n(24)),i=r(n(25)),a=r(n(26)),s=n(20);!function(){if(void 0===e.window&&(e.window=e),!window)throw new Error("window object not found");"Microsoft"in window||(window.Microsoft={}),"CRM"in window.Microsoft||(window.Microsoft.CRM={}),"Omnichannel"in window.Microsoft.CRM||(window.Microsoft.CRM.Omnichannel={}),"SDK"in window.Microsoft.CRM.Omnichannel||(window.Microsoft.CRM.Omnichannel.SDK={SDKProvider:a.default,Util:{uuidv4:s.uuidv4}}),window.document&&o.default.raiseCustomEvent(i.default.OCSDKLOAD)}()}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"raiseCustomEvent",value:function(t,n){var r=e.createCustomEvent(t,n);window.dispatchEvent(r)}},{key:"createCustomEvent",value:function(e,t){var n=t?{detail:t}:void 0,r=null;try{r=new CustomEvent(e,n)}catch(t){(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n)}return r}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"OCSDKLOAD",get:function(){return"oc:sdk:load"}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(9)),s=r(n(27)),u=r(n(29)),c=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getSDK",value:function(e,t,n){var r=new s.default(n);return new u.default({channelId:e.channelId||a.default.defaultChannelId,orgId:e.orgId,orgUrl:e.orgUrl,widgetId:e.widgetId},t||{},r)}}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=r(n(28)),u=function(){function e(t){(0,o.default)(this,e),(0,a.default)(this,"logger",void 0),this.logger=t}return(0,i.default)(e,[{key:"log",value:function(e,t,n,r){if(this.isLoggingEnabled()){var o=s.default.GETTELEMETRYEVENTDATA(t,n,r);this.logEvent(e,o)}}},{key:"logEvent",value:function(e,t){this.isLoggingEnabled()&&this.logger.logClientSdkTelemetryEvent(e,t)}},{key:"isLoggingEnabled",value:function(){return!this.isNullOrUndefined(this.logger)}},{key:"isNullOrUndefined",value:function(e){return null==e}}]),e}();t.default=u},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"GETTELEMETRYEVENTDATA",value:function(e,t,n){return{Description:n,ElapsedTimeInMilliseconds:t.ElapsedTimeInMilliseconds,HttpRequestResponseTime:t.HttpRequestResponseTime,Event:e,ExceptionDetails:t.ExceptionDetails,Region:t.Region,RequestId:t.RequestId,TransactionId:t.TransactionId,RequestHeaders:t.RequestHeaders,RequestPayload:t.RequestPayload,RequestPath:t.RequestPath,RequestMethod:t.RequestMethod,ResponseStatusCode:t.ResponseStatusCode,ResponseErrorcode:t.ResponseErrorcode,AuthTokenDetails:t.AuthTokenDetails}}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(30)),a=r(n(32)),s=r(n(10)),u=r(n(3)),c=r(n(4)),l=r(n(5)),d=n(8),f=r(n(21)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(15)),p=n(39),g=r(n(9)),v=n(40),m=n(41),E=r(n(42)),T=r(n(44)),y=n(45),C=n(46),w=n(47),S=r(n(18)),R=r(n(13)),b=r(n(48)),O=n(49),I=n(50),A=n(57),L=r(n(58)),D=r(n(59)),P=n(20),N=n(60);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultConfiguration,o=arguments.length>2?arguments[2]:void 0;(0,u.default)(this,e),this.omnichannelConfiguration=t,this.configuration=r,this.logger=o,(0,l.default)(this,"liveChatVersion",void 0),(0,l.default)(this,"sessionId",void 0),(0,l.default)(this,"ocUserAgent",void 0),(0,l.default)(this,"HTTPTimeOutErrorMessage","".concat(d.SDKError.ClientHTTPTimeoutErrorName,": ").concat(d.SDKError.ClientHTTPTimeoutErrorMessage)),(0,l.default)(this,"setAuthCodeNonce",(function(e){null!=e&&e.authcodenonce&&(n.configuration.authCodeNonce=null==e?void 0:e.authcodenonce)})),(0,l.default)(this,"setSessionIdHeader",(function(e,t){e&&(t[R.default.ocSessionId]=e)})),(0,l.default)(this,"setRequestIdHeader",(function(e,t){e&&(t[R.default.requestId]=e)})),(0,l.default)(this,"setCorrelationIdInHeader",(function(e,t){e&&(t[R.default.correlationId]=e)})),Object.keys(this.configuration).length&&"object"===(0,s.default)(r)||(this.configuration=e.defaultConfiguration);for(var i=0,a=Object.keys(e.defaultConfiguration);i<a.length;i++){var c=a[i];this.configuration.hasOwnProperty(c)||(this.configuration["".concat(c)]=e.defaultConfiguration["".concat(c)])}for(var f=0,h=Object.keys(e.defaultConfiguration.requestTimeoutConfig);f<h.length;f++){var p=h[f];this.configuration.requestTimeoutConfig.hasOwnProperty(p)||(this.configuration.requestTimeoutConfig["".concat(p)]=e.defaultConfiguration.requestTimeoutConfig["".concat(p)])}var v=t.channelId;if(!Object.values(d.ChannelId).includes(v))throw new Error("Invalid channelId");var m,E=Object.keys(t),T=U(g.default.requiredOmnichannelConfigurationParameters);try{for(T.s();!(m=T.n()).done;){var y=m.value;if(!E.includes(y))throw new Error("Missing '".concat(y,"' in OmnichannelConfiguration"))}}catch(e){T.e(e)}finally{T.f()}this.ocUserAgent=this.configuration.ocUserAgent,this.liveChatVersion=d.LiveChatVersion.V2}var t,n,r,o,N,x,k,M,F,B,j,G,H,q,V,W,K,Y,z;return(0,c.default)(e,[{key:"getLcwFcsDetails",value:(z=(0,a.default)(i.default.mark((function e(){var t,n,r,o,a,s,u,c,l,p,g,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSTARTED,"Get LCW FCS details started",""),n="/".concat(S.default.LcwFcsDetailsPath,"/").concat(this.omnichannelConfiguration.orgId),r="GET",o="".concat(this.omnichannelConfiguration.orgUrl).concat(n),a=f.default.create(),(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),s={},(0,I.addOcUserAgentHeader)(this.ocUserAgent,s),u=O.Timer.TIMER(),e.prev=10,e.next=13,a.get(o,{headers:s,timeout:null!==(c=this.configuration.defaultRequestTimeout)&&void 0!==c?c:this.configuration.requestTimeoutConfig.getChatConfig});case 13:return l=e.sent,p=u.milliSecondsElapsed,g=t.milliSecondsElapsed,v=l.data,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSUCCEEDED,"Get LCW FCS details succeeded","",l,g,n,r,void 0,void 0,s,p),e.abrupt("return",v);case 21:throw e.prev=21,e.t0=e.catch(10),m=u.milliSecondsElapsed,E=t.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSFAILED,"Get LCW FCS details failed","",void 0,E,n,r,e.t0,void 0,s,m),e.t0;case 27:case"end":return e.stop()}}),e,this,[[10,21]])}))),function(){return z.apply(this,arguments)})},{key:"getChatConfig",value:(Y=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,l,p,v,m,E,T,C,w,R=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=R.length>1&&void 0!==R[1]&&R[1],r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGFSTARTED,"Get Chat config started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatConfigPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"?requestId=").concat(t,"&channelId=").concat(this.omnichannelConfiguration.channelId),a="GET",s="".concat(this.omnichannelConfiguration.orgUrl).concat(o),u=f.default.create(),(0,h.default)(u,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),c={},this.addDefaultHeaders(t,c),n&&(c=_(_({},g.default.bypassCacheHeaders),c)),l=O.Timer.TIMER(),e.prev=13,e.next=16,u.get(s,{headers:c,timeout:null!==(p=this.configuration.defaultRequestTimeout)&&void 0!==p?p:this.configuration.requestTimeoutConfig.getChatConfig});case 16:return v=e.sent,m=l.milliSecondsElapsed,E=r.milliSecondsElapsed,(T=v.data).LiveChatVersion&&(this.liveChatVersion=T.LiveChatVersion),T.headers={},v.headers&&v.headers.date&&(T.headers.date=v.headers.date),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGSUCCEEDED,"Get Chat config succeeded",t,v,E,o,a,void 0,void 0,c,m),e.abrupt("return",T);case 27:return e.prev=27,e.t0=e.catch(13),C=l.milliSecondsElapsed,w=r.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATCONFIGFAILED,"Get Chat config failed",t,void 0,w,o,a,e.t0,void 0,c,C),e.abrupt("return",Promise.reject(e.t0));case 33:case"end":return e.stop()}}),e,this,[[13,27]])}))),function(e){return Y.apply(this,arguments)})},{key:"getLWIDetails",value:(K=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSTARTED,"Get LWI Details Started",t),t||(t=(0,P.uuidv4)()),s="/".concat(S.default.LiveChatLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=f.default.create(),(0,h.axiosRetryHandlerWithNotFound)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getLWIDetails}),c=r.authenticatedUserToken,l=r.reconnectId,p=g.default.defaultHeaders,c&&(s="/".concat(S.default.LiveChatAuthLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),p[R.default.authenticatedUserToken]=c,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,l&&(v||(s+="/".concat(l))),m={channelId:this.omnichannelConfiguration.channelId},l&&v&&(m.sig=l),E="".concat(this.omnichannelConfiguration.orgUrl).concat(s),C={headers:p,method:T="GET",url:E,params:m,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getLWIDetails},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(C);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,v=c.headers,w.setAuthCodeNonce(v),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSUCCEEDED,"Get LWI Details succeeded",t,c,f,s,T,void 0,void 0,p,l),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=a.milliSecondsElapsed,E=o.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLWISTATUSFAILED,"Get LWI Details failed",t,void 0,E,s,T,e.t0,void 0,p,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"getChatToken",value:(W=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,S,b,I,D,N,x=this,k=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=k.length>1&&void 0!==k[1]?k[1]:{},o=k.length>2&&void 0!==k[2]?k[2]:0,s=O.Timer.TIMER(),u=r.reconnectId,c=r.authenticatedUserToken,l=r.currentLiveChatVersion,p=r.refreshToken,v=r.MsOcBotApplicationId,m=!!(v&&v.length>0),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSTARTED,"Get Chat Token Started",t),!(o<0)){e.next=8;break}throw new Error("Invalid currentRetryCount");case 8:return t||(t=(0,P.uuidv4)()),E=g.default.defaultHeaders,this.addDefaultHeaders(t,E),T=(0,A.createGetChatTokenEndpoint)(l||this.liveChatVersion,!!c,m),c&&(E[R.default.authenticatedUserToken]=c,E[R.default.authCodeNonce]=this.configuration.authCodeNonce),C="/".concat(T,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),w=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,u&&(w||(C+="/".concat(u))),S={channelId:this.omnichannelConfiguration.channelId},v&&v.length>0&&(S["Ms-Oc-Bot-Application-Id"]=v),p&&(S.refreshToken="true"),u&&w&&(S.sig=u),b="".concat(this.omnichannelConfiguration.orgUrl).concat(C),D={headers:E,method:I="GET",url:b,params:S,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getChatToken},N=f.default.create(),(0,h.default)(N,{headerOverwrites:[R.default.authCodeNonce],retries:o>this.configuration.maxRequestRetriesOnFailure?o:this.configuration.maxRequestRetriesOnFailure,retryOn429:this.configuration.getChatTokenRetryOn429,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatToken}),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,N(D);case 4:if(a=e.sent,c=o.milliSecondsElapsed,l=s.milliSecondsElapsed,f=a.data,h=a.headers,x.setAuthCodeNonce(h),h&&h[R.default.ocSessionId.toLowerCase()]&&(x.sessionId=h[R.default.ocSessionId.toLowerCase()]),!f){e.next=18;break}if(0!==Object.keys(f).length){e.next=14;break}return r(new Error("Empty data received from getChatToken")),e.abrupt("return");case 14:return f.requestId=t,x.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSUCCEEDED,"Get Chat Token succeeded",t,a,l,C,I,void 0,void 0,E,c),n(f),e.abrupt("return");case 18:if(!u||a.status!==g.default.noContentStatusCode){e.next=21;break}return r(a),e.abrupt("return");case 21:e.next=30;break;case 23:e.prev=23,e.t0=e.catch(1),p=o.milliSecondsElapsed,v=s.milliSecondsElapsed,x.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTOKENFAILED,"Get Chat Token failed",t,void 0,v,C,I,e.t0,void 0,E,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(x.HTTPTimeOutErrorMessage)),r(e.t0);case 30:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t,n){return e.apply(this,arguments)}}()));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"getReconnectableChats",value:(V=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),o=t.authenticatedUserToken,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSTARTED,"Get Reconnectable chat Started"),s=null==t?void 0:t.requestId,u="/".concat(S.default.LiveChatGetReconnectableChatsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(s,"?channelId=").concat(this.omnichannelConfiguration.channelId),(c=g.default.defaultHeaders)[R.default.authenticatedUserToken]=o,c[R.default.authCodeNonce]=this.configuration.authCodeNonce,this.addDefaultHeaders(s,c),l="".concat(this.omnichannelConfiguration.orgUrl).concat(u),h={headers:c,method:"GET",url:l,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectableChats},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var o,a,l,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(a=e.sent,l=o.milliSecondsElapsed,f=r.milliSecondsElapsed,m=a.data,E=a.headers,v.setAuthCodeNonce(E),!m){e.next=13;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSUCCEEDED,"Get Reconnectable Chats Succeeded and old session returned",s,a,f,u,"GET",void 0,void 0,c,l),t(m),e.abrupt("return");case 13:return t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=o.milliSecondsElapsed,C=r.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSFAILED,"Get Reconnectable Chats failed",s,void 0,C,u,"GET",e.t0,void 0,c,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getReconnectAvailability",value:(q=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this,m=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>1&&void 0!==m[1]?m[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSTARTED,"Get Reconnectable availability Started"),s="/".concat(S.default.LiveChatReconnectAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=g.default.defaultHeaders,this.addDefaultHeaders(null==r?void 0:r.requestId,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(s),h={headers:u,method:l="GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectAvailability},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var a,c,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(c=e.sent,f=a.milliSecondsElapsed,m=o.milliSecondsElapsed,!(E=c.data)){e.next=12;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability succeeded",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(E),e.abrupt("return");case 12:return v.logWithLogger(y.LogLevel.WARN,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability didn't send any valid data",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYFAILED,"Get Reconnect Availability failed",null==r?void 0:r.requestId,void 0,C,s,l,e.t0,void 0,u,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"getAgentAvailability",value:(H=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,C,I,A,D,P,N,x,k,_=this,U=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=U.length>1&&void 0!==U[1]?U[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSTARTED,"Get agent availability Started",t),s="/".concat(S.default.GetAgentAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=lcw"),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getAgentAvailability}),c=r.authenticatedUserToken,l=r.initContext,C=r.getContext,I=g.default.defaultHeaders,c&&(I[R.default.authenticatedUserToken]=c,I[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,I),A=l||{},D={orgId:this.omnichannelConfiguration.orgId,widgetId:this.omnichannelConfiguration.widgetId},A&&A.customContextData&&(P=v.CustomContextData.sort(A.customContextData),Object.assign(D,{customContext:P})),A.portalcontactid&&Object.assign(D,{portalcontactid:A.portalcontactid}),A.cacheKey=(0,b.default)(JSON.stringify(D)).toString(E.default),!C||window.document){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 17:if(C&&(A.browser=p.BrowserInfo.getBrowserName(),A.device=m.DeviceInfo.getDeviceType(),A.originurl=window.location.href,A.os=w.OSInfo.getOsType()),A.locale||(A.locale=g.default.defaultLocale),!A.locale||T.default.supportedLocales.includes(A.locale)){e.next=21;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(A.locale,"'"))));case 21:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(s),k={data:A,headers:I,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getAgentAvailability},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(k);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,p=c.headers,_.setAuthCodeNonce(p),h&&(_.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSUCCEEDED,"Get agent availability succeeded",t,c,f,s,x,void 0,void 0,I,l),n(h)),e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(1),v=a.milliSecondsElapsed,m=o.milliSecondsElapsed,_.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYFAILED,"Get agent availability failed",t,void 0,m,s,x,e.t0,void 0,I,v),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=20;break}return r(new Error(_.HTTPTimeOutErrorMessage)),e.abrupt("return");case 20:r(e.t0);case 21:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 25:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"sessionInit",value:(G=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B=this,j=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=j.length>1&&void 0!==j[1]?j[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSTARTED,"Session Init Started",t),s=f.default.create(),u=!0,(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,u)},headerOverwrites:[R.default.authCodeNonce]}),c=r.reconnectId,v=r.authenticatedUserToken,E=r.initContext,C=r.getContext,b=E||{},I=_({},g.default.defaultHeaders),A=v?S.default.LiveChatAuthSessionInitPath:S.default.LiveChatSessionInitPath,P="/".concat(A,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),v&&Object.assign(I,(N={},(0,l.default)(N,R.default.authenticatedUserToken,v),(0,l.default)(N,R.default.authCodeNonce,this.configuration.authCodeNonce),N)),this.addDefaultHeaders(t,I),this.setRequestIdHeader(t,I),x=!v&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,c&&(x||(P+="/".concat(c))),k={channelId:this.omnichannelConfiguration.channelId},c&&x&&(k.sig=c),!C||window.document){e.next=20;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 20:if(C&&(b.browser=p.BrowserInfo.getBrowserName(),b.device=m.DeviceInfo.getDeviceType(),b.originurl=window.location.href,b.os=w.OSInfo.getOsType()),b.locale||(b.locale=g.default.defaultLocale),!b.locale||T.default.supportedLocales.includes(b.locale)){e.next=24;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(b.locale,"'"))));case 24:return U="".concat(this.omnichannelConfiguration.orgUrl).concat(P),F={data:b,headers:I,method:M="POST",url:U,params:k,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,u,c,l,f,h,p;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,s(F);case 4:u=e.sent,c=a.milliSecondsElapsed,l=o.milliSecondsElapsed,f=u.headers,B.setAuthCodeNonce(f),B.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSUCCEEDED,"Session Init Succeeded",t,u,l,P,M,void 0,b,I,c),n(),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,p=o.milliSecondsElapsed,B.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONINITFAILED,"Session Init failed",t,void 0,p,P,M,e.t0,b,I,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(B.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 28:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"createConversation",value:(j=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B,j,G,H,q,V=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.length>1&&void 0!==V[1]?V[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSTARTED,"Create conversation call Started",t),a=f.default.create(),s=!0,(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,s)},headerOverwrites:[R.default.authCodeNonce]}),u=r.reconnectId,c=r.authenticatedUserToken,v=r.initContext,E=r.getContext,C=v||{},b=_({},g.default.defaultHeaders),I=c?S.default.LiveChatConnectorAuthPath:S.default.LiveChatConnectorPath,A="/".concat(I,"/").concat(this.omnichannelConfiguration.orgId,"/widgetApp/").concat(this.omnichannelConfiguration.widgetId,"/conversation"),c&&Object.assign(b,(P={},(0,l.default)(P,R.default.authenticatedUserToken,c),(0,l.default)(P,R.default.authCodeNonce,this.configuration.authCodeNonce),P)),this.addDefaultHeaders(t,b),this.setRequestIdHeader(t,b),u&&(C.reconnectId=u),C.channelId=this.omnichannelConfiguration.channelId,!E||window.document){e.next=18;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 18:if(E&&(C.browser=p.BrowserInfo.getBrowserName(),C.device=m.DeviceInfo.getDeviceType(),C.originurl=window.location.href,C.os=w.OSInfo.getOsType()),C.locale||(C.locale=g.default.defaultLocale),!C.locale||T.default.supportedLocales.includes(C.locale)){e.next=22;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(C.locale,"'"))));case 22:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(A),k={data:C,headers:b,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},U=O.Timer.TIMER(),e.prev=26,e.next=29,a(k);case 29:if(M=e.sent,F=U.milliSecondsElapsed,B=o.milliSecondsElapsed,j=M.data,G=M.headers,this.setAuthCodeNonce(G),G&&G[R.default.ocSessionId.toLowerCase()]&&(this.sessionId=G[R.default.ocSessionId.toLowerCase()]),0!==Object.keys(j).length){e.next=37;break}throw new Error("Empty data received from getChatToken");case 37:return j.requestId=t,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSUCCEEDED,"Create coversation call Succeeded",t,M,B,A,x,void 0,void 0,b,F),e.abrupt("return",j);case 42:if(e.prev=42,e.t0=e.catch(26),H=U.milliSecondsElapsed,q=o.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.CREATESESSIONFAILED,"Create conversation call failed",t,void 0,q,A,x,e.t0,C,b,H),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=49;break}throw new Error(this.HTTPTimeOutErrorMessage);case 49:throw e.t0;case 50:case"end":return e.stop()}}),e,this,[[26,42]])}))),function(e){return j.apply(this,arguments)})},{key:"sessionClose",value:(B=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESTARTED,"Session Close Started",t),s="/".concat(S.default.LiveChatSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionClose}),c=r.authenticatedUserToken,l=r.isReconnectChat,p=r.isPersistentChat,v=r.chatId,m=g.default.defaultHeaders,(E={}).chatId=v,c&&(s="/".concat(S.default.LiveChatAuthSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),m[R.default.authenticatedUserToken]=c,m[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,m),l&&(s+="&isReconnectChat=true"),p&&(s+="&isPersistentChat=true"),T="".concat(this.omnichannelConfiguration.orgUrl).concat(s),w={data:E,headers:m,method:C="POST",url:T,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionClose},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(w);case 4:c=e.sent,l=a.milliSecondsElapsed,f=c.headers,b.setAuthCodeNonce(f),h=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESUCCEEDED,"Session Close succeeded",t,c,h,s,C,void 0,void 0,m,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=a.milliSecondsElapsed,v=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONCLOSEFAILED,"Session close failed",t,void 0,v,s,C,e.t0,void 0,m,p),e.t0.code===g.default.axiosTimeoutErrorCode&&r(new Error(b.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return B.apply(this,arguments)})},{key:"validateAuthChatRecord",value:(F=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSTARTED,"Validate Auth Chat Record Started",t),s=n.authenticatedUserToken,u=n.chatId,c="/".concat(S.default.LiveChatValidateAuthChatMapRecordPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(u,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.validateAuthChatRecord}),p=g.default.defaultHeaders,s&&(p[R.default.authenticatedUserToken]=s,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:p,method:"GET",url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.validateAuthChatRecordTimeout},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,f,h,v,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:u=e.sent,f=a.milliSecondsElapsed,h=u.headers,E.setAuthCodeNonce(h),v=o.milliSecondsElapsed,!0===(null===(s=u.data)||void 0===s?void 0:s.authChatExist)?(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSUCCEEDED,"Validate Auth Chat Record succeeded",t,u,v,c,"GET",void 0,void 0,p,f),n(u.data)):(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record Failed. Record is not found or request is not authorized",t,u,v,c,"GET",void 0,void 0,p,f),r(new Error("Validate Auth Chat Record Failed. Record is not found or request is not authorized"))),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record failed",t,void 0,C,c,"GET",e.t0,void 0,p,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),"Error: Request failed with status code 404"===e.t0.toString()?n({}):r(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"submitPostChatResponse",value:(M=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSTARTED,"Submit Post Chat Started",t),u="/".concat(S.default.LiveChatSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.submitPostChatResponse}),l=o.authenticatedUserToken,p=g.default.defaultHeaders,this.addDefaultHeaders(t,p),l&&(u="/".concat(S.default.LiveChatAuthSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.submitPostChatResponse},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSUCCEEDED,"Submit Post Chat succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SUBMITPOSTCHATFAILED,"Submit Post Chat Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getSurveyInviteLink",value:(k=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=w.length>2&&void 0!==w[2]?w[2]:{},s=O.Timer.TIMER(),this.logger&&this.logger.log(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSTARTED,{SurveyOwnerId:t},"Get Survey Invite Link Started"),u="/".concat(S.default.LiveChatGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getSurveyInviteLink}),l=o.authenticatedUserToken,p=o.requestId,v=g.default.defaultHeaders,l&&(u="/".concat(S.default.LiveChatAuthGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),v[R.default.authenticatedUserToken]=l,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId),this.addDefaultHeaders(p,v),p&&(v[R.default.requestId]=p),m="".concat(this.omnichannelConfiguration.orgUrl).concat(u),E="POST",T={data:JSON.stringify(n),headers:v,method:E,url:m,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.getSurveyInviteLink},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,l,f,h,m,w;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),e.prev=1,e.next=4,c(T);case 4:o=e.sent,a=r.milliSecondsElapsed,l=o.data,f=o.headers,C.setAuthCodeNonce(f),h=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSUCCEEDED,"Get Survey Invite Link Succeeded",p,o,h,u,E,void 0,void 0,v,a),t(l),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=r.milliSecondsElapsed,w=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKFAILED,"Get Survey Invite Link failed",p,void 0,w,u,E,e.t0,void 0,v,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(C.HTTPTimeOutErrorMessage)),n(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getChatTranscripts",value:(x=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.length>3&&void 0!==b[3]?b[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSTARTED,"Get Chat Transcript Started",t),c="/".concat(S.default.LiveChatGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatTranscripts}),p=s.authenticatedUserToken,v=s.currentLiveChatVersion,(m=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,m[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,m[R.default.authorization]=r,this.liveChatVersion===d.LiveChatVersion.V2||v&&v===d.LiveChatVersion.V2?(c="/".concat(S.default.LiveChatv2GetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatv2AuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId))):p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,m),E="".concat(this.omnichannelConfiguration.orgUrl).concat(c),C={headers:m,method:T="GET",url:E,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.getChatTranscripts},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,v,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(C);case 4:a=e.sent,s=o.milliSecondsElapsed,f=u.milliSecondsElapsed,h=a.data,p=a.headers,w.setAuthCodeNonce(p),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSUCCEEDED,"Get Chat Transcript succeeded",t,a,f,c,T,void 0,void 0,m,s),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,E=u.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTFAILED,"Get Chat Transcript failed",t,void 0,E,c,T,e.t0,void 0,m,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return x.apply(this,arguments)})},{key:"getPersistentChatHistory",value:(N=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSTARTED,"Get Persistent Chat History Started",t),t||(t=(0,P.uuidv4)()),s=r.authenticatedUserToken,u=r.pageSize,c=r.pageToken,s){e.next=9;break}return l="Authenticated user token is required for persistent chat history",this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed - Missing authenticated user token",t),e.abrupt("return",Promise.reject(new Error(l)));case 9:return p="/".concat(S.default.LiveChatAuthGetPersistentChatHistoryPath,"/").concat(this.omnichannelConfiguration.orgId,"/widgetapp/").concat(this.omnichannelConfiguration.widgetId,"/conversation/history"),v=f.default.create(),(0,h.default)(v,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getPersistentChatHistory}),(m=g.default.defaultHeaders)[R.default.authenticatedUserToken]=s,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c&&(m[R.default.pageToken]=c),this.addDefaultHeaders(t,m),E={},u&&(E.pageSize=u.toString()),T="".concat(this.omnichannelConfiguration.orgUrl).concat(p),w={headers:m,method:C="GET",url:T,params:E,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getPersistentChatHistory},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,c,l,f,h,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,v(w);case 4:s=e.sent,u=a.milliSecondsElapsed,c=o.milliSecondsElapsed,l=s.data,f=s.headers,b.setAuthCodeNonce(f),b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSUCCEEDED,"Get Persistent Chat History succeeded",t,s,c,p,C,void 0,void 0,m,u),n(l),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,E=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed",t,void 0,E,p,C,e.t0,void 0,m,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(b.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 23:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"emailTranscript",value:(o=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=w.length>3&&void 0!==w[3]?w[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSTARTED,"Email Transcript Started",t),c="/".concat(S.default.LiveChatTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.emailTranscript}),p=s.authenticatedUserToken,(v=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,v[R.default.authorization]=n,p&&(v[R.default.authenticatedUserToken]=p,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,v),m="".concat(this.omnichannelConfiguration.orgUrl).concat(c),E="POST",T={data:JSON.stringify(r),headers:v,method:E,url:m,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.emailTranscript},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(T);case 4:a=e.sent,s=o.milliSecondsElapsed,f=a.headers,C.setAuthCodeNonce(f),h=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSUCCEEDED,"Email Transcript succeeded",t,a,h,c,E,void 0,void 0,v,s),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=o.milliSecondsElapsed,m=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTFAILED,"Email Transcript Failed",t,void 0,m,c,E,e.t0,void 0,v,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"fetchDataMaskingInfo",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSTARTED,"Fetch Data Masking Started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatFetchDataMaskingInfoPath,"/").concat(this.omnichannelConfiguration.orgId),s=f.default.create(),(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.fetchDataMaskingInfo}),(u=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u[R.default.requestId]=t,this.addDefaultHeaders(t,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(o),l={headers:u,method:"GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.fetchDataMaskingInfo},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,a){var c,f,h,v,m,E,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=O.Timer.TIMER(),e.prev=1,e.next=4,s(l);case 4:f=e.sent,h=c.milliSecondsElapsed,v=r.milliSecondsElapsed,m=f.data,p.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSUCCEEDED,"Fetch Data Masking succeeded",t,f,v,o,"GET",void 0,void 0,u,h),n(m),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),E=c.milliSecondsElapsed,T=r.milliSecondsElapsed,p.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.FETCHDATAMASKINGFAILED,"Fetch Data Masking Failed",t,void 0,T,o,"GET",e.t0,void 0,u,E),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&a(new Error(p.HTTPTimeOutErrorMessage)),a(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"makeSecondaryChannelEventRequest",value:(n=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSTARTED,"Secondary Channel Event Request Started",t),u="/".concat(S.default.LiveChatSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.makeSecondaryChannelEventRequest}),l=o.authenticatedUserToken,(p=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,l&&(p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce,u="/".concat(S.default.LiveChatAuthSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t)),this.addDefaultHeaders(t,p),u+="?channelId="+g.default.defaultChannelId,v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.makeSecondaryChannelEventRequest},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSUCCEEDED,"Secondary Channel Event Request Succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTFAILED,"Secondary Channel Event Request Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"sendTypingIndicator",value:(t=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,h,p,v,m,E=this,T=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=T.length>2&&void 0!==T[2]?T[2]:{},n&&n===d.LiveChatVersion.V2){e.next=3;break}return e.abrupt("return",Promise.resolve());case 3:if(s=O.Timer.TIMER(),u=o.customerDisplayName,n&&n===d.LiveChatVersion.V2){e.next=7;break}throw new Error("Typing indicator is only supported on v2");case 7:return c="/".concat(S.default.SendTypingIndicatorPath,"/").concat(t),l=f.default.create(),(h=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u&&(h[g.default.customerDisplayName]=u),this.addDefaultHeaders(t,h),p="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:h,method:v="POST",url:p,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.sendTypingIndicator},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,u,f,p,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:a=e.sent,u=o.milliSecondsElapsed,f=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORSUCCEEDED,"Send Typing Indicator Succeeded",t,a,f,c,v,void 0,void 0,h,u),n(),e.next=18;break;case 11:e.prev=11,e.t0=e.catch(1),p=o.milliSecondsElapsed,T=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORFAILED,"Send Typing Indicator Failed",t,void 0,T,c,v,e.t0,void 0,h,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),r(e.t0);case 18:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"logWithLogger",value:function(e,t,n,r,o,i,a,s,u,c,l,d){var f,h,p,v;if(this.logger){u&&C.LoggingSanitizer.stripErrorSensitiveProperties(u);var m=void 0;c&&((m=_({},c)).customContextData&&C.LoggingSanitizer.stripCustomContextDataValues(m.customContextData),m.preChatResponse&&C.LoggingSanitizer.stripPreChatResponse(m.preChatResponse),C.LoggingSanitizer.stripGeolocation(m));var E=void 0,T=void 0;if(l&&(E=_({},l),C.LoggingSanitizer.stripRequestHeadersSensitiveProperties(E),l[R.default.authenticatedUserToken]&&window.document&&window.atob))try{var y=l[R.default.authenticatedUserToken].split(".")[1],w=window.atob(y),S=JSON.parse(w),b=S.lwicontexts;if(T={sub:S.sub,exp:S.exp},b){var O=JSON.parse(b);C.LoggingSanitizer.stripCustomContextDataValues(O),T.lwiContexts=O}}catch(e){}var I={RequestId:r,Region:null==o?void 0:o.data.Region,ElapsedTimeInMilliseconds:i,HttpRequestResponseTime:d,TransactionId:null==o?void 0:o.headers[g.default.transactionid],RequestPath:a,RequestMethod:s,ResponseStatusCode:o?o.status:u?null===(f=u.response)||void 0===f?void 0:f.status:void 0,ExceptionDetails:u?(null===(h=u.response)||void 0===h?void 0:h.data)||u:void 0,RequestPayload:m,RequestHeaders:E,ResponseErrorcode:u?null===(p=u.response)||void 0===p||null===(v=p.headers)||void 0===v?void 0:v.errorcode:void 0,AuthTokenDetails:T};this.logger.log(e,t,I,n)}}},{key:"addDefaultHeaders",value:function(e,t){this.setSessionIdHeader(this.sessionId,t),(0,I.addOcUserAgentHeader)(this.ocUserAgent,t),this.setCorrelationIdInHeader(e,t)}}]),e}();t.default=F,(0,l.default)(F,"defaultRequestTimeoutConfig",{getChatConfig:12e4,getLWIDetails:15e3,getChatToken:15e3,sessionInit:15e3,sessionClose:15e3,getReconnectableChats:15e3,getReconnectAvailability:15e3,submitPostChatResponse:15e3,getSurveyInviteLink:15e3,getChatTranscripts:3e4,emailTranscript:5e3,fetchDataMaskingInfo:5e3,makeSecondaryChannelEventRequest:15e3,getAgentAvailability:15e3,sendTypingIndicator:5e3,validateAuthChatRecordTimeout:15e3,getPersistentChatHistory:15e3}),(0,l.default)(F,"defaultConfiguration",{authCodeNonce:(0,P.uuidv4)().substring(0,8),getChatTokenRetryCount:10,getChatTokenTimeBetweenRetriesOnFailure:1e4,getChatTokenRetryOn429:!0,maxRequestRetriesOnFailure:5,defaultRequestTimeout:void 0,requestTimeoutConfig:F.defaultRequestTimeoutConfig,useUnauthReconnectIdSigQueryParam:!1,waitTimeBetweenRetriesConfig:N.waitTimeBetweenRetriesConfigs,ocUserAgent:[]})},function(e,t,n){e.exports=n(31)},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return b()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function d(){}function f(){}function h(){}var p={};s(p,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(R([])));v&&v!==t&&n.call(v,o)&&(p=v);var m=h.prototype=d.prototype=Object.create(p);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function R(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:b}}function b(){return{value:void 0,done:!0}}return f.prototype=h,s(m,"constructor",h),s(h,"constructor",f),f.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},E(T.prototype),s(T.prototype,i,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new T(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(m),s(m,a,"Generator"),s(m,o,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t){function n(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,u,"next",e)}function u(e){n(a,o,i,s,u,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(34),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(7))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(7),n(14))},function(e,t,n){"use strict";(function(e){
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(36),o=n(37),i=n(38);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return b(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){d=!1;break}if(d)return i}return-1}function T(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function y(e,t,n,r){return H(j(t,e.length-n),e,n,r)}function C(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function w(e,t,n,r){return C(e,t,n,r)}function S(e,t,n,r){return H(G(t),e,n,r)}function R(e,t,n,r){return H(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function b(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,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(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).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(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),d=0;d<s;++d)if(c[d]!==l[d]){i=c[d],a=l[d];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return C(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function L(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=B(e[i]);return o}function D(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function x(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function k(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function _(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||_(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||_(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):k(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):k(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}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 e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:j(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(7))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
9
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserInfo=t.UNKNOWN_VERSION=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=n(8);t.UNKNOWN_VERSION="U";var u=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getUserAgent",value:function(){return this.userAgent()}},{key:"userAgentContainsString",value:function(e){return this.getUserAgent().indexOf(e)>-1}},{key:"isChrome",value:function(){return this.userAgentContainsString(s.BrowserVendor.CHROME)&&!this.userAgentContainsString(s.BrowserVendor.EDGE)&&!this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isIe",value:function(){return this.userAgentContainsString("Trident")}},{key:"isEdge",value:function(){return this.userAgentContainsString(s.BrowserVendor.EDGE)||this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isOpera",value:function(){return this.userAgentContainsString("OPR/")}},{key:"getBrowserName",value:function(){return this.isOpera()?s.BrowserVendor.OPERA:this.isEdge()?s.BrowserVendor.EDGE:this.isChrome()?s.BrowserVendor.CHROME:this.userAgentContainsString(s.BrowserVendor.FIREFOX)?s.BrowserVendor.FIREFOX:this.userAgentContainsString(s.BrowserVendor.SAFARI)?s.BrowserVendor.SAFARI:this.isIe()?s.BrowserVendor.IE:s.BrowserVendor.UNKNOWN}},{key:"getBrowserVersion",value:function(){var e=this;return this.isIe()?function(){var t=e.getUserAgent(),n=t.match(new RegExp(s.BrowserVendor.IE+" ([\\d,.]+)"));if(n)return n[1];var r=t.match(new RegExp("rv:([\\d,.]+)"));return r?r[1]:void 0}():function(t){t===s.BrowserVendor.SAFARI&&(t="Version"),t===s.BrowserVendor.OPERA&&(t="OPR"),t===s.BrowserVendor.EDGE&&(t="Edge?");var n=e.getUserAgent().match(new RegExp(t+"/([\\d,.]+)"));return n?n[1]:"U"}(this.getBrowserName())}}]),e}();t.BrowserInfo=u,(0,a.default)(u,"userAgent",(function(){return window.navigator.userAgent}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextData=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"sort",value:function(e){var t=new Array;return Object.keys(e).forEach((function(n){if(e&&e["".concat(n)]){var r={key:n,value:e["".concat(n)]};t.push(r)}})),t.sort((function(e,t){var n=e.key.toUpperCase(),r=t.key.toUpperCase();return n<r?-1:n>r?1:0})),t}}]),e}();t.CustomContextData=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getDeviceType",value:function(){return window.navigator.userAgent.match(/(android|ipod|windows phone|wpdesktop|windows ce|blackberry\w*|meego|webos|palm|symbian|pda|\w*?mobile\w*?|\w*?phone\w*?)/i)?a.DeviceType.Mobile:window.navigator.userAgent.match(/tablet|ipad/i)?a.DeviceType.Tablet:a.DeviceType.Desktop}}]),e}();t.DeviceInfo=s},function(e,t,n){var r;e.exports=(r=n(17),r.enc.Hex)},function(e,t){},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"supportedLocales",["ar-sa","bg-bg","ca-es","cs-cz","da-dk","de-de","el-gr","en-us","es-es","et-ee","eu-es","fi-fi","fr-fr","gl-es","he-il","hi-in","hr-hr","hu-hu","id-id","it-it","ja-jp","kk-kz","ko-kr","lt-lt","lv-lv","ms-my","nb-no","nl-nl","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sl-si","sr-cyrl-cs","sr-latn-cs","sv-se","th-th","tr-tr","uk-ua","vi-vn","zh-cn","zh-hk","zh-tw"])},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.LogLevel=r,function(e){e.INFO="INFO",e.DEBUG="DEBUG",e.WARN="WARN",e.ERROR="ERROR"}(r||(t.LogLevel=r={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingSanitizer=void 0;var o=r(n(10)),i=r(n(3)),a=r(n(4)),s=r(n(5)),u=r(n(9)),c=r(n(13)),l=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,null,[{key:"stripCustomContextDataValues",value:function(e){var t;e&&(null===(t=Object.keys(e))||void 0===t||t.forEach((function(t){var n;null!==(n=e["".concat(t)])&&void 0!==n&&n.value&&(e["".concat(t)].value=u.default.hiddenContentPlaceholder)})))}},{key:"stripPreChatResponse",value:function(e){e&&Object.keys(e).forEach((function(t){e["".concat(t)]&&"Type"!==t&&(e["".concat(t)]=u.default.hiddenContentPlaceholder)}))}},{key:"stripGeolocation",value:function(e){e&&(Object.keys(e).includes("longitude")&&(e.longitude=u.default.hiddenContentPlaceholder),Object.keys(e).includes("latitude")&&(e.latitude=u.default.hiddenContentPlaceholder))}},{key:"stripAuthenticationUserToken",value:function(e){e&&(Object.keys(e).includes(c.default.authenticatedUserToken)&&(e[c.default.authenticatedUserToken]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authCodeNonce)&&(e[c.default.authCodeNonce]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authorization)&&(e[c.default.authorization]=u.default.hiddenContentPlaceholder))}},{key:"stripRequestHeadersSensitiveProperties",value:function(t){e.stripAuthenticationUserToken(t),Object.keys(t).includes(c.default.authorization)&&(t[c.default.authorization]=u.default.hiddenContentPlaceholder)}},{key:"stripRequestPayloadData",value:function(t){if(null!=t&&t.data){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){n=void 0}n&&(Object.keys(n).includes("preChatResponse")&&e.stripPreChatResponse(n.preChatResponse),Object.keys(n).includes("customContextData")&&e.stripCustomContextDataValues(n.customContextData),e.stripGeolocation(n),t.data=JSON.stringify(n),t.data=e.stripEmailDataFromError(t.data))}}},{key:"stripEmailDataFromError",value:function(e){return e=e.replace(this.emailRegex,u.default.hiddenContentPlaceholder)}},{key:"stripAxiosErrorSensitiveProperties",value:function(t){if(t.isAxiosError){var n,r,o,i,a,s,u,c,l,d;if(null!=t&&null!==(n=t.config)&&void 0!==n&&n.headers)e.stripAuthenticationUserToken(null==t||null===(u=t.config)||void 0===u?void 0:u.headers);if(null!=t&&null!==(r=t.config)&&void 0!==r&&r.data&&this.stripRequestPayloadData(null==t?void 0:t.config),null!=t&&null!==(o=t.response)&&void 0!==o&&null!==(i=o.config)&&void 0!==i&&i.data)this.stripRequestPayloadData(null==t||null===(c=t.response)||void 0===c?void 0:c.config);if(null!=t&&null!==(a=t.response)&&void 0!==a&&null!==(s=a.config)&&void 0!==s&&s.headers)e.stripAuthenticationUserToken(null==t||null===(l=t.response)||void 0===l||null===(d=l.config)||void 0===d?void 0:d.headers)}}},{key:"stripErrorSensitiveProperties",value:function(e){var t;e&&"object"===(0,o.default)(e)&&(null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0&&this.stripAxiosErrorSensitiveProperties(e)}}]),e}();t.LoggingSanitizer=l,(0,s.default)(l,"emailRegex",/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.OSInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getOsType",value:function(){var e=function(){return window.navigator.userAgent};return e().match(/windows\sphone\s\d+\.\d+/i)?a.OperatingSystem.WINDOWS_PHONE:e().match(/ arm;/i)?a.OperatingSystem.WINDOWS_RT:e().match(/(iPad|iPhone|iPod)(?=.*like Mac OS X)/i)?a.OperatingSystem.IOS:e().match(/android/i)?a.OperatingSystem.ANDROID:e().match(/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|cros)/i)?a.OperatingSystem.LINUX:e().match(/(macintosh|mac os x)/i)?a.OperatingSystem.MACOSX:e().match(/(windows|win32)/i)?a.OperatingSystem.WINDOWS:a.OperatingSystem.UNKNOWN}}]),e}();t.OSInfo=s},function(e,t,n){var r;e.exports=(r=n(17),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],d=n[6],f=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=g+c[h-7]+m+c[h-16]}var E=r&o^r&i^o&i,T=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),y=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+u[h]+c[h];f=d,d=l,l=s,s=a+y|0,a=i,i=o,o=r,r=y+(T+E)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"TIMER",value:function(){var e=(new Date).getTime();return{get milliSecondsElapsed(){return(new Date).getTime()-e}}}}]),e}();t.Timer=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.addOcUserAgentHeader=void 0;var o=r(n(51)),i=r(n(13));t.addOcUserAgentHeader=function(e,t){var r=n(56).version,a="ocsdk/".concat(r);t["".concat(i.default.ocUserAgent)]=[].concat((0,o.default)(e),[a]).join(" ")}},function(e,t,n){var r=n(52),o=n(53),i=n(54),a=n(55);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e){e.exports=JSON.parse('{"name":"@microsoft/ocsdk","version":"0.5.21-main.cc89d16","description":"Microsoft Omnichannel SDK","files":["dist/**/*","lib/**/*"],"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"karma start karma.conf.js","start":"webpack-dev-server","watch":"webpack --watch --config webpack.config.js --mode development","build:tsc":"tsc --project tsconfig.json","build:babel":"babel src --extensions .js,.ts --out-dir lib --verbose","build:dev":"webpack --config webpack.config.js --mode development","build:prod":"export NODE_OPTIONS=--openssl-legacy-provider && npm run build:tsc && npm run build:babel && webpack --config webpack.config.js --mode production","format":"prettier --write \\"src/**/*.ts\\" \\"src/**/*.js\\"","lint":"eslint src --ext .ts"},"repository":{"type":"git","url":"https://github.com/microsoft/omnichannel-sdk.git"},"keywords":[],"author":"Microsoft Corporation","license":"MIT","devDependencies":{"@babel/cli":"^7.15.7","@babel/core":"^7.15.5","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-runtime":"^7.15.0","@babel/preset-env":"^7.15.6","@babel/preset-typescript":"^7.15.0","@dhigroup/karma-vsts-reporter":"^1.3.0","@types/crypto-js":"^4.2.2","@types/jasmine":"^3.9.1","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","axios-mock-adapter":"^2.0.0","danger":"^13.0.4","eslint":"^7.32.0","eslint-plugin-security":"^1.4.0","istanbul-instrumenter-loader":"^3.0.1","jasmine":"^3.9.0","karma":"^6.3.16","karma-chrome-launcher":"^3.1.0","karma-cli":"^2.0.0","karma-coverage-istanbul-reporter":"^2.1.1","karma-jasmine":"^2.0.1","karma-spec-reporter":"0.0.32","karma-webpack":"^4.0.2","prettier":"^1.19.1","ts-loader":"^8.4.0","typescript":"^4.9.5","webpack":"^4.47.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.2","webpack-merge":"^4.2.2"},"dependencies":{"@babel/runtime":"^7.15.4","@types/node":"^22.13.10","axios":"^1.12.0","axios-retry":"^3.9.1","crypto-js":"^4.2.0"}}')},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createGetChatTokenEndpoint=void 0;var o=r(n(5)),i=n(8),a=r(n(18));t.createGetChatTokenEndpoint=function(e,t,n){var r,s,u=(r={},(0,o.default)(r,i.LiveChatVersion.V1,a.default.LiveChatGetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V2,a.default.LiveChatv2GetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V3,a.default.LiveChatv3GetChatTokenPath),r),c=(s={},(0,o.default)(s,i.LiveChatVersion.V1,a.default.LiveChatAuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V2,a.default.LiveChatv2AuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V3,a.default.LiveChatv3AuthGetChatTokenPath),s);return n?t?a.default.LiveChatv4AuthGetChatTokenPath:a.default.LiveChatv4GetChatTokenPath:Object.values(i.LiveChatVersion).includes(e)?t?c[e]:u[e]:t?c[i.LiveChatVersion.V2]:u[i.LiveChatVersion.V2]}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(21)),i=function(e,t){try{if(o.default.isAxiosError(e)&&e.code==t)return!0}catch(e){return!1}return!1};t.default=i},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(9)),i=n(16),a=n(15),s=function(e,t){var n,r,s,u,c,l,d;if(null!=e&&null!==(n=e.response)&&void 0!==n&&n.status)switch(e.response.status){case o.default.tooManyRequestsStatusCode:if(!1===t)return!1;break;case o.default.badRequestStatusCode:if(null!==(r=e.response)&&void 0!==r&&null!==(s=r.headers)&&void 0!==s&&s.errorcode&&parseInt(e.response.headers.errorcode)===o.default.outOfOfficeErrorCode)return!1;break;default:return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(u=e.response)||void 0===u?void 0:u.status)||!(null!==(c=e.response)&&void 0!==c&&c.status)}return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(l=e.response)||void 0===l?void 0:l.status)||!(null!==(d=e.response)&&void 0!==d&&d.status)};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitTimeBetweenRetriesConfigs=void 0;t.waitTimeBetweenRetriesConfigs={getChatConfig:1e3,getLWIDetails:3e3,getChatToken:1e3,sessionInit:1e3,sessionClose:1e3,getReconnectableChats:1e3,getReconnectAvailability:1e3,submitPostChatResponse:1e3,getSurveyInviteLink:1e3,getChatTranscripts:1e3,emailTranscript:1e3,fetchDataMaskingInfo:1e3,makeSecondaryChannelEventRequest:1e3,getAgentAvailability:1e3,sendTypingIndicator:1e3,validateAuthChatRecordTimeout:1e3,getPersistentChatHistory:1e3}}]));
1
+ /*! For license information please see SDK.min.js.LICENSE.txt */
2
+ (()=>{var e={79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},477(){},579(e,t,n){var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,a){return new o(r().w(e,t,n,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1111(e){"use strict";const t=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!t.has(e&&e.code)},1132(e,t,n){var r=n(5901),o=n(9291),i=n(7122),a=n(1869);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},1415(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.UNKNOWN_VERSION=t.BrowserInfo=void 0;var o=r(n(7383)),i=r(n(4579)),a=r(n(3693)),s=n(2949),u="([\\d,.]+)",c=t.UNKNOWN_VERSION="U",l=t.BrowserInfo=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"getUserAgent",value:function(){return this.userAgent()}},{key:"userAgentContainsString",value:function(e){return this.getUserAgent().indexOf(e)>-1}},{key:"isChrome",value:function(){return this.userAgentContainsString(s.BrowserVendor.CHROME)&&!this.userAgentContainsString(s.BrowserVendor.EDGE)&&!this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isIe",value:function(){return this.userAgentContainsString("Trident")}},{key:"isEdge",value:function(){return this.userAgentContainsString(s.BrowserVendor.EDGE)||this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isOpera",value:function(){return this.userAgentContainsString("OPR/")}},{key:"getBrowserName",value:function(){return this.isOpera()?s.BrowserVendor.OPERA:this.isEdge()?s.BrowserVendor.EDGE:this.isChrome()?s.BrowserVendor.CHROME:this.userAgentContainsString(s.BrowserVendor.FIREFOX)?s.BrowserVendor.FIREFOX:this.userAgentContainsString(s.BrowserVendor.SAFARI)?s.BrowserVendor.SAFARI:this.isIe()?s.BrowserVendor.IE:s.BrowserVendor.UNKNOWN}},{key:"getBrowserVersion",value:function(){var e=this;return this.isIe()?function(){var t=e.getUserAgent(),n=t.match(new RegExp(s.BrowserVendor.IE+" "+u));if(n)return n[1];var r=t.match(new RegExp("rv:"+u));return r?r[1]:void 0}():function(t){t===s.BrowserVendor.SAFARI&&(t="Version"),t===s.BrowserVendor.OPERA&&(t="OPR"),t===s.BrowserVendor.EDGE&&(t="Edge?");var n=e.getUserAgent().match(new RegExp(t+"/"+u));return n?n[1]:c}(this.getBrowserName())}}])}();(0,a.default)(l,"userAgent",function(){return window.navigator.userAgent})},1728(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7383)),i=r(n(4579)),a=r(n(9478)),s=r(n(5529)),u=r(n(8537));t.default=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"getSDK",value:function(e,t,n){var r=new s.default(n);return new u.default({channelId:e.channelId||a.default.defaultChannelId,orgId:e.orgId,orgUrl:e.orgUrl,widgetId:e.widgetId},t||{},r)}}])}()},1791(e,t,n){var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,a,s){try{var u=t[e](o),c=u.value;return c instanceof r?n.resolve(c.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):n.resolve(c).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},1869(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},1905(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextData=void 0;var o=r(n(7383)),i=r(n(4579));t.CustomContextData=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"sort",value:function(e){var t=new Array;return Object.keys(e).forEach(function(n){if(e&&e["".concat(n)]){var r={key:n,value:e["".concat(n)]};t.push(r)}}),t.sort(function(e,t){var n=e.key.toUpperCase(),r=t.key.toUpperCase();return n<r?-1:n>r?1:0}),t}}])}()},2200(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.addOcUserAgentHeader=void 0;var o=r(n(1132)),i=r(n(2805));t.addOcUserAgentHeader=function(e,t){var r=n(8330).rE,a="ocsdk/".concat(r);t["".concat(i.default.ocUserAgent)]=[].concat((0,o.default)(e),[a]).join(" ")}},2487(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7383)),i=r(n(4579));t.default=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"OCSDKLOAD",get:function(){return"oc:sdk:load"}}])}()},2515(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(9478)),i=n(3770),a=n(9903);t.default=function(e,t){var n,r,s,u,c,l;if(null!=e&&null!==(n=e.response)&&void 0!==n&&n.status)switch(e.response.status){case o.default.tooManyRequestsStatusCode:if(!1===t)return!1;break;case o.default.badRequestStatusCode:if(null!==(r=e.response)&&void 0!==r&&null!==(r=r.headers)&&void 0!==r&&r.errorcode&&parseInt(e.response.headers.errorcode)===o.default.outOfOfficeErrorCode)return!1;break;default:return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(s=e.response)||void 0===s?void 0:s.status)||!(null!==(u=e.response)&&void 0!==u&&u.status)}return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(c=e.response)||void 0===c?void 0:c.status)||!(null!==(l=e.response)&&void 0!==l&&l.status)}},2793(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(4579)),i=r(n(7383)),a=r(n(3693)),s=t.default=(0,o.default)(function e(){(0,i.default)(this,e)});(0,a.default)(s,"LiveChatConnectorPath","livechatconnector/organization"),(0,a.default)(s,"LiveChatConnectorAuthPath","livechatconnector/auth/organization"),(0,a.default)(s,"LcwFcsDetailsPath","livechatconnector/v2/lcwfcsdetails"),(0,a.default)(s,"LiveChatConfigPath","livechatconnector/config"),(0,a.default)(s,"LiveChatSessionInitPath","livechatconnector/sessioninit"),(0,a.default)(s,"LiveChatAuthSessionInitPath","livechatconnector/auth/sessioninit"),(0,a.default)(s,"LiveChatGetChatTokenPath","livechatconnector/getchattoken"),(0,a.default)(s,"LiveChatv2GetChatTokenPath","livechatconnector/v2/getchattoken"),(0,a.default)(s,"LiveChatv3GetChatTokenPath","livechatconnector/v3/getchattoken"),(0,a.default)(s,"LiveChatv4GetChatTokenPath","livechatconnector/v4/getchattoken"),(0,a.default)(s,"LiveChatv4AuthGetChatTokenPath","livechatconnector/v4/auth/getchattoken"),(0,a.default)(s,"LiveChatAuthGetChatTokenPath","livechatconnector/auth/getchattoken"),(0,a.default)(s,"LiveChatv2AuthGetChatTokenPath","livechatconnector/v2/auth/getchattoken"),(0,a.default)(s,"LiveChatv3AuthGetChatTokenPath","livechatconnector/v3/auth/getchattoken"),(0,a.default)(s,"LiveChatSessionClosePath","livechatconnector/sessionclose"),(0,a.default)(s,"LiveChatAuthSessionClosePath","livechatconnector/auth/sessionclose"),(0,a.default)(s,"LiveChatSubmitPostChatPath","survey/submitpostchat"),(0,a.default)(s,"LiveChatAuthSubmitPostChatPath","survey/auth/submitpostchat"),(0,a.default)(s,"LiveChatGetSurveyInviteLinkPath","livechatconnector/getsurveyinvite"),(0,a.default)(s,"LiveChatAuthGetSurveyInviteLinkPath","livechatconnector/auth/getsurveyinvite"),(0,a.default)(s,"LiveChatGetChatTranscriptPath","livechatconnector/getchattranscripts"),(0,a.default)(s,"LiveChatv2GetChatTranscriptPath","livechatconnector/v2/getchattranscripts"),(0,a.default)(s,"LiveChatAuthGetChatTranscriptPath","livechatconnector/auth/getchattranscripts"),(0,a.default)(s,"LiveChatv2AuthGetChatTranscriptPath","livechatconnector/v2/auth/getchattranscripts"),(0,a.default)(s,"LiveChatTranscriptEmailRequestPath","livechatconnector/createemailrequest"),(0,a.default)(s,"LiveChatAuthTranscriptEmailRequestPath","livechatconnector/auth/createemailrequest"),(0,a.default)(s,"LiveChatFetchDataMaskingInfoPath","livechatconnector/fetchdatamaskinginfo"),(0,a.default)(s,"LiveChatSecondaryChannelEventPath","livechatconnector/secondarychannelevent"),(0,a.default)(s,"LiveChatAuthSecondaryChannelEventPath","livechatconnector/auth/secondarychannelevent"),(0,a.default)(s,"LiveChatLiveWorkItemDetailsPath","livechatconnector/getliveworkitemdetails"),(0,a.default)(s,"LiveChatAuthLiveWorkItemDetailsPath","livechatconnector/auth/getliveworkitemdetails"),(0,a.default)(s,"LiveChatGetReconnectableChatsPath","livechatconnector/auth/reconnectablechats"),(0,a.default)(s,"LiveChatReconnectAvailabilityPath","livechatconnector/reconnect"),(0,a.default)(s,"LiveChatValidateAuthChatMapRecordPath","livechatconnector/auth/validateauthchatmaprecord"),(0,a.default)(s,"GetAgentAvailabilityPath","livechatconnector/auth/getagentavailability"),(0,a.default)(s,"SendTypingIndicatorPath","inbound/typingindicator/livechat/sendtypingindicator"),(0,a.default)(s,"LiveChatAuthGetPersistentChatHistoryPath","livechatconnector/auth/organization")},2805(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(4579)),i=r(n(7383)),a=r(n(3693)),s=t.default=(0,o.default)(function e(){(0,i.default)(this,e)});(0,a.default)(s,"authenticatedUserToken","AuthenticatedUserToken"),(0,a.default)(s,"authorization","Authorization"),(0,a.default)(s,"organizationId","OrganizationId"),(0,a.default)(s,"widgetAppId","widgetAppId"),(0,a.default)(s,"requestId","Request-Id"),(0,a.default)(s,"authCodeNonce","AuthCodeNonce"),(0,a.default)(s,"ocSessionId","Oc-Sessionid"),(0,a.default)(s,"ocUserAgent","Ms-Oc-User-Agent"),(0,a.default)(s,"correlationId","x-ms-client-request-id"),(0,a.default)(s,"pageToken","PageToken")},2949(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.OperatingSystem=t.OCSDKTelemetryEvent=t.LiveChatVersion=t.DeviceType=t.ChannelId=t.BrowserVendor=t.Browser=void 0,t.BrowserVendor=function(e){return e.IE="IE",e.CHROME="Chrome",e.FIREFOX="Firefox",e.SAFARI="Safari",e.EDGE="Edge",e.EDGE_CHROMIUM="Edg",e.OPERA="Opera",e.UNKNOWN="Unknown",e}({}),t.Browser=function(e){return e[e.Chrome=0]="Chrome",e[e.Firefox=1]="Firefox",e[e.Ie=2]="Ie",e[e.Edge=3]="Edge",e[e.Safari=4]="Safari",e[e.None=5]="None",e}({}),t.DeviceType=function(e){return e.Desktop="Desktop",e.Mobile="Mobile",e.Tablet="Tablet",e}({}),t.OperatingSystem=function(e){return e.WINDOWS="Windows",e.MACOSX="Mac OS X",e.WINDOWS_PHONE="Windows Phone",e.WINDOWS_RT="Windows RT",e.IOS="iOS",e.ANDROID="Android",e.LINUX="Linux",e.UNKNOWN="Unknown",e}({}),t.ChannelId=function(e){return e.LCW="lcw",e.SMS="sms",e.FACEBOOK="facebook",e.WECHAT="wechat",e}({}),t.OCSDKTelemetryEvent=function(e){return e.GETLCWFCSDETAILSSTARTED="GetLcwFcsDetailsStarted",e.GETLCWFCSDETAILSSUCCEEDED="GetLcwFcsDetailsSucceeded",e.GETLCWFCSDETAILSFAILED="GetLcwFcsDetailsFailed",e.GETCHATCONFIGFSTARTED="GetChatConfig",e.GETCHATCONFIGSUCCEEDED="GetChatConfigSucceeded",e.GETCHATCONFIGFAILED="GetChatConfigFailed",e.GETRECONNECTABLECHATSSTARTED="GetReconnnectableChatsStarted",e.GETRECONNECTABLECHATSSUCCEEDED="GetReconnnectableChatsSucceeded",e.GETRECONNECTABLECHATSFAILED="GetReconnnectableChatsFailed",e.GETRECONNECTAVAILABILITYSUCCEEDED="GetReconnnectableAvailabilitySucceeded",e.GETRECONNECTAVAILABILITYSTARTED="GetReconnnectableAvailabilityStarted",e.GETRECONNECTAVAILABILITYFAILED="GetReconnnectableAvailabilityFailed",e.GETCHATTOKENSTARTED="GetChatTokenStarted",e.GETCHATTOKENSUCCEEDED="GetChatTokenSucceeded",e.GETCHATTOKENFAILED="GetChatTokenFailed",e.GETLWISTATUSSTARTED="GetLwiStatusStarted",e.GETLWISTATUSSUCCEEDED="GetLwiStatusSucceeded",e.GETLWISTATUSFAILED="GetLwiStatusFailed",e.SESSIONINITSTARTED="SessionInitStarted",e.SESSIONINITSUCCEEDED="SessionInitSucceeded",e.SESSIONINITFAILED="SessionInitFailed",e.CREATESESSIONSTARTED="CreateSessionStarted",e.CREATESESSIONSUCCEEDED="CreateSessionSucceeded",e.CREATESESSIONFAILED="CreateSessionFailed",e.SESSIONCLOSESTARTED="SessionCloseStarted",e.SESSIONCLOSESUCCEEDED="SessionCloseSucceeded",e.SESSIONCLOSEFAILED="SessionCloseFailed",e.SUBMITPOSTCHATSTARTED="SubmitPostChatStarted",e.SUBMITPOSTCHATSUCCEEDED="SubmitPostChatSucceeded",e.SUBMITPOSTCHATFAILED="SubmitPostChatFailed",e.GETCHATTRANSCRIPTSTARTED="GetChatTranscriptStarted",e.GETCHATTRANSCRIPTSUCCEEDED="GetChatTranscriptSucceeded",e.GETCHATTRANSCRIPTFAILED="GetChatTranscriptFailed",e.EMAILTRANSCRIPTSTARTED="EmailTranscriptStarted",e.EMAILTRANSCRIPTSUCCEEDED="EmailTranscriptSucceeded",e.EMAILTRANSCRIPTFAILED="EmailTranscriptFailed",e.FETCHDATAMASKINGSTARTED="FetchDataMaskingStarted",e.FETCHDATAMASKINGSUCCEEDED="FetchDataMaskingSucceeded",e.FETCHDATAMASKINGFAILED="FetchDataMaskingFailed",e.SECONDARYCHANNELEVENTREQUESTSTARTED="SecondaryChannelEventRequestStarted",e.SECONDARYCHANNELEVENTREQUESTSUCCEEDED="SecondaryChannelEventRequestSucceeded",e.SECONDARYCHANNELEVENTREQUESTFAILED="SecondaryChannelEventRequestFailed",e.GETSURVEYINVITELINKSTARTED="GetSurveyInviteLinkStarted",e.GETSURVEYINVITELINKSUCCEEDED="GetSurveyInviteLinkSucceeded",e.GETSURVEYINVITELINKFAILED="GetSurveyInviteLinkFailed",e.VALIDATEAUTHCHATRECORDSTARTED="ValidateAuthChatRecordStarted",e.VALIDATEAUTHCHATRECORDSUCCEEDED="ValidateAuthChatRecordSucceeded",e.VALIDATEAUTHCHATRECORDFAILED="ValidateAuthChatRecordFailed",e.GETAGENTAVAILABILITYSTARTED="GetAgentAvailabilityStarted",e.GETAGENTAVAILABILITYSUCCEEDED="GetAgentAvailabilitySucceeded",e.GETAGENTAVAILABILITYFAILED="GetAgentAvailabilityFailed",e.SENDTYPINGINDICATORFAILED="SendTypingIndicatorFailed",e.SENDTYPINGINDICATORSUCCEEDED="SendTypingIndicatorSucceeded",e.GETPERSISTENTCHATHISTORYSTARTED="GetPersistentChatHistoryStarted",e.GETPERSISTENTCHATHISTORYSUCCEEDED="GetPersistentChatHistorySucceeded",e.GETPERSISTENTCHATHISTORYFAILED="GetPersistentChatHistoryFailed",e}({}),t.LiveChatVersion=function(e){return e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e}({}),t.SDKError=function(e){return e.ClientHTTPTimeoutErrorName="ClientHTTPTimeoutError",e.ClientHTTPTimeoutErrorMessage="Server took too long to respond",e}({})},2950(e,t,n){"use strict";var r=n(4994);t.Ay=w;var o=r(n(4756)),i=r(n(3738)),a=r(n(9293)),s=r(n(3693)),u=r(n(1111));function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,s.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d="axios-retry";function f(e){return!e.response&&Boolean(e.code)&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&(0,u.default)(e)}var h=["get","head","options"],p=h.concat(["put","delete"]);function g(e){return"ECONNABORTED"!==e.code&&(!e.response||e.response.status>=500&&e.response.status<=599)}function v(e){return!!e.config&&g(e)&&-1!==p.indexOf(e.config.method)}function E(e){return f(e)||v(e)}var m={retries:3,retryCondition:E,retryDelay:function(){return 0},shouldResetTimeout:!1,onRetry:function(){}};function T(e,t){var n=function(e,t){return l(l(l({},m),t),e[d])}(e,t);return n.retryCount=n.retryCount||0,e[d]=n,n}function C(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function y(e,t){return S.apply(this,arguments)}function S(){return(S=(0,a.default)(o.default.mark(function e(t,n){var r,a,s,u;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.retries,a=t.retryCondition,s=t.retryCount<r&&a(n),"object"!==(0,i.default)(s)){e.next=13;break}return e.prev=3,e.next=6,s;case 6:return u=e.sent,e.abrupt("return",!1!==u);case 10:return e.prev=10,e.t0=e.catch(3),e.abrupt("return",!1);case 13:return e.abrupt("return",s);case 14:case"end":return e.stop()}},e,null,[[3,10]])}))).apply(this,arguments)}function w(e,t){var n=e.interceptors.request.use(function(e){return T(e,t).lastRequestTime=Date.now(),e}),r=e.interceptors.response.use(null,function(){var n=(0,a.default)(o.default.mark(function n(r){var i,a,s,u,c,l,d,f;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=r.config){n.next=3;break}return n.abrupt("return",Promise.reject(r));case 3:return a=T(i,t),n.next=6,y(a,r);case 6:if(!n.sent){n.next=21;break}if(a.retryCount+=1,s=a.retryDelay,u=a.shouldResetTimeout,c=a.onRetry,l=s(a.retryCount,r),C(e,i),u||!i.timeout||!a.lastRequestTime){n.next=17;break}if(d=Date.now()-a.lastRequestTime,!((f=i.timeout-d-l)<=0)){n.next=16;break}return n.abrupt("return",Promise.reject(r));case 16:i.timeout=f;case 17:return i.transformRequest=[function(e){return e}],n.next=20,c(a.retryCount,r,i);case 20:return n.abrupt("return",new Promise(function(t){return setTimeout(function(){return t(e(i))},l)}));case 21:return n.abrupt("return",Promise.reject(r));case 22:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}());return{requestInterceptorId:n,responseInterceptorId:r}}w.isNetworkError=f,w.isSafeRequestError=function(e){return!!e.config&&g(e)&&-1!==h.indexOf(e.config.method)},w.isIdempotentRequestError=v,w.isNetworkOrIdempotentRequestError=E,w.exponentialDelay=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,n=Math.pow(2,e)*t;return n+.2*n*Math.random()},w.isRetryableError=g},3009(e,t,n){var r;e.exports=(r=n(9021),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],d=n[6],f=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],E=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=g+c[h-7]+E+c[h-16]}var m=r&o^r&i^o&i,T=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+u[h]+c[h];f=d,d=l,l=s,s=a+C|0,a=i,i=o,o=r,r=C+(T+m)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)},3693(e,t,n){var r=n(7736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},3770(e,t,n){const r=n(2950).Ay;e.exports=r,e.exports.default=r},3905(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInfo=void 0;var o=r(n(7383)),i=r(n(4579)),a=n(2949);t.DeviceInfo=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"getDeviceType",value:function(){return window.navigator.userAgent.match(/(android|ipod|windows phone|wpdesktop|windows ce|blackberry\w*|meego|webos|palm|symbian|pda|\w*?mobile\w*?|\w*?phone\w*?)/i)?a.DeviceType.Mobile:window.navigator.userAgent.match(/tablet|ipad/i)?a.DeviceType.Tablet:a.DeviceType.Desktop}}])}()},3920(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7383)),i=r(n(4579));t.default=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"raiseCustomEvent",value:function(t,n){var r=e.createCustomEvent(t,n);window.dispatchEvent(r)}},{key:"createCustomEvent",value:function(e,t){var n=t?{detail:t}:void 0,r=null;try{r=new CustomEvent(e,n)}catch(t){(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n)}return r}}])}()},4063(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(6425));t.default=function(e,t){try{if(o.default.isAxiosError(e)&&e.code==t)return!0}catch(e){return!1}return!1}},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4556(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7383)),i=r(n(4579));t.default=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"GETTELEMETRYEVENTDATA",value:function(e,t,n){return{Description:n,ElapsedTimeInMilliseconds:t.ElapsedTimeInMilliseconds,HttpRequestResponseTime:t.HttpRequestResponseTime,Event:e,ExceptionDetails:t.ExceptionDetails,Region:t.Region,RequestId:t.RequestId,TransactionId:t.TransactionId,RequestHeaders:t.RequestHeaders,RequestPayload:t.RequestPayload,RequestPath:t.RequestPath,RequestMethod:t.RequestMethod,ResponseStatusCode:t.ResponseStatusCode,ResponseErrorcode:t.ResponseErrorcode,AuthTokenDetails:t.AuthTokenDetails}}}])}()},4579(e,t,n){var r=n(7736);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var r=n(5172),o=n(6993),i=n(5869),a=n(887),s=n(1791),u=n(4373),c=n(579);function l(){"use strict";var t=o(),n=t.m(l),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,h[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,c(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:f,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(f(t)?a:i)(p(e),t,n,r,o)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},4994(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5529(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7383)),i=r(n(4579)),a=r(n(3693)),s=r(n(4556));t.default=function(){return(0,i.default)(function e(t){(0,o.default)(this,e),(0,a.default)(this,"logger",void 0),this.logger=t},[{key:"log",value:function(e,t,n,r){if(this.isLoggingEnabled()){var o=s.default.GETTELEMETRYEVENTDATA(t,n,r);this.logEvent(e,o)}}},{key:"logEvent",value:function(e,t){this.isLoggingEnabled()&&this.logger.logClientSdkTelemetryEvent(e,t)}},{key:"isLoggingEnabled",value:function(){return!this.isNullOrUndefined(this.logger)}},{key:"isNullOrUndefined",value:function(e){return null==e}}])}()},5546(e){function t(n,r,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5560(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(4579)),i=r(n(7383)),a=r(n(3693)),s=t.default=(0,o.default)(function e(){(0,i.default)(this,e)});(0,a.default)(s,"supportedLocales",["ar-sa","bg-bg","ca-es","cs-cz","da-dk","de-de","el-gr","en-us","es-es","et-ee","eu-es","fi-fi","fr-fr","gl-es","he-il","hi-in","hr-hr","hu-hu","id-id","it-it","ja-jp","kk-kz","ko-kr","lt-lt","lv-lv","ms-my","nb-no","nl-nl","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sl-si","sr-cyrl-cs","sr-latn-cs","sv-se","th-th","tr-tr","uk-ua","vi-vn","zh-cn","zh-hk","zh-tw"])},5606(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,u=[],c=!1,l=-1;function d(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var e=a(d);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}r.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];u.push(new h(e,t)),1!==u.length||c||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5869(e,t,n){var r=n(887);e.exports=function(e,t,n,o,i){var a=r(e,t,n,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},5901(e,t,n){var r=n(79);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6425(e,t,n){"use strict";var r=n(5606);function o(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:u}=Symbol,c=(l=Object.create(null),e=>{const t=i.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const d=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:h}=Array,p=f("undefined");function g(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const v=d("ArrayBuffer"),E=f("string"),m=f("function"),T=f("number"),C=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||u in e||s in e)},S=d("Date"),w=d("File"),R=d("Blob"),O=d("FileList"),I=d("URLSearchParams"),[b,A,L,D]=["ReadableStream","Request","Response","Headers"].map(d);function x(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function N(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,P=e=>!p(e)&&e!==k,_=(U="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>U&&e instanceof U);var U;const F=d("HTMLFormElement"),M=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),G=d("RegExp"),H=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};x(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},j=d("AsyncFunction"),B=(q="function"==typeof setImmediate,V=m(k.postMessage),q?setImmediate:V?(W=`axios@${Math.random()}`,K=[],k.addEventListener("message",({source:e,data:t})=>{e===k&&t===W&&K.length&&K.shift()()},!1),e=>{K.push(e),k.postMessage(W,"*")}):e=>setTimeout(e));var q,V,W,K;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(k):void 0!==r&&r.nextTick||B;var Y={isArray:h,isArrayBuffer:v,isBuffer:g,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=c(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer),t},isString:E,isNumber:T,isBoolean:e=>!0===e||!1===e,isObject:C,isPlainObject:y,isEmptyObject:e=>{if(!C(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:b,isRequest:A,isResponse:L,isHeaders:D,isUndefined:p,isDate:S,isFile:w,isBlob:R,isRegExp:G,isFunction:m,isStream:e=>C(e)&&m(e.pipe),isURLSearchParams:I,isTypedArray:_,isFileList:O,forEach:x,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,i)=>{const a=t&&N(r,i)||i;y(r[a])&&y(o)?r[a]=e(r[a],o):y(o)?r[a]=e({},o):h(o)?r[a]=o.slice():n&&p(o)||(r[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(x(t,(t,r)=>{n&&m(t)?e[r]=o(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:d,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!T(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors:H,freezeMethods:e=>{H(e,(t,n)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:N,global:k,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[u]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(C(e)){if(t.indexOf(e)>=0)return;if(g(e))return e;if(!("toJSON"in e)){t[r]=e;const o=h(e)?[]:{};return x(e,(e,t)=>{const i=n(e,r+1);!p(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:j,isThenable:e=>e&&(C(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:B,asap:z,isIterable:e=>null!=e&&m(e[s])};function J(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Y.inherits(J,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:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const $=J.prototype,X={};function Q(e){return Y.isPlainObject(e)||Y.isArray(e)}function Z(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function ee(e,t,n){return e?e.concat(t).map(function(e,t){return e=Z(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{X[e]={value:e}}),Object.defineProperties(J,X),Object.defineProperty($,"isAxiosError",{value:!0}),J.from=(e,t,n,r,o,i)=>{const a=Object.create($);Y.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return J.call(a,s,u,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const te=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function ne(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Y.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Y.isSpecCompliantForm(t);if(!Y.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Y.isDate(e))return e.toISOString();if(Y.isBoolean(e))return e.toString();if(!s&&Y.isBlob(e))throw new J("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(e)||Y.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Y.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Y.isArray(e)&&function(e){return Y.isArray(e)&&!e.some(Q)}(e)||(Y.isFileList(e)||Y.endsWith(n,"[]"))&&(s=Y.toArray(e)))return n=Z(n),s.forEach(function(e,r){!Y.isUndefined(e)&&null!==e&&t.append(!0===a?ee([n],r,i):null===a?n:n+"[]",u(e))}),!1;return!!Q(e)||(t.append(ee(o,n,i),u(e)),!1)}const l=[],d=Object.assign(te,{defaultVisitor:c,convertValue:u,isVisitable:Q});if(!Y.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Y.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Y.forEach(n,function(n,i){!0===(!(Y.isUndefined(n)||null===n)&&o.call(t,n,Y.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function oe(e,t){this._pairs=[],e&&ne(e,this,t)}const ie=oe.prototype;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ae;Y.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Y.isURLSearchParams(t)?t.toString():new oe(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ue=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(t){null!==t&&e(t)})}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:oe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const de="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,he=de&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),pe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ge=de&&window.location.href||"http://localhost";var ve={...Object.freeze({__proto__:null,hasBrowserEnv:de,hasStandardBrowserWebWorkerEnv:pe,hasStandardBrowserEnv:he,navigator:fe,origin:ge}),...le};function Ee(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Y.isArray(r)?r.length:i,s?(Y.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Y.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Y.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,(e,r)=>{t(function(e){return Y.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const me={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Y.isObject(e);if(o&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return r?JSON.stringify(Ee(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e)||Y.isReadableStream(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ne(e,new ve.classes.URLSearchParams,{visitor:function(e,t,n,r){return ve.isNode&&Y.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ne(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(Y.isString(e))try{return(0,JSON.parse)(e),Y.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Y.isResponse(e)||Y.isReadableStream(e))return e;if(e&&Y.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw J.from(e,J.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],e=>{me.headers[e]={}});var Te=me;const Ce=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ye=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function we(e){return!1===e||null==e?e:Y.isArray(e)?e.map(we):String(e)}function Re(e,t,n,r,o){return Y.isFunction(r)?r.call(this,t,n):(o&&(t=n),Y.isString(t)?Y.isString(r)?-1!==t.indexOf(r):Y.isRegExp(r)?r.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Se(t);if(!o)throw new Error("header name must be a non-empty string");const i=Y.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=we(e))}const i=(e,t)=>Y.forEach(e,(e,n)=>o(e,n,t));if(Y.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Y.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ce[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Y.isObject(e)&&Y.isIterable(e)){let n,r,o={};for(const t of e){if(!Y.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Y.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Se(e)){const n=Y.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Y.isFunction(t))return t.call(this,e,n);if(Y.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Se(e)){const n=Y.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Se(e)){const o=Y.findKey(n,e);!o||t&&!Re(0,n[o],o,t)||(delete n[o],r=!0)}}return Y.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Re(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Y.forEach(this,(r,o)=>{const i=Y.findKey(n,o);if(i)return t[i]=we(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=we(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Y.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Y.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ye]=this[ye]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Se(e);t[r]||(function(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Y.isArray(e)?e.forEach(r):r(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Y.freezeMethods(Oe);var Ie=Oe;function be(e,t){const n=this||Te,r=t||n,o=Ie.from(r.headers);let i=r.data;return Y.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ae(e){return!(!e||!e.__CANCEL__)}function Le(e,t,n){J.call(this,null==e?"canceled":e,J.ERR_CANCELED,t,n),this.name="CanceledError"}function De(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Y.inherits(Le,J,{__CANCEL__:!0});const xe=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];o||(o=u),n[i]=s,r[i]=u;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(n,i){let a,s,u=0,c=1e3/i;const l=(n,i=Date.now())=>{u=i,a=null,s&&(clearTimeout(s),s=null),(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,u=o(s);r=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-u;n>=c?l(e,t):(a=e,s||(s=setTimeout(()=>{s=null,l(a)},c-n)))},()=>a&&l(a)]}(0,n)},Ne=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ke=e=>(...t)=>Y.asap(()=>e(...t));var Pe=ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,_e=ve.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Y.isString(r)&&s.push(`path=${r}`),Y.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Y.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ue(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fe=e=>e instanceof Ie?{...e}:e;function Me(e,t){t=t||{};const n={};function r(e,t,n,r){return Y.isPlainObject(e)&&Y.isPlainObject(t)?Y.merge.call({caseless:r},e,t):Y.isPlainObject(t)?Y.merge({},t):Y.isArray(t)?t.slice():t}function o(e,t,n,o){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Y.isUndefined(t))return r(void 0,t)}function a(e,t){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const u={url:i,method:i,data:i,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:s,headers:(e,t,n)=>o(Fe(e),Fe(t),0,!0)};return Y.forEach(Object.keys({...e,...t}),function(r){const i=u[r]||o,a=i(e[r],t[r],r);Y.isUndefined(a)&&i!==s||(n[r]=a)}),n}var Ge=e=>{const t=Me({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ie.from(a),t.url=se(Ue(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Y.isFormData(n))if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Y.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(ve.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(t)),r||!1!==r&&Pe(t.url))){const e=o&&i&&_e.read(i);e&&a.set(o,e)}return t},He="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ge(e);let o=r.data;const i=Ie.from(r.headers).normalize();let a,s,u,c,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function v(){if(!g)return;const r=Ie.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());De(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=v:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(v)},g.onabort=function(){g&&(n(new J("Request aborted",J.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new J(t&&t.message?t.message:"Network Error",J.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new J(t,o.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Y.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Y.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([u,l]=xe(h,!0),g.addEventListener("progress",u)),f&&g.upload&&([s,c]=xe(f),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Le(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const E=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);E&&-1===ve.protocols.indexOf(E)?n(new J("Unsupported protocol "+E+":",J.ERR_BAD_REQUEST,e)):g.send(o||null)})},je=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof J?t:new Le(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Y.asap(a),s}};const Be=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*Be(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Ve}=Y,We=(({Request:e,Response:t})=>({Request:e,Response:t}))(Y.global),{ReadableStream:Ke,TextEncoder:ze}=Y.global,Ye=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Je=e=>{e=Y.merge.call({skipUndefined:!0},We,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ve(t):"function"==typeof fetch,i=Ve(n),a=Ve(r);if(!o)return!1;const s=o&&Ve(Ke),u=o&&("function"==typeof ze?(c=new ze,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const l=i&&s&&Ye(()=>{let e=!1;const t=new n(ve.origin,{body:new Ke,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Ye(()=>Y.isReadableStream(new r("").body)),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,n)})});return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:h,timeout:p,onDownloadProgress:g,onUploadProgress:v,responseType:E,headers:m,withCredentials:T="same-origin",fetchOptions:C}=Ge(e),y=t||fetch;E=E?(E+"").toLowerCase():"text";let S=je([c,h&&h.toAbortSignal()],p),w=null;const R=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let O;try{if(v&&l&&"get"!==a&&"head"!==a&&0!==(O=await(async(e,t)=>{const r=Y.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e)){const t=new n(ve.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Y.isArrayBufferView(e)||Y.isArrayBuffer(e)?e.byteLength:(Y.isURLSearchParams(e)&&(e+=""),Y.isString(e)?(await u(e)).byteLength:void 0)})(t):r})(m,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Y.isFormData(s)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,n]=Ne(O,xe(ke(v)));s=qe(t.body,65536,e,n)}}Y.isString(T)||(T=T?"include":"omit");const t=i&&"credentials"in n.prototype,c={...C,signal:S,method:a.toUpperCase(),headers:m.normalize().toJSON(),body:s,duplex:"half",credentials:t?T:void 0};w=i&&new n(o,c);let h=await(i?y(w,C):y(o,c));const p=d&&("stream"===E||"response"===E);if(d&&(g||p&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Y.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&Ne(t,xe(ke(g),!0))||[];h=new r(qe(h.body,65536,n,()=>{o&&o(),R&&R()}),e)}E=E||"text";let I=await f[Y.findKey(f,E)||"text"](h,e);return!p&&R&&R(),await new Promise((t,n)=>{De(t,n,{data:I,headers:Ie.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:w})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new J("Network Error",J.ERR_NETWORK,e,w),{cause:t.cause||t});throw J.from(t,t&&t.code,e,w)}}},$e=new Map,Xe=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,u=i.length,c=$e;for(;u--;)a=i[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:Je(t)),c=s;return s};Xe();const Qe={http:null,xhr:He,fetch:{get:Xe}};Y.forEach(Qe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Ze=e=>`- ${e}`,et=e=>Y.isFunction(e)||null===e||!1===e;var tt=function(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=e[a],o=r,!et(r)&&(o=Qe[(n=String(r)).toLowerCase()],void 0===o))throw new J(`Unknown adapter '${n}'`);if(o&&(Y.isFunction(o)||(o=o.get(t))))break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new J("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Le(null,e)}function rt(e){return nt(e),e.headers=Ie.from(e.headers),e.data=be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||Te.adapter,e)(e).then(function(t){return nt(e),t.data=be.call(e,e.transformResponse,t),t.headers=Ie.from(t.headers),t},function(t){return Ae(t)||(nt(e),t&&t.response&&(t.response.data=be.call(e,e.transformResponse,t.response),t.response.headers=Ie.from(t.response.headers))),Promise.reject(t)})}const ot="1.13.2",it={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const at={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new J(r(o," has been removed"+(t?" in "+t:"")),J.ERR_DEPRECATED);return t&&!at[o]&&(at[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var st={assertOptions:function(e,t,n){if("object"!=typeof e)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new J("option "+i+" must be "+n,J.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new J("Unknown option "+i,J.ERR_BAD_OPTION)}},validators:it};const ut=st.validators;class ct{constructor(e){this.defaults=e||{},this.interceptors={request:new ue,response:new ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Me(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:ut.transitional(ut.boolean),forcedJSONParsing:ut.transitional(ut.boolean),clarifyTimeoutError:ut.transitional(ut.boolean)},!1),null!=r&&(Y.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:ut.function,serialize:ut.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:ut.spelling("baseURL"),withXsrfToken:ut.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Y.merge(o.common,o[t.method]);o&&Y.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ie.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const u=[];let c;this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let l,d=0;if(!s){const e=[rt.bind(this),void 0];for(e.unshift(...a),e.push(...u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=rt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return se(Ue((e=Me(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Y.forEach(["delete","get","head","options"],function(e){ct.prototype[e]=function(t,n){return this.request(Me(n||{},{method:e,url:t,data:(n||{}).data}))}}),Y.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Me(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)});var lt=ct;class dt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Le(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new dt(function(t){e=t}),cancel:e}}}var ft=dt;const ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ht).forEach(([e,t])=>{ht[t]=e});var pt=ht;const gt=function e(t){const n=new lt(t),r=o(lt.prototype.request,n);return Y.extend(r,lt.prototype,n,{allOwnKeys:!0}),Y.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Me(t,n))},r}(Te);gt.Axios=lt,gt.CanceledError=Le,gt.CancelToken=ft,gt.isCancel=Ae,gt.VERSION=ot,gt.toFormData=ne,gt.AxiosError=J,gt.Cancel=gt.CanceledError,gt.all=function(e){return Promise.all(e)},gt.spread=function(e){return function(t){return e.apply(null,t)}},gt.isAxiosError=function(e){return Y.isObject(e)&&!0===e.isAxiosError},gt.mergeConfig=Me,gt.AxiosHeaders=Ie,gt.formToJSON=e=>Ee(Y.isHTMLForm(e)?new FormData(e):e),gt.getAdapter=tt,gt.HttpStatusCode=pt,gt.default=gt,e.exports=gt},6676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0,t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},6993(e,t,n){var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function u(e,o,i,a){var s=o&&o.prototype instanceof l?o:l,u=Object.create(s.prototype);return r(u,"_invoke",function(e,r,o){var i,a,s,u=0,l=o||[],d=!1,f={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,f.n=n,c}};function h(e,r){for(a=e,s=r,n=0;!d&&u&&!o&&n<l.length;n++){var o,i=l[n],h=f.p,p=i[2];e>3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&h<i[1])?(a=0,f.v=r,f.n=i[1]):h<p&&(o=e<3||i[0]>r||r>p)&&(i[4]=e,i[5]=r,f.n=p,a=0))}if(o||e>1)return c;throw d=!0,r}return function(o,l,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===l&&h(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(u=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(d=f.n<0)?s:e.call(r,f))!==c)break}catch(e){i=t,a=1,s=e}finally{u=1}}return{value:n,done:d}}}(e,i,a),!0),u}var c={};function l(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=f.prototype=l.prototype=Object.create(h);function g(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=f,r(p,"constructor",f),r(f,"constructor",d),d.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:u,m:g}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7122(e,t,n){var r=n(79);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},7383(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7537(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.OSInfo=void 0;var o=r(n(7383)),i=r(n(4579)),a=n(2949);t.OSInfo=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"getOsType",value:function(){var e=function(){return window.navigator.userAgent};return e().match(/windows\sphone\s\d+\.\d+/i)?a.OperatingSystem.WINDOWS_PHONE:e().match(/ arm;/i)?a.OperatingSystem.WINDOWS_RT:e().match(/(iPad|iPhone|iPod)(?=.*like Mac OS X)/i)?a.OperatingSystem.IOS:e().match(/android/i)?a.OperatingSystem.ANDROID:e().match(/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|cros)/i)?a.OperatingSystem.LINUX:e().match(/(macintosh|mac os x)/i)?a.OperatingSystem.MACOSX:e().match(/(windows|win32)/i)?a.OperatingSystem.WINDOWS:a.OperatingSystem.UNKNOWN}}])}()},7736(e,t,n){var r=n(3738).default,o=n(9045);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},7748(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.createGetChatTokenEndpoint=void 0;var o=r(n(3693)),i=n(2949),a=r(n(2793));t.createGetChatTokenEndpoint=function(e,t,n){var r=(0,o.default)((0,o.default)((0,o.default)({},i.LiveChatVersion.V1,a.default.LiveChatGetChatTokenPath),i.LiveChatVersion.V2,a.default.LiveChatv2GetChatTokenPath),i.LiveChatVersion.V3,a.default.LiveChatv3GetChatTokenPath),s=(0,o.default)((0,o.default)((0,o.default)({},i.LiveChatVersion.V1,a.default.LiveChatAuthGetChatTokenPath),i.LiveChatVersion.V2,a.default.LiveChatv2AuthGetChatTokenPath),i.LiveChatVersion.V3,a.default.LiveChatv3AuthGetChatTokenPath);return n?t?a.default.LiveChatv4AuthGetChatTokenPath:a.default.LiveChatv4GetChatTokenPath:Object.values(i.LiveChatVersion).includes(e)?t?s[e]:r[e]:t?s[i.LiveChatVersion.V2]:r[i.LiveChatVersion.V2]}},7938(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitTimeBetweenRetriesConfigs=void 0,t.waitTimeBetweenRetriesConfigs={getChatConfig:1e3,getLWIDetails:3e3,getChatToken:1e3,sessionInit:1e3,sessionClose:1e3,getReconnectableChats:1e3,getReconnectAvailability:1e3,submitPostChatResponse:1e3,getSurveyInviteLink:1e3,getChatTranscripts:1e3,emailTranscript:1e3,fetchDataMaskingInfo:1e3,makeSecondaryChannelEventRequest:1e3,getAgentAvailability:1e3,sendTypingIndicator:1e3,validateAuthChatRecordTimeout:1e3,getPersistentChatHistory:1e3}},8310(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var o=r(n(7383)),i=r(n(4579));t.Timer=function(){return(0,i.default)(function e(){(0,o.default)(this,e)},null,[{key:"TIMER",value:function(){var e=(new Date).getTime();return{get milliSecondsElapsed(){return(new Date).getTime()-e}}}}])}()},8330(e){"use strict";e.exports={rE:"0.5.21"}},8503(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingSanitizer=void 0;var o=r(n(3738)),i=r(n(7383)),a=r(n(4579)),s=r(n(3693)),u=r(n(9478)),c=r(n(2805)),l=t.LoggingSanitizer=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,null,[{key:"stripCustomContextDataValues",value:function(e){var t;e&&(null===(t=Object.keys(e))||void 0===t||t.forEach(function(t){var n;null!==(n=e["".concat(t)])&&void 0!==n&&n.value&&(e["".concat(t)].value=u.default.hiddenContentPlaceholder)}))}},{key:"stripPreChatResponse",value:function(e){e&&Object.keys(e).forEach(function(t){e["".concat(t)]&&"Type"!==t&&(e["".concat(t)]=u.default.hiddenContentPlaceholder)})}},{key:"stripGeolocation",value:function(e){e&&(Object.keys(e).includes("longitude")&&(e.longitude=u.default.hiddenContentPlaceholder),Object.keys(e).includes("latitude")&&(e.latitude=u.default.hiddenContentPlaceholder))}},{key:"stripAuthenticationUserToken",value:function(e){e&&(Object.keys(e).includes(c.default.authenticatedUserToken)&&(e[c.default.authenticatedUserToken]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authCodeNonce)&&(e[c.default.authCodeNonce]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authorization)&&(e[c.default.authorization]=u.default.hiddenContentPlaceholder))}},{key:"stripRequestHeadersSensitiveProperties",value:function(t){e.stripAuthenticationUserToken(t),Object.keys(t).includes(c.default.authorization)&&(t[c.default.authorization]=u.default.hiddenContentPlaceholder)}},{key:"stripRequestPayloadData",value:function(t){if(null!=t&&t.data){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){n=void 0}n&&(Object.keys(n).includes("preChatResponse")&&e.stripPreChatResponse(n.preChatResponse),Object.keys(n).includes("customContextData")&&e.stripCustomContextDataValues(n.customContextData),e.stripGeolocation(n),t.data=JSON.stringify(n),t.data=e.stripEmailDataFromError(t.data))}}},{key:"stripEmailDataFromError",value:function(e){return e.replace(this.emailRegex,u.default.hiddenContentPlaceholder)}},{key:"stripAxiosErrorSensitiveProperties",value:function(t){var n,r,o,i,a,s,u;t.isAxiosError&&(null!=t&&null!==(n=t.config)&&void 0!==n&&n.headers&&e.stripAuthenticationUserToken(null==t||null===(a=t.config)||void 0===a?void 0:a.headers),null!=t&&null!==(r=t.config)&&void 0!==r&&r.data&&this.stripRequestPayloadData(null==t?void 0:t.config),null!=t&&null!==(o=t.response)&&void 0!==o&&null!==(o=o.config)&&void 0!==o&&o.data&&this.stripRequestPayloadData(null==t||null===(s=t.response)||void 0===s?void 0:s.config),null!=t&&null!==(i=t.response)&&void 0!==i&&null!==(i=i.config)&&void 0!==i&&i.headers&&e.stripAuthenticationUserToken(null==t||null===(u=t.response)||void 0===u||null===(u=u.config)||void 0===u?void 0:u.headers))}},{key:"stripErrorSensitiveProperties",value:function(e){var t;e&&"object"===(0,o.default)(e)&&(null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0&&this.stripAxiosErrorSensitiveProperties(e)}}])}();(0,s.default)(l,"emailRegex",/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g)},8537(e,t,n){"use strict";var r=n(4994),o=n(3738);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a=r(n(4756)),s=r(n(9293)),u=r(n(3738)),c=r(n(7383)),l=r(n(4579)),d=r(n(3693)),f=n(2949),h=r(n(6425)),p=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,i={__proto__:null,default:e};if(null===e||"object"!=o(e)&&"function"!=typeof e)return i;if(n=t){if(n.has(e))return n.get(e);n.set(e,i)}for(var a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,a))&&(r.get||r.set)?n(i,a,r):i[a]=e[a]);return i}(e)}(n(9903)),g=n(1415),v=r(n(9478)),E=n(1905),m=n(3905),T=r(n(9956)),C=r(n(5560)),y=n(8971),S=n(8503),w=n(7537),R=r(n(2793)),O=r(n(2805)),I=r(n(3009)),b=n(8310),A=n(2200),L=n(7748),D=r(n(4063)),x=r(n(2515)),N=n(6676),k=n(7938);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){(0,d.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var F=t.default=function(){return(0,l.default)(function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultConfiguration,o=arguments.length>2?arguments[2]:void 0;(0,c.default)(this,e),this.omnichannelConfiguration=t,this.configuration=r,this.logger=o,(0,d.default)(this,"liveChatVersion",void 0),(0,d.default)(this,"sessionId",void 0),(0,d.default)(this,"ocUserAgent",void 0),(0,d.default)(this,"HTTPTimeOutErrorMessage","".concat(f.SDKError.ClientHTTPTimeoutErrorName,": ").concat(f.SDKError.ClientHTTPTimeoutErrorMessage)),(0,d.default)(this,"setAuthCodeNonce",function(e){null!=e&&e.authcodenonce&&(n.configuration.authCodeNonce=null==e?void 0:e.authcodenonce)}),(0,d.default)(this,"setSessionIdHeader",function(e,t){e&&(t[O.default.ocSessionId]=e)}),(0,d.default)(this,"setRequestIdHeader",function(e,t){e&&(t[O.default.requestId]=e)}),(0,d.default)(this,"setCorrelationIdInHeader",function(e,t){e&&(t[O.default.correlationId]=e)}),Object.keys(this.configuration).length&&"object"===(0,u.default)(r)||(this.configuration=e.defaultConfiguration);for(var i=0,a=Object.keys(e.defaultConfiguration);i<a.length;i++){var s=a[i];this.configuration.hasOwnProperty(s)||(this.configuration["".concat(s)]=e.defaultConfiguration["".concat(s)])}for(var l=0,h=Object.keys(e.defaultConfiguration.requestTimeoutConfig);l<h.length;l++){var p=h[l];this.configuration.requestTimeoutConfig.hasOwnProperty(p)||(this.configuration.requestTimeoutConfig["".concat(p)]=e.defaultConfiguration.requestTimeoutConfig["".concat(p)])}var g=t.channelId;if(!Object.values(f.ChannelId).includes(g))throw new Error("Invalid channelId");var E,m=Object.keys(t),T=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return U(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(v.default.requiredOmnichannelConfigurationParameters);try{for(T.s();!(E=T.n()).done;){var C=E.value;if(!m.includes(C))throw new Error("Missing '".concat(C,"' in OmnichannelConfiguration"))}}catch(e){T.e(e)}finally{T.f()}this.ocUserAgent=this.configuration.ocUserAgent,this.liveChatVersion=f.LiveChatVersion.V2},[{key:"getLcwFcsDetails",value:(z=(0,s.default)(a.default.mark(function e(){var t,n,r,o,i,s,u,c,l,d,g,v,E,m,T;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETLCWFCSDETAILSSTARTED,"Get LCW FCS details started",""),n="/".concat(R.default.LcwFcsDetailsPath,"/").concat(this.omnichannelConfiguration.orgId),r="GET",o="".concat(this.omnichannelConfiguration.orgUrl).concat(n),i=h.default.create(),(0,p.default)(i,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),s={},(0,A.addOcUserAgentHeader)(this.ocUserAgent,s),u=b.Timer.TIMER(),e.prev=1,e.next=2,i.get(o,{headers:s,timeout:null!==(c=this.configuration.defaultRequestTimeout)&&void 0!==c?c:this.configuration.requestTimeoutConfig.getChatConfig});case 2:return l=e.sent,d=u.milliSecondsElapsed,g=t.milliSecondsElapsed,v=l.data,this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETLCWFCSDETAILSSUCCEEDED,"Get LCW FCS details succeeded","",l,g,n,r,void 0,void 0,s,d),e.abrupt("return",v);case 3:throw e.prev=3,T=e.catch(1),E=u.milliSecondsElapsed,m=t.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETLCWFCSDETAILSFAILED,"Get LCW FCS details failed","",void 0,m,n,r,T,void 0,s,E),T;case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(){return z.apply(this,arguments)})},{key:"getChatConfig",value:(K=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,s,u,c,l,d,g,E,m,T,C,S,w,O=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=O.length>1&&void 0!==O[1]&&O[1],r=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATCONFIGFSTARTED,"Get Chat config started",t),t||(t=(0,N.uuidv4)()),o="/".concat(R.default.LiveChatConfigPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"?requestId=").concat(t,"&channelId=").concat(this.omnichannelConfiguration.channelId),i="GET",s="".concat(this.omnichannelConfiguration.orgUrl).concat(o),u=h.default.create(),(0,p.default)(u,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),c={},this.addDefaultHeaders(t,c),n&&(c=_(_({},v.default.bypassCacheHeaders),c)),l=b.Timer.TIMER(),e.prev=1,e.next=2,u.get(s,{headers:c,timeout:null!==(d=this.configuration.defaultRequestTimeout)&&void 0!==d?d:this.configuration.requestTimeoutConfig.getChatConfig});case 2:return g=e.sent,E=l.milliSecondsElapsed,m=r.milliSecondsElapsed,(T=g.data).LiveChatVersion&&(this.liveChatVersion=T.LiveChatVersion),T.headers={},g.headers&&g.headers.date&&(T.headers.date=g.headers.date),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATCONFIGSUCCEEDED,"Get Chat config succeeded",t,g,m,o,i,void 0,void 0,c,E),e.abrupt("return",T);case 3:return e.prev=3,w=e.catch(1),C=l.milliSecondsElapsed,S=r.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETCHATCONFIGFAILED,"Get Chat config failed",t,void 0,S,o,i,w,void 0,c,C),e.abrupt("return",Promise.reject(w));case 4:case"end":return e.stop()}},e,this,[[1,3]])})),function(e){return K.apply(this,arguments)})},{key:"getLWIDetails",value:(W=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,g,E,m,T,C=this,S=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=S.length>1&&void 0!==S[1]?S[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETLWISTATUSSTARTED,"Get LWI Details Started",t),t||(t=(0,N.uuidv4)()),i="/".concat(R.default.LiveChatLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=h.default.create(),(0,p.axiosRetryHandlerWithNotFound)(u,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getLWIDetails}),c=r.authenticatedUserToken,l=r.reconnectId,d=v.default.defaultHeaders,c&&(i="/".concat(R.default.LiveChatAuthLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),d[O.default.authenticatedUserToken]=c,d[O.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,d),g=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,l&&(g||(i+="/".concat(l))),E={channelId:this.omnichannelConfiguration.channelId},l&&g&&(E.sig=l),m="".concat(this.omnichannelConfiguration.orgUrl).concat(i),T={headers:d,method:"GET",url:m,params:E,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getLWIDetails},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var s,c,l,h,p,g,E,m,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.Timer.TIMER(),e.prev=1,e.next=2,u(T);case 2:c=e.sent,l=s.milliSecondsElapsed,h=o.milliSecondsElapsed,p=c.data,g=c.headers,C.setAuthCodeNonce(g),C.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETLWISTATUSSUCCEEDED,"Get LWI Details succeeded",t,c,h,i,"GET",void 0,void 0,d,l),n(p),e.next=4;break;case 3:e.prev=3,S=e.catch(1),E=s.milliSecondsElapsed,m=o.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETLWISTATUSFAILED,"Get LWI Details failed",t,void 0,m,i,"GET",S,void 0,d,E),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(S);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e){return W.apply(this,arguments)})},{key:"getChatToken",value:(V=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,g,E,m,T,C,S,w,R,I,A,x=this,k=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=k.length>1&&void 0!==k[1]?k[1]:{},o=k.length>2&&void 0!==k[2]?k[2]:0,i=b.Timer.TIMER(),u=r.reconnectId,c=r.authenticatedUserToken,l=r.currentLiveChatVersion,d=r.refreshToken,g=r.MsOcBotApplicationId,E=!!(g&&g.length>0),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATTOKENSTARTED,"Get Chat Token Started",t),!(o<0)){e.next=1;break}throw new Error("Invalid currentRetryCount");case 1:return t||(t=(0,N.uuidv4)()),m=v.default.defaultHeaders,this.addDefaultHeaders(t,m),T=(0,L.createGetChatTokenEndpoint)(l||this.liveChatVersion,!!c,E),c&&(m[O.default.authenticatedUserToken]=c,m[O.default.authCodeNonce]=this.configuration.authCodeNonce),C="/".concat(T,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),S=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,u&&(S||(C+="/".concat(u))),w={channelId:this.omnichannelConfiguration.channelId},g&&g.length>0&&(w["Ms-Oc-Bot-Application-Id"]=g),d&&(w.refreshToken="true"),u&&S&&(w.sig=u),R="".concat(this.omnichannelConfiguration.orgUrl).concat(C),I={headers:m,method:"GET",url:R,params:w,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getChatToken},A=h.default.create(),(0,p.default)(A,{headerOverwrites:[O.default.authCodeNonce],retries:o>this.configuration.maxRequestRetriesOnFailure?o:this.configuration.maxRequestRetriesOnFailure,retryOn429:this.configuration.getChatTokenRetryOn429,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatToken}),e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,s,c,l,d,h,p,g,E;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,A(I);case 2:if(s=e.sent,c=o.milliSecondsElapsed,l=i.milliSecondsElapsed,d=s.data,h=s.headers,x.setAuthCodeNonce(h),h&&h[O.default.ocSessionId.toLowerCase()]&&(x.sessionId=h[O.default.ocSessionId.toLowerCase()]),!d){e.next=4;break}if(0!==Object.keys(d).length){e.next=3;break}return r(new Error("Empty data received from getChatToken")),e.abrupt("return");case 3:return d.requestId=t,x.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATTOKENSUCCEEDED,"Get Chat Token succeeded",t,s,l,C,"GET",void 0,void 0,m,c),n(d),e.abrupt("return");case 4:if(!u||s.status!==v.default.noContentStatusCode){e.next=5;break}return r(s),e.abrupt("return");case 5:e.next=7;break;case 6:e.prev=6,E=e.catch(1),p=o.milliSecondsElapsed,g=i.milliSecondsElapsed,x.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETCHATTOKENFAILED,"Get Chat Token failed",t,void 0,g,C,"GET",E,void 0,m,p),(0,D.default)(E,v.default.axiosTimeoutErrorCode)&&r(new Error(x.HTTPTimeOutErrorMessage)),r(E);case 7:case"end":return e.stop()}},e,null,[[1,6]])}));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"getReconnectableChats",value:(q=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,p,g=this;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.Timer.TIMER(),o=t.authenticatedUserToken,this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSTARTED,"Get Reconnectable chat Started"),i=null==t?void 0:t.requestId,u="/".concat(R.default.LiveChatGetReconnectableChatsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(i,"?channelId=").concat(this.omnichannelConfiguration.channelId),(c=v.default.defaultHeaders)[O.default.authenticatedUserToken]=o,c[O.default.authCodeNonce]=this.configuration.authCodeNonce,this.addDefaultHeaders(i,c),l="".concat(this.omnichannelConfiguration.orgUrl).concat(u),d={headers:c,method:"GET",url:l,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectableChats},p=h.default.create(),e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(t,n){var o,s,l,h,E,m,T,C,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,p(d);case 2:if(s=e.sent,l=o.milliSecondsElapsed,h=r.milliSecondsElapsed,E=s.data,m=s.headers,g.setAuthCodeNonce(m),!E){e.next=3;break}return g.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSUCCEEDED,"Get Reconnectable Chats Succeeded and old session returned",i,s,h,u,"GET",void 0,void 0,c,l),t(E),e.abrupt("return");case 3:return t(),e.abrupt("return");case 4:return e.prev=4,S=e.catch(1),T=o.milliSecondsElapsed,C=r.milliSecondsElapsed,g.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETRECONNECTABLECHATSFAILED,"Get Reconnectable Chats failed",i,void 0,C,u,"GET",S,void 0,c,T),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&n(new Error(g.HTTPTimeOutErrorMessage)),n(S),e.abrupt("return");case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e){return q.apply(this,arguments)})},{key:"getReconnectAvailability",value:(B=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,p,g=this,E=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=E.length>1&&void 0!==E[1]?E[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSTARTED,"Get Reconnectable availability Started"),i="/".concat(R.default.LiveChatReconnectAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=v.default.defaultHeaders,this.addDefaultHeaders(null==r?void 0:r.requestId,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(i),d={headers:u,method:l="GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectAvailability},p=h.default.create(),e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(t,n){var s,c,h,E,m,T,C,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.Timer.TIMER(),e.prev=1,e.next=2,p(d);case 2:if(c=e.sent,h=s.milliSecondsElapsed,E=o.milliSecondsElapsed,!(m=c.data)){e.next=3;break}return g.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability succeeded",null==r?void 0:r.requestId,c,E,i,l,void 0,void 0,u,h),t(m),e.abrupt("return");case 3:return g.logWithLogger(y.LogLevel.WARN,f.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability didn't send any valid data",null==r?void 0:r.requestId,c,E,i,l,void 0,void 0,u,h),t(),e.abrupt("return");case 4:return e.prev=4,S=e.catch(1),T=s.milliSecondsElapsed,C=o.milliSecondsElapsed,g.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYFAILED,"Get Reconnect Availability failed",null==r?void 0:r.requestId,void 0,C,i,l,S,void 0,u,T),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&n(new Error(g.HTTPTimeOutErrorMessage)),n(S),e.abrupt("return");case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e){return B.apply(this,arguments)})},{key:"getAgentAvailability",value:(j=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,S,A,L,x,N,k,P,_=this,U=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=U.length>1&&void 0!==U[1]?U[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSTARTED,"Get agent availability Started",t),i="/".concat(R.default.GetAgentAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=lcw"),u=h.default.create(),(0,p.default)(u,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getAgentAvailability}),c=r.authenticatedUserToken,l=r.initContext,d=r.getContext,S=v.default.defaultHeaders,c&&(S[O.default.authenticatedUserToken]=c,S[O.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,S),A=l||{},L={orgId:this.omnichannelConfiguration.orgId,widgetId:this.omnichannelConfiguration.widgetId},A&&A.customContextData&&(x=E.CustomContextData.sort(A.customContextData),Object.assign(L,{customContext:x})),A.portalcontactid&&Object.assign(L,{portalcontactid:A.portalcontactid}),A.cacheKey=(0,I.default)(JSON.stringify(L)).toString(T.default),!d||window.document){e.next=1;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 1:if(d&&(A.browser=g.BrowserInfo.getBrowserName(),A.device=m.DeviceInfo.getDeviceType(),A.originurl=window.location.href,A.os=w.OSInfo.getOsType()),A.locale||(A.locale=v.default.defaultLocale),!A.locale||C.default.supportedLocales.includes(A.locale)){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(A.locale,"'"))));case 2:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(i),P={data:A,headers:S,method:k="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getAgentAvailability},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var s,c,l,d,h,p,g,E,m;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.Timer.TIMER(),e.prev=1,e.next=2,u(P);case 2:c=e.sent,l=s.milliSecondsElapsed,d=o.milliSecondsElapsed,h=c.data,p=c.headers,_.setAuthCodeNonce(p),h&&(_.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSUCCEEDED,"Get agent availability succeeded",t,c,d,i,k,void 0,void 0,S,l),n(h)),e.next=5;break;case 3:if(e.prev=3,m=e.catch(1),g=s.milliSecondsElapsed,E=o.milliSecondsElapsed,_.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETAGENTAVAILABILITYFAILED,"Get agent availability failed",t,void 0,E,i,k,m,void 0,S,g),!(0,D.default)(m,v.default.axiosTimeoutErrorCode)){e.next=4;break}return r(new Error(_.HTTPTimeOutErrorMessage)),e.abrupt("return");case 4:r(m);case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}},e,this)})),function(e){return j.apply(this,arguments)})},{key:"sessionInit",value:(H=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,E,T,S,I,A,L,N,k,P,U,F=this,M=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=M.length>1&&void 0!==M[1]?M[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SESSIONINITSTARTED,"Session Init Started",t),i=h.default.create(),(0,p.default)(i,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,x.default)(e,!0)},headerOverwrites:[O.default.authCodeNonce]}),u=r.reconnectId,c=r.authenticatedUserToken,l=r.initContext,E=r.getContext,T=l||{},S=_({},v.default.defaultHeaders),I=c?R.default.LiveChatAuthSessionInitPath:R.default.LiveChatSessionInitPath,A="/".concat(I,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),c&&Object.assign(S,(0,d.default)((0,d.default)({},O.default.authenticatedUserToken,c),O.default.authCodeNonce,this.configuration.authCodeNonce)),this.addDefaultHeaders(t,S),this.setRequestIdHeader(t,S),L=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,u&&(L||(A+="/".concat(u))),N={channelId:this.omnichannelConfiguration.channelId},u&&L&&(N.sig=u),!E||window.document){e.next=1;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 1:if(E&&(T.browser=g.BrowserInfo.getBrowserName(),T.device=m.DeviceInfo.getDeviceType(),T.originurl=window.location.href,T.os=w.OSInfo.getOsType()),T.locale||(T.locale=v.default.defaultLocale),!T.locale||C.default.supportedLocales.includes(T.locale)){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(T.locale,"'"))));case 2:return k="".concat(this.omnichannelConfiguration.orgUrl).concat(A),U={data:T,headers:S,method:P="POST",url:k,params:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var s,u,c,l,d,h,p,g;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.Timer.TIMER(),e.prev=1,e.next=2,i(U);case 2:u=e.sent,c=s.milliSecondsElapsed,l=o.milliSecondsElapsed,d=u.headers,F.setAuthCodeNonce(d),F.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SESSIONINITSUCCEEDED,"Session Init Succeeded",t,u,l,A,P,void 0,T,S,c),n(),e.next=5;break;case 3:if(e.prev=3,g=e.catch(1),h=s.milliSecondsElapsed,p=o.milliSecondsElapsed,F.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.SESSIONINITFAILED,"Session Init failed",t,void 0,p,A,P,g,T,S,h),!(0,D.default)(g,v.default.axiosTimeoutErrorCode)){e.next=4;break}return r(new Error(F.HTTPTimeOutErrorMessage)),e.abrupt("return");case 4:r(g);case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}},e,this)})),function(e){return H.apply(this,arguments)})},{key:"createConversation",value:(G=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,s,u,c,l,E,T,S,I,A,L,N,k,P,U,F,M,G,H,j,B,q=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=q.length>1&&void 0!==q[1]?q[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.CREATESESSIONSTARTED,"Create conversation call Started",t),i=h.default.create(),(0,p.default)(i,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,x.default)(e,!0)},headerOverwrites:[O.default.authCodeNonce]}),s=r.reconnectId,u=r.authenticatedUserToken,c=r.initContext,l=r.getContext,E=c||{},T=_({},v.default.defaultHeaders),S=u?R.default.LiveChatConnectorAuthPath:R.default.LiveChatConnectorPath,I="/".concat(S,"/").concat(this.omnichannelConfiguration.orgId,"/widgetApp/").concat(this.omnichannelConfiguration.widgetId,"/conversation"),u&&Object.assign(T,(0,d.default)((0,d.default)({},O.default.authenticatedUserToken,u),O.default.authCodeNonce,this.configuration.authCodeNonce)),this.addDefaultHeaders(t,T),this.setRequestIdHeader(t,T),s&&(E.reconnectId=s),E.channelId=this.omnichannelConfiguration.channelId,!l||window.document){e.next=1;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 1:if(l&&(E.browser=g.BrowserInfo.getBrowserName(),E.device=m.DeviceInfo.getDeviceType(),E.originurl=window.location.href,E.os=w.OSInfo.getOsType()),E.locale||(E.locale=v.default.defaultLocale),!E.locale||C.default.supportedLocales.includes(E.locale)){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(E.locale,"'"))));case 2:return A="".concat(this.omnichannelConfiguration.orgUrl).concat(I),N={data:E,headers:T,method:L="POST",url:A,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},k=b.Timer.TIMER(),e.prev=3,e.next=4,i(N);case 4:if(P=e.sent,U=k.milliSecondsElapsed,F=o.milliSecondsElapsed,M=P.data,G=P.headers,this.setAuthCodeNonce(G),G&&G[O.default.ocSessionId.toLowerCase()]&&(this.sessionId=G[O.default.ocSessionId.toLowerCase()]),0!==Object.keys(M).length){e.next=5;break}throw new Error("Empty data received from getChatToken");case 5:return M.requestId=t,this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.CREATESESSIONSUCCEEDED,"Create coversation call Succeeded",t,P,F,I,L,void 0,void 0,T,U),e.abrupt("return",M);case 6:if(e.prev=6,B=e.catch(3),H=k.milliSecondsElapsed,j=o.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.CREATESESSIONFAILED,"Create conversation call failed",t,void 0,j,I,L,B,E,T,H),!(0,D.default)(B,v.default.axiosTimeoutErrorCode)){e.next=7;break}throw new Error(this.HTTPTimeOutErrorMessage);case 7:throw B;case 8:case"end":return e.stop()}},e,this,[[3,6]])})),function(e){return G.apply(this,arguments)})},{key:"sessionClose",value:(M=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,g,E,m,T,C,S,w=this,I=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=I.length>1&&void 0!==I[1]?I[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SESSIONCLOSESTARTED,"Session Close Started",t),i="/".concat(R.default.LiveChatSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),u=h.default.create(),(0,p.default)(u,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionClose}),c=r.authenticatedUserToken,l=r.isReconnectChat,d=r.isPersistentChat,g=r.chatId,E=v.default.defaultHeaders,(m={}).chatId=g,c&&(i="/".concat(R.default.LiveChatAuthSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),E[O.default.authenticatedUserToken]=c,E[O.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,E),l&&(i+="&isReconnectChat=true"),d&&(i+="&isPersistentChat=true"),T="".concat(this.omnichannelConfiguration.orgUrl).concat(i),S={data:m,headers:E,method:C="POST",url:T,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionClose},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var s,c,l,d,h,p,g,m;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.Timer.TIMER(),e.prev=1,e.next=2,u(S);case 2:c=e.sent,l=s.milliSecondsElapsed,d=c.headers,w.setAuthCodeNonce(d),h=o.milliSecondsElapsed,w.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SESSIONCLOSESUCCEEDED,"Session Close succeeded",t,c,h,i,C,void 0,void 0,E,l),n(),e.next=4;break;case 3:e.prev=3,m=e.catch(1),p=s.milliSecondsElapsed,g=o.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.SESSIONCLOSEFAILED,"Session close failed",t,void 0,g,i,C,m,void 0,E,p),m.code===v.default.axiosTimeoutErrorCode&&r(new Error(w.HTTPTimeOutErrorMessage)),r(m);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e){return M.apply(this,arguments)})},{key:"validateAuthChatRecord",value:(F=(0,s.default)(a.default.mark(function e(t,n){var r,o,i,u,c,l,d,g,E,m,T=this;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSTARTED,"Validate Auth Chat Record Started",t),i=n.authenticatedUserToken,u=n.chatId,c="/".concat(R.default.LiveChatValidateAuthChatMapRecordPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(u,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=h.default.create(),(0,p.default)(l,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.validateAuthChatRecord}),d=v.default.defaultHeaders,i&&(d[O.default.authenticatedUserToken]=i,d[O.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,d),g="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:d,method:E="GET",url:g,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.validateAuthChatRecordTimeout},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var i,s,u,h,p,g,C,S,w;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=b.Timer.TIMER(),e.prev=1,e.next=2,l(m);case 2:u=e.sent,h=i.milliSecondsElapsed,p=u.headers,T.setAuthCodeNonce(p),g=o.milliSecondsElapsed,!0===(null===(s=u.data)||void 0===s?void 0:s.authChatExist)?(T.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSUCCEEDED,"Validate Auth Chat Record succeeded",t,u,g,c,E,void 0,void 0,d,h),n(u.data)):(T.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record Failed. Record is not found or request is not authorized",t,u,g,c,E,void 0,void 0,d,h),r(new Error("Validate Auth Chat Record Failed. Record is not found or request is not authorized"))),e.next=4;break;case 3:e.prev=3,w=e.catch(1),C=i.milliSecondsElapsed,S=o.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record failed",t,void 0,S,c,E,w,void 0,d,C),(0,D.default)(w,v.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),"Error: Request failed with status code 404"===w.toString()?n({}):r(w);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return F.apply(this,arguments)})},{key:"submitPostChatResponse",value:(P=(0,s.default)(a.default.mark(function e(t,n){var r,o,i,u,c,l,d,g,E,m,T=this,C=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},i=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SUBMITPOSTCHATSTARTED,"Submit Post Chat Started",t),u="/".concat(R.default.LiveChatSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),c=h.default.create(),(0,p.default)(c,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.submitPostChatResponse}),l=o.authenticatedUserToken,d=v.default.defaultHeaders,this.addDefaultHeaders(t,d),l&&(u="/".concat(R.default.LiveChatAuthSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),d[O.default.authenticatedUserToken]=l,d[O.default.authCodeNonce]=this.configuration.authCodeNonce),g="".concat(this.omnichannelConfiguration.orgUrl).concat(u),E="POST",m={data:JSON.stringify(n),headers:d,method:E,url:g,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.submitPostChatResponse},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,s,l,h,p,g,C,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,c(m);case 2:s=e.sent,l=o.milliSecondsElapsed,h=s.headers,T.setAuthCodeNonce(h),p=i.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SUBMITPOSTCHATSUCCEEDED,"Submit Post Chat succeeded",t,s,p,u,E,void 0,void 0,d,l),n(),e.next=4;break;case 3:e.prev=3,S=e.catch(1),g=o.milliSecondsElapsed,C=i.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.SUBMITPOSTCHATFAILED,"Submit Post Chat Failed",t,void 0,C,u,E,S,void 0,d,g),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(S);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return P.apply(this,arguments)})},{key:"getSurveyInviteLink",value:(k=(0,s.default)(a.default.mark(function e(t,n){var r,o,i,u,c,l,d,g,E,m,T,C=this,S=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=S.length>2&&void 0!==S[2]?S[2]:{},i=b.Timer.TIMER(),this.logger&&this.logger.log(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETSURVEYINVITELINKSTARTED,{SurveyOwnerId:t},"Get Survey Invite Link Started"),u="/".concat(R.default.LiveChatGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),c=h.default.create(),(0,p.default)(c,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getSurveyInviteLink}),l=o.authenticatedUserToken,d=o.requestId,g=v.default.defaultHeaders,l&&(u="/".concat(R.default.LiveChatAuthGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),g[O.default.authenticatedUserToken]=l,g[O.default.authCodeNonce]=this.configuration.authCodeNonce,g[O.default.widgetAppId]=this.omnichannelConfiguration.widgetId),this.addDefaultHeaders(d,g),d&&(g[O.default.requestId]=d),E="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",T={data:JSON.stringify(n),headers:g,method:m,url:E,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.getSurveyInviteLink},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(t,n){var r,o,s,l,h,p,E,S,w;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.Timer.TIMER(),e.prev=1,e.next=2,c(T);case 2:o=e.sent,s=r.milliSecondsElapsed,l=o.data,h=o.headers,C.setAuthCodeNonce(h),p=i.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETSURVEYINVITELINKSUCCEEDED,"Get Survey Invite Link Succeeded",d,o,p,u,m,void 0,void 0,g,s),t(l),e.next=4;break;case 3:e.prev=3,w=e.catch(1),E=r.milliSecondsElapsed,S=i.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETSURVEYINVITELINKFAILED,"Get Survey Invite Link failed",d,void 0,S,u,m,w,void 0,g,E),(0,D.default)(w,v.default.axiosTimeoutErrorCode)&&n(new Error(C.HTTPTimeOutErrorMessage)),n(w);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,t){return k.apply(this,arguments)})},{key:"getChatTranscripts",value:(i=(0,s.default)(a.default.mark(function e(t,n,r){var o,i,u,c,l,d,g,E,m,T,C=this,S=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=S.length>3&&void 0!==S[3]?S[3]:{},u=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSTARTED,"Get Chat Transcript Started",t),c="/".concat(R.default.LiveChatGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=h.default.create(),(0,p.default)(l,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatTranscripts}),d=i.authenticatedUserToken,g=i.currentLiveChatVersion,(E=v.default.defaultHeaders)[O.default.organizationId]=this.omnichannelConfiguration.orgId,E[O.default.widgetAppId]=this.omnichannelConfiguration.widgetId,E[O.default.authorization]=r,this.liveChatVersion===f.LiveChatVersion.V2||g&&g===f.LiveChatVersion.V2?(c="/".concat(R.default.LiveChatv2GetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),d&&(E[O.default.authenticatedUserToken]=d,E[O.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(R.default.LiveChatv2AuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId))):d&&(E[O.default.authenticatedUserToken]=d,E[O.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(R.default.LiveChatAuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,E),m="".concat(this.omnichannelConfiguration.orgUrl).concat(c),T={headers:E,method:"GET",url:m,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.getChatTranscripts},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,i,s,d,h,p,g,m,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,l(T);case 2:i=e.sent,s=o.milliSecondsElapsed,d=u.milliSecondsElapsed,h=i.data,p=i.headers,C.setAuthCodeNonce(p),C.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSUCCEEDED,"Get Chat Transcript succeeded",t,i,d,c,"GET",void 0,void 0,E,s),n(h),e.next=4;break;case 3:e.prev=3,S=e.catch(1),g=o.milliSecondsElapsed,m=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETCHATTRANSCRIPTFAILED,"Get Chat Transcript failed",t,void 0,m,c,"GET",S,void 0,E,g),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(S);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,t,n){return i.apply(this,arguments)})},{key:"getPersistentChatHistory",value:(o=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d,g,E,m,T,C=this,S=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=S.length>1&&void 0!==S[1]?S[1]:{},o=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSTARTED,"Get Persistent Chat History Started",t),i=r.authenticatedUserToken,u=r.pageSize,c=r.pageToken,i){e.next=1;break}return this.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed - Missing authenticated user token",t),e.abrupt("return",Promise.reject(new Error("Authenticated user token is required for persistent chat history")));case 1:return l="/".concat(R.default.LiveChatAuthGetPersistentChatHistoryPath,"/").concat(this.omnichannelConfiguration.orgId,"/widgetapp/").concat(this.omnichannelConfiguration.widgetId,"/conversation/history"),d=h.default.create(),(0,p.default)(d,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getPersistentChatHistory}),(g=_({},v.default.defaultHeaders))[O.default.authenticatedUserToken]=i,g[O.default.authCodeNonce]=this.configuration.authCodeNonce,this.addDefaultHeaders(t,g),E={},u&&(E.pageSize=u.toString()),g[O.default.pageToken]=c||"",m="".concat(this.omnichannelConfiguration.orgUrl).concat(l),T={headers:g,method:"GET",url:m,params:E,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getPersistentChatHistory},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var i,s,u,c,h,p,E,m,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=b.Timer.TIMER(),e.prev=1,e.next=2,d(T);case 2:s=e.sent,u=i.milliSecondsElapsed,c=o.milliSecondsElapsed,h=s.data,p=s.headers,C.setAuthCodeNonce(p),C.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSUCCEEDED,"Get Persistent Chat History succeeded",t,s,c,l,"GET",void 0,void 0,g,u),n(h),e.next=5;break;case 3:if(e.prev=3,S=e.catch(1),E=i.milliSecondsElapsed,m=o.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed",t,void 0,m,l,"GET",S,void 0,g,E),!(0,D.default)(S,v.default.axiosTimeoutErrorCode)){e.next=4;break}return r(new Error(C.HTTPTimeOutErrorMessage)),e.abrupt("return");case 4:r(S);case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"emailTranscript",value:(r=(0,s.default)(a.default.mark(function e(t,n,r){var o,i,u,c,l,d,g,E,m,T,C=this,S=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=S.length>3&&void 0!==S[3]?S[3]:{},u=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.EMAILTRANSCRIPTSTARTED,"Email Transcript Started",t),c="/".concat(R.default.LiveChatTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=h.default.create(),(0,p.default)(l,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.emailTranscript}),d=i.authenticatedUserToken,(g=v.default.defaultHeaders)[O.default.organizationId]=this.omnichannelConfiguration.orgId,g[O.default.widgetAppId]=this.omnichannelConfiguration.widgetId,g[O.default.authorization]=n,d&&(g[O.default.authenticatedUserToken]=d,g[O.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(R.default.LiveChatAuthTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,g),E="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m="POST",T={data:JSON.stringify(r),headers:g,method:m,url:E,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.emailTranscript},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,i,s,d,h,p,E,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,l(T);case 2:i=e.sent,s=o.milliSecondsElapsed,d=i.headers,C.setAuthCodeNonce(d),h=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.EMAILTRANSCRIPTSUCCEEDED,"Email Transcript succeeded",t,i,h,c,m,void 0,void 0,g,s),n(),e.next=4;break;case 3:e.prev=3,S=e.catch(1),p=o.milliSecondsElapsed,E=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.EMAILTRANSCRIPTFAILED,"Email Transcript Failed",t,void 0,E,c,m,S,void 0,g,p),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(S);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,t,n){return r.apply(this,arguments)})},{key:"fetchDataMaskingInfo",value:(n=(0,s.default)(a.default.mark(function e(t){var n,r,o,i,u,c,l,d=this;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.FETCHDATAMASKINGSTARTED,"Fetch Data Masking Started",t),t||(t=(0,N.uuidv4)()),o="/".concat(R.default.LiveChatFetchDataMaskingInfoPath,"/").concat(this.omnichannelConfiguration.orgId),i=h.default.create(),(0,p.default)(i,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.fetchDataMaskingInfo}),(u=v.default.defaultHeaders)[O.default.organizationId]=this.omnichannelConfiguration.orgId,u[O.default.requestId]=t,this.addDefaultHeaders(t,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(o),l={headers:u,method:"GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.fetchDataMaskingInfo},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,s){var c,h,p,g,E,m,T,C;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=b.Timer.TIMER(),e.prev=1,e.next=2,i(l);case 2:h=e.sent,p=c.milliSecondsElapsed,g=r.milliSecondsElapsed,E=h.data,d.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.FETCHDATAMASKINGSUCCEEDED,"Fetch Data Masking succeeded",t,h,g,o,"GET",void 0,void 0,u,p),n(E),e.next=4;break;case 3:e.prev=3,C=e.catch(1),m=c.milliSecondsElapsed,T=r.milliSecondsElapsed,d.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.FETCHDATAMASKINGFAILED,"Fetch Data Masking Failed",t,void 0,T,o,"GET",C,void 0,u,m),(0,D.default)(C,v.default.axiosTimeoutErrorCode)&&s(new Error(d.HTTPTimeOutErrorMessage)),s(C);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"makeSecondaryChannelEventRequest",value:(t=(0,s.default)(a.default.mark(function e(t,n){var r,o,i,u,c,l,d,g,E,m,T=this,C=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},i=b.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSTARTED,"Secondary Channel Event Request Started",t),u="/".concat(R.default.LiveChatSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),c=h.default.create(),(0,p.default)(c,{headerOverwrites:[O.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.makeSecondaryChannelEventRequest}),l=o.authenticatedUserToken,(d=v.default.defaultHeaders)[O.default.organizationId]=this.omnichannelConfiguration.orgId,l&&(d[O.default.authenticatedUserToken]=l,d[O.default.authCodeNonce]=this.configuration.authCodeNonce,u="/".concat(R.default.LiveChatAuthSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t)),this.addDefaultHeaders(t,d),u+="?channelId="+v.default.defaultChannelId,g="".concat(this.omnichannelConfiguration.orgUrl).concat(u),E="POST",m={data:JSON.stringify(n),headers:d,method:E,url:g,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.makeSecondaryChannelEventRequest},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,s,l,h,p,g,C,S;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,c(m);case 2:s=e.sent,l=o.milliSecondsElapsed,h=s.headers,T.setAuthCodeNonce(h),p=i.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSUCCEEDED,"Secondary Channel Event Request Succeeded",t,s,p,u,E,void 0,void 0,d,l),n(),e.next=4;break;case 3:e.prev=3,S=e.catch(1),g=o.milliSecondsElapsed,C=i.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTFAILED,"Secondary Channel Event Request Failed",t,void 0,C,u,E,S,void 0,d,g),(0,D.default)(S,v.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(S);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}},e,this)})),function(e,n){return t.apply(this,arguments)})},{key:"sendTypingIndicator",value:(e=(0,s.default)(a.default.mark(function e(t,n){var r,o,i,u,c,l,d,p,g,E,m=this,T=arguments;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=T.length>2&&void 0!==T[2]?T[2]:{},n&&n===f.LiveChatVersion.V2){e.next=1;break}return e.abrupt("return",Promise.resolve());case 1:if(i=b.Timer.TIMER(),u=o.customerDisplayName,n&&n===f.LiveChatVersion.V2){e.next=2;break}throw new Error("Typing indicator is only supported on v2");case 2:return c="/".concat(R.default.SendTypingIndicatorPath,"/").concat(t),l=h.default.create(),(d=v.default.defaultHeaders)[O.default.organizationId]=this.omnichannelConfiguration.orgId,u&&(d[v.default.customerDisplayName]=u),this.addDefaultHeaders(t,d),p="".concat(this.omnichannelConfiguration.orgUrl).concat(c),E={headers:d,method:g="POST",url:p,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.sendTypingIndicator},e.abrupt("return",new Promise(function(){var e=(0,s.default)(a.default.mark(function e(n,r){var o,s,u,h,p,T,C;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=b.Timer.TIMER(),e.prev=1,e.next=2,l(E);case 2:s=e.sent,u=o.milliSecondsElapsed,h=i.milliSecondsElapsed,m.logWithLogger(y.LogLevel.INFO,f.OCSDKTelemetryEvent.SENDTYPINGINDICATORSUCCEEDED,"Send Typing Indicator Succeeded",t,s,h,c,g,void 0,void 0,d,u),n(),e.next=4;break;case 3:e.prev=3,C=e.catch(1),p=o.milliSecondsElapsed,T=i.milliSecondsElapsed,m.logWithLogger(y.LogLevel.ERROR,f.OCSDKTelemetryEvent.SENDTYPINGINDICATORFAILED,"Send Typing Indicator Failed",t,void 0,T,c,g,C,void 0,d,p),(0,D.default)(C,v.default.axiosTimeoutErrorCode)&&r(new Error(m.HTTPTimeOutErrorMessage)),r(C);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:"logWithLogger",value:function(e,t,n,r,o,i,a,s,u,c,l,d){var f,h,p;if(this.logger){u&&S.LoggingSanitizer.stripErrorSensitiveProperties(u);var g=void 0;c&&((g=_({},c)).customContextData&&S.LoggingSanitizer.stripCustomContextDataValues(g.customContextData),g.preChatResponse&&S.LoggingSanitizer.stripPreChatResponse(g.preChatResponse),S.LoggingSanitizer.stripGeolocation(g));var E=void 0,m=void 0;if(l&&(E=_({},l),S.LoggingSanitizer.stripRequestHeadersSensitiveProperties(E),l[O.default.authenticatedUserToken]&&window.document&&window.atob))try{var T=l[O.default.authenticatedUserToken].split(".")[1],C=window.atob(T),y=JSON.parse(C),w=y.lwicontexts;if(m={sub:y.sub,exp:y.exp},w){var R=JSON.parse(w);S.LoggingSanitizer.stripCustomContextDataValues(R),m.lwiContexts=R}}catch(e){}var I={RequestId:r,Region:null==o?void 0:o.data.Region,ElapsedTimeInMilliseconds:i,HttpRequestResponseTime:d,TransactionId:null==o?void 0:o.headers[v.default.transactionid],RequestPath:a,RequestMethod:s,ResponseStatusCode:o?o.status:u?null===(f=u.response)||void 0===f?void 0:f.status:void 0,ExceptionDetails:u?(null===(h=u.response)||void 0===h?void 0:h.data)||u:void 0,RequestPayload:g,RequestHeaders:E,ResponseErrorcode:u?null===(p=u.response)||void 0===p||null===(p=p.headers)||void 0===p?void 0:p.errorcode:void 0,AuthTokenDetails:m};this.logger.log(e,t,I,n)}}},{key:"addDefaultHeaders",value:function(e,t){this.setSessionIdHeader(this.sessionId,t),(0,A.addOcUserAgentHeader)(this.ocUserAgent,t),this.setCorrelationIdInHeader(e,t)}}]);var e,t,n,r,o,i,k,P,F,M,G,H,j,B,q,V,W,K,z}();i=F,(0,d.default)(F,"defaultRequestTimeoutConfig",{getChatConfig:12e4,getLWIDetails:15e3,getChatToken:15e3,sessionInit:15e3,sessionClose:15e3,getReconnectableChats:15e3,getReconnectAvailability:15e3,submitPostChatResponse:15e3,getSurveyInviteLink:15e3,getChatTranscripts:3e4,emailTranscript:5e3,fetchDataMaskingInfo:5e3,makeSecondaryChannelEventRequest:15e3,getAgentAvailability:15e3,sendTypingIndicator:5e3,validateAuthChatRecordTimeout:15e3,getPersistentChatHistory:15e3}),(0,d.default)(F,"defaultConfiguration",{authCodeNonce:(0,N.uuidv4)().substring(0,8),getChatTokenRetryCount:10,getChatTokenTimeBetweenRetriesOnFailure:1e4,getChatTokenRetryOn429:!0,maxRequestRetriesOnFailure:5,defaultRequestTimeout:void 0,requestTimeoutConfig:i.defaultRequestTimeoutConfig,useUnauthReconnectIdSigQueryParam:!1,waitTimeBetweenRetriesConfig:k.waitTimeBetweenRetriesConfigs,ocUserAgent:[]})},8971(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.LogLevel=function(e){return e.INFO="INFO",e.DEBUG="DEBUG",e.WARN="WARN",e.ERROR="ERROR",e}({})},9021(e,t,n){var r;e.exports=(r=r||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==n.g&&n.g.crypto&&(t=n.g.crypto),!t)try{t=n(477)}catch(e){}var r=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var d=0;d<c;d+=a)this._doProcessBlock(o,d);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(a.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),i.algo={});return i}(Math),r)},9045(e,t,n){var r=n(3738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9291(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9293(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,u,"next",e)}function u(e){t(a,o,i,s,u,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},9478(e,t,n){"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(4579)),i=r(n(7383)),a=r(n(3693)),s=n(2949),u=t.default=(0,o.default)(function e(){(0,i.default)(this,e)});(0,a.default)(u,"requiredOmnichannelConfigurationParameters",["orgUrl","orgId","widgetId"]),(0,a.default)(u,"defaultHeaders",{"Content-Type":"application/json"}),(0,a.default)(u,"bypassCacheHeaders",{"Cache-Control":"no-store, must-revalidate, no-cache","X-Cache-Control":"no-store"}),(0,a.default)(u,"defaultChannelId",s.ChannelId.LCW),(0,a.default)(u,"defaultLocale","en-us"),(0,a.default)(u,"noContentStatusCode",204),(0,a.default)(u,"tooManyRequestsStatusCode",429),(0,a.default)(u,"notFoundStatusCode",404),(0,a.default)(u,"badRequestStatusCode",400),(0,a.default)(u,"outOfOfficeErrorCode",705),(0,a.default)(u,"sensitiveProperties",["AuthenticatedUserToken"]),(0,a.default)(u,"transactionid","transaction-id"),(0,a.default)(u,"customerDisplayName","customerDisplayName"),(0,a.default)(u,"hiddenContentPlaceholder","*content hidden*"),(0,a.default)(u,"axiosTimeoutErrorCode","ECONNABORTED")},9903(e,t,n){"use strict";var r=n(4994),o=n(3738);Object.defineProperty(t,"__esModule",{value:!0}),t.axiosRetryHandlerWithNotFound=function(e,t){c(e,{retries:t.retries,waitTimeInMsBetweenRetries:t.waitTimeInMsBetweenRetries,shouldRetry:function(e){var n;return u(e,t.retryOn429)||(null===(n=e.response)||void 0===n?void 0:n.status)===a.default.notFoundStatusCode}})},t.default=void 0,t.isRetryableError=l;var i=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var n,r,i={__proto__:null,default:e};if(null===e||"object"!=o(e)&&"function"!=typeof e)return i;if(n=t){if(n.has(e))return n.get(e);n.set(e,i)}for(var a in e)"default"!==a&&{}.hasOwnProperty.call(e,a)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,a))&&(r.get||r.set)?n(i,a,r):i[a]=e[a]);return i}(e)}(n(3770)),a=r(n(9478));function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(e,t){var n,r,o;return!((null===(n=e.response)||void 0===n?void 0:n.status)===a.default.tooManyRequestsStatusCode&&!t)&&(l(e)||(0,i.isNetworkError)(e)||0===(null===(r=e.response)||void 0===r?void 0:r.status)||!(null!==(o=e.response)&&void 0!==o&&o.status))},c=function(e,t){void 0!==t.retryOn429&&null!==t.retryOn429||(t.retryOn429=!1),t.shouldRetry||(t.shouldRetry=function(e){return u(e,t.retryOn429)}),(0,i.default)(e,{retries:t.retries,retryCondition:t.shouldRetry,onRetry:function(e,n,r){var o=n.response,i=t.headerOverwrites;if(i&&null!=o&&o.headers){var a,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(i);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=null==o?void 0:o.headers[c.toLocaleLowerCase()];l&&r.headers&&(r.headers[c]=l)}}catch(e){u.e(e)}finally{u.f()}}},retryDelay:function(e,n){var r,o,i=t.waitTimeInMsBetweenRetries,s=null==n||null===(r=n.response)||void 0===r||null===(r=r.headers)||void 0===r?void 0:r["retry-after"],u=i;if(s){var c=parseInt(s);if(isNaN(c)){var l=new Date(s),d=(new Date).getTime();l&&l instanceof Date&&isFinite(l.getTime())&&(u=Math.max(0,l.getTime()-d))}else u=c*i;return u}return(null===(o=n.response)||void 0===o?void 0:o.status)===a.default.tooManyRequestsStatusCode?5e3:Math.pow(2,e)*i}})};function l(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}t.default=c},9956(e,t,n){e.exports=n(9021).enc.Hex}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};(()=>{"use strict";var e=r,t=n(4994);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"SDKProvider",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"uuidv4",{enumerable:!0,get:function(){return s.uuidv4}});var o=t(n(3920)),i=t(n(2487)),a=t(n(1728)),s=n(6676);!function(){if(void 0===n.g.window&&(n.g.window=n.g),!window)throw new Error("window object not found");"Microsoft"in window||(window.Microsoft={}),"CRM"in window.Microsoft||(window.Microsoft.CRM={}),"Omnichannel"in window.Microsoft.CRM||(window.Microsoft.CRM.Omnichannel={}),"SDK"in window.Microsoft.CRM.Omnichannel||(window.Microsoft.CRM.Omnichannel.SDK={SDKProvider:a.default,Util:{uuidv4:s.uuidv4}}),window.document&&o.default.raiseCustomEvent(i.default.OCSDKLOAD)}()})();var o=window;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();