import{t as e}from"./axios-m7YkukvY.js";import{et as t}from"./runtime-core.esm-bundler-Babufkcf.js";import{t as n}from"./i18n-jmtZ2Bqk.js";var r=t({}),i=!1,a=null;function o(){async function t(t=!1){if(!(i&&!t))return a||(a=(async()=>{try{let{data:t}=await e.get(`/lookups`);r.value=t||{},i=!0}catch{}finally{a=null}})(),a)}function o(e){return r.value[e]||[]}function s(e){return e?n.locale===`fa`&&e.label_fa?e.label_fa:e.label_en||e.label_fa||e.code:``}function c(e){return o(e).map(e=>({label:s(e),value:e.code,label_en:e.label_en,label_fa:e.label_fa}))}function l(e,t){if(t==null||t===``)return``;let n=o(e).find(e=>e.code===t);return n?s(n):String(t)}return{groups:r,loadLookups:t,options:c,label:l,rows:o,labelOf:s}}export{o as t};