1import{a3 as p,ay as d,aM as h,r as y,j as s,H as m,T as n,z as f,I as u,aT as g,q as c,ar as o}from"./index-Dayw3-GA.js";import{T as w}from"./TextArea-CnO2J5Ul.js";import{p as T}from"./pbCloneDeep-DGyRx7Le.js";import{I}from"./IoTypes-ByvVfMhe.js";import{w as v}from"./withTranslation-BaoSscmF.js";import"./virtualExposes-LPRSDCRG.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__buster__assets35968757485_remoteEntry_js-BpKdap8h.js";import"./preload-helper-B-fPAXoJ.js";import"./SpinnerWrapper-MMNmZ1xk.js";import"./Badge-Dhbj5-7s.js";import"./index-D5hT9Zdp.js";import"./debounce-DB71ZKjW.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="e3fccb98-3160-4544-8a37-9271f4121f1d",r._sentryDebugIdIdentifier="sentry-dbid-e3fccb98-3160-4544-8a37-9271f4121f1d")}catch{}})();class x extends y.Component{ioTypesService=new I;constructor(e){super(e),this.state={hasImportantError:!1,ioTypesData:{},isOverwritingIoTypes:!1}}render(){const{t:e}=this.props;return s.jsxs(s.Fragment,{children:[s.jsx(m,{title:e("Admin I/O types")}),s.jsxs("div",{className:"container flex flex-col",children:[s.jsx(n,{variant:"heading",size:"L",component:"h1",className:"mb-2",children:e("I/O types")}),this.state.ioTypes?s.jsxs(s.Fragment,{children:[this.state.ioTypes.map(t=>s.jsxs("div",{className:"mt-2",children:[s.jsx(n,{variant:"heading",size:"M",component:"h2",className:"mb-1",children:t.slug}),s.jsx(w,{name:t.slug,className:"resize-none",required:!0,rows:5,"data-io-type-slug":t.slug,value:this.state.ioTypesData[t.slug].data,onChange:this.state.ioTypesData[t.slug].onModifiersChange})]},t.slug)),s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsx(f,{type:"button",variant:"primary",analyticsid:"adminUserOverwriteIoTypesBtn",isLoading:this.state.isOverwritingIoTypes,onClick:this.handleOverwriteIoTypes,children:e("Overwrite I/O types")})})]}):s.jsx("div",{className:"mt-2 flex justify-center",children:s.jsx(u,{name:"regularSpinner",className:"animate-spin text-icon-l"})})]})]})}componentDidMount=async()=>{this.fetchIoTypes().catch(e=>{console.error("Cannot fetch io types",e),window.alert(e.message)})};componentWillUnmount(){this.ioTypesService.abort()}handleIoTypeDataChange=(e,t)=>
1{this.setState(i=>{const a=T(i.ioTypesData);return a[e].data=t,{ioTypesData:a}})};fetchIoTypes=async()=>{try{const e=await this.ioTypesService.fetchAll({}),t=e.reduce((i,a)=>({...i,[a.slug]:{data:JSON.stringify(g(a,["slug"]),null," "),onModifiersChange:l=>{this.handleIoTypeDataChange(a.slug,l.target.value)}}}),{});this.setState({ioTypes:e,ioTypesData:t})}catch(e){if(e instanceof c)return;console.error("Could not fetch ioTypes",e),window.alert(o(e).message)}};handleOverwriteIoTypes=async()=>{if(!this.state.isOverwritingIoTypes&&window.confirm(this.props.t("Are you sure you want to overwrite all I/O types?"))){this.setState({isOverwritingIoTypes:!0});try{const e=[];for(const[t,i]of Object.entries(this.state.ioTypesData))try{e.push({slug:t,...JSON.parse(i.data)})}catch(a){throw new Error(`${t}: ${o(a).message}`)}await this.ioTypesService.adminOverwriteAll(e),this.fetchIoTypes().catch(t=>{console.error("Cannot fetch io types",t),window.alert(t.message)})}catch(e){if(e instanceof c)return;console.error("Could not save plan modifiers",e),window.alert(o(e).message)}this.setState({isOverwritingIoTypes:!1})}}}const L=v()(p(d(h(x))));export{L as default}; 2//# sourceMappingURL=IoTypes-DmmUiStD.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.