{"version":3,"file":"country_eligible-6IBabjgK.js","sources":["../../../app/frontend/entrypoints/pages/jobs/country_eligible.js"],"sourcesContent":["import Loader from \"@/javascript/components/loader\"\n\nconst bindCountryEligibleLabel = (content) => {\n const select = content.querySelector('.country-select')\n const target = content.querySelector('label[for=\"job_country_eligible_only\"]')\n if(select && typeof(select.selectize) != 'undefined') {\n select.selectize.on('item_add', (value, item) => {\n target.innerHTML = target.innerHTML.replace(/\\:(.*)$/, `: ${item[0].innerHTML}`)\n })\n }\n}\n\nconst bindNonEligibleApplicationSubmit = (content) => {\n const eligibleButton = content.querySelector('#application_country_eligible_true')\n const nonEligibleButton = content.querySelector('#application_country_eligible_false')\n const buttons = [eligibleButton, nonEligibleButton]\n\n buttons.forEach((button) => {\n if(button) {\n button.addEventListener('click', (e) => {\n nonEligibleButton.form.submit.disabled = nonEligibleButton.checked\n })\n }\n })\n\n if(eligibleButton && eligibleButton.form) {\n eligibleButton.form.submit.disabled = !eligibleButton.checked\n }\n}\n\nLoader.functional((content, resolve) => {\n if(document.querySelector('.js-country-eligible-only-wrapper')){\n bindCountryEligibleLabel(content)\n }\n\n if(document.querySelector('.js-country-eligible-container')) {\n bindNonEligibleApplicationSubmit(content)\n }\n\n resolve()\n})\n"],"names":["bindCountryEligibleLabel","content","select","target","value","item","bindNonEligibleApplicationSubmit","eligibleButton","nonEligibleButton","button","e","Loader","resolve"],"mappings":"yCAEA,MAAMA,EAA4BC,GAAY,CAC5C,MAAMC,EAASD,EAAQ,cAAc,iBAAiB,EAChDE,EAASF,EAAQ,cAAc,wCAAwC,EAC1EC,GAAU,OAAOA,EAAO,UAAc,KACvCA,EAAO,UAAU,GAAG,WAAY,CAACE,EAAOC,IAAS,CAC/CF,EAAO,UAAYA,EAAO,UAAU,QAAQ,UAAW,KAAKE,EAAK,CAAC,EAAE,SAAS,EAAE,CAChF,CAAA,CAEL,EAEMC,EAAoCL,GAAY,CACpD,MAAMM,EAAiBN,EAAQ,cAAc,oCAAoC,EAC3EO,EAAoBP,EAAQ,cAAc,qCAAqC,EACrE,CAACM,EAAgBC,CAAiB,EAE1C,QAASC,GAAW,CACvBA,GACDA,EAAO,iBAAiB,QAAUC,GAAM,CACtCF,EAAkB,KAAK,OAAO,SAAWA,EAAkB,OAC5D,CAAA,CAEJ,CAAA,EAEED,GAAkBA,EAAe,OAClCA,EAAe,KAAK,OAAO,SAAW,CAACA,EAAe,QAE1D,EAEAI,EAAO,WAAW,CAACV,EAASW,IAAY,CACnC,SAAS,cAAc,mCAAmC,GAC3DZ,EAAyBC,CAAO,EAG/B,SAAS,cAAc,gCAAgC,GACxDK,EAAiCL,CAAO,EAG1CW,EAAO,CACT,CAAC"}