1import{a8 as i,F as o,on as l,oo as d,op as n,k0 as c,k1 as m,k2 as u,P as e,I as p,a7 as h,b0 as L,ol as f,p as a,N as g,ci as T,oq as O,O as S}from"./index-DSjYOy4I.js";import{d as P,c as R}from"./vendor-Daqlmq31.js";import{c as b,f as q}from"./suppliers-DLxjIPyY.js";import{c as x,f as y,a as C}from"./licenses-Copikn7W.js";import{C as I}from"./index-CLXnDE0r.js";import"./index-BtujQf_u.js";import"./index-C2Knti1l.js";const j=t=>({suppliers:u(t),suppliersLoading:m(t),suppliersLoaded:c(t),templates:n(t),templatesLoading:d(t),templatesLoaded:l(t)}),_={createOrder:C,fetchSuppliers:q,clearSuppliers:b,fetchTemplatesList:y,clearLicenseTemplates:x};class k extends R.Component{static propTypes={history:h.history.isRequired,createOrder:e.func.isRequired,clearSuppliers:e.func.isRequired,suppliers:p.list,suppliersLoading:e.bool,suppliersLoaded:e.bool,fetchSuppliers:e.func.isRequired,t:e.func.isRequired,templates:p.list,templatesLoading:e.bool,templatesLoaded:e.bool,fetchTemplatesList:e.func.isRequired,clearLicenseTemplates:e.func.isRequired};static defaultProps={suppliers:null,suppliersLoading:!1,suppliersLoaded:!1,templates:null,templatesLoading:!1,templatesLoaded:!1};constructor(r){super(r),this.state={}}componentDidMount(){this.props.suppliersLoading||this.props.fetchSuppliers(),this.props.templatesLoading||this.props.fetchTemplatesList()}componentWillUnmount(){this.props.clearLicenseTemplates(),this.props.clearSuppliers()}handleCreateOrder=async(r,s)=>{await this.props.createOrder(r,s)&&await this.props.history.push(L(f)(1))};render(){return this.props.suppliersLoaded&&this.props.templatesLoaded?a.jsx(g,{onSubmit:this.handleCreateOrder,initialValues:{supplier:null,purchase_order:"",reference:"",comment:"",free:!1,order_items:[{license_template_id:null,amount:1}]},validationSchema:O(this.props.t),render:r=>a.jsx(T,{...this.props,children:a.jsx(I,{...r,t:this.props.t,suppliers:this.props.suppliers&&this.props.suppliers.map(s=>({id:s.get("id"),value:s.get("name"),label:s.get("name")})).toJS(),templates:this.props.templates.map(s=>({label:s.get("description"),id:s.get("id"),value:s.get("id")})).toJS(),isCreate:!0})})}):a.jsx(S,{})}}const M=i(o()(P(j,_)(k)));export{M as default}; 2//# sourceMappingURL=create-order-DjAVw25G.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.