"use strict";(self.webpackChunkbackend_ai_webui_react=self.webpackChunkbackend_ai_webui_react||[]).push([[502],{1502:function(n,e,i){i.r(e),i.d(e,{default:function(){return _},useShadowRoot:function(){return T},useWebComponentInfo:function(){return V}});var t=i(9439),r=i(4519),a=i(6980),o=i(6114),l=i(9002),u=i(7112),s=i(4447),c=i(1748),d=i(3881),g=i(9883),v=i(6670),f=i(4165),h=i(5861),b=i(1011),m=i(1413);function p(n,e){var i=(0,m.Z)({},e);return function(n){for(var e,i=/(\w+)\s@\s*(\w+)\s*\(\s*(\w+)\s*:\s*(\$?\w+)\s*\)/g,r=[];null!==(e=i.exec(n));){var a=e,o=(0,t.Z)(a,5),l=o[0],u=o[1],s=o[2],c=o[3],d=o[4];r.push({fieldName:u,directive:s,argumentName:c,argumentValue:d,originFieldStr:l})}return r}(n).forEach((function(t){if("skipOnClient"===t.directive&&"if"===t.argumentName&&(n=!t.argumentValue||!0!==e[t.argumentValue.substring(1)]&&"true"!==t.argumentValue?n.replace(t.originFieldStr,t.originFieldStr.replace(/@\s*(skipOnClient)\s*\(\s*(\w+)\s*:\s*(\$?\w+)\s*\)/,"")):n.replace(t.originFieldStr,""),t.argumentValue.startsWith("$")&&2===n.split(t.argumentValue).length)){var r=t.argumentValue.substring(1),a=new RegExp(".*".concat(r,".*\n"),"g");n=n.replace(a,""),delete i[t.argumentValue.substring(1)]}})),{query:n,variables:i}}b.RelayFeatureFlags.ENABLE_RELAY_RESOLVERS=!0;var w=function(){var n=(0,h.Z)((0,f.Z)().mark((function n(e,i){var t,r,a,o,l,u;return(0,f.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=p(e.text||"",i),o={query:a.query,variables:a.variables},l=null===(t=globalThis.backendaiclient)||void 0===t?void 0:t.newSignedRequest("POST","/admin/gql",o),n.next=5,null===(r=globalThis.backendaiclient)||void 0===r?void 0:r._wrapWithPromise(l,!1,null,1e4,0);case 5:return u=n.sent,n.abrupt("return",u);case 7:case"end":return n.stop()}}),n)})));return function(e,i){return n.apply(this,arguments)}}();var k,x=new b.Environment({network:b.Network.create(w,void 0),store:new b.Store(new b.RecordSource)}),y=i(382),C=i(4322),E=i(2556),S=r.createContext(null),j=r.createContext(null),T=function(){return r.useContext(j)},V=function(){return r.useContext(S)},Z=new u.QueryClient({defaultOptions:{queries:{suspense:!0,refetchOnWindowFocus:!1,retry:!1}}});s.ZP.use(c.Db).use(d.Z).init({backend:{loadPath:"/resources/i18n/{{lng}}.json"},lng:(null===globalThis||void 0===globalThis||null===(k=globalThis.backendaioptions)||void 0===k?void 0:k.get("current_language"))||"en",fallbackLng:"en",interpolation:{escapeValue:!1}});var _=function(n){var e=n.children,i=n.value,s=n.styles,d=n.shadowRoot,f=n.dispatchEvent,h=(0,r.useMemo)((function(){return(0,o.Df)()}),[]),b=function(){var n,e=(0,r.useState)(null===globalThis||void 0===globalThis||null===(n=globalThis.backendaioptions)||void 0===n?void 0:n.get("current_language")),i=(0,t.Z)(e,2),a=i[0],o=i[1],l=(0,c.$G)().i18n;return(0,r.useEffect)((function(){setTimeout((function(){return null===l||void 0===l?void 0:l.changeLanguage(a)}),0)}),[]),(0,r.useEffect)((function(){var n=function(n){var e,i;o(null===n||void 0===n||null===(e=n.detail)||void 0===e?void 0:e.lang);var t=(null===n||void 0===n||null===(i=n.detail)||void 0===i?void 0:i.lang)||"en";null===l||void 0===l||l.changeLanguage(t)};return window.addEventListener("langChanged",n),function(){return window.removeEventListener("langChanged",n)}}),[l]),[a]}(),m=(0,t.Z)(b,1)[0],p=(0,y.x)(),w=(0,r.useMemo)((function(){return{value:i,dispatchEvent:f,moveTo:function(n){f("moveTo",{path:n})}}}),[i,f]);return(0,E.jsx)(E.Fragment,{children:x&&(0,E.jsx)(a.RelayEnvironmentProvider,{environment:x,children:(0,E.jsxs)(r.StrictMode,{children:[(0,E.jsxs)("style",{children:[s,"\n.anticon {\n  display: inline-block;\n  color: inherit;\n  font-style: normal;\n  line-height: 0;\n  text-align: center;\n  text-transform: none;\n  vertical-align: -0.125em;\n  text-rendering: optimizeLegibility;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n  line-height: 1;\n}\n\n.anticon svg {\n  display: inline-block;\n}\n\n.anticon::before {\n  display: none;\n}\n\n.anticon .anticon-icon {\n  display: block;\n}\n\n.anticon[tabindex] {\n  cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n  display: inline-block;\n  -webkit-animation: loadingCircle 1s infinite linear;\n  animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n\n@keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n"]}),(0,E.jsx)(u.QueryClientProvider,{client:Z,children:(0,E.jsx)(j.Provider,{value:d,children:(0,E.jsx)(S.Provider,{value:w,children:(0,E.jsx)(l.ZP,{getPopupContainer:function(n){return null!==n&&void 0!==n&&n.parentNode?n.parentNode:d},locale:"ko"===m?v.Z:g.Z,theme:p,children:(0,E.jsx)(o.V9,{container:d,cache:h,children:(0,E.jsx)(r.Suspense,{fallback:"",children:(0,E.jsx)(C.VK,{children:e})})})})})})})]})})})}}}]);
//# sourceMappingURL=502.9e298a0c.chunk.js.map