create project

This commit is contained in:
ismailsosic
2022-12-27 12:05:56 +01:00
parent 2a33a2d3de
commit cd2143287c
16035 changed files with 2489703 additions and 0 deletions

View File

@@ -0,0 +1,361 @@
import React, { useCallback, useEffect, useReducer, useMemo, // @ts-expect-error TODO-APP: startTransition exists
startTransition } from 'react';
import stripAnsi from 'next/dist/compiled/strip-ansi';
import formatWebpackMessages from '../../dev/error-overlay/format-webpack-messages';
import { useRouter } from '../navigation';
import { errorOverlayReducer } from './internal/error-overlay-reducer';
import { ACTION_BUILD_OK, ACTION_BUILD_ERROR, ACTION_BEFORE_REFRESH, ACTION_REFRESH, ACTION_UNHANDLED_ERROR, ACTION_UNHANDLED_REJECTION } from './internal/error-overlay-reducer';
import { parseStack } from './internal/helpers/parseStack';
import ReactDevOverlay from './internal/ReactDevOverlay';
import { RuntimeErrorHandler, useErrorHandler } from './internal/helpers/use-error-handler';
import { useSendMessage, useWebsocket, useWebsocketPing } from './internal/helpers/use-websocket';
let mostRecentCompilationHash = null;
let __nextDevClientId = Math.round(Math.random() * 100 + Date.now());
// let startLatency = undefined
function onBeforeFastRefresh(dispatcher, hasUpdates) {
if (hasUpdates) {
dispatcher.onBeforeRefresh();
}
}
function onFastRefresh(dispatcher, hasUpdates) {
dispatcher.onBuildOk();
if (hasUpdates) {
dispatcher.onRefresh();
}
}
// There is a newer version of the code available.
function handleAvailableHash(hash) {
// Update last known compilation hash.
mostRecentCompilationHash = hash;
}
// Is there a newer version of this code available?
function isUpdateAvailable() {
/* globals __webpack_hash__ */ // __webpack_hash__ is the hash of the current compilation.
// It's a global variable injected by Webpack.
// @ts-expect-error __webpack_hash__ exists
return mostRecentCompilationHash !== __webpack_hash__;
}
// Webpack disallows updates in other states.
function canApplyUpdates() {
// @ts-expect-error module.hot exists
return module.hot.status() === 'idle';
}
function afterApplyUpdates(fn) {
if (canApplyUpdates()) {
fn();
} else {
function handler(status) {
if (status === 'idle') {
// @ts-expect-error module.hot exists
module.hot.removeStatusHandler(handler);
fn();
}
}
// @ts-expect-error module.hot exists
module.hot.addStatusHandler(handler);
}
}
function performFullReload(err, sendMessage) {
const stackTrace = err && (err.stack && err.stack.split('\n').slice(0, 5).join('\n') || err.message || err + '');
sendMessage(JSON.stringify({
event: 'client-full-reload',
stackTrace,
hadRuntimeError: !!RuntimeErrorHandler.hadRuntimeError
}));
window.location.reload();
}
// Attempt to update code on the fly, fall back to a hard reload.
function tryApplyUpdates(onBeforeUpdate, onHotUpdateSuccess, sendMessage, dispatcher) {
if (!isUpdateAvailable() || !canApplyUpdates()) {
dispatcher.onBuildOk();
return;
}
function handleApplyUpdates(err, updatedModules) {
if (err || RuntimeErrorHandler.hadRuntimeError || !updatedModules) {
if (err) {
console.warn('[Fast Refresh] performing full reload\n\n' + "Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.\n" + 'You might have a file which exports a React component but also exports a value that is imported by a non-React component file.\n' + 'Consider migrating the non-React component export to a separate file and importing it into both files.\n\n' + 'It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.\n' + 'Fast Refresh requires at least one parent function component in your React tree.');
} else if (RuntimeErrorHandler.hadRuntimeError) {
console.warn('[Fast Refresh] performing full reload because your application had an unrecoverable error');
}
performFullReload(err, sendMessage);
return;
}
const hasUpdates = Boolean(updatedModules.length);
if (typeof onHotUpdateSuccess === 'function') {
// Maybe we want to do something.
onHotUpdateSuccess(hasUpdates);
}
if (isUpdateAvailable()) {
// While we were updating, there was a new update! Do it again.
tryApplyUpdates(hasUpdates ? ()=>{} : onBeforeUpdate, hasUpdates ? ()=>dispatcher.onBuildOk() : onHotUpdateSuccess, sendMessage, dispatcher);
} else {
dispatcher.onBuildOk();
if (process.env.__NEXT_TEST_MODE) {
afterApplyUpdates(()=>{
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB();
self.__NEXT_HMR_CB = null;
}
});
}
}
}
// https://webpack.js.org/api/hot-module-replacement/#check
// @ts-expect-error module.hot exists
module.hot.check(/* autoApply */ false).then((updatedModules)=>{
if (!updatedModules) {
return null;
}
if (typeof onBeforeUpdate === 'function') {
const hasUpdates = Boolean(updatedModules.length);
onBeforeUpdate(hasUpdates);
}
// https://webpack.js.org/api/hot-module-replacement/#apply
// @ts-expect-error module.hot exists
return module.hot.apply();
}).then((updatedModules)=>{
handleApplyUpdates(null, updatedModules);
}, (err)=>{
handleApplyUpdates(err, null);
});
}
function processMessage(e, sendMessage, router, dispatcher) {
const obj = JSON.parse(e.data);
switch(obj.action){
case 'building':
{
console.log('[Fast Refresh] rebuilding');
break;
}
case 'built':
case 'sync':
{
if (obj.hash) {
handleAvailableHash(obj.hash);
}
const { errors , warnings } = obj;
const hasErrors = Boolean(errors && errors.length);
// Compilation with errors (e.g. syntax error or missing modules).
if (hasErrors) {
sendMessage(JSON.stringify({
event: 'client-error',
errorCount: errors.length,
clientId: __nextDevClientId
}));
// "Massage" webpack messages.
var formatted = formatWebpackMessages({
errors: errors,
warnings: []
});
// Only show the first error.
dispatcher.onBuildError(formatted.errors[0]);
// Also log them to the console.
for(let i = 0; i < formatted.errors.length; i++){
console.error(stripAnsi(formatted.errors[i]));
}
// Do not attempt to reload now.
// We will reload on next success instead.
if (process.env.__NEXT_TEST_MODE) {
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB(formatted.errors[0]);
self.__NEXT_HMR_CB = null;
}
}
return;
}
const hasWarnings = Boolean(warnings && warnings.length);
if (hasWarnings) {
sendMessage(JSON.stringify({
event: 'client-warning',
warningCount: warnings.length,
clientId: __nextDevClientId
}));
// Compilation with warnings (e.g. ESLint).
const isHotUpdate = obj.action !== 'sync';
// Print warnings to the console.
const formattedMessages = formatWebpackMessages({
warnings: warnings,
errors: []
});
for(let i = 0; i < formattedMessages.warnings.length; i++){
if (i === 5) {
console.warn('There were more warnings in other files.\n' + 'You can find a complete log in the terminal.');
break;
}
console.warn(stripAnsi(formattedMessages.warnings[i]));
}
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onBeforeHotUpdate(hasUpdates) {
onBeforeFastRefresh(dispatcher, hasUpdates);
}, function onSuccessfulHotUpdate(hasUpdates) {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
onFastRefresh(dispatcher, hasUpdates);
}, sendMessage, dispatcher);
}
return;
}
sendMessage(JSON.stringify({
event: 'client-success',
clientId: __nextDevClientId
}));
const isHotUpdate = obj.action !== 'sync' || (!window.__NEXT_DATA__ || window.__NEXT_DATA__.page !== '/_error') && isUpdateAvailable();
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onBeforeHotUpdate(hasUpdates) {
onBeforeFastRefresh(dispatcher, hasUpdates);
}, function onSuccessfulHotUpdate(hasUpdates) {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
onFastRefresh(dispatcher, hasUpdates);
}, sendMessage, dispatcher);
}
return;
}
// TODO-APP: make server component change more granular
case 'serverComponentChanges':
{
sendMessage(JSON.stringify({
event: 'server-component-reload-page',
clientId: __nextDevClientId
}));
if (RuntimeErrorHandler.hadRuntimeError) {
return window.location.reload();
}
startTransition(()=>{
router.refresh();
dispatcher.onRefresh();
});
if (process.env.__NEXT_TEST_MODE) {
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB();
self.__NEXT_HMR_CB = null;
}
}
return;
}
case 'reloadPage':
{
sendMessage(JSON.stringify({
event: 'client-reload-page',
clientId: __nextDevClientId
}));
return window.location.reload();
}
case 'removedPage':
{
// TODO-APP: potentially only refresh if the currently viewed page was removed.
router.refresh();
return;
}
case 'addedPage':
{
// TODO-APP: potentially only refresh if the currently viewed page was added.
router.refresh();
return;
}
case 'pong':
{
const { invalid } = obj;
if (invalid) {
// Payload can be invalid even if the page does exist.
// So, we check if it can be created.
router.refresh();
}
return;
}
default:
{
throw new Error('Unexpected action ' + obj.action);
}
}
}
export default function HotReload({ assetPrefix , children }) {
const [state, dispatch] = useReducer(errorOverlayReducer, {
nextId: 1,
buildError: null,
errors: [],
refreshState: {
type: 'idle'
}
});
const dispatcher = useMemo(()=>{
return {
onBuildOk () {
dispatch({
type: ACTION_BUILD_OK
});
},
onBuildError (message) {
dispatch({
type: ACTION_BUILD_ERROR,
message
});
},
onBeforeRefresh () {
dispatch({
type: ACTION_BEFORE_REFRESH
});
},
onRefresh () {
dispatch({
type: ACTION_REFRESH
});
}
};
}, [
dispatch
]);
const handleOnUnhandledError = useCallback((error)=>{
dispatch({
type: ACTION_UNHANDLED_ERROR,
reason: error,
frames: parseStack(error.stack)
});
}, []);
const handleOnUnhandledRejection = useCallback((reason)=>{
dispatch({
type: ACTION_UNHANDLED_REJECTION,
reason: reason,
frames: parseStack(reason.stack)
});
}, []);
const handleOnReactError = useCallback(()=>{
RuntimeErrorHandler.hadRuntimeError = true;
}, []);
useErrorHandler(handleOnUnhandledError, handleOnUnhandledRejection);
const webSocketRef = useWebsocket(assetPrefix);
useWebsocketPing(webSocketRef);
const sendMessage = useSendMessage(webSocketRef);
const router = useRouter();
useEffect(()=>{
const handler = (event)=>{
if (event.data.indexOf('action') === -1 && // TODO-APP: clean this up for consistency
event.data.indexOf('pong') === -1) {
return;
}
try {
processMessage(event, sendMessage, router, dispatcher);
} catch (ex) {
console.warn('Invalid HMR message: ' + event.data + '\n', ex);
}
};
const websocket = webSocketRef.current;
if (websocket) {
websocket.addEventListener('message', handler);
}
return ()=>websocket && websocket.removeEventListener('message', handler);
}, [
sendMessage,
router,
webSocketRef,
dispatcher
]);
return /*#__PURE__*/ React.createElement(ReactDevOverlay, {
onReactError: handleOnReactError,
state: state
}, children);
};
//# sourceMappingURL=hot-reloader-client.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,60 @@
import * as React from 'react';
import { ACTION_UNHANDLED_ERROR } from './error-overlay-reducer';
import { ShadowPortal } from './components/ShadowPortal';
import { BuildError } from './container/BuildError';
import { Errors } from './container/Errors';
import { Base } from './styles/Base';
import { ComponentStyles } from './styles/ComponentStyles';
import { CssReset } from './styles/CssReset';
import { parseStack } from './helpers/parseStack';
import { RootLayoutError } from './container/RootLayoutError';
class ReactDevOverlay extends React.PureComponent {
static getDerivedStateFromError(error) {
const e = error;
const event = {
type: ACTION_UNHANDLED_ERROR,
reason: error,
frames: parseStack(e.stack)
};
const errorEvent = {
id: 0,
event
};
return {
reactError: errorEvent
};
}
componentDidCatch(componentErr) {
this.props.onReactError(componentErr);
}
render() {
const { state , children } = this.props;
const { reactError } = this.state;
const hasBuildError = state.buildError != null;
const hasRuntimeErrors = Boolean(state.errors.length);
const rootLayoutMissingTagsError = state.rootLayoutMissingTagsError;
const isMounted = hasBuildError || hasRuntimeErrors || reactError || rootLayoutMissingTagsError;
return /*#__PURE__*/ React.createElement(React.Fragment, null, reactError ? /*#__PURE__*/ React.createElement("html", null, /*#__PURE__*/ React.createElement("head", null), /*#__PURE__*/ React.createElement("body", null)) : children, isMounted ? /*#__PURE__*/ React.createElement(ShadowPortal, null, /*#__PURE__*/ React.createElement(CssReset, null), /*#__PURE__*/ React.createElement(Base, null), /*#__PURE__*/ React.createElement(ComponentStyles, null), rootLayoutMissingTagsError ? /*#__PURE__*/ React.createElement(RootLayoutError, {
missingTags: rootLayoutMissingTagsError.missingTags
}) : hasBuildError ? /*#__PURE__*/ React.createElement(BuildError, {
message: state.buildError
}) : reactError ? /*#__PURE__*/ React.createElement(Errors, {
initialDisplayState: "fullscreen",
errors: [
reactError
]
}) : hasRuntimeErrors ? /*#__PURE__*/ React.createElement(Errors, {
initialDisplayState: "minimized",
errors: state.errors
}) : undefined) : undefined);
}
constructor(...args){
super(...args);
this.state = {
reactError: null
};
}
}
export default ReactDevOverlay;
//# sourceMappingURL=ReactDevOverlay.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../client/components/react-dev-overlay/internal/ReactDevOverlay.tsx"],"names":["React","ACTION_UNHANDLED_ERROR","ShadowPortal","BuildError","Errors","Base","ComponentStyles","CssReset","parseStack","RootLayoutError","ReactDevOverlay","PureComponent","getDerivedStateFromError","error","e","event","type","reason","frames","stack","errorEvent","id","reactError","componentDidCatch","componentErr","props","onReactError","render","state","children","hasBuildError","buildError","hasRuntimeErrors","Boolean","errors","length","rootLayoutMissingTagsError","isMounted","html","head","body","missingTags","message","initialDisplayState","undefined"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SACEC,sBAAsB,QAGjB,yBAAyB,CAAA;AAEhC,SAASC,YAAY,QAAQ,2BAA2B,CAAA;AACxD,SAASC,UAAU,QAAQ,wBAAwB,CAAA;AACnD,SAASC,MAAM,QAA6B,oBAAoB,CAAA;AAChE,SAASC,IAAI,QAAQ,eAAe,CAAA;AACpC,SAASC,eAAe,QAAQ,0BAA0B,CAAA;AAC1D,SAASC,QAAQ,QAAQ,mBAAmB,CAAA;AAC5C,SAASC,UAAU,QAAQ,sBAAsB,CAAA;AACjD,SAASC,eAAe,QAAQ,6BAA6B,CAAA;AAK7D,MAAMC,eAAe,SAASV,KAAK,CAACW,aAAa;IAU/C,OAAOC,wBAAwB,CAACC,KAAY,EAAwB;QAClE,MAAMC,CAAC,GAAGD,KAAK;QACf,MAAME,KAAK,GAAyB;YAClCC,IAAI,EAAEf,sBAAsB;YAC5BgB,MAAM,EAAEJ,KAAK;YACbK,MAAM,EAAEV,UAAU,CAACM,CAAC,CAACK,KAAK,CAAE;SAC7B;QACD,MAAMC,UAAU,GAAwB;YACtCC,EAAE,EAAE,CAAC;YACLN,KAAK;SACN;QACD,OAAO;YAAEO,UAAU,EAAEF,UAAU;SAAE,CAAA;KAClC;IAEDG,iBAAiB,CAACC,YAAmB,EAAE;QACrC,IAAI,CAACC,KAAK,CAACC,YAAY,CAACF,YAAY,CAAC;KACtC;IAEDG,MAAM,GAAG;QACP,MAAM,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAG,IAAI,CAACJ,KAAK;QACtC,MAAM,EAAEH,UAAU,CAAA,EAAE,GAAG,IAAI,CAACM,KAAK;QAEjC,MAAME,aAAa,GAAGF,KAAK,CAACG,UAAU,IAAI,IAAI;QAC9C,MAAMC,gBAAgB,GAAGC,OAAO,CAACL,KAAK,CAACM,MAAM,CAACC,MAAM,CAAC;QACrD,MAAMC,0BAA0B,GAAGR,KAAK,CAACQ,0BAA0B;QACnE,MAAMC,SAAS,GACbP,aAAa,IACbE,gBAAgB,IAChBV,UAAU,IACVc,0BAA0B;QAE5B,qBACE,0CACGd,UAAU,iBACT,oBAACgB,MAAI,sBACH,oBAACC,MAAI,OAAQ,gBACb,oBAACC,MAAI,OAAQ,CACR,GAEPX,QAAQ,AACT,EACAQ,SAAS,iBACR,oBAACnC,YAAY,sBACX,oBAACK,QAAQ,OAAG,gBACZ,oBAACF,IAAI,OAAG,gBACR,oBAACC,eAAe,OAAG,EAElB8B,0BAA0B,iBACzB,oBAAC3B,eAAe;YACdgC,WAAW,EAAEL,0BAA0B,CAACK,WAAW;UACnD,GACAX,aAAa,iBACf,oBAAC3B,UAAU;YAACuC,OAAO,EAAEd,KAAK,CAACG,UAAU;UAAK,GACxCT,UAAU,iBACZ,oBAAClB,MAAM;YAACuC,mBAAmB,EAAC,YAAY;YAACT,MAAM,EAAE;gBAACZ,UAAU;aAAC;UAAI,GAC/DU,gBAAgB,iBAClB,oBAAC5B,MAAM;YAACuC,mBAAmB,EAAC,WAAW;YAACT,MAAM,EAAEN,KAAK,CAACM,MAAM;UAAI,GAC9DU,SAAS,CACA,GACbA,SAAS,CACZ,CACJ;KACF;;;QAhEDhB,KAAAA,KAAK,GAAG;YAAEN,UAAU,EAAE,IAAI;SAAE,CAAA;;CAiE7B;AAED,eAAeZ,eAAe,CAAA"}

View File

@@ -0,0 +1,77 @@
import _extends from "@swc/helpers/src/_extends.mjs";
import Anser from 'next/dist/compiled/anser';
import * as React from 'react';
import stripAnsi from 'next/dist/compiled/strip-ansi';
import { getFrameSource } from '../../helpers/stack-frame';
export const CodeFrame = function CodeFrame({ stackFrame , codeFrame , }) {
// Strip leading spaces out of the code frame:
const formattedFrame = React.useMemo(()=>{
const lines = codeFrame.split(/\r?\n/g);
const prefixLength = lines.map((line)=>/^>? +\d+ +\| [ ]+/.exec(stripAnsi(line)) === null ? null : /^>? +\d+ +\| ( *)/.exec(stripAnsi(line))).filter(Boolean).map((v)=>v.pop()).reduce((c, n)=>isNaN(c) ? n.length : Math.min(c, n.length), NaN);
if (prefixLength > 1) {
const p = ' '.repeat(prefixLength);
return lines.map((line, a)=>~(a = line.indexOf('|')) ? line.substring(0, a) + line.substring(a).replace(p, '') : line).join('\n');
}
return lines.join('\n');
}, [
codeFrame
]);
const decoded = React.useMemo(()=>{
return Anser.ansiToJson(formattedFrame, {
json: true,
use_classes: true,
remove_empty: true
});
}, [
formattedFrame
]);
const open = React.useCallback(()=>{
const params = new URLSearchParams();
for(const key in stackFrame){
var _key;
params.append(key, ((_key = stackFrame[key]) != null ? _key : '').toString());
}
self.fetch(`${process.env.__NEXT_ROUTER_BASEPATH || ''}/__nextjs_launch-editor?${params.toString()}`).then(()=>{}, ()=>{
console.error('There was an issue opening this code in your editor.');
});
}, [
stackFrame
]);
// TODO: make the caret absolute
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-codeframe": true
}, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("p", {
role: "link",
onClick: open,
tabIndex: 1,
title: "Click to open in your editor"
}, /*#__PURE__*/ React.createElement("span", null, getFrameSource(stackFrame), " @ ", stackFrame.methodName), /*#__PURE__*/ React.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, /*#__PURE__*/ React.createElement("path", {
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
}), /*#__PURE__*/ React.createElement("polyline", {
points: "15 3 21 3 21 9"
}), /*#__PURE__*/ React.createElement("line", {
x1: "10",
y1: "14",
x2: "21",
y2: "3"
})))), /*#__PURE__*/ React.createElement("pre", null, decoded.map((entry, index)=>/*#__PURE__*/ React.createElement("span", {
key: `frame-${index}`,
style: _extends({
color: entry.fg ? `var(--color-${entry.fg})` : undefined
}, entry.decoration === 'bold' ? {
fontWeight: 800
} : entry.decoration === 'italic' ? {
fontStyle: 'italic'
} : undefined)
}, entry.content))));
};
//# sourceMappingURL=CodeFrame.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx"],"names":["Anser","React","stripAnsi","getFrameSource","CodeFrame","stackFrame","codeFrame","formattedFrame","useMemo","lines","split","prefixLength","map","line","exec","filter","Boolean","v","pop","reduce","c","n","isNaN","length","Math","min","NaN","p","repeat","a","indexOf","substring","replace","join","decoded","ansiToJson","json","use_classes","remove_empty","open","useCallback","params","URLSearchParams","key","append","toString","self","fetch","process","env","__NEXT_ROUTER_BASEPATH","then","console","error","div","data-nextjs-codeframe","role","onClick","tabIndex","title","span","methodName","svg","xmlns","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","path","d","polyline","points","x1","y1","x2","y2","pre","entry","index","style","color","fg","undefined","decoration","fontWeight","fontStyle","content"],"mappings":"AAAA;AAAA,OAAOA,KAAK,MAAM,0BAA0B,CAAA;AAC5C,YAAYC,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAOC,SAAS,MAAM,+BAA+B,CAAA;AACrD,SAASC,cAAc,QAAQ,2BAA2B,CAAA;AAI1D,OAAO,MAAMC,SAAS,GAA6B,SAASA,SAAS,CAAC,EACpEC,UAAU,CAAA,EACVC,SAAS,CAAA,IACV,EAAE;IACD,8CAA8C;IAC9C,MAAMC,cAAc,GAAGN,KAAK,CAACO,OAAO,CAAS,IAAM;QACjD,MAAMC,KAAK,GAAGH,SAAS,CAACI,KAAK,UAAU;QACvC,MAAMC,YAAY,GAAGF,KAAK,CACvBG,GAAG,CAAC,CAACC,IAAI,GACR,oBAAoBC,IAAI,CA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oBAAC5D,MAAI;QAAC6D,EAAE,EAAC,IAAI;QAACC,EAAE,EAAC,IAAI;QAACC,EAAE,EAAC,IAAI;QAACC,EAAE,EAAC,GAAG;MAAQ,CACxC,CACJ,CACA,gBACN,oBAACC,KAAG,QACD5C,OAAO,CAACtB,GAAG,CAAC,CAACmE,KAAK,EAAEC,KAAK,iBACxB,oBAACpB,MAAI;YACHjB,GAAG,EAAE,CAAC,MAAM,EAAEqC,KAAK,CAAC,CAAC;YACrBC,KAAK,EAAE;gBACLC,KAAK,EAAEH,KAAK,CAACI,EAAE,GAAG,CAAC,YAAY,EAAEJ,KAAK,CAACI,EAAE,CAAC,CAAC,CAAC,GAAGC,SAAS;eACpDL,KAAK,CAACM,UAAU,KAAK,MAAM,GAC3B;gBAAEC,UAAU,EAAE,GAAG;aAAE,GACnBP,KAAK,CAACM,UAAU,KAAK,QAAQ,GAC7B;gBAAEE,SAAS,EAAE,QAAQ;aAAE,GACvBH,SAAS,CACd;WAEAL,KAAK,CAACS,OAAO,CACT,AACR,CAAC,CACE,CACF,CACP;CACF,CAAA"}

View File

@@ -0,0 +1,3 @@
export { CodeFrame } from './CodeFrame';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/CodeFrame/index.tsx"],"names":["CodeFrame"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa,CAAA"}

View File

@@ -0,0 +1,52 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-codeframe] {
overflow: auto;
border-radius: var(--size-gap-half);
background-color: var(--color-ansi-bg);
color: var(--color-ansi-fg);
}
[data-nextjs-codeframe]::selection,
[data-nextjs-codeframe] *::selection {
background-color: var(--color-ansi-selection);
}
[data-nextjs-codeframe] * {
color: inherit;
background-color: transparent;
font-family: var(--font-stack-monospace);
}
[data-nextjs-codeframe] > * {
margin: 0;
padding: calc(var(--size-gap) + var(--size-gap-half))
calc(var(--size-gap-double) + var(--size-gap-half));
}
[data-nextjs-codeframe] > div {
display: inline-block;
width: auto;
min-width: 100%;
border-bottom: 1px solid var(--color-ansi-bright-black);
}
[data-nextjs-codeframe] > div > p {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
margin: 0;
}
[data-nextjs-codeframe] > div > p:hover {
text-decoration: underline dotted;
}
[data-nextjs-codeframe] div > p > svg {
width: auto;
height: 1em;
margin-left: 8px;
}
[data-nextjs-codeframe] div > pre {
overflow: hidden;
display: inline-block;
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/CodeFrame/styles.tsx"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,55 @@
import _object_without_properties_loose from "@swc/helpers/src/_object_without_properties_loose.mjs";
import * as React from 'react';
import { useOnClickOutside } from '../../hooks/use-on-click-outside';
const Dialog = function Dialog(_param) {
var { children , type , onClose } = _param, props = _object_without_properties_loose(_param, [
"children",
"type",
"onClose"
]);
const [dialog, setDialog] = React.useState(null);
const onDialog = React.useCallback((node)=>{
setDialog(node);
}, []);
useOnClickOutside(dialog, onClose);
// Make HTMLElements with `role=link` accessible to be triggered by the
// keyboard, i.e. [Enter].
React.useEffect(()=>{
if (dialog == null) {
return;
}
const root = dialog.getRootNode();
// Always true, but we do this for TypeScript:
if (!(root instanceof ShadowRoot)) {
return;
}
const shadowRoot = root;
function handler(e) {
const el = shadowRoot.activeElement;
if (e.key === 'Enter' && el instanceof HTMLElement && el.getAttribute('role') === 'link') {
e.preventDefault();
e.stopPropagation();
el.click();
}
}
shadowRoot.addEventListener('keydown', handler);
return ()=>shadowRoot.removeEventListener('keydown', handler);
}, [
dialog
]);
return /*#__PURE__*/ React.createElement("div", {
ref: onDialog,
"data-nextjs-dialog": true,
tabIndex: -1,
role: "dialog",
"aria-labelledby": props['aria-labelledby'],
"aria-describedby": props['aria-describedby'],
"aria-modal": "true"
}, /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-banner": true,
className: `banner-${type}`
}), children);
};
export { Dialog };
//# sourceMappingURL=Dialog.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx"],"names":["React","useOnClickOutside","Dialog","children","type","onClose","props","dialog","setDialog","useState","onDialog","useCallback","node","useEffect","root","getRootNode","ShadowRoot","shadowRoot","handler","e","el","activeElement","key","HTMLElement","getAttribute","preventDefault","stopPropagation","click","addEventListener","removeEventListener","div","ref","data-nextjs-dialog","tabIndex","role","aria-labelledby","aria-describedby","aria-modal","data-nextjs-dialog-banner","className"],"mappings":"AAAA;AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,iBAAiB,QAAQ,kCAAkC,CAAA;AASpE,MAAMC,MAAM,GAA0B,SAASA,MAAM,CAAC,MAKrD,EAAE;QALmD,EACpDC,QAAQ,CAAA,EACRC,IAAI,CAAA,EACJC,OAAO,CAAA,EAER,GALqD,MAKrD,EADIC,KAAK,oCAJ4C,MAKrD;QAJCH,UAAQ;QACRC,MAAI;QACJC,SAAO;;IAGP,MAAM,CAACE,MAAM,EAAEC,SAAS,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAAwB,IAAI,CAAC;IACvE,MAAMC,QAAQ,GAAGV,KAAK,CAACW,WAAW,CAAC,CAACC,IAAI,GAAK;QAC3CJ,SAAS,CAACI,IAAI,CAAC;KAChB,EAAE,EAAE,CAAC;IACNX,iBAAiB,CAACM,MAAM,EAAEF,OAAO,CAAC;IAElC,uEAAuE;IACvE,0BAA0B;IAC1BL,KAAK,CAACa,SAAS,CAAC,IAAM;QACpB,IAAIN,MAAM,IAAI,IAAI,EAAE;YAClB,OAAM;SACP;QAED,MAAMO,IAAI,GAAGP,MAAM,CAACQ,WAAW,EAAE;QACjC,8CAA8C;QAC9C,IAAI,CAAC,CAACD,IAAI,YAAYE,UAAU,CAAC,EAAE;YACjC,OAAM;SACP;QACD,MAAMC,UAAU,GAAGH,IAAI;QACvB,SAASI,OAAO,CAACC,CAAgB,EAAE;YACjC,MAAMC,EAAE,GAAGH,UAAU,CAACI,aAAa;YACnC,IACEF,CAAC,CAACG,GAAG,KAAK,OAAO,IACjBF,EAAE,YAAYG,WAAW,IACzBH,EAAE,CAACI,YAAY,CAAC,MAAM,CAAC,KAAK,MAAM,EAClC;gBACAL,CAAC,CAACM,cAAc,EAAE;gBAClBN,CAAC,CAACO,eAAe,EAAE;gBAEnBN,EAAE,CAACO,KAAK,EAAE;aACX;SACF;QAEDV,UAAU,CAACW,gBAAgB,CAAC,SAAS,EAAEV,OAAO,CAAkB;QAChE,OAAO,IACLD,UAAU,CAACY,mBAAmB,CAAC,SAAS,EAAEX,OAAO,CAAkB,CAAA;KACtE,EAAE;QAACX,MAAM;KAAC,CAAC;IAEZ,qBACE,oBAACuB,KAAG;QACFC,GAAG,EAAErB,QAAQ;QACbsB,oBAAkB,EAAlBA,IAAkB;QAClBC,QAAQ,EAAE,CAAC,CAAC;QACZC,IAAI,EAAC,QAAQ;QACbC,iBAAe,EAAE7B,KAAK,CAAC,iBAAiB,CAAC;QACzC8B,kBAAgB,EAAE9B,KAAK,CAAC,kBAAkB,CAAC;QAC3C+B,YAAU,EAAC,MAAM;qBAEjB,oBAACP,KAAG;QAACQ,2BAAyB,EAAzBA,IAAyB;QAACC,SAAS,EAAE,CAAC,OAAO,EAAEnC,IAAI,CAAC,CAAC;MAAI,EAC7DD,QAAQ,CACL,CACP;CACF;AAED,SAASD,MAAM,GAAE"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
const DialogBody = function DialogBody({ children , className , }) {
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-body": true,
className: className
}, children);
};
export { DialogBody };
//# sourceMappingURL=DialogBody.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx"],"names":["React","DialogBody","children","className","div","data-nextjs-dialog-body"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAMC,UAAU,GAA8B,SAASA,UAAU,CAAC,EAChEC,QAAQ,CAAA,EACRC,SAAS,CAAA,IACV,EAAE;IACD,qBACE,oBAACC,KAAG;QAACC,yBAAuB,EAAvBA,IAAuB;QAACF,SAAS,EAAEA,SAAS;OAC9CD,QAAQ,CACL,CACP;CACF;AAED,SAASD,UAAU,GAAE"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
const DialogContent = function DialogContent({ children , className , }) {
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-content": true,
className: className
}, children);
};
export { DialogContent };
//# sourceMappingURL=DialogContent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx"],"names":["React","DialogContent","children","className","div","data-nextjs-dialog-content"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAMC,aAAa,GAAiC,SAASA,aAAa,CAAC,EACzEC,QAAQ,CAAA,EACRC,SAAS,CAAA,IACV,EAAE;IACD,qBACE,oBAACC,KAAG;QAACC,4BAA0B,EAA1BA,IAA0B;QAACF,SAAS,EAAEA,SAAS;OACjDD,QAAQ,CACL,CACP;CACF;AAED,SAASD,aAAa,GAAE"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
const DialogHeader = function DialogHeader({ children , className , }) {
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-header": true,
className: className
}, children);
};
export { DialogHeader };
//# sourceMappingURL=DialogHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx"],"names":["React","DialogHeader","children","className","div","data-nextjs-dialog-header"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAMC,YAAY,GAAgC,SAASA,YAAY,CAAC,EACtEC,QAAQ,CAAA,EACRC,SAAS,CAAA,IACV,EAAE;IACD,qBACE,oBAACC,KAAG;QAACC,2BAAyB,EAAzBA,IAAyB;QAACF,SAAS,EAAEA,SAAS;OAChDD,QAAQ,CACL,CACP;CACF;AAED,SAASD,YAAY,GAAE"}

View File

@@ -0,0 +1,7 @@
export { Dialog } from './Dialog';
export { DialogBody } from './DialogBody';
export { DialogContent } from './DialogContent';
export { DialogHeader } from './DialogHeader';
export { styles } from './styles';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/index.ts"],"names":["Dialog","DialogBody","DialogContent","DialogHeader","styles"],"mappings":"AAAA,SAASA,MAAM,QAAQ,UAAU,CAAA;AACjC,SAASC,UAAU,QAAQ,cAAc,CAAA;AACzC,SAASC,aAAa,QAAQ,iBAAiB,CAAA;AAC/C,SAASC,YAAY,QAAQ,gBAAgB,CAAA;AAC7C,SAASC,MAAM,QAAQ,UAAU,CAAA"}

View File

@@ -0,0 +1,91 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-dialog] {
display: flex;
flex-direction: column;
width: 100%;
margin-right: auto;
margin-left: auto;
outline: none;
background: white;
border-radius: var(--size-gap);
box-shadow: 0 var(--size-gap-half) var(--size-gap-double)
rgba(0, 0, 0, 0.25);
max-height: calc(100% - 56px);
overflow-y: hidden;
}
@media (max-height: 812px) {
[data-nextjs-dialog-overlay] {
max-height: calc(100% - 15px);
}
}
@media (min-width: 576px) {
[data-nextjs-dialog] {
max-width: 540px;
box-shadow: 0 var(--size-gap) var(--size-gap-quad) rgba(0, 0, 0, 0.25);
}
}
@media (min-width: 768px) {
[data-nextjs-dialog] {
max-width: 720px;
}
}
@media (min-width: 992px) {
[data-nextjs-dialog] {
max-width: 960px;
}
}
[data-nextjs-dialog-banner] {
position: relative;
}
[data-nextjs-dialog-banner].banner-warning {
border-color: var(--color-ansi-yellow);
}
[data-nextjs-dialog-banner].banner-error {
border-color: var(--color-ansi-red);
}
[data-nextjs-dialog-banner]::after {
z-index: 2;
content: '';
position: absolute;
top: 0;
right: 0;
width: 100%;
/* banner width: */
border-top-width: var(--size-gap-half);
border-bottom-width: 0;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: inherit;
border-bottom-color: transparent;
}
[data-nextjs-dialog-content] {
overflow-y: auto;
border: none;
margin: 0;
/* calc(padding + banner width offset) */
padding: calc(var(--size-gap-double) + var(--size-gap-half))
var(--size-gap-double);
height: 100%;
display: flex;
flex-direction: column;
}
[data-nextjs-dialog-content] > [data-nextjs-dialog-header] {
flex-shrink: 0;
margin-bottom: var(--size-gap-double);
}
[data-nextjs-dialog-content] > [data-nextjs-dialog-body] {
position: relative;
flex: 1 1 auto;
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Dialog/styles.ts"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,134 @@
import * as React from 'react';
import { CloseIcon } from '../../icons/CloseIcon';
const LeftRightDialogHeader = function LeftRightDialogHeader({ children , className , previous , next , close , }) {
const buttonLeft = React.useRef(null);
const buttonRight = React.useRef(null);
const buttonClose = React.useRef(null);
const [nav, setNav] = React.useState(null);
const onNav = React.useCallback((el)=>{
setNav(el);
}, []);
React.useEffect(()=>{
if (nav == null) {
return;
}
const root = nav.getRootNode();
const d = self.document;
function handler(e) {
if (e.key === 'ArrowLeft') {
e.stopPropagation();
if (buttonLeft.current) {
buttonLeft.current.focus();
}
previous && previous();
} else if (e.key === 'ArrowRight') {
e.stopPropagation();
if (buttonRight.current) {
buttonRight.current.focus();
}
next && next();
} else if (e.key === 'Escape') {
e.stopPropagation();
if (root instanceof ShadowRoot) {
const a = root.activeElement;
if (a && a !== buttonClose.current && a instanceof HTMLElement) {
a.blur();
return;
}
}
if (close) {
close();
}
}
}
root.addEventListener('keydown', handler);
if (root !== d) {
d.addEventListener('keydown', handler);
}
return function() {
root.removeEventListener('keydown', handler);
if (root !== d) {
d.removeEventListener('keydown', handler);
}
};
}, [
close,
nav,
next,
previous
]);
// Unlock focus for browsers like Firefox, that break all user focus if the
// currently focused item becomes disabled.
React.useEffect(()=>{
if (nav == null) {
return;
}
const root = nav.getRootNode();
// Always true, but we do this for TypeScript:
if (root instanceof ShadowRoot) {
const a = root.activeElement;
if (previous == null) {
if (buttonLeft.current && a === buttonLeft.current) {
buttonLeft.current.blur();
}
} else if (next == null) {
if (buttonRight.current && a === buttonRight.current) {
buttonRight.current.blur();
}
}
}
}, [
nav,
next,
previous
]);
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-left-right": true,
className: className
}, /*#__PURE__*/ React.createElement("nav", {
ref: onNav
}, /*#__PURE__*/ React.createElement("button", {
ref: buttonLeft,
type: "button",
disabled: previous == null ? true : undefined,
"aria-disabled": previous == null ? true : undefined,
onClick: previous != null ? previous : undefined
}, /*#__PURE__*/ React.createElement("svg", {
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/ React.createElement("path", {
d: "M6.99996 1.16666L1.16663 6.99999L6.99996 12.8333M12.8333 6.99999H1.99996H12.8333Z",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}))), /*#__PURE__*/ React.createElement("button", {
ref: buttonRight,
type: "button",
disabled: next == null ? true : undefined,
"aria-disabled": next == null ? true : undefined,
onClick: next != null ? next : undefined
}, /*#__PURE__*/ React.createElement("svg", {
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/ React.createElement("path", {
d: "M6.99996 1.16666L12.8333 6.99999L6.99996 12.8333M1.16663 6.99999H12H1.16663Z",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}))), "\xa0", children), close ? /*#__PURE__*/ React.createElement("button", {
"data-nextjs-errors-dialog-left-right-close-button": true,
ref: buttonClose,
type: "button",
onClick: close,
"aria-label": "Close"
}, /*#__PURE__*/ React.createElement("span", {
"aria-hidden": "true"
}, /*#__PURE__*/ React.createElement(CloseIcon, null))) : null);
};
export { LeftRightDialogHeader };
//# sourceMappingURL=LeftRightDialogHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx"],"names":["React","CloseIcon","LeftRightDialogHeader","children","className","previous","next","close","buttonLeft","useRef","buttonRight","buttonClose","nav","setNav","useState","onNav","useCallback","el","useEffect","root","getRootNode","d","self","document","handler","e","key","stopPropagation","current","focus","ShadowRoot","a","activeElement","HTMLElement","blur","addEventListener","removeEventListener","div","data-nextjs-dialog-left-right","ref","button","type","disabled","undefined","aria-disabled","onClick","svg","viewBox","fill","xmlns","path","stroke","strokeWidth","strokeLinecap","strokeLinejoin","data-nextjs-errors-dialog-left-right-close-button","aria-label","span","aria-hidden"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,SAAS,QAAQ,uBAAuB,CAAA;AASjD,MAAMC,qBAAqB,GACzB,SAASA,qBAAqB,CAAC,EAC7BC,QAAQ,CAAA,EACRC,SAAS,CAAA,EACTC,QAAQ,CAAA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,EAAC,8EAA8E;QAChF8B,MAAM,EAAC,cAAc;QACrBC,WAAW,EAAC,GAAG;QACfC,aAAa,EAAC,OAAO;QACrBC,cAAc,EAAC,OAAO;MACtB,CACE,CACC,EAAA,MAET,EAACnD,QAAQ,CACL,EACLI,KAAK,iBACJ,oBAACiC,QAAM;QACLe,mDAAiD,EAAjDA,IAAiD;QACjDhB,GAAG,EAAE5B,WAAW;QAChB8B,IAAI,EAAC,QAAQ;QACbI,OAAO,EAAEtC,KAAK;QACdiD,YAAU,EAAC,OAAO;qBAElB,oBAACC,MAAI;QAACC,aAAW,EAAC,MAAM;qBACtB,oBAACzD,SAAS,OAAG,CACR,CACA,GACP,IAAI,CACJ,CACP;CACF;AAEH,SAASC,qBAAqB,GAAE"}

View File

@@ -0,0 +1,4 @@
export { LeftRightDialogHeader } from './LeftRightDialogHeader';
export { styles } from './styles';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/index.ts"],"names":["LeftRightDialogHeader","styles"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,yBAAyB,CAAA;AAC/D,SAASC,MAAM,QAAQ,UAAU,CAAA"}

View File

@@ -0,0 +1,61 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-dialog-left-right] {
display: flex;
flex-direction: row;
align-content: center;
align-items: center;
justify-content: space-between;
}
[data-nextjs-dialog-left-right] > nav > button {
display: inline-flex;
align-items: center;
justify-content: center;
width: calc(var(--size-gap-double) + var(--size-gap));
height: calc(var(--size-gap-double) + var(--size-gap));
font-size: 0;
border: none;
background-color: rgba(255, 85, 85, 0.1);
color: var(--color-ansi-red);
cursor: pointer;
transition: background-color 0.25s ease;
}
[data-nextjs-dialog-left-right] > nav > button > svg {
width: auto;
height: calc(var(--size-gap) + var(--size-gap-half));
}
[data-nextjs-dialog-left-right] > nav > button:hover {
background-color: rgba(255, 85, 85, 0.2);
}
[data-nextjs-dialog-left-right] > nav > button:disabled {
background-color: rgba(255, 85, 85, 0.1);
color: rgba(255, 85, 85, 0.4);
cursor: not-allowed;
}
[data-nextjs-dialog-left-right] > nav > button:first-of-type {
border-radius: var(--size-gap-half) 0 0 var(--size-gap-half);
margin-right: 1px;
}
[data-nextjs-dialog-left-right] > nav > button:last-of-type {
border-radius: 0 var(--size-gap-half) var(--size-gap-half) 0;
}
[data-nextjs-dialog-left-right] > button:last-of-type {
border: 0;
padding: 0;
background-color: transparent;
appearance: none;
opacity: 0.4;
transition: opacity 0.25s ease;
}
[data-nextjs-dialog-left-right] > button:last-of-type:hover {
opacity: 0.7;
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/styles.ts"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,40 @@
// @ts-ignore
import allyTrap from './maintain--tab-focus';
import * as React from 'react';
import { lock, unlock } from './body-locker';
const Overlay = function Overlay({ className , children , fixed , }) {
React.useEffect(()=>{
lock();
return ()=>{
unlock();
};
}, []);
const [overlay, setOverlay] = React.useState(null);
const onOverlay = React.useCallback((el)=>{
setOverlay(el);
}, []);
React.useEffect(()=>{
if (overlay == null) {
return;
}
const handle2 = allyTrap({
context: overlay
});
return ()=>{
handle2.disengage();
};
}, [
overlay
]);
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-overlay": true,
className: className,
ref: onOverlay
}, /*#__PURE__*/ React.createElement("div", {
"data-nextjs-dialog-backdrop": true,
"data-nextjs-dialog-backdrop-fixed": fixed ? true : undefined
}), children);
};
export { Overlay };
//# sourceMappingURL=Overlay.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx"],"names":["allyTrap","React","lock","unlock","Overlay","className","children","fixed","useEffect","overlay","setOverlay","useState","onOverlay","useCallback","el","handle2","context","disengage","div","data-nextjs-dialog-overlay","ref","data-nextjs-dialog-backdrop","data-nextjs-dialog-backdrop-fixed","undefined"],"mappings":"AAAA,aAAa;AACb,OAAOA,QAAQ,MAAM,uBAAuB,CAAA;AAC5C,YAAYC,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,IAAI,EAAEC,MAAM,QAAQ,eAAe,CAAA;AAI5C,MAAMC,OAAO,GAA2B,SAASA,OAAO,CAAC,EACvDC,SAAS,CAAA,EACTC,QAAQ,CAAA,EACRC,KAAK,CAAA,IACN,EAAE;IACDN,KAAK,CAACO,SAAS,CAAC,IAAM;QACpBN,IAAI,EAAE;QACN,OAAO,IAAM;YACXC,MAAM,EAAE;SACT,CAAA;KACF,EAAE,EAAE,CAAC;IAEN,MAAM,CAACM,OAAO,EAAEC,UAAU,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAAwB,IAAI,CAAC;IACzE,MAAMC,SAAS,GAAGX,KAAK,CAACY,WAAW,CAAC,CAACC,EAAkB,GAAK;QAC1DJ,UAAU,CAACI,EAAE,CAAC;KACf,EAAE,EAAE,CAAC;IAENb,KAAK,CAACO,SAAS,CAAC,IAAM;QACpB,IAAIC,OAAO,IAAI,IAAI,EAAE;YACnB,OAAM;SACP;QAED,MAAMM,OAAO,GAAGf,QAAQ,CAAC;YAAEgB,OAAO,EAAEP,OAAO;SAAE,CAAC;QAC9C,OAAO,IAAM;YACXM,OAAO,CAACE,SAAS,EAAE;SACpB,CAAA;KACF,EAAE;QAACR,OAAO;KAAC,CAAC;IAEb,qBACE,oBAACS,KAAG;QAACC,4BAA0B,EAA1BA,IAA0B;QAACd,SAAS,EAAEA,SAAS;QAAEe,GAAG,EAAER,SAAS;qBAClE,oBAACM,KAAG;QACFG,6BAA2B,EAA3BA,IAA2B;QAC3BC,mCAAiC,EAAEf,KAAK,GAAG,IAAI,GAAGgB,SAAS;MAC3D,EACDjB,QAAQ,CACL,CACP;CACF;AAED,SAASF,OAAO,GAAE"}

View File

@@ -0,0 +1,34 @@
let previousBodyPaddingRight;
let previousBodyOverflowSetting;
let activeLocks = 0;
export function lock() {
setTimeout(()=>{
if (activeLocks++ > 0) {
return;
}
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth;
if (scrollBarGap > 0) {
previousBodyPaddingRight = document.body.style.paddingRight;
document.body.style.paddingRight = `${scrollBarGap}px`;
}
previousBodyOverflowSetting = document.body.style.overflow;
document.body.style.overflow = 'hidden';
});
}
export function unlock() {
setTimeout(()=>{
if (activeLocks === 0 || --activeLocks !== 0) {
return;
}
if (previousBodyPaddingRight !== undefined) {
document.body.style.paddingRight = previousBodyPaddingRight;
previousBodyPaddingRight = undefined;
}
if (previousBodyOverflowSetting !== undefined) {
document.body.style.overflow = previousBodyOverflowSetting;
previousBodyOverflowSetting = undefined;
}
});
}
//# sourceMappingURL=body-locker.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Overlay/body-locker.ts"],"names":["previousBodyPaddingRight","previousBodyOverflowSetting","activeLocks","lock","setTimeout","scrollBarGap","window","innerWidth","document","documentElement","clientWidth","body","style","paddingRight","overflow","unlock","undefined"],"mappings":"AAAA,IAAIA,wBAAwB,AAAoB;AAChD,IAAIC,2BAA2B,AAAoB;AAEnD,IAAIC,WAAW,GAAG,CAAC;AAEnB,OAAO,SAASC,IAAI,GAAG;IACrBC,UAAU,CAAC,IAAM;QACf,IAAIF,WAAW,EAAE,GAAG,CAAC,EAAE;YACrB,OAAM;SACP;QAED,MAAMG,YAAY,GAChBC,MAAM,CAACC,UAAU,GAAGC,QAAQ,CAACC,eAAe,CAACC,WAAW;QAE1D,IAAIL,YAAY,GAAG,CAAC,EAAE;YACpBL,wBAAwB,GAAGQ,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACC,YAAY;YAC3DL,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACC,YAAY,GAAG,CAAC,EAAER,YAAY,CAAC,EAAE,CAAC;SACvD;QAEDJ,2BAA2B,GAAGO,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACE,QAAQ;QAC1DN,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACE,QAAQ,GAAG,QAAQ;KACxC,CAAC;CACH;AAED,OAAO,SAASC,MAAM,GAAG;IACvBX,UAAU,CAAC,IAAM;QACf,IAAIF,WAAW,KAAK,CAAC,IAAI,EAAEA,WAAW,KAAK,CAAC,EAAE;YAC5C,OAAM;SACP;QAED,IAAIF,wBAAwB,KAAKgB,SAAS,EAAE;YAC1CR,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACC,YAAY,GAAGb,wBAAwB;YAC3DA,wBAAwB,GAAGgB,SAAS;SACrC;QAED,IAAIf,2BAA2B,KAAKe,SAAS,EAAE;YAC7CR,QAAQ,CAACG,IAAI,CAACC,KAAK,CAACE,QAAQ,GAAGb,2BAA2B;YAC1DA,2BAA2B,GAAGe,SAAS;SACxC;KACF,CAAC;CACH"}

View File

@@ -0,0 +1,3 @@
export { Overlay } from './Overlay';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Overlay/index.tsx"],"names":["Overlay"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WAAW,CAAA"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,44 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-dialog-overlay] {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
z-index: 9000;
display: flex;
align-content: center;
align-items: center;
flex-direction: column;
padding: 10vh 15px 0;
}
@media (max-height: 812px) {
[data-nextjs-dialog-overlay] {
padding: 15px 15px 0;
}
}
[data-nextjs-dialog-backdrop] {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(17, 17, 17, 0.2);
pointer-events: all;
z-index: -1;
}
[data-nextjs-dialog-backdrop-fixed] {
cursor: not-allowed;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Overlay/styles.tsx"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,24 @@
import * as React from 'react';
import { createPortal } from 'react-dom';
export function ShadowPortal({ children }) {
let portalNode = React.useRef(null);
let shadowNode = React.useRef(null);
let [, forceUpdate] = React.useState();
React.useLayoutEffect(()=>{
const ownerDocument = document;
portalNode.current = ownerDocument.createElement('nextjs-portal');
shadowNode.current = portalNode.current.attachShadow({
mode: 'open'
});
ownerDocument.body.appendChild(portalNode.current);
forceUpdate({});
return ()=>{
if (portalNode.current && portalNode.current.ownerDocument) {
portalNode.current.ownerDocument.body.removeChild(portalNode.current);
}
};
}, []);
return shadowNode.current ? /*#__PURE__*/ createPortal(children, shadowNode.current) : null;
}
//# sourceMappingURL=ShadowPortal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/components/ShadowPortal.tsx"],"names":["React","createPortal","ShadowPortal","children","portalNode","useRef","shadowNode","forceUpdate","useState","useLayoutEffect","ownerDocument","document","current","createElement","attachShadow","mode","body","appendChild","removeChild"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,YAAY,QAAQ,WAAW,CAAA;AAExC,OAAO,SAASC,YAAY,CAAC,EAAEC,QAAQ,CAAA,EAAiC,EAAE;IACxE,IAAIC,UAAU,GAAGJ,KAAK,CAACK,MAAM,CAAqB,IAAI,CAAC;IACvD,IAAIC,UAAU,GAAGN,KAAK,CAACK,MAAM,CAAoB,IAAI,CAAC;IACtD,IAAI,GAAGE,WAAW,CAAC,GAAGP,KAAK,CAACQ,QAAQ,EAAkB;IAEtDR,KAAK,CAACS,eAAe,CAAC,IAAM;QAC1B,MAAMC,aAAa,GAAGC,QAAQ;QAC9BP,UAAU,CAACQ,OAAO,GAAGF,aAAa,CAACG,aAAa,CAAC,eAAe,CAAC;QACjEP,UAAU,CAACM,OAAO,GAAGR,UAAU,CAACQ,OAAO,CAACE,YAAY,CAAC;YAAEC,IAAI,EAAE,MAAM;SAAE,CAAC;QACtEL,aAAa,CAACM,IAAI,CAACC,WAAW,CAACb,UAAU,CAACQ,OAAO,CAAC;QAClDL,WAAW,CAAC,EAAE,CAAC;QACf,OAAO,IAAM;YACX,IAAIH,UAAU,CAACQ,OAAO,IAAIR,UAAU,CAACQ,OAAO,CAACF,aAAa,EAAE;gBAC1DN,UAAU,CAACQ,OAAO,CAACF,aAAa,CAACM,IAAI,CAACE,WAAW,CAACd,UAAU,CAACQ,OAAO,CAAC;aACtE;SACF,CAAA;KACF,EAAE,EAAE,CAAC;IAEN,OAAON,UAAU,CAACM,OAAO,iBACrBX,YAAY,CAACE,QAAQ,EAAEG,UAAU,CAACM,OAAO,CAAQ,GACjD,IAAI,CAAA;CACT"}

View File

@@ -0,0 +1,28 @@
import _extends from "@swc/helpers/src/_extends.mjs";
import Anser from 'next/dist/compiled/anser';
import * as React from 'react';
export const Terminal = function Terminal({ content , }) {
const decoded = React.useMemo(()=>{
return Anser.ansiToJson(content, {
json: true,
use_classes: true,
remove_empty: true
});
}, [
content
]);
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-terminal": true
}, /*#__PURE__*/ React.createElement("pre", null, decoded.map((entry, index)=>/*#__PURE__*/ React.createElement("span", {
key: `terminal-entry-${index}`,
style: _extends({
color: entry.fg ? `var(--color-${entry.fg})` : undefined
}, entry.decoration === 'bold' ? {
fontWeight: 800
} : entry.decoration === 'italic' ? {
fontStyle: 'italic'
} : undefined)
}, entry.content))));
};
//# sourceMappingURL=Terminal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx"],"names":["Anser","React","Terminal","content","decoded","useMemo","ansiToJson","json","use_classes","remove_empty","div","data-nextjs-terminal","pre","map","entry","index","span","key","style","color","fg","undefined","decoration","fontWeight","fontStyle"],"mappings":"AAAA;AAAA,OAAOA,KAAK,MAAM,0BAA0B,CAAA;AAC5C,YAAYC,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,MAAMC,QAAQ,GAA4B,SAASA,QAAQ,CAAC,EACjEC,OAAO,CAAA,IACR,EAAE;IACD,MAAMC,OAAO,GAAGH,KAAK,CAACI,OAAO,CAAC,IAAM;QAClC,OAAOL,KAAK,CAACM,UAAU,CAACH,OAAO,EAAE;YAC/BI,IAAI,EAAE,IAAI;YACVC,WAAW,EAAE,IAAI;YACjBC,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;KACH,EAAE;QAACN,OAAO;KAAC,CAAC;IAEb,qBACE,oBAACO,KAAG;QAACC,sBAAoB,EAApBA,IAAoB;qBACvB,oBAACC,KAAG,QACDR,OAAO,CAACS,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,iBACxB,oBAACC,MAAI;YACHC,GAAG,EAAE,CAAC,eAAe,EAAEF,KAAK,CAAC,CAAC;YAC9BG,KAAK,EAAE;gBACLC,KAAK,EAAEL,KAAK,CAACM,EAAE,GAAG,CAAC,YAAY,EAAEN,KAAK,CAACM,EAAE,CAAC,CAAC,CAAC,GAAGC,SAAS;eACpDP,KAAK,CAACQ,UAAU,KAAK,MAAM,GAC3B;gBAAEC,UAAU,EAAE,GAAG;aAAE,GACnBT,KAAK,CAACQ,UAAU,KAAK,QAAQ,GAC7B;gBAAEE,SAAS,EAAE,QAAQ;aAAE,GACvBH,SAAS,CACd;WAEAP,KAAK,CAACX,OAAO,CACT,AACR,CAAC,CACE,CACF,CACP;CACF,CAAA"}

View File

@@ -0,0 +1,3 @@
export { Terminal } from './Terminal';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Terminal/index.tsx"],"names":["Terminal"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,YAAY,CAAA"}

View File

@@ -0,0 +1,30 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-terminal] {
border-radius: var(--size-gap-half);
background-color: var(--color-ansi-bg);
color: var(--color-ansi-fg);
}
[data-nextjs-terminal]::selection,
[data-nextjs-terminal] *::selection {
background-color: var(--color-ansi-selection);
}
[data-nextjs-terminal] * {
color: inherit;
background-color: transparent;
font-family: var(--font-stack-monospace);
}
[data-nextjs-terminal] > * {
margin: 0;
padding: calc(var(--size-gap) + var(--size-gap-half))
calc(var(--size-gap-double) + var(--size-gap-half));
}
[data-nextjs-terminal] pre {
white-space: pre-wrap;
word-break: break-word;
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Terminal/styles.tsx"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,12 @@
import * as React from 'react';
export const Toast = function Toast({ onClick , children , className , }) {
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-toast": true,
onClick: onClick,
className: className
}, /*#__PURE__*/ React.createElement("div", {
"data-nextjs-toast-wrapper": true
}, children));
};
//# sourceMappingURL=Toast.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Toast/Toast.tsx"],"names":["React","Toast","onClick","children","className","div","data-nextjs-toast","data-nextjs-toast-wrapper"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,MAAMC,KAAK,GAAyB,SAASA,KAAK,CAAC,EACxDC,OAAO,CAAA,EACPC,QAAQ,CAAA,EACRC,SAAS,CAAA,IACV,EAAE;IACD,qBACE,oBAACC,KAAG;QAACC,mBAAiB,EAAjBA,IAAiB;QAACJ,OAAO,EAAEA,OAAO;QAAEE,SAAS,EAAEA,SAAS;qBAC3D,oBAACC,KAAG;QAACE,2BAAyB,EAAzBA,IAAyB;OAAEJ,QAAQ,CAAO,CAC3C,CACP;CACF,CAAA"}

View File

@@ -0,0 +1,4 @@
export { styles } from './styles';
export { Toast } from './Toast';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Toast/index.tsx"],"names":["styles","Toast"],"mappings":"AAAA,SAASA,MAAM,QAAQ,UAAU,CAAA;AACjC,SAASC,KAAK,QAAQ,SAAS,CAAA"}

View File

@@ -0,0 +1,30 @@
import { noop as css } from '../../helpers/noop-template';
const styles = css`
[data-nextjs-toast] {
position: fixed;
bottom: var(--size-gap-double);
left: var(--size-gap-double);
max-width: 420px;
z-index: 9000;
}
@media (max-width: 440px) {
[data-nextjs-toast] {
max-width: 90vw;
left: 5vw;
}
}
[data-nextjs-toast-wrapper] {
padding: 16px;
border-radius: var(--size-gap-half);
font-weight: 500;
color: var(--color-ansi-bright-white);
background-color: var(--color-ansi-red);
box-shadow: 0px var(--size-gap-double) var(--size-gap-quad)
rgba(0, 0, 0, 0.25);
}
`;
export { styles };
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../client/components/react-dev-overlay/internal/components/Toast/styles.ts"],"names":["noop","css","styles"],"mappings":"AAAA,SAASA,IAAI,IAAIC,GAAG,QAAQ,6BAA6B,CAAA;AAEzD,MAAMC,MAAM,GAAGD,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAyBnB,CAAC;AAED,SAASC,MAAM,GAAE"}

View File

@@ -0,0 +1,46 @@
import * as React from 'react';
import { Dialog, DialogBody, DialogContent, DialogHeader } from '../components/Dialog';
import { Overlay } from '../components/Overlay';
import { Terminal } from '../components/Terminal';
import { noop as css } from '../helpers/noop-template';
export const BuildError = function BuildError({ message , }) {
const noop = React.useCallback(()=>{}, []);
return /*#__PURE__*/ React.createElement(Overlay, {
fixed: true
}, /*#__PURE__*/ React.createElement(Dialog, {
type: "error",
"aria-labelledby": "nextjs__container_build_error_label",
"aria-describedby": "nextjs__container_build_error_desc",
onClose: noop
}, /*#__PURE__*/ React.createElement(DialogContent, null, /*#__PURE__*/ React.createElement(DialogHeader, {
className: "nextjs-container-build-error-header"
}, /*#__PURE__*/ React.createElement("h4", {
id: "nextjs__container_build_error_label"
}, "Failed to compile")), /*#__PURE__*/ React.createElement(DialogBody, {
className: "nextjs-container-build-error-body"
}, /*#__PURE__*/ React.createElement(Terminal, {
content: message
}), /*#__PURE__*/ React.createElement("footer", null, /*#__PURE__*/ React.createElement("p", {
id: "nextjs__container_build_error_desc"
}, /*#__PURE__*/ React.createElement("small", null, "This error occurred during the build process and can only be dismissed by fixing the error.")))))));
};
export const styles = css`
.nextjs-container-build-error-header > h4 {
line-height: 1.5;
margin: 0;
padding: 0;
}
.nextjs-container-build-error-body footer {
margin-top: var(--size-gap);
}
.nextjs-container-build-error-body footer p {
margin: 0;
}
.nextjs-container-build-error-body small {
color: #757575;
}
`;
//# sourceMappingURL=BuildError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/container/BuildError.tsx"],"names":["React","Dialog","DialogBody","DialogContent","DialogHeader","Overlay","Terminal","noop","css","BuildError","message","useCallback","fixed","type","aria-labelledby","aria-describedby","onClose","className","h4","id","content","footer","p","small","styles"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,YAAY,QACP,sBAAsB,CAAA;AAC7B,SAASC,OAAO,QAAQ,uBAAuB,CAAA;AAC/C,SAASC,QAAQ,QAAQ,wBAAwB,CAAA;AACjD,SAASC,IAAI,IAAIC,GAAG,QAAQ,0BAA0B,CAAA;AAItD,OAAO,MAAMC,UAAU,GAA8B,SAASA,UAAU,CAAC,EACvEC,OAAO,CAAA,IACR,EAAE;IACD,MAAMH,IAAI,GAAGP,KAAK,CAACW,WAAW,CAAC,IAAM,EAAE,EAAE,EAAE,CAAC;IAC5C,qBACE,oBAACN,OAAO;QAACO,KAAK,EAALA,IAAK;qBACZ,oBAACX,MAAM;QACLY,IAAI,EAAC,OAAO;QACZC,iBAAe,EAAC,qCAAqC;QACrDC,kBAAgB,EAAC,oCAAoC;QACrDC,OAAO,EAAET,IAAI;qBAEb,oBAACJ,aAAa,sBACZ,oBAACC,YAAY;QAACa,SAAS,EAAC,qCAAqC;qBAC3D,oBAACC,IAAE;QAACC,EAAE,EAAC,qCAAqC;OAAC,mBAAiB,CAAK,CACtD,gBACf,oBAACjB,UAAU;QAACe,SAAS,EAAC,mCAAmC;qBACvD,oBAACX,QAAQ;QAACc,OAAO,EAAEV,OAAO;MAAI,gBAC9B,oBAACW,QAAM,sBACL,oBAACC,GAAC;QAACH,EAAE,EAAC,oCAAoC;qBACxC,oBAACI,OAAK,QAAC,6FAGP,CAAQ,CACN,CACG,CACE,CACC,CACT,CACD,CACX;CACF,CAAA;AAED,OAAO,MAAMC,MAAM,GAAGhB,GAAG,CAAC;;;;;;;;;;;;;;;;;AAiB1B,CAAC,CAAA"}

View File

@@ -0,0 +1,297 @@
import _extends from "@swc/helpers/src/_extends.mjs";
import * as React from 'react';
import { ACTION_UNHANDLED_ERROR, ACTION_UNHANDLED_REJECTION } from '../error-overlay-reducer';
import { Dialog, DialogBody, DialogContent, DialogHeader } from '../components/Dialog';
import { LeftRightDialogHeader } from '../components/LeftRightDialogHeader';
import { Overlay } from '../components/Overlay';
import { Toast } from '../components/Toast';
import { getErrorByType } from '../helpers/getErrorByType';
import { getErrorSource } from '../helpers/nodeStackFrames';
import { noop as css } from '../helpers/noop-template';
import { CloseIcon } from '../icons/CloseIcon';
import { RuntimeError } from './RuntimeError';
function getErrorSignature(ev) {
const { event } = ev;
switch(event.type){
case ACTION_UNHANDLED_ERROR:
case ACTION_UNHANDLED_REJECTION:
{
return `${event.reason.name}::${event.reason.message}::${event.reason.stack}`;
}
default:
{}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = event;
return '';
}
const HotlinkedText = function HotlinkedText(props) {
const { text } = props;
const linkRegex = /https?:\/\/[^\s/$.?#].[^\s"]*/i;
return /*#__PURE__*/ React.createElement(React.Fragment, null, linkRegex.test(text) ? text.split(' ').map((word, index, array)=>{
if (linkRegex.test(word)) {
return /*#__PURE__*/ React.createElement(React.Fragment, {
key: `link-${index}`
}, /*#__PURE__*/ React.createElement("a", {
href: word
}, word), index === array.length - 1 ? '' : ' ');
}
return index === array.length - 1 ? /*#__PURE__*/ React.createElement(React.Fragment, {
key: `text-${index}`
}, word) : /*#__PURE__*/ React.createElement(React.Fragment, {
key: `text-${index}`
}, word, " ");
}) : text);
};
export const Errors = function Errors({ errors , initialDisplayState , }) {
const [lookups, setLookups] = React.useState({});
const [readyErrors, nextError] = React.useMemo(()=>{
let ready = [];
let next = null;
// Ensure errors are displayed in the order they occurred in:
for(let idx = 0; idx < errors.length; ++idx){
const e = errors[idx];
const { id } = e;
if (id in lookups) {
ready.push(lookups[id]);
continue;
}
// Check for duplicate errors
if (idx > 0) {
const prev = errors[idx - 1];
if (getErrorSignature(prev) === getErrorSignature(e)) {
continue;
}
}
next = e;
break;
}
return [
ready,
next
];
}, [
errors,
lookups
]);
const isLoading = React.useMemo(()=>{
return readyErrors.length < 1 && Boolean(errors.length);
}, [
errors.length,
readyErrors.length
]);
React.useEffect(()=>{
if (nextError == null) {
return;
}
let mounted = true;
getErrorByType(nextError).then((resolved)=>{
// We don't care if the desired error changed while we were resolving,
// thus we're not tracking it using a ref. Once the work has been done,
// we'll store it.
if (mounted) {
setLookups((m)=>_extends({}, m, {
[resolved.id]: resolved
}));
}
}, ()=>{
// TODO: handle this, though an edge case
});
return ()=>{
mounted = false;
};
}, [
nextError
]);
const [displayState, setDisplayState] = React.useState(initialDisplayState);
const [activeIdx, setActiveIndex] = React.useState(0);
const previous = React.useCallback((e)=>{
e == null ? void 0 : e.preventDefault();
setActiveIndex((v)=>Math.max(0, v - 1));
}, []);
const next1 = React.useCallback((e)=>{
e == null ? void 0 : e.preventDefault();
setActiveIndex((v)=>Math.max(0, Math.min(readyErrors.length - 1, v + 1)));
}, [
readyErrors.length
]);
var _activeIdx;
const activeError = React.useMemo(()=>(_activeIdx = readyErrors[activeIdx]) != null ? _activeIdx : null, [
activeIdx,
readyErrors
]);
// Reset component state when there are no errors to be displayed.
// This should never happen, but lets handle it.
React.useEffect(()=>{
if (errors.length < 1) {
setLookups({});
setDisplayState('hidden');
setActiveIndex(0);
}
}, [
errors.length
]);
const minimize = React.useCallback((e)=>{
e == null ? void 0 : e.preventDefault();
setDisplayState('minimized');
}, []);
const hide = React.useCallback((e)=>{
e == null ? void 0 : e.preventDefault();
setDisplayState('hidden');
}, []);
const fullscreen = React.useCallback((e)=>{
e == null ? void 0 : e.preventDefault();
setDisplayState('fullscreen');
}, []);
// This component shouldn't be rendered with no errors, but if it is, let's
// handle it gracefully by rendering nothing.
if (errors.length < 1 || activeError == null) {
return null;
}
if (isLoading) {
// TODO: better loading state
return /*#__PURE__*/ React.createElement(Overlay, null);
}
if (displayState === 'hidden') {
return null;
}
if (displayState === 'minimized') {
return /*#__PURE__*/ React.createElement(Toast, {
className: "nextjs-toast-errors-parent",
onClick: fullscreen
}, /*#__PURE__*/ React.createElement("div", {
className: "nextjs-toast-errors"
}, /*#__PURE__*/ React.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, /*#__PURE__*/ React.createElement("circle", {
cx: "12",
cy: "12",
r: "10"
}), /*#__PURE__*/ React.createElement("line", {
x1: "12",
y1: "8",
x2: "12",
y2: "12"
}), /*#__PURE__*/ React.createElement("line", {
x1: "12",
y1: "16",
x2: "12.01",
y2: "16"
})), /*#__PURE__*/ React.createElement("span", null, readyErrors.length, " error", readyErrors.length > 1 ? 's' : ''), /*#__PURE__*/ React.createElement("button", {
"data-nextjs-toast-errors-hide-button": true,
className: "nextjs-toast-errors-hide-button",
type: "button",
onClick: (e)=>{
e.stopPropagation();
hide();
},
"aria-label": "Hide Errors"
}, /*#__PURE__*/ React.createElement(CloseIcon, null))));
}
const isServerError = [
'server',
'edge-server'
].includes(getErrorSource(activeError.error) || '');
return /*#__PURE__*/ React.createElement(Overlay, null, /*#__PURE__*/ React.createElement(Dialog, {
type: "error",
"aria-labelledby": "nextjs__container_errors_label",
"aria-describedby": "nextjs__container_errors_desc",
onClose: isServerError ? undefined : minimize
}, /*#__PURE__*/ React.createElement(DialogContent, null, /*#__PURE__*/ React.createElement(DialogHeader, {
className: "nextjs-container-errors-header"
}, /*#__PURE__*/ React.createElement(LeftRightDialogHeader, {
previous: activeIdx > 0 ? previous : null,
next: activeIdx < readyErrors.length - 1 ? next1 : null,
close: isServerError ? undefined : minimize
}, /*#__PURE__*/ React.createElement("small", null, /*#__PURE__*/ React.createElement("span", null, activeIdx + 1), " of", ' ', /*#__PURE__*/ React.createElement("span", null, readyErrors.length), " unhandled error", readyErrors.length < 2 ? '' : 's')), /*#__PURE__*/ React.createElement("h1", {
id: "nextjs__container_errors_label"
}, isServerError ? 'Server Error' : 'Unhandled Runtime Error'), /*#__PURE__*/ React.createElement("p", {
id: "nextjs__container_errors_desc"
}, activeError.error.name, ":", ' ', /*#__PURE__*/ React.createElement(HotlinkedText, {
text: activeError.error.message
})), isServerError ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("small", null, "This error happened while generating the page. Any console logs will be displayed in the terminal window.")) : undefined), /*#__PURE__*/ React.createElement(DialogBody, {
className: "nextjs-container-errors-body"
}, /*#__PURE__*/ React.createElement(RuntimeError, {
key: activeError.id.toString(),
error: activeError
})))));
};
export const styles = css`
.nextjs-container-errors-header > h1 {
font-size: var(--size-font-big);
line-height: var(--size-font-bigger);
font-weight: bold;
margin: 0;
margin-top: calc(var(--size-gap-double) + var(--size-gap-half));
}
.nextjs-container-errors-header small {
font-size: var(--size-font-small);
color: var(--color-accents-1);
margin-left: var(--size-gap-double);
}
.nextjs-container-errors-header small > span {
font-family: var(--font-stack-monospace);
}
.nextjs-container-errors-header > p {
font-family: var(--font-stack-monospace);
font-size: var(--size-font-small);
line-height: var(--size-font-big);
font-weight: bold;
margin: 0;
margin-top: var(--size-gap-half);
color: var(--color-ansi-red);
white-space: pre-wrap;
}
.nextjs-container-errors-header > div > small {
margin: 0;
margin-top: var(--size-gap-half);
}
.nextjs-container-errors-header > p > a {
color: var(--color-ansi-red);
}
.nextjs-container-errors-body > h5:not(:first-child) {
margin-top: calc(var(--size-gap-double) + var(--size-gap));
}
.nextjs-container-errors-body > h5 {
margin-bottom: var(--size-gap);
}
.nextjs-toast-errors-parent {
cursor: pointer;
transition: transform 0.2s ease;
}
.nextjs-toast-errors-parent:hover {
transform: scale(1.1);
}
.nextjs-toast-errors {
display: flex;
align-items: center;
justify-content: flex-start;
}
.nextjs-toast-errors > svg {
margin-right: var(--size-gap);
}
.nextjs-toast-errors-hide-button {
margin-left: var(--size-gap-triple);
border: none;
background: none;
color: var(--color-ansi-bright-white);
padding: 0;
transition: opacity 0.25s ease;
opacity: 0.7;
}
.nextjs-toast-errors-hide-button:hover {
opacity: 1;
}
`;
//# sourceMappingURL=Errors.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,47 @@
import React from 'react';
import { Dialog, DialogBody, DialogContent, DialogHeader } from '../components/Dialog';
import { Overlay } from '../components/Overlay';
import { Terminal } from '../components/Terminal';
import { noop as css } from '../helpers/noop-template';
export const RootLayoutError = function BuildError({ missingTags }) {
const message = 'Please make sure to include the following tags in your root layout: <html>, <body>.\n\n' + `Missing required root layout tag${missingTags.length === 1 ? '' : 's'}: ` + missingTags.join(', ');
const noop = React.useCallback(()=>{}, []);
return /*#__PURE__*/ React.createElement(Overlay, {
fixed: true
}, /*#__PURE__*/ React.createElement(Dialog, {
type: "error",
"aria-labelledby": "nextjs__container_root_layout_error_label",
"aria-describedby": "nextjs__container_root_layout_error_desc",
onClose: noop
}, /*#__PURE__*/ React.createElement(DialogContent, null, /*#__PURE__*/ React.createElement(DialogHeader, {
className: "nextjs-container-root-layout-error-header"
}, /*#__PURE__*/ React.createElement("h4", {
id: "nextjs__container_root_layout_error_label"
}, "Missing required tags")), /*#__PURE__*/ React.createElement(DialogBody, {
className: "nextjs-container-root-layout-error-body"
}, /*#__PURE__*/ React.createElement(Terminal, {
content: message
}), /*#__PURE__*/ React.createElement("footer", null, /*#__PURE__*/ React.createElement("p", {
id: "nextjs__container_root_layout_error_desc"
}, /*#__PURE__*/ React.createElement("small", null, "This error and can only be dismissed by providing all required tags.")))))));
};
export const styles = css`
.nextjs-container-root-layout-error-header > h4 {
line-height: 1.5;
margin: 0;
padding: 0;
}
.nextjs-container-root-layout-error-body footer {
margin-top: var(--size-gap);
}
.nextjs-container-root-layout-error-body footer p {
margin: 0;
}
.nextjs-container-root-layout-error-body small {
color: #757575;
}
`;
//# sourceMappingURL=RootLayoutError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/container/RootLayoutError.tsx"],"names":["React","Dialog","DialogBody","DialogContent","DialogHeader","Overlay","Terminal","noop","css","RootLayoutError","BuildError","missingTags","message","length","join","useCallback","fixed","type","aria-labelledby","aria-describedby","onClose","className","h4","id","content","footer","p","small","styles"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO,CAAA;AACzB,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,YAAY,QACP,sBAAsB,CAAA;AAC7B,SAASC,OAAO,QAAQ,uBAAuB,CAAA;AAC/C,SAASC,QAAQ,QAAQ,wBAAwB,CAAA;AACjD,SAASC,IAAI,IAAIC,GAAG,QAAQ,0BAA0B,CAAA;AAItD,OAAO,MAAMC,eAAe,GAC1B,SAASC,UAAU,CAAC,EAAEC,WAAW,CAAA,EAAE,EAAE;IACnC,MAAMC,OAAO,GACX,yFAAyF,GACzF,CAAC,gCAAgC,EAC/BD,WAAW,CAACE,MAAM,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CACpC,EAAE,CAAC,GACJF,WAAW,CAACG,IAAI,CAAC,IAAI,CAAC;IAExB,MAAMP,IAAI,GAAGP,KAAK,CAACe,WAAW,CAAC,IAAM,EAAE,EAAE,EAAE,CAAC;IAC5C,qBACE,oBAACV,OAAO;QAACW,KAAK,EAALA,IAAK;qBACZ,oBAACf,MAAM;QACLgB,IAAI,EAAC,OAAO;QACZC,iBAAe,EAAC,2CAA2C;QAC3DC,kBAAgB,EAAC,0CAA0C;QAC3DC,OAAO,EAAEb,IAAI;qBAEb,oBAACJ,aAAa,sBACZ,oBAACC,YAAY;QAACiB,SAAS,EAAC,2CAA2C;qBACjE,oBAACC,IAAE;QAACC,EAAE,EAAC,2CAA2C;OAAC,uBAEnD,CAAK,CACQ,gBACf,oBAACrB,UAAU;QAACmB,SAAS,EAAC,yCAAyC;qBAC7D,oBAACf,QAAQ;QAACkB,OAAO,EAAEZ,OAAO;MAAI,gBAC9B,oBAACa,QAAM,sBACL,oBAACC,GAAC;QAACH,EAAE,EAAC,0CAA0C;qBAC9C,oBAACI,OAAK,QAAC,sEAGP,CAAQ,CACN,CACG,CACE,CACC,CACT,CACD,CACX;CACF,CAAA;AAEH,OAAO,MAAMC,MAAM,GAAGpB,GAAG,CAAC;;;;;;;;;;;;;;;;;AAiB1B,CAAC,CAAA"}

View File

@@ -0,0 +1,161 @@
import * as React from 'react';
import { CodeFrame } from '../components/CodeFrame';
import { noop as css } from '../helpers/noop-template';
import { getFrameSource } from '../helpers/stack-frame';
const CallStackFrame = function CallStackFrame({ frame }) {
var _originalStackFrame;
// TODO: ability to expand resolved frames
// TODO: render error or external indicator
const f = (_originalStackFrame = frame.originalStackFrame) != null ? _originalStackFrame : frame.sourceStackFrame;
const hasSource = Boolean(frame.originalCodeFrame);
const open = React.useCallback(()=>{
if (!hasSource) return;
const params = new URLSearchParams();
for(const key in f){
var _key;
params.append(key, ((_key = f[key]) != null ? _key : '').toString());
}
self.fetch(`${process.env.__NEXT_ROUTER_BASEPATH || ''}/__nextjs_launch-editor?${params.toString()}`).then(()=>{}, ()=>{
console.error('There was an issue opening this code in your editor.');
});
}, [
hasSource,
f
]);
return /*#__PURE__*/ React.createElement("div", {
"data-nextjs-call-stack-frame": true
}, /*#__PURE__*/ React.createElement("h6", {
"data-nextjs-frame-expanded": Boolean(frame.expanded)
}, f.methodName), /*#__PURE__*/ React.createElement("div", {
"data-has-source": hasSource ? 'true' : undefined,
tabIndex: hasSource ? 10 : undefined,
role: hasSource ? 'link' : undefined,
onClick: open,
title: hasSource ? 'Click to open in your editor' : undefined
}, /*#__PURE__*/ React.createElement("span", null, getFrameSource(f)), /*#__PURE__*/ React.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, /*#__PURE__*/ React.createElement("path", {
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
}), /*#__PURE__*/ React.createElement("polyline", {
points: "15 3 21 3 21 9"
}), /*#__PURE__*/ React.createElement("line", {
x1: "10",
y1: "14",
x2: "21",
y2: "3"
}))));
};
const RuntimeError = function RuntimeError({ error , }) {
const firstFirstPartyFrameIndex = React.useMemo(()=>{
return error.frames.findIndex((entry)=>entry.expanded && Boolean(entry.originalCodeFrame) && Boolean(entry.originalStackFrame));
}, [
error.frames
]);
const firstFrame = React.useMemo(()=>{
var _firstFirstPartyFrameIndex;
return (_firstFirstPartyFrameIndex = error.frames[firstFirstPartyFrameIndex]) != null ? _firstFirstPartyFrameIndex : null;
}, [
error.frames,
firstFirstPartyFrameIndex
]);
const allLeadingFrames = React.useMemo(()=>firstFirstPartyFrameIndex < 0 ? [] : error.frames.slice(0, firstFirstPartyFrameIndex), [
error.frames,
firstFirstPartyFrameIndex
]);
const [all, setAll] = React.useState(firstFrame == null);
const toggleAll = React.useCallback(()=>{
setAll((v)=>!v);
}, []);
const leadingFrames = React.useMemo(()=>allLeadingFrames.filter((f)=>f.expanded || all), [
all,
allLeadingFrames
]);
const allCallStackFrames = React.useMemo(()=>error.frames.slice(firstFirstPartyFrameIndex + 1), [
error.frames,
firstFirstPartyFrameIndex
]);
const visibleCallStackFrames = React.useMemo(()=>allCallStackFrames.filter((f)=>f.expanded || all), [
all,
allCallStackFrames
]);
const canShowMore = React.useMemo(()=>{
return allCallStackFrames.length !== visibleCallStackFrames.length || all && firstFrame != null;
}, [
all,
allCallStackFrames.length,
firstFrame,
visibleCallStackFrames.length,
]);
return /*#__PURE__*/ React.createElement(React.Fragment, null, firstFrame ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h5", null, "Source"), leadingFrames.map((frame, index)=>/*#__PURE__*/ React.createElement(CallStackFrame, {
key: `leading-frame-${index}-${all}`,
frame: frame
})), /*#__PURE__*/ React.createElement(CodeFrame, {
stackFrame: firstFrame.originalStackFrame,
codeFrame: firstFrame.originalCodeFrame
})) : undefined, visibleCallStackFrames.length ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h5", null, "Call Stack"), visibleCallStackFrames.map((frame, index)=>/*#__PURE__*/ React.createElement(CallStackFrame, {
key: `call-stack-${index}-${all}`,
frame: frame
}))) : undefined, canShowMore ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("button", {
tabIndex: 10,
"data-nextjs-data-runtime-error-collapsed-action": true,
type: "button",
onClick: toggleAll
}, all ? 'Hide' : 'Show', " collapsed frames")) : undefined);
};
export const styles = css`
button[data-nextjs-data-runtime-error-collapsed-action] {
background: none;
border: none;
padding: 0;
font-size: var(--size-font-small);
line-height: var(--size-font-bigger);
color: var(--color-accents-3);
}
[data-nextjs-call-stack-frame]:not(:last-child) {
margin-bottom: var(--size-gap-double);
}
[data-nextjs-call-stack-frame] > h6 {
margin-top: 0;
margin-bottom: var(--size-gap);
font-family: var(--font-stack-monospace);
color: #222;
}
[data-nextjs-call-stack-frame] > h6[data-nextjs-frame-expanded='false'] {
color: #666;
}
[data-nextjs-call-stack-frame] > div {
display: flex;
align-items: center;
padding-left: calc(var(--size-gap) + var(--size-gap-half));
font-size: var(--size-font-small);
color: #999;
}
[data-nextjs-call-stack-frame] > div > svg {
width: auto;
height: var(--size-font-small);
margin-left: var(--size-gap);
display: none;
}
[data-nextjs-call-stack-frame] > div[data-has-source] {
cursor: pointer;
}
[data-nextjs-call-stack-frame] > div[data-has-source]:hover {
text-decoration: underline dotted;
}
[data-nextjs-call-stack-frame] > div[data-has-source] > svg {
display: unset;
}
`;
export { RuntimeError };
//# sourceMappingURL=RuntimeError.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,95 @@
import _extends from "@swc/helpers/src/_extends.mjs";
export const ACTION_BUILD_OK = 'build-ok';
export const ACTION_BUILD_ERROR = 'build-error';
export const ACTION_BEFORE_REFRESH = 'before-fast-refresh';
export const ACTION_REFRESH = 'fast-refresh';
export const ACTION_UNHANDLED_ERROR = 'unhandled-error';
export const ACTION_UNHANDLED_REJECTION = 'unhandled-rejection';
function pushErrorFilterDuplicates(errors, err) {
return [
...errors.filter((e)=>{
// Filter out duplicate errors
return e.event.reason !== err.event.reason;
}),
err,
];
}
export function errorOverlayReducer(state, action) {
switch(action.type){
case ACTION_BUILD_OK:
{
return _extends({}, state, {
buildError: null
});
}
case ACTION_BUILD_ERROR:
{
return _extends({}, state, {
buildError: action.message
});
}
case ACTION_BEFORE_REFRESH:
{
return _extends({}, state, {
refreshState: {
type: 'pending',
errors: []
}
});
}
case ACTION_REFRESH:
{
return _extends({}, state, {
buildError: null,
errors: // Errors can come in during updates. In this case, UNHANDLED_ERROR
// and UNHANDLED_REJECTION events might be dispatched between the
// BEFORE_REFRESH and the REFRESH event. We want to keep those errors
// around until the next refresh. Otherwise we run into a race
// condition where those errors would be cleared on refresh completion
// before they can be displayed.
state.refreshState.type === 'pending' ? state.refreshState.errors : [],
refreshState: {
type: 'idle'
}
});
}
case ACTION_UNHANDLED_ERROR:
case ACTION_UNHANDLED_REJECTION:
{
switch(state.refreshState.type){
case 'idle':
{
return _extends({}, state, {
nextId: state.nextId + 1,
errors: pushErrorFilterDuplicates(state.errors, {
id: state.nextId,
event: action
})
});
}
case 'pending':
{
return _extends({}, state, {
nextId: state.nextId + 1,
refreshState: _extends({}, state.refreshState, {
errors: pushErrorFilterDuplicates(state.refreshState.errors, {
id: state.nextId,
event: action
})
})
});
}
default:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = state.refreshState;
return state;
}
}
default:
{
return state;
}
}
}
//# sourceMappingURL=error-overlay-reducer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../client/components/react-dev-overlay/internal/error-overlay-reducer.ts"],"names":["ACTION_BUILD_OK","ACTION_BUILD_ERROR","ACTION_BEFORE_REFRESH","ACTION_REFRESH","ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","pushErrorFilterDuplicates","errors","err","filter","e","event","reason","errorOverlayReducer","state","action","type","buildError","message","refreshState","nextId","id","_"],"mappings":"AAAA;AAGA,OAAO,M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K,CAACK,YAAY,CAACZ,MAAM,GACzB,EAAE;oBACRY,YAAY,EAAE;wBAAEH,IAAI,EAAE,MAAM;qBAAE;kBAC/B,CAAA;aACF;QACD,KAAKZ,sBAAsB,CAAC;QAC5B,KAAKC,0BAA0B;YAAE;gBAC/B,OAAQS,KAAK,CAACK,YAAY,CAACH,IAAI;oBAC7B,KAAK,MAAM;wBAAE;4BACX,OAAO,aACFF,KAAK;gCACRM,MAAM,EAAEN,KAAK,CAACM,MAAM,GAAG,CAAC;gCACxBb,MAAM,EAAED,yBAAyB,CAACQ,KAAK,CAACP,MAAM,EAAE;oCAC9Cc,EAAE,EAAEP,KAAK,CAACM,MAAM;oCAChBT,KAAK,EAAEI,MAAM;iCACd,CAAC;8BACH,CAAA;yBACF;oBACD,KAAK,SAAS;wBAAE;4BACd,OAAO,aACFD,KAAK;gCACRM,MAAM,EAAEN,KAAK,CAACM,MAAM,GAAG,CAAC;gCACxBD,YAAY,EAAE,aACTL,KAAK,CAACK,YAAY;oCACrBZ,MAAM,EAAED,yBAAyB,CAACQ,KAAK,CAACK,YAAY,CAACZ,MAAM,EAAE;wCAC3Dc,EAAE,EAAEP,KAAK,CAACM,MAAM;wCAChBT,KAAK,EAAEI,MAAM;qCACd,CAAC;kCACH;8BACF,CAAA;yBACF;oBACD;wBACE,6DAA6D;wBAC7D,MAAMO,CAAC,GAAUR,KAAK,CAACK,YAAY;wBACnC,OAAOL,KAAK,CAAA;iBACf;aACF;QACD;YAAS;gBACP,OAAOA,KAAK,CAAA;aACb;KACF;CACF"}

View File

@@ -0,0 +1,10 @@
export function getSocketProtocol(assetPrefix) {
let protocol = window.location.protocol;
try {
// assetPrefix is a url
protocol = new URL(assetPrefix).protocol;
} catch (_) {}
return protocol === 'http:' ? 'ws' : 'wss';
}
//# sourceMappingURL=get-socket-protocol.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/get-socket-protocol.ts"],"names":["getSocketProtocol","assetPrefix","protocol","window","location","URL","_"],"mappings":"AAAA,OAAO,SAASA,iBAAiB,CAACC,WAAmB,EAAU;IAC7D,IAAIC,QAAQ,GAAGC,MAAM,CAACC,QAAQ,CAACF,QAAQ;IAEvC,IAAI;QACF,uBAAuB;QACvBA,QAAQ,GAAG,IAAIG,GAAG,CAACJ,WAAW,CAAC,CAACC,QAAQ;KACzC,CAAC,OAAOI,CAAC,EAAE,EAAE;IAEd,OAAOJ,QAAQ,KAAK,OAAO,GAAG,IAAI,GAAG,KAAK,CAAA;CAC3C"}

View File

@@ -0,0 +1,34 @@
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import { ACTION_UNHANDLED_ERROR, ACTION_UNHANDLED_REJECTION } from '../error-overlay-reducer';
import { getErrorSource } from './nodeStackFrames';
import { getOriginalStackFrames } from './stack-frame';
export function getErrorByType(ev) {
return _getErrorByType.apply(this, arguments);
}
function _getErrorByType() {
_getErrorByType = _async_to_generator(function*(ev) {
const { id , event } = ev;
switch(event.type){
case ACTION_UNHANDLED_ERROR:
case ACTION_UNHANDLED_REJECTION:
{
return {
id,
runtime: true,
error: event.reason,
frames: yield getOriginalStackFrames(event.frames, getErrorSource(event.reason), event.reason.toString())
};
}
default:
{
break;
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = event;
throw new Error('type system invariant violation');
});
return _getErrorByType.apply(this, arguments);
}
//# sourceMappingURL=getErrorByType.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/getErrorByType.ts"],"names":["ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","getErrorSource","getOriginalStackFrames","getErrorByType","ev","id","event","type","runtime","error","reason","frames","toString","_","Error"],"mappings":"AAAA;AAAA,SACEA,sBAAsB,EACtBC,0BAA0B,QACrB,0BAA0B,CAAA;AAEjC,SAASC,cAAc,QAAQ,mBAAmB,CAAA;AAClD,SAASC,sBAAsB,QAA4B,eAAe,CAAA;AAS1E,gBAAsBC,cAAc,CAClCC,EAAuB;WADHD,eAAc;CAyBnC;SAzBqBA,eAAc;IAAdA,eAAc,GAA7B,oBAAA,UACLC,EAAuB,EACK;QAC5B,MAAM,EAAEC,EAAE,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGF,EAAE;QACxB,OAAQE,KAAK,CAACC,IAAI;YAChB,KAAKR,sBAAsB,CAAC;YAC5B,KAAKC,0BAA0B;gBAAE;oBAC/B,OAAO;wBACLK,EAAE;wBACFG,OAAO,EAAE,IAAI;wBACbC,KAAK,EAAEH,KAAK,CAACI,MAAM;wBACnBC,MAAM,EAAE,MAAMT,sBAAsB,CAClCI,KAAK,CAACK,MAAM,EACZV,cAAc,CAACK,KAAK,CAACI,MAAM,CAAC,EAC5BJ,KAAK,CAACI,MAAM,CAACE,QAAQ,EAAE,CACxB;qBACF,CAAA;iBACF;YACD;gBAAS;oBACP,MAAK;iBACN;SACF;QACD,6DAA6D;QAC7D,MAAMC,CAAC,GAAUP,KAAK;QACtB,MAAM,IAAIQ,KAAK,CAAC,iCAAiC,CAAC,CAAA;KACnD,CAAA;WAzBqBX,eAAc"}

View File

@@ -0,0 +1,28 @@
import dataUriToBuffer from 'next/dist/compiled/data-uri-to-buffer';
import { getSourceMapUrl } from './getSourceMapUrl';
export function getRawSourceMap(fileContents) {
const sourceUrl = getSourceMapUrl(fileContents);
if (!(sourceUrl == null ? void 0 : sourceUrl.startsWith('data:'))) {
return null;
}
let buffer;
try {
// @ts-expect-error TODO-APP: fix type.
buffer = dataUriToBuffer(sourceUrl);
} catch (err) {
console.error('Failed to parse source map URL:', err);
return null;
}
if (buffer.type !== 'application/json') {
console.error(`Unknown source map type: ${buffer.typeFull}.`);
return null;
}
try {
return JSON.parse(buffer.toString());
} catch (e) {
console.error('Failed to parse source map.');
return null;
}
}
//# sourceMappingURL=getRawSourceMap.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/getRawSourceMap.ts"],"names":["dataUriToBuffer","getSourceMapUrl","getRawSourceMap","fileContents","sourceUrl","startsWith","buffer","err","console","error","type","typeFull","JSON","parse","toString"],"mappings":"AAAA,OAAOA,eAAe,MAEf,uCAAuC,CAAA;AAE9C,SAASC,eAAe,QAAQ,mBAAmB,CAAA;AAEnD,OAAO,SAASC,eAAe,CAACC,YAAoB,EAAuB;IACzE,MAAMC,SAAS,GAAGH,eAAe,CAACE,YAAY,CAAC;IAC/C,IAAI,EAACC,SAAS,QAAY,GAArBA,KAAAA,CAAqB,GAArBA,SAAS,CAAEC,UAAU,CAAC,OAAO,CAAC,CAAA,EAAE;QACnC,OAAO,IAAI,CAAA;KACZ;IAED,IAAIC,MAAM,AAAY;IACtB,IAAI;QACF,uCAAuC;QACvCA,MAAM,GAAGN,eAAe,CAACI,SAAS,CAAC;KACpC,CAAC,OAAOG,GAAG,EAAE;QACZC,OAAO,CAACC,KAAK,CAAC,iCAAiC,EAAEF,GAAG,CAAC;QACrD,OAAO,IAAI,CAAA;KACZ;IAED,IAAID,MAAM,CAACI,IAAI,KAAK,kBAAkB,EAAE;QACtCF,OAAO,CAACC,KAAK,CAAC,CAAC,yBAAyB,EAAEH,MAAM,CAACK,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAA;KACZ;IAED,IAAI;QACF,OAAOC,IAAI,CAACC,KAAK,CAACP,MAAM,CAACQ,QAAQ,EAAE,CAAC,CAAA;KACrC,CAAC,UAAM;QACNN,OAAO,CAACC,KAAK,CAAC,6BAA6B,CAAC;QAC5C,OAAO,IAAI,CAAA;KACZ;CACF"}

View File

@@ -0,0 +1,17 @@
export function getSourceMapUrl(fileContents) {
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
let match = null;
for(;;){
let next = regex.exec(fileContents);
if (next == null) {
break;
}
match = next;
}
if (!(match && match[1])) {
return null;
}
return match[1].toString();
}
//# sourceMappingURL=getSourceMapUrl.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/getSourceMapUrl.ts"],"names":["getSourceMapUrl","fileContents","regex","match","next","exec","toString"],"mappings":"AAAA,OAAO,SAASA,eAAe,CAACC,YAAoB,EAAiB;IACnE,MAAMC,KAAK,gDAAgD;IAC3D,IAAIC,KAAK,GAAG,IAAI;IAChB,OAAS;QACP,IAAIC,IAAI,GAAGF,KAAK,CAACG,IAAI,CAACJ,YAAY,CAAC;QACnC,IAAIG,IAAI,IAAI,IAAI,EAAE;YAChB,MAAK;SACN;QACDD,KAAK,GAAGC,IAAI;KACb;IACD,IAAI,CAAC,CAACD,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;QACxB,OAAO,IAAI,CAAA;KACZ;IACD,OAAOA,KAAK,CAAC,CAAC,CAAC,CAACG,QAAQ,EAAE,CAAA;CAC3B"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,57 @@
import _extends from "@swc/helpers/src/_extends.mjs";
import { parse } from 'next/dist/compiled/stacktrace-parser';
export function getFilesystemFrame(frame) {
const f = _extends({}, frame);
if (typeof f.file === 'string') {
if (// Posix:
f.file.startsWith('/') || // Win32:
/^[a-z]:\\/i.test(f.file) || // Win32 UNC:
f.file.startsWith('\\\\')) {
f.file = `file://${f.file}`;
}
}
return f;
}
const symbolError = Symbol('NextjsError');
export function getErrorSource(error) {
return error[symbolError] || null;
}
export function decorateServerError(error, type) {
Object.defineProperty(error, symbolError, {
writable: false,
enumerable: false,
configurable: false,
value: type
});
}
export function getServerError(error, type) {
let n;
try {
throw new Error(error.message);
} catch (e) {
n = e;
}
n.name = error.name;
try {
n.stack = `${n.toString()}\n${parse(error.stack).map(getFilesystemFrame).map((f)=>{
let str = ` at ${f.methodName}`;
if (f.file) {
let loc = f.file;
if (f.lineNumber) {
loc += `:${f.lineNumber}`;
if (f.column) {
loc += `:${f.column}`;
}
}
str += ` (${loc})`;
}
return str;
}).join('\n')}`;
} catch (e1) {
n.stack = error.stack;
}
decorateServerError(n, type);
return n;
}
//# sourceMappingURL=nodeStackFrames.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/nodeStackFrames.ts"],"names":["parse","getFilesystemFrame","frame","f","file","startsWith","test","symbolError","Symbol","getErrorSource","error","decorateServerError","type","Object","defineProperty","writable","enumerable","configurable","value","getServerError","n","Error","message","e","name","stack","toString","map","str","methodName","loc","lineNumber","column","join"],"mappings":"AAAA;AAAA,SAASA,KAAK,QAAoB,sCAAsC,CAAA;AAExE,OAAO,SAASC,kBAAkB,CAACC,KAAiB,EAAc;IAChE,MAAMC,CAAC,GAAe,aAAKD,KAAK,CAAE;IAElC,IAAI,OAAOC,CAAC,CAACC,IAAI,KAAK,QAAQ,EAAE;QAC9B,IACE,SAAS;QACTD,CAAC,CAACC,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,IACtB,SAAS;QACT,aAAaC,IAAI,CAACH,CAAC,CAACC,IAAI,CAAC,IACzB,aAAa;QACbD,CAAC,CAACC,IAAI,CAACC,UAAU,CAAC,MAAM,CAAC,EACzB;YACAF,CAAC,CAACC,IAAI,GAAG,CAAC,OAAO,EAAED,CAAC,CAACC,IAAI,CAAC,CAAC;SAC5B;KACF;IAED,OAAOD,CAAC,CAAA;CACT;AAED,MAAMI,WAAW,GAAGC,MAAM,CAAC,aAAa,CAAC;AAEzC,OAAO,SAASC,cAAc,CAACC,KAAY,EAAmC;IAC5E,OAAO,AAACA,KAAK,AAAQ,CAACH,WAAW,CAAC,IAAI,IAAI,CAAA;CAC3C;AAID,OAAO,SAASI,mBAAmB,CAACD,KAAY,EAAEE,IAAe,EAAE;IACjEC,MAAM,CAACC,cAAc,CAACJ,KAAK,EAAEH,WAAW,EAAE;QACxCQ,QAAQ,EAAE,KAAK;QACfC,UAAU,EAAE,KAAK;QACjBC,YAAY,EAAE,KAAK;QACnBC,KAAK,EAAEN,IAAI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
export function noop(strings, ...keys) {
const lastIndex = strings.length - 1;
return strings.slice(0, lastIndex).reduce((p, s, i)=>p + s + keys[i], '') + strings[lastIndex];
}
//# sourceMappingURL=noop-template.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/noop-template.ts"],"names":["noop","strings","keys","lastIndex","length","slice","reduce","p","s","i"],"mappings":"AAAA,OAAO,SAASA,IAAI,CAClBC,OAA6B,EAC7B,GAAGC,IAAI,AAAmB,EAC1B;IACA,MAAMC,SAAS,GAAGF,OAAO,CAACG,MAAM,GAAG,CAAC;IACpC,OACEH,OAAO,CAACI,KAAK,CAAC,CAAC,EAAEF,SAAS,CAAC,CAACG,MAAM,CAAC,CAACC,CAAC,EAAEC,CAAC,EAAEC,CAAC,GAAKF,CAAC,GAAGC,CAAC,GAAGN,IAAI,CAACO,CAAC,CAAC,EAAE,EAAE,CAAC,GACpER,OAAO,CAACE,SAAS,CAAC,CACnB;CACF"}

View File

@@ -0,0 +1,21 @@
import { parse } from 'next/dist/compiled/stacktrace-parser';
const regexNextStatic = /\/_next(\/static\/.+)/g;
export function parseStack(stack) {
const frames = parse(stack);
return frames.map((frame)=>{
try {
const url = new URL(frame.file);
const res = regexNextStatic.exec(url.pathname);
if (res) {
var ref, ref1;
const distDir = (ref1 = (ref = process.env.__NEXT_DIST_DIR) == null ? void 0 : ref.replace(/\\/g, '/')) == null ? void 0 : ref1.replace(/\/$/, '');
if (distDir) {
frame.file = 'file://' + distDir.concat(res.pop());
}
}
} catch (e) {}
return frame;
});
}
//# sourceMappingURL=parseStack.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/parseStack.ts"],"names":["parse","regexNextStatic","parseStack","stack","frames","map","frame","url","URL","file","res","exec","pathname","process","distDir","env","__NEXT_DIST_DIR","replace","concat","pop"],"mappings":"AAAA,SAASA,KAAK,QAAoB,sCAAsC,CAAA;AAExE,MAAMC,eAAe,2BAA2B;AAEhD,OAAO,SAASC,UAAU,CAACC,KAAa,EAAgB;IACtD,MAAMC,MAAM,GAAGJ,KAAK,CAACG,KAAK,CAAC;IAC3B,OAAOC,MAAM,CAACC,GAAG,CAAC,CAACC,KAAK,GAAK;QAC3B,IAAI;YACF,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAACF,KAAK,CAACG,IAAI,CAAE;YAChC,MAAMC,GAAG,GAAGT,eAAe,CAACU,IAAI,CAACJ,GAAG,CAACK,QAAQ,CAAC;YAC9C,IAAIF,GAAG,EAAE;oBACSG,GAA2B;gBAA3C,MAAMC,OAAO,GAAGD,QAAAA,CAAAA,GAA2B,GAA3BA,OAAO,CAACE,GAAG,CAACC,eAAe,SAChC,GADKH,KAAAA,CACL,GADKA,GAA2B,CACvCI,OAAO,QAAQ,GAAG,CAAC,SACZ,GAFKJ,KAAAA,CAEL,GAFKA,KAEZI,OAAO,QAAQ,EAAE,CAAC;gBACtB,IAAIH,OAAO,EAAE;oBACXR,KAAK,CAACG,IAAI,GAAG,SAAS,GAAGK,OAAO,CAACI,MAAM,CAACR,GAAG,CAACS,GAAG,EAAE,CAAE;iBACpD;aACF;SACF,CAAC,UAAM,EAAE;QACV,OAAOb,KAAK,CAAA;KACb,CAAC,CAAA;CACH"}

View File

@@ -0,0 +1,102 @@
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export function getOriginalStackFrame(source, type, errorMessage) {
var ref7, ref1;
function _getOriginalStackFrame() {
return __getOriginalStackFrame.apply(this, arguments);
}
function __getOriginalStackFrame() {
__getOriginalStackFrame = _async_to_generator(function*() {
var ref, ref4, ref5;
const params = new URLSearchParams();
params.append('isServer', String(type === 'server'));
params.append('isEdgeServer', String(type === 'edge-server'));
params.append('isAppDirectory', 'true');
params.append('errorMessage', errorMessage);
for(const key in source){
var _key;
params.append(key, ((_key = source[key]) != null ? _key : '').toString());
}
const controller = new AbortController();
const tm = setTimeout(()=>controller.abort(), 3000);
const res = yield self.fetch(`${process.env.__NEXT_ROUTER_BASEPATH || ''}/__nextjs_original-stack-frame?${params.toString()}`, {
signal: controller.signal
}).finally(()=>{
clearTimeout(tm);
});
if (!res.ok || res.status === 204) {
return Promise.reject(new Error((yield res.text())));
}
const body = yield res.json();
var /* collapsed */ ref6;
return {
error: false,
reason: null,
external: false,
expanded: !Boolean((ref6 = (((ref = source.file) == null ? void 0 : ref.includes('node_modules')) || ((ref4 = body.originalStackFrame) == null ? void 0 : (ref5 = ref4.file) == null ? void 0 : ref5.includes('node_modules')))) != null ? ref6 : true),
sourceStackFrame: source,
originalStackFrame: body.originalStackFrame,
originalCodeFrame: body.originalCodeFrame || null
};
});
return __getOriginalStackFrame.apply(this, arguments);
}
if (!(((ref7 = source.file) == null ? void 0 : ref7.startsWith('webpack-internal:')) || ((ref1 = source.file) == null ? void 0 : ref1.startsWith('file:')))) {
return Promise.resolve({
error: false,
reason: null,
external: true,
expanded: false,
sourceStackFrame: source,
originalStackFrame: null,
originalCodeFrame: null
});
}
var ref2, ref3;
return _getOriginalStackFrame().catch((err)=>{
return {
error: true,
reason: (ref3 = (ref2 = err == null ? void 0 : err.message) != null ? ref2 : err == null ? void 0 : err.toString()) != null ? ref3 : 'Unknown Error',
external: false,
expanded: false,
sourceStackFrame: source,
originalStackFrame: null,
originalCodeFrame: null
};
});
}
export function getOriginalStackFrames(frames, type, errorMessage) {
return Promise.all(frames.map((frame)=>getOriginalStackFrame(frame, type, errorMessage)));
}
export function getFrameSource(frame) {
let str = '';
try {
var ref;
const u = new URL(frame.file);
// Strip the origin for same-origin scripts.
if (typeof globalThis !== 'undefined' && ((ref = globalThis.location) == null ? void 0 : ref.origin) !== u.origin) {
// URLs can be valid without an `origin`, so long as they have a
// `protocol`. However, `origin` is preferred.
if (u.origin === 'null') {
str += u.protocol;
} else {
str += u.origin;
}
}
// Strip query string information as it's typically too verbose to be
// meaningful.
str += u.pathname;
str += ' ';
} catch (e) {
str += (frame.file || '(unknown)') + ' ';
}
if (frame.lineNumber != null) {
if (frame.column != null) {
str += `(${frame.lineNumber}:${frame.column}) `;
} else {
str += `(${frame.lineNumber}) `;
}
}
return str.slice(0, -1);
}
//# sourceMappingURL=stack-frame.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/stack-frame.ts"],"names":["getOriginalStackFrame","source","type","errorMessage","_getOriginalStackFrame","body","params","URLSearchParams","append","String","key","toString","controller","AbortController","tm","setTimeout","abort","res","self","fetch","process","env","__NEXT_ROUTER_BASEPATH","signal","finally","clearTimeout","ok","status","Promise","reject","Error","text","json","error","reason","external","expanded","Boolean","file","includes","originalStackFrame","sourceStackFrame","originalCodeFrame","startsWith","resolve","err","catch","message","getOriginalStackFrames","frames","all","map","frame","getFrameSource","str","globalThis","u","URL","location","origin","protocol","pathname","lineNumber","column","slice"],"mappings":"AAAA;AAgCA,OAAO,SAASA,qBAAqB,CACnCC,MAAkB,EAClBC,IAAqC,EACrCC,YAAoB,EACS;QAgDzBF,IAAW,EACXA,IAAW;aAhDAG,sBAAsB;eAAtBA,uBAAsB;;aAAtBA,uBAAsB;QAAtBA,uBAAsB,GAArC,oBAAA,YAAqE;gBAmC9DH,GAAW,EACVI,IAAuB;YAnC7B,MAAMC,MAAM,GAAG,IAAIC,eAAe,EAAE;YACpCD,MAAM,CAACE,MAAM,CAAC,UAAU,EAAEC,MAAM,CAACP,IAAI,KAAK,QAAQ,CAAC,CAAC;YACpDI,MAAM,CAACE,MAAM,CAAC,cAAc,EAAEC,MAAM,CAACP,IAAI,KAAK,aAAa,CAAC,CAAC;YAC7DI,MAAM,CAACE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;YACvCF,MAAM,CAACE,MAAM,CAAC,cAAc,EAAEL,YAAY,CAAC;YAC3C,IAAK,MAAMO,GAAG,IAAIT,MAAM,CAAE;oBACJ,IAAoB;gBAAxCK,MAAM,CAACE,MAAM,CAACE,GAAG,EAAE,CAAC,CAAA,IAAoB,GAApB,AAAC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AEF,KAAK,CAACU,UAAU,CAAC,CAAC,EAAEV,KAAK,CAACW,MAAM,CAAC,EAAE,CAAC;SAChD,MAAM;YACLT,GAAG,IAAI,CAAC,CAAC,EAAEF,KAAK,CAACU,UAAU,CAAC,EAAE,CAAC;SAChC;KACF;IACD,OAAOR,GAAG,CAACU,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;CACxB"}

View File

@@ -0,0 +1,76 @@
import { useEffect } from 'react';
export const RuntimeErrorHandler = {
hadRuntimeError: false
};
function isNextRouterError(error) {
return error && error.digest && (error.digest.startsWith('NEXT_REDIRECT') || error.digest === 'NEXT_NOT_FOUND');
}
function isHydrationError(error) {
return error.message.match(/(hydration|content does not match|did not match)/i) != null;
}
if (typeof window !== 'undefined') {
try {
// Increase the number of stack frames on the client
Error.stackTraceLimit = 50;
} catch (e) {}
}
const errorQueue = [];
const rejectionQueue = [];
const errorHandlers = [];
const rejectionHandlers = [];
if (typeof window !== 'undefined') {
// These event handlers must be added outside of the hook because there is no
// guarantee that the hook will be alive in a mounted component in time to
// when the errors occur.
window.addEventListener('error', (ev)=>{
if (isNextRouterError(ev.error)) {
ev.preventDefault();
return;
}
const error = ev == null ? void 0 : ev.error;
if (!error || !(error instanceof Error) || typeof error.stack !== 'string') {
// A non-error was thrown, we don't have anything to show. :-(
return;
}
if (isHydrationError(error)) {
error.message += `\n\nSee more info here: https://nextjs.org/docs/messages/react-hydration-error`;
}
const e = error;
errorQueue.push(e);
for (const handler of errorHandlers){
handler(e);
}
});
window.addEventListener('unhandledrejection', (ev)=>{
const reason = ev == null ? void 0 : ev.reason;
if (!reason || !(reason instanceof Error) || typeof reason.stack !== 'string') {
// A non-error was thrown, we don't have anything to show. :-(
return;
}
const e = reason;
rejectionQueue.push(e);
for (const handler of rejectionHandlers){
handler(e);
}
});
}
export function useErrorHandler(handleOnUnhandledError, handleOnUnhandledRejection) {
useEffect(()=>{
// Handle queued errors.
errorQueue.forEach(handleOnUnhandledError);
rejectionQueue.forEach(handleOnUnhandledRejection);
// Listen to new errors.
errorHandlers.push(handleOnUnhandledError);
rejectionHandlers.push(handleOnUnhandledRejection);
return ()=>{
// Remove listeners.
errorHandlers.splice(errorHandlers.indexOf(handleOnUnhandledError), 1);
rejectionHandlers.splice(rejectionHandlers.indexOf(handleOnUnhandledRejection), 1);
};
}, [
handleOnUnhandledError,
handleOnUnhandledRejection
]);
}
//# sourceMappingURL=use-error-handler.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/use-error-handler.ts"],"names":["useEffect","RuntimeErrorHandler","hadRuntimeError","isNextRouterError","error","digest","startsWith","isHydrationError","message","match","window","Error","stackTraceLimit","errorQueue","rejectionQueue","errorHandlers","rejectionHandlers","addEventListener","ev","preventDefault","stack","e","push","handler","reason","useErrorHandler","handleOnUnhandledError","handleOnUnhandledRejection","forEach","splice","indexOf"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO,CAAA;AAIjC,OAAO,MAAMC,mBAAmB,GAAG;IACjCC,eAAe,EAAE,KAAK;CACvB,CAAA;AAED,SAASC,iBAAiB,CAACC,KAAU,EAAW;IAC9C,OACEA,KAAK,IACLA,KAAK,CAACC,MAAM,IACZ,CAACD,KAAK,CAACC,MAAM,CAACC,UAAU,CAAC,eAAe,CAAC,IACvCF,KAAK,CAACC,MAAM,KAAK,gBAAgB,CAAC,CACrC;CACF;AAED,SAASE,gBAAgB,CAACH,KAAY,EAAW;IAC/C,OACEA,KAAK,CAACI,OAAO,CAACC,KAAK,qDAAqD,IACxE,IAAI,CACL;CACF;AAED,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,IAAI;QACF,oDAAoD;QACpDC,KAAK,CAACC,eAAe,GAAG,EAAE;KAC3B,CAAC,UAAM,EAAE;CACX;AAED,MAAMC,UAAU,GAAiB,EAAE;AACnC,MAAMC,cAAc,GAAiB,EAAE;AACvC,MAAMC,aAAa,GAAwB,EAAE;AAC7C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ACF,CAAC,CAAC;SACX;KACF,CACF;CACF;AAED,OAAO,SAASI,eAAe,CAC7BC,sBAAoC,EACpCC,0BAAwC,EACxC;IACA3B,SAAS,CAAC,IAAM;QACd,wBAAwB;QACxBa,UAAU,CAACe,OAAO,CAACF,sBAAsB,CAAC;QAC1CZ,cAAc,CAACc,OAAO,CAACD,0BAA0B,CAAC;QAElD,wBAAwB;QACxBZ,aAAa,CAACO,IAAI,CAACI,sBAAsB,CAAC;QAC1CV,iBAAiB,CAACM,IAAI,CAACK,0BAA0B,CAAC;QAElD,OAAO,IAAM;YACX,oBAAoB;YACpBZ,aAAa,CAACc,MAAM,CAACd,aAAa,CAACe,OAAO,CAACJ,sBAAsB,CAAC,EAAE,CAAC,CAAC;YACtEV,iBAAiB,CAACa,MAAM,CACtBb,iBAAiB,CAACc,OAAO,CAACH,0BAA0B,CAAC,EACrD,CAAC,CACF;SACF,CAAA;KACF,EAAE;QAACD,sBAAsB;QAAEC,0BAA0B;KAAC,CAAC;CACzD"}

View File

@@ -0,0 +1,55 @@
import { useCallback, useContext, useEffect, useRef } from 'react';
import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context';
import { getSocketProtocol } from './get-socket-protocol';
export function useWebsocket(assetPrefix) {
const webSocketRef = useRef();
useEffect(()=>{
if (webSocketRef.current) {
return;
}
const { hostname , port } = window.location;
const protocol = getSocketProtocol(assetPrefix);
const normalizedAssetPrefix = assetPrefix.replace(/^\/+/, '');
let url = `${protocol}://${hostname}:${port}${normalizedAssetPrefix ? `/${normalizedAssetPrefix}` : ''}`;
if (normalizedAssetPrefix.startsWith('http')) {
url = `${protocol}://${normalizedAssetPrefix.split('://')[1]}`;
}
webSocketRef.current = new window.WebSocket(`${url}/_next/webpack-hmr`);
}, [
assetPrefix
]);
return webSocketRef;
}
export function useSendMessage(webSocketRef) {
const sendMessage = useCallback((data)=>{
const socket = webSocketRef.current;
if (!socket || socket.readyState !== socket.OPEN) {
return;
}
return socket.send(data);
}, [
webSocketRef
]);
return sendMessage;
}
export function useWebsocketPing(websocketRef) {
const sendMessage = useSendMessage(websocketRef);
const { tree } = useContext(GlobalLayoutRouterContext);
useEffect(()=>{
// Taken from on-demand-entries-client.js
// TODO-APP: check 404 case
const interval = setInterval(()=>{
sendMessage(JSON.stringify({
event: 'ping',
tree,
appDirRoute: true
}));
}, 2500);
return ()=>clearInterval(interval);
}, [
tree,
sendMessage
]);
}
//# sourceMappingURL=use-websocket.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/helpers/use-websocket.ts"],"names":["useCallback","useContext","useEffect","useRef","GlobalLayoutRouterContext","getSocketProtocol","useWebsocket","assetPrefix","webSocketRef","current","hostname","port","window","location","protocol","normalizedAssetPrefix","replace","url","startsWith","split","WebSocket","useSendMessage","sendMessage","data","socket","readyState","OPEN","send","useWebsocketPing","websocketRef","tree","interval","setInterval","JSON","stringify","event","appDirRoute","clearInterval"],"mappings":"AAAA,SAASA,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO,CAAA;AAClE,SAASC,yBAAyB,QAAQ,8CAA8C,CAAA;AACxF,SAASC,iBAAiB,QAAQ,uBAAuB,CAAA;AAEzD,OAAO,SAASC,YAAY,CAACC,WAAmB,EAAE;IAChD,MAAMC,YAAY,GAAGL,MAAM,EAAa;IAExCD,SAAS,CAAC,IAAM;QACd,IAAIM,YAAY,CAACC,OAAO,EAAE;YACxB,OAAM;SACP;QAED,MAAM,EAAEC,QAAQ,CAAA,EAAEC,IAAI,CAAA,EAAE,GAAGC,MAAM,CAACC,QAAQ;QAC1C,MAAMC,QAAQ,GAAGT,iBAAiB,CAACE,WAAW,CAAC;QAC/C,MAAMQ,qBAAqB,GAAGR,WAAW,CAACS,OAAO,SAAS,EAAE,CAAC;QAE7D,IAAIC,GAAG,GAAG,CAAC,EAAEH,QAAQ,CAAC,GAAG,EAAEJ,QAAQ,CAAC,CAAC,EAAEC,IAAI,CAAC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IAAI,CAAC;QACR,OAAO,IAAMC,aAAa,CAACN,QAAQ,CAAC,CAAA;KACrC,EAAE;QAACD,IAAI;QAAER,WAAW;KAAC,CAAC;CACxB"}

View File

@@ -0,0 +1,27 @@
import * as React from 'react';
export function useOnClickOutside(el, handler) {
React.useEffect(()=>{
if (el == null || handler == null) {
return;
}
const listener = (e)=>{
// Do nothing if clicking ref's element or descendent elements
if (!el || el.contains(e.target)) {
return;
}
handler(e);
};
const root = el.getRootNode();
root.addEventListener('mousedown', listener);
root.addEventListener('touchstart', listener);
return function() {
root.removeEventListener('mousedown', listener);
root.removeEventListener('touchstart', listener);
};
}, [
handler,
el
]);
}
//# sourceMappingURL=use-on-click-outside.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/hooks/use-on-click-outside.ts"],"names":["React","useOnClickOutside","el","handler","useEffect","listener","e","contains","target","root","getRootNode","addEventListener","removeEventListener"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,SAASC,iBAAiB,CAC/BC,EAAe,EACfC,OAA2D,EAC3D;IACAH,KAAK,CAACI,SAAS,CAAC,IAAM;QACpB,IAAIF,EAAE,IAAI,IAAI,IAAIC,OAAO,IAAI,IAAI,EAAE;YACjC,OAAM;SACP;QAED,MAAME,QAAQ,GAAG,CAACC,CAA0B,GAAK;YAC/C,8DAA8D;YAC9D,IAAI,CAACJ,EAAE,IAAIA,EAAE,CAACK,QAAQ,CAACD,CAAC,CAACE,MAAM,CAAY,EAAE;gBAC3C,OAAM;aACP;YAEDL,OAAO,CAACG,CAAC,CAAC;SACX;QAED,MAAMG,IAAI,GAAGP,EAAE,CAACQ,WAAW,EAAE;QAC7BD,IAAI,CAACE,gBAAgB,CAAC,WAAW,EAAEN,QAAQ,CAAkB;QAC7DI,IAAI,CAACE,gBAAgB,CAAC,YAAY,EAAEN,QAAQ,CAAkB;QAC9D,OAAO,WAAY;YACjBI,IAAI,CAACG,mBAAmB,CAAC,WAAW,EAAEP,QAAQ,CAAkB;YAChEI,IAAI,CAACG,mBAAmB,CAAC,YAAY,EAAEP,QAAQ,CAAkB;SAClE,CAAA;KACF,EAAE;QAACF,OAAO;QAAED,EAAE;KAAC,CAAC;CAClB"}

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
const CloseIcon = ()=>{
return /*#__PURE__*/ React.createElement("svg", {
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/ React.createElement("path", {
d: "M18 6L6 18",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}), /*#__PURE__*/ React.createElement("path", {
d: "M6 6L18 18",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}));
};
export { CloseIcon };
//# sourceMappingURL=CloseIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/icons/CloseIcon.tsx"],"names":["React","CloseIcon","svg","width","height","viewBox","fill","xmlns","path","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAMC,SAAS,GAAG,IAAM;IACtB,qBACE,oBAACC,KAAG;QACFC,KAAK,EAAC,IAAI;QACVC,MAAM,EAAC,IAAI;QACXC,OAAO,EAAC,WAAW;QACnBC,IAAI,EAAC,MAAM;QACXC,KAAK,EAAC,4BAA4B;qBAElC,oBAACC,MAAI;QACHC,CAAC,EAAC,YAAY;QACdC,MAAM,EAAC,cAAc;QACrBC,WAAW,EAAC,GAAG;QACfC,aAAa,EAAC,OAAO;QACrBC,cAAc,EAAC,OAAO;MACtB,gBACF,oBAACL,MAAI;QACHC,CAAC,EAAC,YAAY;QACdC,MAAM,EAAC,cAAc;QACrBC,WAAW,EAAC,GAAG;QACfC,aAAa,EAAC,OAAO;QACrBC,cAAc,EAAC,OAAO;MACtB,CACE,CACP;CACF;AAED,SAASZ,SAAS,GAAE"}

View File

@@ -0,0 +1,82 @@
import * as React from 'react';
import { noop as css } from '../helpers/noop-template';
export function Base() {
return /*#__PURE__*/ React.createElement("style", null, css`
:host {
--size-gap-half: 4px;
--size-gap: 8px;
--size-gap-double: 16px;
--size-gap-triple: 24px;
--size-gap-quad: 32px;
--size-font-small: 14px;
--size-font: 16px;
--size-font-big: 20px;
--size-font-bigger: 24px;
--color-accents-1: #808080;
--color-accents-2: #222222;
--color-accents-3: #404040;
--font-stack-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono',
Menlo, Courier, monospace;
--color-ansi-selection: rgba(95, 126, 151, 0.48);
--color-ansi-bg: #111111;
--color-ansi-fg: #cccccc;
--color-ansi-white: #777777;
--color-ansi-black: #141414;
--color-ansi-blue: #00aaff;
--color-ansi-cyan: #88ddff;
--color-ansi-green: #98ec65;
--color-ansi-magenta: #aa88ff;
--color-ansi-red: #ff5555;
--color-ansi-yellow: #ffcc33;
--color-ansi-bright-white: #ffffff;
--color-ansi-bright-black: #777777;
--color-ansi-bright-blue: #33bbff;
--color-ansi-bright-cyan: #bbecff;
--color-ansi-bright-green: #b6f292;
--color-ansi-bright-magenta: #cebbff;
--color-ansi-bright-red: #ff8888;
--color-ansi-bright-yellow: #ffd966;
}
.mono {
font-family: var(--font-stack-monospace);
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: var(--size-gap);
font-weight: 500;
line-height: 1.5;
}
h1 {
font-size: 40px;
}
h2 {
font-size: 32px;
}
h3 {
font-size: 28px;
}
h4 {
font-size: 24px;
}
h5 {
font-size: 20px;
}
h6 {
font-size: 16px;
}
`);
}
//# sourceMappingURL=Base.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/styles/Base.tsx"],"names":["React","noop","css","Base","style"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,IAAI,IAAIC,GAAG,QAAQ,0BAA0B,CAAA;AAEtD,OAAO,SAASC,IAAI,GAAG;IACrB,qBACE,oBAACC,OAAK,QACHF,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2EL,CAAC,CACK,CACT;CACF"}

View File

@@ -0,0 +1,29 @@
import * as React from 'react';
import { styles as codeFrame } from '../components/CodeFrame/styles';
import { styles as dialog } from '../components/Dialog';
import { styles as leftRightDialogHeader } from '../components/LeftRightDialogHeader/styles';
import { styles as overlay } from '../components/Overlay/styles';
import { styles as terminal } from '../components/Terminal/styles';
import { styles as toast } from '../components/Toast';
import { styles as buildErrorStyles } from '../container/BuildError';
import { styles as rootLayoutErrorStyles } from '../container/RootLayoutError';
import { styles as containerErrorStyles } from '../container/Errors';
import { styles as containerRuntimeErrorStyles } from '../container/RuntimeError';
import { noop as css } from '../helpers/noop-template';
export function ComponentStyles() {
return /*#__PURE__*/ React.createElement("style", null, css`
${overlay}
${toast}
${dialog}
${leftRightDialogHeader}
${codeFrame}
${terminal}
${buildErrorStyles}
${rootLayoutErrorStyles}
${containerErrorStyles}
${containerRuntimeErrorStyles}
`);
}
//# sourceMappingURL=ComponentStyles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/styles/ComponentStyles.tsx"],"names":["React","styles","codeFrame","dialog","leftRightDialogHeader","overlay","terminal","toast","buildErrorStyles","rootLayoutErrorStyles","containerErrorStyles","containerRuntimeErrorStyles","noop","css","ComponentStyles","style"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAE9B,SAASC,MAAM,IAAIC,SAAS,QAAQ,gCAAgC,CAAA;AACpE,SAASD,MAAM,IAAIE,MAAM,QAAQ,sBAAsB,CAAA;AACvD,SAASF,MAAM,IAAIG,qBAAqB,QAAQ,4CAA4C,CAAA;AAC5F,SAASH,MAAM,IAAII,OAAO,QAAQ,8BAA8B,CAAA;AAChE,SAASJ,MAAM,IAAIK,QAAQ,QAAQ,+BAA+B,CAAA;AAClE,SAASL,MAAM,IAAIM,KAAK,QAAQ,qBAAqB,CAAA;AACrD,SAASN,MAAM,IAAIO,gBAAgB,QAAQ,yBAAyB,CAAA;AACpE,SAASP,MAAM,IAAIQ,qBAAqB,QAAQ,8BAA8B,CAAA;AAC9E,SAASR,MAAM,IAAIS,oBAAoB,QAAQ,qBAAqB,CAAA;AACpE,SAAST,MAAM,IAAIU,2BAA2B,QAAQ,2BAA2B,CAAA;AACjF,SAASC,IAAI,IAAIC,GAAG,QAAQ,0BAA0B,CAAA;AAEtD,OAAO,SAASC,eAAe,GAAG;IAChC,qBACE,oBAACC,OAAK,QACHF,GAAG,CAAC;QACH,EAAER,OAAO,CAAC;QACV,EAAEE,KAAK,CAAC;QACR,EAAEJ,MAAM,CAAC;QACT,EAAEC,qBAAqB,CAAC;QACxB,EAAEF,SAAS,CAAC;QACZ,EAAEI,QAAQ,CAAC;;QAEX,EAAEE,gBAAgB,CAAC;QACnB,EAAEC,qBAAqB,CAAC;QACxB,EAAEC,oBAAoB,CAAC;QACvB,EAAEC,2BAA2B,CAAC;MAChC,CAAC,CACK,CACT;CACF"}

View File

@@ -0,0 +1,359 @@
import * as React from 'react';
import { noop as css } from '../helpers/noop-template';
export function CssReset() {
return /*#__PURE__*/ React.createElement("style", null, css`
:host {
all: initial;
/* the direction property is not reset by 'all' */
direction: ltr;
}
/*!
* Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
:host {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article,
aside,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
display: block;
}
:host {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex='-1']:focus:not(:focus-visible) {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: 8px;
}
p {
margin-top: 0;
margin-bottom: 16px;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 16px;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 16px;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 8px;
margin-left: 0;
}
blockquote {
margin: 0 0 16px;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]) {
color: inherit;
text-decoration: none;
}
a:not([href]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas,
'Liberation Mono', 'Courier New', monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 16px;
overflow: auto;
}
figure {
margin: 0 0 16px;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 12px;
padding-bottom: 12px;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: 8px;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
select {
word-wrap: normal;
}
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
}
button:not(:disabled),
[type='button']:not(:disabled),
[type='reset']:not(:disabled),
[type='submit']:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type='radio'],
input[type='checkbox'] {
box-sizing: border-box;
padding: 0;
}
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: 8px;
font-size: 24px;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}
[type='search'] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
`);
}
//# sourceMappingURL=CssReset.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../client/components/react-dev-overlay/internal/styles/CssReset.tsx"],"names":["React","noop","css","CssReset","style"],"mappings":"AAAA,YAAYA,KAAK,MAAM,OAAO,CAAA;AAC9B,SAASC,IAAI,IAAIC,GAAG,QAAQ,0BAA0B,CAAA;AAEtD,OAAO,SAASC,QAAQ,GAAG;IACzB,qBACE,oBAACC,OAAK,QACHF,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgWL,CAAC,CACK,CACT;CACF"}