Kargi-Sitesi/.angular/cache/16.2.16/babel-webpack/bfe1b6e05cae397398f7bbf2dafd3577a5515188f3e4cb2da7a447d709293907.json

1 line
8.3 KiB
JSON
Raw Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import createMachine from \"./fsm.js\";\n\n/**\n * @typedef {Object} ShowOverlayData\n * @property {'warning' | 'error'} level\n * @property {Array<string | { moduleIdentifier?: string, moduleName?: string, loc?: string, message?: string }>} messages\n * @property {'build' | 'runtime'} messageSource\n */\n\n/**\n * @typedef {Object} CreateOverlayMachineOptions\n * @property {(data: ShowOverlayData) => void} showOverlay\n * @property {() => void} hideOverlay\n */\n\n/**\n * @param {CreateOverlayMachineOptions} options\n */\nvar createOverlayMachine = function createOverlayMachine(options) {\n var hideOverlay = options.hideOverlay,\n showOverlay = options.showOverlay;\n var overlayMachine = createMachine({\n initial: \"hidden\",\n context: {\n level: \"error\",\n messages: [],\n messageSource: \"build\"\n },\n states: {\n hidden: {\n on: {\n BUILD_ERROR: {\n target: \"displayBuildError\",\n actions: [\"setMessages\", \"showOverlay\"]\n },\n RUNTIME_ERROR: {\n target: \"displayRuntimeError\",\n actions: [\"setMessages\", \"showOverlay\"]\n }\n }\n },\n displayBuildError: {\n on: {\n DISMISS: {\n target: \"hidden\",\n actions: [\"dismissMessages\", \"hideOverlay\"]\n },\n BUILD_ERROR: {\n target: \"displayBuildError\",\n actions: [\"appendMessages\", \"showOverlay\"]\n }\n }\n },\n displayRuntimeError: {\n on: {\n DISMISS: {\n target: \"hidden\",\n actions: [\"dismissMessages\", \"hideOverlay\"]\n },\n RUNTIME_ERROR: {\n target: \"displayRuntimeError\",\n actions: [\"appendMessages\", \"showOverlay\"]\n },\n BUILD_ERROR: {\n target: \"displayBuildError\",\n actions: [\"setMessages\", \"showOverlay\"]\n }\n }\n }\n }\n }, {\n actions: {\n dismissMessages: function dismissMessages() {\n return {\n messages: [],\n level: \"error\",\n messageSource: \"build\"\n };\n },\n appendMessages: function appendMessages(context, event) {\n return {\n messages: context.messages.concat(event.messages),\n level: event.level || context.level,\n messageSource: event.type === \"RUNTIME_ERROR\" ? \"runtime\" : \"build\"\n };\n },\n setMessages: function setMessages(context, event) {\n return {\n messages: event.messages,\n level: event.level || context.level,\n messageSource: event.type === \"RUNTIME_ERROR\" ? \"runtime\" : \"build\"\n };\n },\n hideOverlay: hideOverlay,\n showOverlay: showOverlay\n }\n });\n return overlayMachine;\n};\nexport default createOverlayMachine;","map":{"version":3,"names":["createMachine","createOverlayMachine","options","hideOverlay","showOverlay","overlayMachine","initial","context","level","messages","messageSource","states","hidden","on","BUILD_ERROR","target","actions","RUNTIME_ERROR","displayBuildError","DISMISS","displayRuntimeError","dismissMessages","appendMessages","event","concat","type","setMessages"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/webpack-dev-server/client/overlay/state-machine.js"],"sourcesContent":["import createMachine from \"./fsm.js\";\n\n/**\n * @typedef {Object} ShowOverlayData\n * @property {'warning' | 'error'} level\n * @property {Array<string | { moduleIdentifier?: string, moduleName?: string, loc?: string, message?: string }>} messages\n * @property {'build' | 'runtime'} messageSource\n */\n\n/**\n * @typedef {Object} CreateOverlayMachineOptions\n * @property {(data: ShowOverlayData) => void} showOverlay\n * @property {() => void} hideOverlay\n */\n\n/**\n * @param {CreateOverlayMachineOptions} options\n */\nvar createOverlayMachine = function createOverlayMachine(options)