import{__awaiter as e,__generator as t}from"tslib";import{useQuery as r}from"@tanstack/react-query";import o from"../store/useAuthStore.js";import n from"../store/useEnvStore.js";import{fetchLMSConfig as i}from"../apis/scopeApis.js";import{useLMSConfigStore as s,useTeachMeConfigStore as u}from"../store/useLMSConfigStore.js";import{useLearningTemplateStore as a}from"../store/useLearningTemplateStore.js";function f(f,m,c){var l=this;void 0===c&&(c=!0);var p=o(function(e){var t,r;return null!==(r=null===(t=e.user)||void 0===t?void 0:t.accessToken)&&void 0!==r?r:""}),v=n(function(e){var t;return null!==(t=e.llmStudioUrl)&&void 0!==t?t:""}),d=s(function(e){return e.setLMSConfig}),g=u(function(e){return e.setTeachMeConfig}),h=a(function(e){return e.setTemplateData});return r({queryKey:["lms-config",f],queryFn:function(){return e(l,void 0,void 0,function(){var e,r,o,n;return t(this,function(t){switch(t.label){case 0:return[4,i(v,f,p)];case 1:return e=t.sent(),r=e.lmsConfig,o=e.teachMeConfig,n=e.template,r&&d(r),o&&g(o),n&&h(f,n),[2,{lmsConfig:r,teachMeConfig:o,template:n}]}})})},enabled:c&&!!f&&!!p&&!!v&&!m,staleTime:6e5})}export{f as useLMSConfigQuery};
//# sourceMappingURL=useLMSConfigQuery.js.map
