You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			35 lines
		
	
	
		
			29 KiB
		
	
	
	
		
			JavaScript
		
	
		
		
			
		
	
	
			35 lines
		
	
	
		
			29 KiB
		
	
	
	
		
			JavaScript
		
	
| 
											9 months ago
										 | "use strict"; | ||
|  | /* | ||
|  |  * ATTENTION: An "eval-source-map" devtool has been used. | ||
|  |  * This devtool is neither made for production nor for readable output files. | ||
|  |  * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. | ||
|  |  * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 | ||
|  |  * or disable the default devtool with "devtool: false". | ||
|  |  * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 | ||
|  |  */ | ||
|  | exports.id = "vendor-chunks/@fortaine"; | ||
|  | exports.ids = ["vendor-chunks/@fortaine"]; | ||
|  | exports.modules = { | ||
|  | 
 | ||
|  | /***/ "(ssr)/./node_modules/@fortaine/fetch-event-source/lib/esm/fetch.js": | ||
|  | /*!********************************************************************!*\ | ||
|  |   !*** ./node_modules/@fortaine/fetch-event-source/lib/esm/fetch.js ***! | ||
|  |   \********************************************************************/ | ||
|  | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | ||
|  | 
 | ||
|  | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   EventStreamContentType: () => (/* binding */ EventStreamContentType),\n/* harmony export */   fetchEventSource: () => (/* binding */ fetchEventSource)\n/* harmony export */ });\n/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse.js */ \"(ssr)/./node_modules/@fortaine/fetch-event-source/lib/esm/parse.js\");\nvar __rest = undefined && undefined.__rest || function(s, e) {\n    var t = {};\n    for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for(var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++){\n        if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n    }\n    return t;\n};\n\nconst EventStreamContentType = \"text/event-stream\";\nconst DefaultRetryInterval = 1000;\nconst LastEventId = \"last-event-id\";\nfunction fetchEventSource(input, _a) {\n    var { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch } = _a, rest = __rest(_a, [\n        \"signal\",\n        \"headers\",\n        \"onopen\",\n        \"onmessage\",\n        \"onclose\",\n        \"onerror\",\n        \"openWhenHidden\",\n        \"fetch\"\n    ]);\n    return new Promise((resolve, reject)=>{\n        const headers = Object.assign({}, inputHeaders);\n        if (!headers.accept) {\n            headers.accept = EventStreamContentType;\n        }\n        let curRequestController;\n        function onVisibilityChange() {\n            curRequestController.abort();\n            if (!document.hidden) {\n                create();\n            }\n        }\n        if (typeof document !== \"undefined\" && !openWhenHidden) {\n            document.addEventListener(\"visibilitychange\", onVisibilityChange);\n        }\n        let retryInterval = DefaultRetryInterval;\n        let retryTimer = 0;\n        function dispose() {\n            if (typeof document !== \"undefined\" && !openWhenHidden) {\n                document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n            }\n            clearTimeout(retryTimer);\n            curRequestController.abort();\n        }\n        inputSignal === null || inputSignal === void 0 ? void 0 : inputSignal.addEventListener(\"abort\", ()=>{\n            dispose();\n            resolve();\n        });\n        const fetchFn = inputFetch !== null && inputFetch !== void 0 ? inputFetch : fetch;\n        const onopen = inputOnOpen !== null && inputOnOpen !== void 0 ? inputOnOpen : defaultOnOpen;\n        async function create() {\n            var _a;\n            curRequestController = new AbortController();\n            try {\n                const response = await fetchFn(input, Object.assign(Object.assign({}, rest), {\n                    headers,\n                    signal: curRequestController.signal\n                }));\n                await onopen(response);\n                await (0,_parse_js__WEBPACK_IMPORTED_MODULE_0__.getBytes)(response.body, (0,_parse_js__WEBPACK_IMPORTED_MODULE_0__.getLines)((0,_parse_js__WEBPACK_IMPORTED_MODULE_0__.getMessages)(onmessage, (id)=>{\n                    if (id) {\n                        headers[LastEventId] = id;\n                    } else {\n                        delete headers[LastEventId];\n                    }\n                }, (retry)=>{\n                    retryInterval = retry;\n                })));\n                onclose === null || onclose === void 0 ? void 0 : onclose();\n                dispose();\n                resolve();\n            } catch (err) {\n                if (!curRequestController.signal.aborted) {\n                    try {\n                        const interval = (_a = onerror === null || onerror === void 0 ? void 0 : onerror(err)) !== null && _a !== void 0 ? _a : retryIn | ||
|  | 
 | ||
|  | /***/ }), | ||
|  | 
 | ||
|  | /***/ "(ssr)/./node_modules/@fortaine/fetch-event-source/lib/esm/parse.js": | ||
|  | /*!********************************************************************!*\ | ||
|  |   !*** ./node_modules/@fortaine/fetch-event-source/lib/esm/parse.js ***! | ||
|  |   \********************************************************************/ | ||
|  | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | ||
|  | 
 | ||
|  | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   getBytes: () => (/* binding */ getBytes),\n/* harmony export */   getLines: () => (/* binding */ getLines),\n/* harmony export */   getMessages: () => (/* binding */ getMessages)\n/* harmony export */ });\nasync function getBytes(stream, onChunk) {\n    const reader = stream.getReader();\n    let result;\n    while(!(result = await reader.read()).done){\n        onChunk(result.value);\n    }\n}\nfunction getLines(onLine) {\n    let buffer;\n    let position;\n    let fieldLength;\n    let discardTrailingNewline = false;\n    return function onChunk(arr) {\n        if (buffer === undefined) {\n            buffer = arr;\n            position = 0;\n            fieldLength = -1;\n        } else {\n            buffer = concat(buffer, arr);\n        }\n        const bufLength = buffer.length;\n        let lineStart = 0;\n        while(position < bufLength){\n            if (discardTrailingNewline) {\n                if (buffer[position] === 10) {\n                    lineStart = ++position;\n                }\n                discardTrailingNewline = false;\n            }\n            let lineEnd = -1;\n            for(; position < bufLength && lineEnd === -1; ++position){\n                switch(buffer[position]){\n                    case 58:\n                        if (fieldLength === -1) {\n                            fieldLength = position - lineStart;\n                        }\n                        break;\n                    case 13:\n                        discardTrailingNewline = true;\n                    case 10:\n                        lineEnd = position;\n                        break;\n                }\n            }\n            if (lineEnd === -1) {\n                break;\n            }\n            onLine(buffer.subarray(lineStart, lineEnd), fieldLength);\n            lineStart = position;\n            fieldLength = -1;\n        }\n        if (lineStart === bufLength) {\n            buffer = undefined;\n        } else if (lineStart !== 0) {\n            buffer = buffer.subarray(lineStart);\n            position -= lineStart;\n        }\n    };\n}\nfunction getMessages(onMessage, onId, onRetry) {\n    let message = newMessage();\n    const decoder = new TextDecoder();\n    return function onLine(line, fieldLength) {\n        if (line.length === 0) {\n            onMessage === null || onMessage === void 0 ? void 0 : onMessage(message);\n            message = newMessage();\n        } else if (fieldLength > 0) {\n            const field = decoder.decode(line.subarray(0, fieldLength));\n            const valueOffset = fieldLength + (line[fieldLength + 1] === 32 ? 2 : 1);\n            const value = decoder.decode(line.subarray(valueOffset));\n            switch(field){\n                case \"data\":\n                    message.data = message.data ? message.data + \"\\n\" + value : value;\n                    break;\n                case \"event\":\n                    message.event = value;\n                    break;\n                case \"id\":\n                    onId === null || onId === void 0 ? void 0 : onId(message.id = value);\n                    break;\n                case \"retry\":\n                    const retry = parseInt(value, 10);\n                    if (!isNaN(retry)) {\n                        onRetry === null || onRetry === void 0 ? void 0 : onRetry(message.retry = retry);\n                    }\n                    break;\n            }\n        }\n    };\n}\nfunction concat(a, b) {\n    const res = new Uint8Array(a.length + b.length);\n    res.set(a);\n    res.set(b, a.length);\n    return res;\n}\nfunction newMessage() {\n    return {\n        data: \"\",\n        event: \"\",\n        id: \"\",\n        retry: undefined\n    };\n} //# sourceMappingURL=parse.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQGZvcnRhaW5lL2ZldGNoLWV2ZW50LXN
 | ||
|  | 
 | ||
|  | /***/ }) | ||
|  | 
 | ||
|  | }; | ||
|  | ; |