import{aa as n,ab as c}from"./_applist-tangy-colts-beg-36.js";import{aR as m,_ as i}from"./main-tangy-colts-beg.js";import{s as h}from"./machine.-tangy-colts-beg-869.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const l=async()=>m("pro_get_allCommissionType",void 0,void 0,"GET");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const a=async o=>{o.setComponent("commission-type-id",t=>{t.loading=!0});const{data:e,status:s}=await l();if(s==="error"){o.setComponent("commission-type-id",t=>{o.util.isSelectComponent(t)&&(t.status=s,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch commission-type");return}o.setComponent("commission-type-id",t=>{o.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const u=n(({helpers:o})=>({actions:{ON_MACHINE_LOAD:async({$:e})=>{h(e,[{db:"commissionTypeId",id:"commission-type-id"}]),await a(e)},REFETCH_COMMISSION_TYPES:async({$:e})=>a(e),SELECT_COMMISSION_TYPE:async({$:e,e:s})=>{e.setThisComponent(t=>{t.value=s}),e.setDb({commissionTypeId:s})}},states:{components:[{componentName:o.componentName.select,fieldType:"config",id:"commission-type-id",label:i("Commission-types"),onChange:"SELECT_COMMISSION_TYPE",onRefetch:"REFETCH_COMMISSION_TYPES",options:[],placeholder:i("Select a commission-type"),render:!0,value:void 0},{componentName:o.componentName.hookListener,fieldType:"config",id:"hook-listener",label:i("Listen Hook"),render:({$:e})=>{var s;return c((s=e.getComponent("commission-type-id"))==null?void 0:s.value)}}]}}));export{u as default};
