function asyncGeneratorStep(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function _async_to_generator(c){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=c.apply(e,i);function o(e){asyncGeneratorStep(r,t,n,o,a,"next",e)}function a(e){asyncGeneratorStep(r,t,n,o,a,"throw",e)}o(void 0)})}}function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _object_spread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);(r="function"==typeof Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})):r).forEach(function(e){_define_property(t,e,n[e])})}return t}function ownKeys(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),n.push.apply(n,e)),n}function _object_spread_props(t,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}function _ts_generator(r,o){var a,i,c,l={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,i&&(c=2&t[0]?i.return:t[0]?i.throw||((c=i.return)&&c.call(i),0):i.next)&&!(c=c.call(i,t[1])).done)return c;switch(i=0,(t=c?[2&t[0],c.value]:t)[0]){case 0:case 1:c=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(c=0<(c=l.trys).length&&c[c.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!c||t[1]>c[0]&&t[1]<c[3]))l.label=t[1];else if(6===t[0]&&l.label<c[1])l.label=c[1],c=t;else{if(!(c&&l.label<c[2])){c[2]&&l.ops.pop(),l.trys.pop();continue}l.label=c[2],l.ops.push(t)}}t=o.call(r,l)}catch(e){t=[6,e],i=0}finally{a=c=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var checkAndDecodeBase64String=function(t){if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function validateConfig(e){return _validateConfig.apply(this,arguments)}function _validateConfig(){return(_validateConfig=_async_to_generator(function(t){return _ts_generator(this,function(e){return t.baseUrl||console.info("@aiware/js: baseUrl is required. It defaults to the US Commercial environment which is https://api.us-1.veritone.com/v3/graphql"),t.authToken&&(t.authToken=checkAndDecodeBase64String(t.authToken)),t.knowledgeBaseURL&&t.knowledgeBaseUrl&&t.knowledgeBaseURL!==t.knowledgeBaseUrl||t.knowledgeBaseURL&&!t.knowledgeBaseUrl?(console.info("@aiware/js: knowledgeBaseURL is deprecated and scheduled to be removed in v3. Please use knowledgeBaseUrl instead."),[2,_object_spread_props(_object_spread({},t),{knowledgeBaseUrl:t.knowledgeBaseURL})]):[2,t]})})).apply(this,arguments)}export{validateConfig};
