{"version":3,"file":"stimulus-vite-helpers-DKnW3ZQZ.js","sources":["../../../../../shared/node_modules/stimulus-vite-helpers/dist/index.js"],"sourcesContent":["// src/index.ts\nvar CONTROLLER_FILENAME_REGEX = /^(?:.*?(?:controllers|components)\\/|\\.?\\.\\/)?(.+)(?:[/_-]controller\\..+?)$/;\nfunction registerControllers(application, controllerModules) {\n application.load(definitionsFromGlob(controllerModules));\n}\nfunction definitionsFromGlob(controllerModules) {\n return Object.entries(controllerModules).map(definitionFromEntry).filter((value) => value);\n}\nfunction definitionFromEntry([name, controllerModule]) {\n var _a;\n const identifier = identifierForGlobKey(name);\n const controllerConstructor = (_a = controllerModule.default) != null ? _a : controllerModule;\n if (identifier && typeof controllerConstructor === \"function\")\n return { identifier, controllerConstructor };\n}\nfunction identifierForGlobKey(key) {\n const logicalName = (key.match(CONTROLLER_FILENAME_REGEX) || [])[1];\n if (logicalName)\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n}\nexport {\n CONTROLLER_FILENAME_REGEX,\n definitionsFromGlob,\n identifierForGlobKey,\n registerControllers\n};\n"],"names":["CONTROLLER_FILENAME_REGEX","registerControllers","application","controllerModules","definitionsFromGlob","definitionFromEntry","value","name","controllerModule","_a","identifier","identifierForGlobKey","controllerConstructor","key","logicalName"],"mappings":"AACA,IAAIA,EAA4B,6EAChC,SAASC,EAAoBC,EAAaC,EAAmB,CAC3DD,EAAY,KAAKE,EAAoBD,CAAiB,CAAC,CACzD,CACA,SAASC,EAAoBD,EAAmB,CAC9C,OAAO,OAAO,QAAQA,CAAiB,EAAE,IAAIE,CAAmB,EAAE,OAAQC,GAAUA,CAAK,CAC3F,CACA,SAASD,EAAoB,CAACE,EAAMC,CAAgB,EAAG,CACrD,IAAIC,EACJ,MAAMC,EAAaC,EAAqBJ,CAAI,EACtCK,GAAyBH,EAAKD,EAAiB,UAAY,KAAOC,EAAKD,EAC7E,GAAIE,GAAc,OAAOE,GAA0B,WACjD,MAAO,CAAE,WAAAF,EAAY,sBAAAE,CAAuB,CAChD,CACA,SAASD,EAAqBE,EAAK,CACjC,MAAMC,GAAeD,EAAI,MAAMb,CAAyB,GAAK,CAAE,GAAE,CAAC,EAClE,GAAIc,EACF,OAAOA,EAAY,QAAQ,KAAM,GAAG,EAAE,QAAQ,MAAO,IAAI,CAC7D","x_google_ignoreList":[0]}