(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,n=window.wp.apiFetch;var s=e.n(n);const l=window.wp.i18n,r=window.wp.components,o="agentic/v1/ui-settings";function i(){const[e,n]=(0,a.useState)(!0),[i,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(""),[g,m]=(0,a.useState)(!1),[_,b]=(0,a.useState)("basic"),[h,v]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{s()({path:o}).then(e=>{b("advanced"===e.ui_mode?"advanced":"basic"),v(!!e.show_onboarding),n(!1)}).catch(e=>{u(e.message||(0,l.__)("Could not load interface settings.","agent-builder")),n(!1)})},[]),e?(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardBody,null,(0,t.createElement)(r.Spinner,null)," ",(0,l.__)("Loading interface settings…","agent-builder"))):(0,t.createElement)(r.Card,{className:"agentic-interface-settings"},(0,t.createElement)(r.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,l.__)("Interface","agent-builder"))),(0,t.createElement)(r.CardBody,null,c&&(0,t.createElement)(r.Notice,{status:"error",isDismissible:!1,className:"agentic-mb-12"},c),g&&!c&&(0,t.createElement)(r.Notice,{status:"success",isDismissible:!0,onRemove:()=>m(!1),className:"agentic-mb-12"},(0,l.__)("Interface settings saved.","agent-builder")),(0,t.createElement)(r.RadioControl,{label:(0,l.__)("Interface mode","agent-builder"),help:(0,l.__)("Basic keeps the menu focused on everyday tasks. Advanced reveals developer tools such as Skills, APIs and Endpoints.","agent-builder"),selected:_,options:[{label:(0,l.__)("Basic","agent-builder"),value:"basic"},{label:(0,l.__)("Advanced","agent-builder"),value:"advanced"}],onChange:e=>b(e)}),(0,t.createElement)("div",{style:{marginTop:"20px"}},(0,t.createElement)(r.ToggleControl,{label:(0,l.__)("Show the Getting Started checklist on the dashboard","agent-builder"),help:(0,l.__)("Turn this off once you are set up to hide the onboarding checklist.","agent-builder"),checked:h,onChange:e=>v(e),__nextHasNoMarginBottom:!0}))),(0,t.createElement)(r.CardFooter,null,(0,t.createElement)(r.Flex,{justify:"flex-start"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"primary",onClick:()=>{d(!0),m(!1),u(""),s()({path:o,method:"POST",data:{ui_mode:_,show_onboarding:h}}).then(e=>{b("advanced"===e.ui_mode?"advanced":"basic"),v(!!e.show_onboarding),d(!1),m(!0)}).catch(e=>{u(e.message||(0,l.__)("Could not save interface settings.","agent-builder")),d(!1)})},isBusy:i,disabled:i},i?(0,l.__)("Saving…","agent-builder"):(0,l.__)("Save changes","agent-builder"))))))}document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("agentic-interface-settings-root");e&&(0,a.createRoot)(e).render((0,t.createElement)(i,null))})})();