{"version":3,"file":"openFeature.afb395b0.js","sources":["../../../../middleware/openFeature.ts"],"sourcesContent":["export default defineNuxtRouteMiddleware(to => {\n const openFeature = useOpenFeature()\n\n for (const feature of to.meta.openFeatures as string[]) {\n // consider objects\n if (feature.includes('.')) {\n const [flag, key] = feature.split('.')\n const value = openFeature.getObject(flag, {})\n if (!value[key]) {\n console.log(`nope - ${feature}.${key} is not open!`)\n return navigateTo('/')\n }\n }\n\n if (!openFeature.getBool(feature, false)) {\n console.log(`nope - ${feature} is not open!`)\n return navigateTo('/')\n }\n }\n})\n"],"names":["openFeature","defineNuxtRouteMiddleware","to","useOpenFeature","feature","flag","key","navigateTo"],"mappings":"wDAAA,MAAAA,EAAeC,EAAgCC,GAAA,CAC7C,MAAMF,EAAcG,IAET,UAAAC,KAAWF,EAAG,KAAK,aAA0B,CAElD,GAAAE,EAAQ,SAAS,GAAG,EAAG,CACzB,KAAM,CAACC,EAAMC,CAAG,EAAIF,EAAQ,MAAM,GAAG,EAEjC,GAAA,CADUJ,EAAY,UAAUK,EAAM,CAAE,CAAA,EACjCC,CAAG,EACZ,eAAQ,IAAI,UAAUF,CAAO,IAAIE,CAAG,eAAe,EAC5CC,EAAW,GAAG,CAEzB,CAEA,GAAI,CAACP,EAAY,QAAQI,EAAS,EAAK,EAC7B,eAAA,IAAI,UAAUA,CAAO,eAAe,EACrCG,EAAW,GAAG,CAEzB,CACF,CAAC"}