(window.webpackJsonp__wix_chat_widget=window.webpackJsonp__wix_chat_widget||[]).push([[45],{1102:function(t,e,r){"use strict";r.r(e),e.default=function t(e){function r(t){return function(e,r){return i(e,Object.assign({method:t},r))}}function n(t){return function(e,r,n){return i(e,Object.assign({method:t,data:r},n))}}function o(t,e,r){if(Array.isArray(t))return t.concat(e);if(e&&"object"==typeof e){var n,i={};if(t)for(n in t)i[r?n.toLowerCase():n]=t[n];for(n in e){var s=r?n.toLowerCase():n;"headers"===s&&(r=!0),i[s]=n in i?o(i[s],e[n],r):e[n]}return i}return e}function i(t,r){"string"!=typeof t&&(t=(r=t).url);var n=o(e,r||{}),i=n.data;if(n.transformRequest)for(var s=0;s0?{headers:n}:void 0;return this.runHttpRequest(t,a,r,c)},e.prototype.runHttpRequest=function(t,e,r,n){switch(void 0===n&&(n={}),this.testkitBaseUrl?e=p(this.testkitBaseUrl,e):this.useRedaxios&&(e=p(this.baseUrl,e)),n.method=t,t){case"GET":return this.axiosClient.get(e+"?"+this.payloadToQueryString(r),n).then((function(t){return t.data})).catch(this.handleErrors);case"POST":return this.axiosClient.post(e,r,n).then((function(t){return t.data})).catch(this.handleErrors);case"PUT":return this.axiosClient.put(e,r,n).then((function(t){return t.data})).catch(this.handleErrors);case"PATCH":return this.axiosClient.patch(e,r,n).then((function(t){return t.data})).catch(this.handleErrors);case"DELETE":return this.axiosClient.delete(e+"?"+this.payloadToQueryString(r),n).then((function(t){return t.data})).catch(this.handleErrors);default:return null}},e.prototype.createWixHeaders=function(t){return this.config.isWixHttpClient?{}:s.createHeaders(t)},e.prototype.fetchHttpRequest=function(t,e,r,n){var o=p(this.testkitBaseUrl||this.baseUrl,e);switch(t){case"GET":return this.fetchClient(o+"?"+this.payloadToQueryString(r),{method:"GET",headers:n}).then(this.handleFetchResponse,this.handleFetchErrors);case"POST":return this.fetchClient(o,{method:"POST",headers:this.mergeHeadersWithContentType(n||{}),body:JSON.stringify(r)}).then(this.handleFetchResponse,this.handleFetchErrors);case"PUT":return this.fetchClient(o,{method:"PUT",headers:this.mergeHeadersWithContentType(n||{}),body:JSON.stringify(r)}).then(this.handleFetchResponse,this.handleFetchErrors);case"PATCH":return this.fetchClient(o,{method:"PATCH",headers:this.mergeHeadersWithContentType(n||{}),body:JSON.stringify(r)}).then(this.handleFetchResponse,this.handleFetchErrors);case"DELETE":return this.fetchClient(o+"?"+this.payloadToQueryString(r),{method:"DELETE",headers:n}).then(this.handleFetchResponse,this.handleFetchErrors);default:return null}},e.prototype.mergeHeadersWithContentType=function(t){return i(i({},{"Content-Type":"application/json"}),t)},e.prototype.configForTestingIfRequired=function(){var e;t.env.AMBASSADOR_TESTKIT_HTTP_URL&&(e=t.env.AMBASSADOR_TESTKIT_HTTP_URL),"undefined"!=typeof window&&window.__AMBASSADOR_TESTKIT_HTTP_URL&&(e=window.__AMBASSADOR_TESTKIT_HTTP_URL),e&&(this.testkitBaseUrl=p(e,encodeURIComponent(this.baseUrl)))},e.prototype.payloadToQueryString=function(t){var e=this;return Object.keys(t).filter((function(e){return null!==t[e]&&void 0!==t[e]})).map((function(r){if(t[r]instanceof Array)return e.arrayToQueryString(r,t[r]);if("object"==typeof t[r]){var n=Object.keys(t[r]).reduce((function(e,n){var o;return i(i({},e),((o={})[r+"."+n]=t[r][n],o))}),{});return e.payloadToQueryString(n)}return encodeURIComponent(r)+"="+encodeURIComponent(t[r])})).join("&")},e.prototype.arrayToQueryString=function(t,e){return e.map((function(e){return encodeURIComponent(t)+"="+encodeURIComponent(e)})).join("&")},e.prototype.getParamsFromPath=function(t){for(var e=[],r=t;r.match(/\{[^}]+\}/);){var n=r.match(/\{([^}]+)\}/),o=(n[0],n[1]);e.push(o),r=r.replace(/\{[^}]+\}/,"")}return e},e.prototype.getValueFromPayload=function(t,e){return e.split(".").reduce((function(t,e){return t[e]||t[a.snakeToCamelCase(e)]}),t)},e.prototype.addTrailingSlash=function(t){return t.endsWith("/")?t:t+"/"},e.prototype.removeLeadingSlash=function(t){return t.startsWith("/")?t.substr(1):t},e}();function h(t){try{return JSON.parse(t)}catch(e){return t}}function p(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}e.AmbassadorHTTPClient=u}).call(this,r(58))},1174:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.snakeToCamelCase=function(t){return t.replace(/([-_][a-z])/g,(function(t){return t.toUpperCase().replace("-","").replace("_","")}))},e.getMajorVersion=function(t){if(null!=t&&-1!==t.indexOf(".")){var e=Number.parseInt(t.split(".")[0]);if(!Number.isNaN(e))return e}return-1}},1175:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1190:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.PresenceService=void 0;var i=r(1172);e.PresenceService=function(t,e){var r=new i.AmbassadorHTTPClient(t,e);return{PresenceService:function(){return function(t){var e={resetScope:function(e){return r.invoke("POST","/api/v1/reset-scope",e,t)},setData:function(e){return r.invoke("POST","/api/v1/set-data",e,t)},watch:function(e){return r.invoke("POST","/api/v1/watch",e,t)}};return e.resetScope.__http_method="POST",e.resetScope.__http_url="/api/v1/reset-scope",e.setData.__http_method="POST",e.setData.__http_url="/api/v1/set-data",e.watch.__http_method="POST",e.watch.__http_url="/api/v1/watch",e}}}},e.PresenceService.__transport="http",o(r(1175),e)}}]); //# sourceMappingURL=45.chunk.min.js.map