{"version":3,"file":"sentence-fTbplinA.js","sources":["../../../app/javascript/controllers/models/sentence.js"],"sourcesContent":["const commaSeperatedListWithAndConjunction = (array) => {\n if(array.length === 1) {\n return array[0]\n } else if(array.length === 2) {\n return array.join(` ${t.sentence.conjunction.and.normal} `)\n } else {\n const secondToLast = array[array.length - 2]\n const last = array[array.length - 1]\n\n return `${array.slice(0, -2).join(', ')}, ${secondToLast} ${t.sentence.conjunction.and.normal} ${last}`\n }\n}\n\nconst commaSeperatedListWithOrConjunction = (array) => {\n if(array.length === 1) {\n return array[0]\n } else if(array.length === 2) {\n return array.join(` ${t.sentence.conjunction.or.normal} `)\n } else {\n const secondToLast = array[array.length - 2]\n const last = array[array.length - 1]\n\n return `${array.slice(0, -2).join(', ')}, ${secondToLast} ${t.sentence.conjunction.or.normal} ${last}`\n }\n}\n\nexport { commaSeperatedListWithAndConjunction, commaSeperatedListWithOrConjunction }\n"],"names":["commaSeperatedListWithAndConjunction","array","secondToLast","last","commaSeperatedListWithOrConjunction"],"mappings":"AAAK,MAACA,EAAwCC,GAAU,CACtD,GAAGA,EAAM,SAAW,EAClB,OAAOA,EAAM,CAAC,EACT,GAAGA,EAAM,SAAW,EACzB,OAAOA,EAAM,KAAK,IAAI,EAAE,SAAS,YAAY,IAAI,MAAM,GAAG,EACrD,CACL,MAAMC,EAAeD,EAAMA,EAAM,OAAS,CAAC,EACrCE,EAAOF,EAAMA,EAAM,OAAS,CAAC,EAEnC,MAAO,GAAGA,EAAM,MAAM,EAAG,EAAE,EAAE,KAAK,IAAI,CAAC,KAAKC,CAAY,IAAI,EAAE,SAAS,YAAY,IAAI,MAAM,IAAIC,CAAI,EACzG,CACA,EAEMC,EAAuCH,GAAU,CACrD,GAAGA,EAAM,SAAW,EAClB,OAAOA,EAAM,CAAC,EACT,GAAGA,EAAM,SAAW,EACzB,OAAOA,EAAM,KAAK,IAAI,EAAE,SAAS,YAAY,GAAG,MAAM,GAAG,EACpD,CACL,MAAMC,EAAeD,EAAMA,EAAM,OAAS,CAAC,EACrCE,EAAOF,EAAMA,EAAM,OAAS,CAAC,EAEnC,MAAO,GAAGA,EAAM,MAAM,EAAG,EAAE,EAAE,KAAK,IAAI,CAAC,KAAKC,CAAY,IAAI,EAAE,SAAS,YAAY,GAAG,MAAM,IAAIC,CAAI,EACxG,CACA"}