fix: lot of thingsthis commit makes the broken features functionnal again
the instant router is broken, app router is used as a stub, but instead of "instant" is reloads to next page for now
@@ -19,6 +19,7 @@ COPY ./yarn.lock /usr/src/app/yarn.lock
# Install dependencies
RUN apk upgrade --no-cache openssl
+RUN npm install --global yarn
RUN yarn install
# [local tree] [builder tree]
@@ -168,10 +169,19 @@ USER root
WORKDIR /home/git
RUN service ssh start
+# RUN service ssh status
EXPOSE 22
EXPOSE ${PORT}
WORKDIR /app
-CMD ["/bin/bash", "-c", "/usr/sbin/sshd -D & nohup; node app/server.js"]
+RUN echo "\
+ #!/bin/bash \
+ /usr/sbin/sshd -D & nohup; \
+ node app/server.js; \
+" >> /app/entrypoint.sh
+
+RUN chmod a+x /app/entrypoint.sh
+
+CMD ["/bin/bash", "-c", "/app/entrypoint.sh"]
@@ -1,5 +1,5 @@
{
- "_generatedAtUnix": 1712711081241,
+ "_generatedAtUnix": 1778263212194,
"_hashAlgorithm": "sha1",
"_version": 2,
"assets": {
@@ -10,91 +10,91 @@
},
"InstantRouter": {
"kind": "generated",
- "hash": "3d08c09ed073afa4560e7b9943914bf3ddc6098d",
+ "hash": "200719af8370ed46e076acd80c0f053b3de89836",
"path": "./public/islands-runtime.js"
}
},
"islands": {
"AppRouter": {
- "hash": "503ea3936602d644f38a7d20fa990d7d050b0d12",
+ "hash": "8afbbf1045fc9513fc75dd93d92cb6b7fee5823e",
"pathSource": "./app/islands/AppRouter.tsx",
"pathBundle": "./public/.islands/AppRouter.bundle.js",
"pathSourceMap": "./public/.islands/AppRouter.bundle.js.map"
},
"Code": {
- "hash": "4b585b9dc0f2dcd0dacbfed17fcf8c0c4f40e0e8",
+ "hash": "2f1068f28f37b4c9fc39d082e5e443a49268bf80",
"pathSource": "./app/islands/Code.tsx",
"pathBundle": "./public/.islands/Code.bundle.js",
"pathSourceMap": "./public/.islands/Code.bundle.js.map"
},
"InstantRouterIndicator": {
- "hash": "7950e8886858e70a4b3616bc551c30a2ca9744bd",
+ "hash": "882b1079900ca62bbed9edb917e9f98d25510389",
"pathSource": "./app/islands/InstantRouterIndicator.tsx",
"pathBundle": "./public/.islands/InstantRouterIndicator.bundle.js",
"pathSourceMap": "./public/.islands/InstantRouterIndicator.bundle.js.map"
},
"PullRequestSourceSelect": {
- "hash": "e9a167828cf774db2391b674d5ef5eaba8b3f8cd",
+ "hash": "8e551193aa6fb6db829580555a4fd079c7f9f3d2",
"pathSource": "./app/islands/PullRequestSourceSelect.tsx",
"pathBundle": "./public/.islands/PullRequestSourceSelect.bundle.js",
"pathSourceMap": "./public/.islands/PullRequestSourceSelect.bundle.js.map"
},
"RepositoriesList": {
- "hash": "98b735ebcd727f3d34f2e2d4af578dbda9ae3081",
+ "hash": "75dbdd8bc65ad5b787235cb8514ed53168744a7d",
"pathSource": "./app/islands/RepositoriesList.tsx",
"pathBundle": "./public/.islands/RepositoriesList.bundle.js",
"pathSourceMap": "./public/.islands/RepositoriesList.bundle.js.map"
},
"RepositoryCommitSummaryLine": {
- "hash": "f1b583339bcae5d3a207139106daee95924db9b9",
+ "hash": "7c3d65ecbffa640a17a60f90c9817fa3ebaa72ee",
"pathSource": "./app/islands/RepositoryCommitSummaryLine.tsx",
"pathBundle": "./public/.islands/RepositoryCommitSummaryLine.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryCommitSummaryLine.bundle.js.map"
},
"RepositoryCreateForm": {
- "hash": "1188f10449f61ba13d960e4656eff51771688b0b",
+ "hash": "546ac2b54b8b42e6dd1b499cdd865b650659900e",
"pathSource": "./app/islands/RepositoryCreateForm.tsx",
"pathBundle": "./public/.islands/RepositoryCreateForm.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryCreateForm.bundle.js.map"
},
"RepositoryFilesDiffsList": {
- "hash": "5a450fca443764deb2043fd1b70264cd7646e7ba",
+ "hash": "9ce62604a45279c7f72a745076a8cdb6a24e8ca4",
"pathSource": "./app/islands/RepositoryFilesDiffsList.tsx",
"pathBundle": "./public/.islands/RepositoryFilesDiffsList.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryFilesDiffsList.bundle.js.map"
},
"RepositoryForkForm": {
- "hash": "5213fa59ac3971ce10dea7bbf3ed6771761fb4e7",
+ "hash": "e744c88ef2c2885a32b5594732b1cfab088f4350",
"pathSource": "./app/islands/RepositoryForkForm.tsx",
"pathBundle": "./public/.islands/RepositoryForkForm.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryForkForm.bundle.js.map"
},
"RepositoryHero": {
- "hash": "9856ab7b1b73d82476e8cfae0adab2af53e62c1b",
+ "hash": "86d474ab9b3342158f964569b85d3e6b9aeba9e3",
"pathSource": "./app/islands/RepositoryHero.tsx",
"pathBundle": "./public/.islands/RepositoryHero.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryHero.bundle.js.map"
},
"RepositoryInitialSetup": {
- "hash": "5a8bf6a597e995832fd8c4d970281e079b97c3c5",
+ "hash": "e74c7ffee28f9a4c3c2b9d9430d4b1329f6d0fd4",
"pathSource": "./app/islands/RepositoryInitialSetup.tsx",
"pathBundle": "./public/.islands/RepositoryInitialSetup.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryInitialSetup.bundle.js.map"
},
"RepositoryPullRequestCreateForm": {
- "hash": "47bb70e8c7ffbc9b2b05f85f2955deda92136951",
+ "hash": "6b7fca0b6cabeacdb1cc6129535dfdb67ab0e9e0",
"pathSource": "./app/islands/RepositoryPullRequestCreateForm.tsx",
"pathBundle": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js.map"
},
"RepositoryTreeView": {
- "hash": "6ae32b3d9d68df79fa2479c4b22c1da948320bda",
+ "hash": "dc566c91c41bd9fc04da9e7017cd168f008c8b72",
"pathSource": "./app/islands/RepositoryTreeView.tsx",
"pathBundle": "./public/.islands/RepositoryTreeView.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryTreeView.bundle.js.map"
},
"SSHKeyItem": {
- "hash": "8bf0cef0ee6fefe102e3d99e23fd764d6f06bd22",
+ "hash": "31e551858d85e502e5de1a37699de2225916ba96",
"pathSource": "./app/islands/SSHKeyItem.tsx",
"pathBundle": "./public/.islands/SSHKeyItem.bundle.js",
"pathSourceMap": "./public/.islands/SSHKeyItem.bundle.js.map"
@@ -102,91 +102,91 @@
},
"views": {
"HomeView": {
- "hash": "b5e4852402693d127221441f6075aea131a5ef61",
+ "hash": "71df46f8100afeaf8edf234ffb076740a2c8b735",
"pathSource": "./app/views/HomeView.tsx"
},
"InternalErrorView": {
- "hash": "16f0d72a0d5e3b56fb7e11bdf8b35c5e60a12643",
+ "hash": "af1d1eb51c24336b7f57985d6a8039aebccd7387",
"pathSource": "./app/views/InternalErrorView.tsx"
},
"LoginView": {
- "hash": "f6ac28e71caa03457bd6a50564d8a08abbd4e8a3",
+ "hash": "62a9ad12da41d6505e0490b83966e239cfdcb55c",
"pathSource": "./app/views/auth/LoginView.tsx"
},
"RegisterView": {
- "hash": "7db4267b67a6d6eed0dd256399e02b4ff9d1d7e2",
+ "hash": "5091e491a50151b50d4c683c1ce1f525ebfa0f6c",
"pathSource": "./app/views/auth/RegisterView.tsx"
},
"OrganizationDetailsView": {
- "hash": "ccb720380689bb15285ed08e8a6925d17f80e21a",
+ "hash": "9f4015bd7b0c21cf393cf3309f1bd52c9cd2c4d2",
"pathSource": "./app/views/organization/OrganizationDetailsView.tsx"
},
"RepositoryBrowserView": {
- "hash": "250df130001f1a23730fe44eee6371a05fdd2025",
+ "hash": "7b41bf07b8f2b7533023c0ddd01a254ccc04c216",
"pathSource": "./app/views/repository/RepositoryBrowserView.tsx"
},
"RepositoryCommitsLogView": {
- "hash": "7d61f9373b0b31cedbf1475ccbdf2055a2e8f3aa",
+ "hash": "0d8c3d27a27e82f345ef5be98122927103a60d09",
"pathSource": "./app/views/repository/RepositoryCommitsLogView.tsx"
},
"RepositoryCompareView": {
- "hash": "a18c579196ebc2ec82ae743046a8e02ec03ca8a9",
+ "hash": "a7ac4991abcd466ff0d6862ab3cc1f3c1541f317",
"pathSource": "./app/views/repository/RepositoryCompareView.tsx"
},
"RepositoryCreateView": {
- "hash": "b7138339dcb62e965acd1a1deb9ecc75412b333b",
+ "hash": "d38e91def64064530cad123022ea856100bf79ae",
"pathSource": "./app/views/repository/RepositoryCreateView.tsx"
},
"RepositoryDetailsView": {
- "hash": "8f1460767fe170aa825ab4dac93d63aa6bf59b1c",
+ "hash": "6162522f8245f1287a3b0a974278f38308203d20",
"pathSource": "./app/views/repository/RepositoryDetailsView.tsx"
},
"RepositoryExploreView": {
- "hash": "1b5cc5fb0fd692ae993fe8e892c59456346b32c5",
+ "hash": "23c047be74527e247e7e3d334f300d591e70e5a3",
"pathSource": "./app/views/repository/RepositoryExploreView.tsx"
},
"RepositoryForkView": {
- "hash": "2b09c90107b865e627c524ed9983efcb457b7fe1",
+ "hash": "af5b2ddc25d33b4d48f0ac2dfc6e4e6537be7354",
"pathSource": "./app/views/repository/RepositoryForkView.tsx"
},
"RepositoryShowObjectView": {
- "hash": "eaccea13f91094a106ba6815ca6d8d5765de0c29",
+ "hash": "428390b5d94c5806b809cde4bf912a663be0ca36",
"pathSource": "./app/views/repository/RepositoryShowObjectView.tsx"
},
"RepositoryPullRequestCreateView": {
- "hash": "d0cb60a6511891581ca12ca2c3b7b54ddd0faebe",
+ "hash": "25a239fcc8d0aa05e3cc312d51b2e6f018e7cd65",
"pathSource": "./app/views/repositoryPullRequests/RepositoryPullRequestCreateView.tsx"
},
"RepositoryPullRequestDetailsView": {
- "hash": "cceff37024b4ef5e07d6834d40fde849bc53dc04",
+ "hash": "2fa65a3012cc05738f83656d4f0e773ebd0e5bb3",
"pathSource": "./app/views/repositoryPullRequests/RepositoryPullRequestDetailsView.tsx"
},
"RepositoryPullRequestsView": {
- "hash": "33831a5912cdf2e8dd0f44f6159ef6b438322445",
+ "hash": "1816a6fb6b830daa31d3a371ef2712b3cd634188",
"pathSource": "./app/views/repositoryPullRequests/RepositoryPullRequestsView.tsx"
},
"SettingsKeyAddView": {
- "hash": "584c3cd4b6821f96a4129dfeaac8b54bf9cbcff6",
+ "hash": "49a739a0d6783448980745c0ac979f9811b4bb47",
"pathSource": "./app/views/settings/SettingsKeyAddView.tsx"
},
"SettingsKeyUpdateView": {
- "hash": "18b98cb52792e2ad59b99d1995e5c15e81b67c95",
+ "hash": "bb7caeb011500b55d56f851d8182678f3ed9ff08",
"pathSource": "./app/views/settings/SettingsKeyUpdateView.tsx"
},
"SettingsKeysListView": {
- "hash": "deebae0aaf402482f8ff1298921d9f6cd5016619",
+ "hash": "512650c4e1b5ea9e2127ec4f2ef68d40ab70c6fb",
"pathSource": "./app/views/settings/SettingsKeysListView.tsx"
},
"SettingsView": {
- "hash": "83a043d69f6544f5f605779f77f251f4ee7810cf",
+ "hash": "0d7e4617b9b905ab8cce136062e9e3504d9fa138",
"pathSource": "./app/views/settings/SettingsView.tsx"
},
"UserDashboardView": {
- "hash": "272155a4521b51a4849c4a1bb4b7a2db717a369f",
+ "hash": "2f9e8e3393a4c63f5ba6c0d088d5d23f83a6fac3",
"pathSource": "./app/views/user/UserDashboardView.tsx"
},
"UserDetailsView": {
- "hash": "ade40bdda227fd333fb3c4f05e9d83a9e7d12747",
+ "hash": "05ab81a08fffc02b366ae34460d482c863750b33",
"pathSource": "./app/views/user/UserDetailsView.tsx"
}
}
@@ -33,8 +33,8 @@ const baseButtonCss = css<ButtonProps>`
padding: 8px 16px;
background-color: ${Colors.PRIMARY_01};
- border: 1px solid ${Colors.WHITE_01};
- border-radius: 8px;
+ border: none; /* 1px solid ${Colors.WHITE_01}; */
+ border-radius: 4px;
color: ${Colors.WHITE_01};
font-size: 16px;
font-weight: 600;
@@ -43,8 +43,10 @@ const baseButtonCss = css<ButtonProps>`
user-select: none;
text-align: center;
- transition: background-color 140ms ease-in-out 0s,
- border-color 140ms ease-in-out 0s, padding-top 140ms ease-in-out 0s,
+ transition:
+ background-color 140ms ease-in-out 0s,
+ border-color 140ms ease-in-out 0s,
+ padding-top 140ms ease-in-out 0s,
transform 140ms ease-in-out 0s;
&:not(:disabled) {
@@ -16,5 +16,5 @@ export const Card = styled.div<WithThemeSchemeProp>`
border: 1px solid ${NamedColors.BORDER_CARD[themeScheme]};
`};
- border-radius: 12px;
+ border-radius: 8px;
`;
@@ -3,11 +3,13 @@ import React, { FC } from "react";
import styled, { css } from "styled-components";
// app
import type { CommonViewProps, WithThemeSchemeProp } from "../types";
+import { Const } from "../const";
import { NamedColors } from "../utils/style";
-import { PageHeader } from "./PageHeader";
// app islands
import InstantRouterIndicator from "../islands/InstantRouterIndicator";
+import { PageHeader } from "./PageHeader";
+
interface LayoutProps extends CommonViewProps {
foo?: boolean;
appVersion: string;
@@ -87,7 +89,8 @@ export const Layout: FC<LayoutProps & WithThemeSchemeProp> = (commonProps) => {
<StyledFooterWrapper>
<p>
<a href={"https://gitfoss.io/ethicdevs/gitfoss"}>
- GitFOSS - v{appVersion} (#{gitStamp.slice(0, 7)}) - MIT License
+ {Const.APP_NAME} - v{appVersion} (#{gitStamp.slice(0, 7)}) - MIT
+ License
</a>
</p>
</StyledFooterWrapper>
@@ -24,22 +24,39 @@ export const MarkdownToJsx: VFC<MarkdownToJsxProps> = ({
wrapper: ({ children }) => <>{children}</>,
forceBlock: true,
overrides: {
- a: ({ children, href, title, ...props }) => (
- <StyledAnchor
- {...props}
- href={href}
- themeScheme={themeScheme}
- title={title}
- target={href.startsWith("http") ? "_blank" : undefined}
- rel={
- href.startsWith("http")
- ? "noopener noreferer noreferrer"
- : undefined
- }
- >
- {children}
- </StyledAnchor>
- ),
+ a: ({ children, href, title, ...props }) => {
+ const isAbsolute =
+ href && /^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i.test(href);
+ // choose base: fixed './tree/' or relative to current repo path
+ const base = "./tree/"; // or: const base = `${location.pathname.replace(/\/?$/, '/') }tree/`;
+ const normalizedHref =
+ !href || isAbsolute
+ ? href
+ : href.startsWith("./") // relative path
+ ? base + href.replace(/^\.?\/?/, "")
+ : href;
+
+ return (
+ <StyledAnchor
+ {...props}
+ href={normalizedHref}
+ themeScheme={themeScheme}
+ title={title}
+ target={
+ normalizedHref && normalizedHref.startsWith("http")
+ ? "_blank"
+ : undefined
+ }
+ rel={
+ normalizedHref && normalizedHref.startsWith("http")
+ ? "noopener noreferrer"
+ : undefined
+ }
+ >
+ {children}
+ </StyledAnchor>
+ );
+ },
p: ({ children }) => (
<StyledParagraph themeScheme={themeScheme}>
{children}
@@ -55,7 +72,7 @@ export const MarkdownToJsx: VFC<MarkdownToJsxProps> = ({
const { className, children: code } = children["props"];
const language = (className || "lang-plaintext").replace(
"lang-",
- ""
+ "",
);
return (
<Code
@@ -120,7 +137,7 @@ export const MarkdownToJsx: VFC<MarkdownToJsxProps> = ({
),
},
}),
- [markdown]
+ [markdown],
);
return (
@@ -13,7 +13,7 @@ type Const = {
};
export const Const: Const = {
- APP_NAME: "GitBase",
+ APP_NAME: "GitFOSS",
PRIMARY_BRANCH_REF: "master",
DEFAULT_HEAD_REF: "HEAD",
DEFAULT_THEME_SCHEME: "light",
@@ -12,6 +12,7 @@ import { makeUsersService } from "../../services/user";
import RepositoryCreateView, {
RepositoryCreateViewProps,
} from "../../views/repository/RepositoryCreateView";
+import { ResourceVisibility } from "@prisma/client";
const postRepositoryCreateAction: ReqHandler<
AppRouteParams,
@@ -36,7 +37,7 @@ const postRepositoryCreateAction: ReqHandler<
return reqHandler<RepositoryCreateViewProps>(RepositoryCreateView.name, {
errorMessage,
availableParentOrgs: await usersService.getUserOrganizations(
- request.session.data.curr_user_uid
+ request.session.data.curr_user_uid,
),
});
}
@@ -64,17 +65,17 @@ const postRepositoryCreateAction: ReqHandler<
isFork: false,
keywords: keywords.split(","),
lastPushedAt: null,
- shortDescription,
- visibility,
- websiteUrl, // TODO: Ensure it resolves/has a TXT record in DNS pointing to us.
+ shortDescription: shortDescription || null,
+ visibility: visibility || ResourceVisibility.PRIVATE,
+ websiteUrl: websiteUrl || null, // TODO: Ensure it resolves/has a TXT record in DNS pointing to us.
},
repoInitFlags: {
orgRepositoriesDir: resolve(
- join(Env.GIT_REPOSITORIES_ROOT, parentOrgSlug)
+ join(Env.GIT_REPOSITORIES_ROOT, parentOrgSlug),
),
withBaseReadmeFile: withBaseReadmeFile === "on",
withLicense: withLicense === "on",
- withLicenseKind,
+ withLicenseKind: withLicenseKind || "MIT",
},
});
@@ -3,6 +3,21 @@ import { ReactIsland } from "@ethicdevs/react-monolith";
// 3rd-party
import React, { useEffect, useRef } from "react";
+declare global {
+ interface Window {
+ __router: {
+ push(path: string): void;
+ navigate(
+ url: URL,
+ pushState?: boolean,
+ prefetchHtml?: string,
+ prefetchTargetUrl?: string,
+ ): Promise<void>;
+ };
+ }
+ var __router: Window["__router"];
+}
+
export const AppRouterEventPrefix = `app_router_`;
export const AppRouterEvent = {
LOADING: `${AppRouterEventPrefix}loading`,
@@ -13,7 +28,7 @@ export const AppRouterEvent = {
NAVIGATION_ERROR: `${AppRouterEventPrefix}navigation_error`,
};
-function evalPageScripts() {
+function reloadScript() {
const scripts = document.body.querySelectorAll("script");
scripts.forEach((script) => {
@@ -38,7 +53,7 @@ function evalPageScripts() {
const AppRouter: ReactIsland = () => {
const domParserRef = useRef(
- typeof DOMParser !== "undefined" ? new DOMParser() : null
+ typeof DOMParser !== "undefined" ? new DOMParser() : null,
);
const domParser = domParserRef.current!;
@@ -62,7 +77,7 @@ const AppRouter: ReactIsland = () => {
url: URL,
pushState: boolean = true,
prefetchHtml?: string,
- prefetchTargetUrl?: string
+ prefetchTargetUrl?: string,
): Promise<void> {
if (document.location.origin == url.origin) {
if (loadUrlRef.current != null && url.href === loadUrlRef.current) {
@@ -75,11 +90,7 @@ const AppRouter: ReactIsland = () => {
document.dispatchEvent(
new CustomEvent(AppRouterEvent.LOADING, {
detail: { request: { url: url.href } },
- })
- );
-
- console.log(
- `[${new Date().getTime()}][AppRouter] Navigate: ${url.href}`
+ }),
);
const currentUrl = new URL(document.location.href);
@@ -89,7 +100,7 @@ const AppRouter: ReactIsland = () => {
scrollTop: document.documentElement.scrollTop,
},
"",
- currentUrl
+ currentUrl,
);
let html;
@@ -99,6 +110,9 @@ const AppRouter: ReactIsland = () => {
targetUrl = new URL(prefetchTargetUrl);
}
+ window.location.href = url.toString();
+ return;
+
if (prefetchHtml != null) {
html = prefetchHtml;
} else {
@@ -115,6 +129,10 @@ const AppRouter: ReactIsland = () => {
targetUrl = targetUrl!;
+ console.log(
+ `[${new Date().getTime()}][AppRouter] Navigate: ${targetUrl.href}`,
+ );
+
loadUrlRef.current = targetUrl.href;
document.dispatchEvent(
@@ -123,7 +141,7 @@ const AppRouter: ReactIsland = () => {
request: { url: targetUrl.href },
response: { html },
},
- })
+ }),
);
document.dispatchEvent(
@@ -132,7 +150,7 @@ const AppRouter: ReactIsland = () => {
request: { url: targetUrl.href },
response: { html },
},
- })
+ }),
);
const targetDoc = domParser.parseFromString(html, "text/html");
@@ -145,9 +163,12 @@ const AppRouter: ReactIsland = () => {
document.title = targetTitle;
+ console.log("title:", targetTitle);
+
document.head.innerHTML =
targetHead.innerHTML || document.head.innerHTML;
+ document.documentElement.innerHTML = "";
document.body.innerHTML =
targetBody.innerHTML || document.body.innerHTML;
@@ -156,7 +177,7 @@ const AppRouter: ReactIsland = () => {
document.scrollingElement != null &&
targetUrl.href !== currentUrl.href
) {
- document.scrollingElement.scrollTo({
+ document.scrollingElement!.scrollTo({
behavior: "auto",
top: 0,
});
@@ -165,11 +186,11 @@ const AppRouter: ReactIsland = () => {
window.history.pushState(
{ href: targetUrl.href, scrollTop: 0 },
"",
- targetUrl
+ targetUrl,
);
}
- evalPageScripts; //();
+ reloadScript();
document.dispatchEvent(
new CustomEvent(AppRouterEvent.NAVIGATED, {
@@ -177,7 +198,7 @@ const AppRouter: ReactIsland = () => {
request: { url: targetUrl.href },
response: { html },
},
- })
+ }),
);
} catch (err) {
const error = err as Error;
@@ -187,7 +208,7 @@ const AppRouter: ReactIsland = () => {
request: { url: url.href },
response: { error },
},
- })
+ }),
);
} finally {
loadUrlRef.current = null;
@@ -251,7 +272,7 @@ const AppRouter: ReactIsland = () => {
};
let onClickHandler: ((subEv: MouseEvent) => boolean) | null = (
- subEv: MouseEvent
+ subEv: MouseEvent,
) => {
subEv.preventDefault();
@@ -318,6 +339,13 @@ const AppRouter: ReactIsland = () => {
window.addEventListener("popstate", onPopState);
+ window.__router = window.__router ?? ({} as Window["__router"]);
+ window.__router.navigate = navigate;
+ window.__router.push = (path: string) => {
+ const url = new URL(path, document.location.href);
+ navigate(url, true);
+ };
+
return () => {
document.removeEventListener("submit", onFormSubmit);
document.removeEventListener("mousedown", onMouseDown);
@@ -8,7 +8,6 @@ import React, {
useMemo,
useState,
} from "react";
-import Prism from "prismjs";
import styled, { css } from "styled-components";
// import { fetch } from "cross-fetch";
// app
@@ -26,6 +25,7 @@ interface CodeProps {
}
if (typeof window === "undefined") {
+ const Prism = require("prismjs");
Prism.languages.prisma = Prism.languages.extend("javascript", {
keyword: /\b(?:datasource|enum|generator|model|type)\b/,
});
@@ -52,24 +52,31 @@ const Code: ReactIsland<CodeProps & WithThemeSchemeProp> = ({
}) => {
const { before: lineStartAt } = useMemo(
() => getGitdiffLineStart(code),
- [code]
+ [code],
);
const computeSyntaxHighlightingSSR = useCallback(() => {
- const safeLanguage =
- "languages" in Prism &&
- Prism.languages != null &&
- typeof Prism.languages === "object" &&
- language in Prism.languages &&
- Prism.languages[language] != null
- ? Prism.languages[language]
- : null;
- return {
- __html:
- safeLanguage != null
- ? Prism.highlight(code, safeLanguage, language)
- : escapeHtmlCode(code),
- };
+ if (typeof window === "undefined") {
+ const Prism = require("prismjs");
+ const safeLanguage =
+ "languages" in Prism &&
+ Prism.languages != null &&
+ typeof Prism.languages === "object" &&
+ language in Prism.languages &&
+ Prism.languages[language] != null
+ ? Prism.languages[language]
+ : null;
+ return {
+ __html:
+ safeLanguage != null
+ ? Prism.highlight(code, safeLanguage, language)
+ : escapeHtmlCode(code),
+ };
+ } else {
+ return {
+ __html: escapeHtmlCode(code),
+ };
+ }
}, [code, language]);
const appendLineNumbers = useCallback(
@@ -88,11 +95,11 @@ const Code: ReactIsland<CodeProps & WithThemeSchemeProp> = ({
copyInnerHtml.__html += `</span>`;
return copyInnerHtml;
},
- [lineStartAt]
+ [lineStartAt],
);
const [innerHtml, setInnerHtml] = useState<{ __html: string }>(
- appendLineNumbers(computeSyntaxHighlightingSSR())
+ appendLineNumbers(computeSyntaxHighlightingSSR()),
);
const getHighlightedCodeInnerHtml = useCallback(async (): Promise<{
@@ -116,7 +123,7 @@ const Code: ReactIsland<CodeProps & WithThemeSchemeProp> = ({
language,
theme_scheme: themeScheme,
}),
- }
+ },
);
const jsonRes = await res.json();
inHtml = {
@@ -151,12 +158,12 @@ const Code: ReactIsland<CodeProps & WithThemeSchemeProp> = ({
onClientSideRouterLoadComplete();
document.addEventListener(
ClientSideRouterEvents.NAVIGATED,
- onClientSideRouterLoadComplete
+ onClientSideRouterLoadComplete,
);
return () => {
document.removeEventListener(
ClientSideRouterEvents.NAVIGATED,
- onClientSideRouterLoadComplete
+ onClientSideRouterLoadComplete,
);
};
}, []);
@@ -38,7 +38,7 @@ const InstantRouterIndicator: ReactIsland<InstantRouterIndicatorProps> = () => {
if (isInstantRouteLoading) {
setInstantRouteLoadPercent((prev) => prev + 10);
}
- }, 500);
+ }, 5);
}, [
isInstantRouteLoading,
setInstantRouteLoading,
@@ -86,37 +86,37 @@ const InstantRouterIndicator: ReactIsland<InstantRouterIndicatorProps> = () => {
if (typeof document !== "undefined") {
document.addEventListener(
ClientSideRouterEvents.LOADING,
- onClientSideRouterLoadStart
+ onClientSideRouterLoadStart,
);
document.addEventListener(
ClientSideRouterEvents.NAVIGATED,
- onClientSideRouterLoadComplete
+ onClientSideRouterLoadComplete,
);
document.addEventListener(
ClientSideRouterEvents.LOAD_ERROR,
- onClientSideRouterLoadError
+ onClientSideRouterLoadError,
);
document.addEventListener(
ClientSideRouterEvents.NAVIGATION_ERROR,
- onClientSideRouterNavigationError
+ onClientSideRouterNavigationError,
);
return () => {
document.removeEventListener(
ClientSideRouterEvents.LOADING,
- onClientSideRouterLoadStart
+ onClientSideRouterLoadStart,
);
document.removeEventListener(
ClientSideRouterEvents.NAVIGATED,
- onClientSideRouterLoadComplete
+ onClientSideRouterLoadComplete,
);
document.removeEventListener(
ClientSideRouterEvents.LOAD_ERROR,
- onClientSideRouterLoadError
+ onClientSideRouterLoadError,
);
document.removeEventListener(
ClientSideRouterEvents.NAVIGATION_ERROR,
- onClientSideRouterNavigationError
+ onClientSideRouterNavigationError,
);
};
}
@@ -186,7 +186,7 @@ const StyledInstantRouteProgressIndicator = styled.div`
right: 0;
left: 0;
- z-index: 25000;
+ z-index: 80000;
background-color: transparent;
`;
@@ -9,7 +9,8 @@ import {
RepositoryWithParentAndForkedFromRepos,
WithThemeSchemeProp,
} from "../types";
-import { Grid, Select } from "../components";
+import { Grid } from "../components/Grid";
+import { Select } from "../components/TextInput.styled";
export interface PullRequestSourceSelection {
selectedOrg: {
@@ -51,7 +52,7 @@ export interface PullRequestSourceSelectProps {
};
namePrefix: "source" | "target";
onSelectionChange?: (
- ev: PullRequestSourceSelectionChangeEvent
+ ev: PullRequestSourceSelectionChangeEvent,
) => void | Promise<void>;
}
@@ -65,27 +66,30 @@ const PullRequestSourceSelect: ReactIsland<
sources,
}) => {
const [selectedOrgSlug, setSelectedOrgSlug] = useState<string>(
- defaultSource.org.slug
+ defaultSource.org.slug,
);
const [selectedRepoSlug, setSelectedRepoSlug] = useState<string>(
- defaultSource.repo.slug
+ defaultSource.repo.slug,
);
const [selectedBranch, setSelectedBranch] = useState<string>(
- defaultSource.branch
+ defaultSource.branch,
);
const allOrganizations = useMemo(() => {
const orgsBySlug = Object.entries(sources);
- return orgsBySlug.reduce((acc, [_, { org }]) => {
- acc = [
- ...acc,
- {
- key: org.slug,
- value: org.displayName || org.slug,
- },
- ];
- return acc;
- }, [] as { key: string; value: string }[]);
+ return orgsBySlug.reduce(
+ (acc, [_, { org }]) => {
+ acc = [
+ ...acc,
+ {
+ key: org.slug,
+ value: org.displayName || org.slug,
+ },
+ ];
+ return acc;
+ },
+ [] as { key: string; value: string }[],
+ );
}, [sources]);
const allReposBySelectedOrgSlug = useMemo(() => {
@@ -94,16 +98,19 @@ const PullRequestSourceSelect: ReactIsland<
if (org == null) return [];
const [_selectedOrgSlug, { repos: orgRepositories }] = org;
const reposBySlug = Object.entries(orgRepositories);
- return reposBySlug.reduce((acc, [_, { repo }]) => {
- acc = [
- ...acc,
- {
- key: repo.slug,
- value: repo.displayName || repo.slug,
- },
- ];
- return acc;
- }, [] as { key: string; value: string }[]);
+ return reposBySlug.reduce(
+ (acc, [_, { repo }]) => {
+ acc = [
+ ...acc,
+ {
+ key: repo.slug,
+ value: repo.displayName || repo.slug,
+ },
+ ];
+ return acc;
+ },
+ [] as { key: string; value: string }[],
+ );
}, [sources, selectedOrgSlug]);
const allBranchesBySelectedOrgAndRepoSlugs = useMemo(() => {
@@ -115,7 +122,7 @@ const PullRequestSourceSelect: ReactIsland<
const repo = reposByKey.find(
(r) =>
r[1].repo.organization.slug === selectedOrgSlug &&
- r[1].repo.slug === selectedRepoSlug
+ r[1].repo.slug === selectedRepoSlug,
);
if (repo == null) return [];
return repo[1].branches.map((branch) => ({
@@ -133,14 +140,14 @@ const PullRequestSourceSelect: ReactIsland<
const selectedRepo = useMemo(() => {
const orgsBySlug = Object.entries(sources);
const parentOrg = orgsBySlug.find(
- ([_, o]) => o.org.slug === selectedOrgSlug
+ ([_, o]) => o.org.slug === selectedOrgSlug,
);
if (parentOrg == null) return null;
const reposBySlug = Object.entries(parentOrg[1].repos);
const repo = reposBySlug.find(
(r) =>
r[1].repo.organization.slug === selectedOrgSlug &&
- r[1].repo.slug === selectedRepoSlug
+ r[1].repo.slug === selectedRepoSlug,
);
if (repo == null) return null;
return repo[1];
@@ -149,14 +156,14 @@ const PullRequestSourceSelect: ReactIsland<
const selectedBranchResult = useMemo(() => {
const orgsBySlug = Object.entries(sources);
const parentOrg = orgsBySlug.find(
- ([_, o]) => o.org.slug === selectedOrgSlug
+ ([_, o]) => o.org.slug === selectedOrgSlug,
);
if (parentOrg == null) return selectedBranch;
const reposBySlug = Object.entries(parentOrg[1].repos);
const repo = reposBySlug.find(
(r) =>
r[1].repo.organization.slug === selectedOrgSlug &&
- r[1].repo.slug === selectedRepoSlug
+ r[1].repo.slug === selectedRepoSlug,
);
if (repo == null) return selectedBranch;
const { branches } = repo[1];
@@ -206,7 +213,7 @@ const PullRequestSourceSelect: ReactIsland<
setSelectedOrgSlug,
setSelectedRepoSlug,
setSelectedBranch,
- ]
+ ],
);
const onRepoSlugChange = useCallback(
@@ -230,7 +237,7 @@ const PullRequestSourceSelect: ReactIsland<
selectedOrgSlug,
setSelectedRepoSlug,
setSelectedBranch,
- ]
+ ],
);
const onBranchChange = useCallback(
@@ -241,18 +248,17 @@ const PullRequestSourceSelect: ReactIsland<
setSelectedBranch(ev.target.value);
emitSelectionChangeEvent();
},
- [emitSelectionChangeEvent, setSelectedBranch]
+ [emitSelectionChangeEvent, setSelectedBranch],
);
const keyValueToOptionMapFn = useMemo(
() =>
- ({ key, value }: { key: string; value: string }, idx: number) =>
- (
- <option key={[key, idx].join(":")} value={key}>
- {value}
- </option>
- ),
- []
+ ({ key, value }: { key: string; value: string }, idx: number) => (
+ <option key={[key, idx].join(":")} value={key}>
+ {value}
+ </option>
+ ),
+ [],
);
useEffect(() => {
@@ -10,7 +10,7 @@ import { slugify } from "../utils/shared";
import { Button } from "../components/Button.styled";
import { Card } from "../components/Card.styled";
import { Grid } from "../components/Grid";
-import { Select, TextArea, TextInput } from "../components";
+import { Select, TextArea, TextInput } from "../components/TextInput.styled";
export interface RepositoryCreateFormProps extends WithThemeSchemeProp {
availableParentOrgs: Organization[];
@@ -34,14 +34,14 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
initialValues = undefined,
}) => {
const [displayName, setDisplayName] = useState<string>(
- initialValues?.repo_display_name || ""
+ initialValues?.repo_display_name || "",
);
const [slug, setSlug] = useState<string>(
- initialValues?.repo_slug || slugify(initialValues?.repo_display_name || "")
+ initialValues?.repo_slug || slugify(initialValues?.repo_display_name || ""),
);
const [slugInputDirty, setSlugInputDirty] = useState<boolean>(false);
const [shortDescription, setShortDescription] = useState<string>(
- initialValues?.repo_short_description || ""
+ initialValues?.repo_short_description || "",
);
const [keywords, setKeywords] = useState<string[]>([
...(initialValues?.repo_keywords || []),
@@ -59,7 +59,7 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
setDisplayName(ev.target.value);
return undefined;
},
- [setDisplayName]
+ [setDisplayName],
);
const onSlugInputChange = useCallback(
@@ -74,7 +74,7 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
}
return undefined;
},
- [slugInputDirty, setSlug, setSlugInputDirty]
+ [slugInputDirty, setSlug, setSlugInputDirty],
);
const onShortDescriptionTextAreaChange = useCallback(
@@ -90,7 +90,7 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
setShortDescription(ev.target.value);
return undefined;
},
- [setShortDescription]
+ [setShortDescription],
);
const onKeywordsInputChange = useCallback(
@@ -101,7 +101,7 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
setKeywords(ev.target.value.split(",").map((w) => w.trim()));
return undefined;
},
- [setKeywords]
+ [setKeywords],
);
const onRepoInitLicenseFileInputChange = useCallback(
@@ -112,7 +112,7 @@ const RepositoryCreateForm: ReactIsland<RepositoryCreateFormProps> = ({
setRepoInitLicenseFileChecked(ev.target.checked);
return undefined;
},
- [setRepoInitLicenseFileChecked]
+ [setRepoInitLicenseFileChecked],
);
// An effect that will update the slug if it isn't dirty when the display name
@@ -7,7 +7,10 @@ import type { Organization, ResourceVisibility } from "@prisma/client";
// app
import type { WithThemeSchemeProp } from "../types";
import { slugify } from "../utils/shared";
-import { Button, Card, Grid, Select, TextInput } from "../components";
+import { Button } from "../components/Button.styled";
+import { Card } from "../components/Card.styled";
+import { Grid } from "../components/Grid";
+import { Select, TextInput } from "../components/TextInput.styled";
export interface RepositoryForkFormProps {
disabled?: boolean;
@@ -31,11 +34,11 @@ const RepositoryForkForm: ReactIsland<
initialValues = undefined,
}) => {
const [displayName, setDisplayName] = useState<string>(
- initialValues?.target_repo_display_name || ""
+ initialValues?.target_repo_display_name || "",
);
const [slug, setSlug] = useState<string>(
initialValues?.target_repo_slug ||
- slugify(initialValues?.target_repo_display_name || "")
+ slugify(initialValues?.target_repo_display_name || ""),
);
const [slugInputDirty, setSlugInputDirty] = useState<boolean>(false);
@@ -49,7 +52,7 @@ const RepositoryForkForm: ReactIsland<
setDisplayName(ev.target.value);
return undefined;
},
- [setDisplayName]
+ [setDisplayName],
);
const onSlugInputChange = useCallback(
@@ -64,7 +67,7 @@ const RepositoryForkForm: ReactIsland<
}
return undefined;
},
- [slugInputDirty, setSlug, setSlugInputDirty]
+ [slugInputDirty, setSlug, setSlugInputDirty],
);
// An effect that will update the slug if it isn't dirty when the display name
@@ -7,7 +7,7 @@ import type { Organization, Repository } from "@prisma/client";
// app
import type { RepositoryForkedFromRepoMeta } from "../types";
import { buildRouteLink } from "../utils/shared";
-import { ButtonAnchor } from "../components";
+import { ButtonAnchor } from "../components/Button.styled";
import { AppRoute } from "../routes.defs";
import { Grid } from "../components/Grid";
@@ -12,7 +12,10 @@ import type {
} from "../types";
import { buildRouteLink } from "../utils/shared";
import { AppRoute } from "../routes.defs";
-import { Button, Card, Grid, IslandWrapper } from "../components";
+import { Button } from "../components/Button.styled";
+import { Card } from "../components/Card.styled";
+import { Grid } from "../components/Grid";
+import { IslandWrapper } from "../components/IslandWrapper.styled";
// app islands
import RepositoryFilesDiffsList from "./RepositoryFilesDiffsList";
import PullRequestSourceSelect, {
@@ -37,7 +40,7 @@ export interface RepositoryPullRequestTarget {
branch: string;
}
export type RepositoryPullRequestCreateFormPropsByState<
- S extends PullRequestFormState = PullRequestFormState
+ S extends PullRequestFormState = PullRequestFormState,
> = S extends PullRequestFormState.CONFIGURE
? {
sources: {
@@ -54,21 +57,21 @@ export type RepositoryPullRequestCreateFormPropsByState<
target: RepositoryPullRequestTarget;
}
: S extends PullRequestFormState.COMPARE
- ? {
- fileDiffs: RepositoryFileDiff[];
- source: RepositoryPullRequestTarget;
- target: RepositoryPullRequestTarget;
- }
- : S extends PullRequestFormState.DETAILS
- ? {
- canCurrentUserSubmitPullRequest: boolean;
- pullRequest: PullRequest;
- }
- : S extends PullRequestFormState.ERROR
- ? {
- errorMessage: string;
- }
- : never;
+ ? {
+ fileDiffs: RepositoryFileDiff[];
+ source: RepositoryPullRequestTarget;
+ target: RepositoryPullRequestTarget;
+ }
+ : S extends PullRequestFormState.DETAILS
+ ? {
+ canCurrentUserSubmitPullRequest: boolean;
+ pullRequest: PullRequest;
+ }
+ : S extends PullRequestFormState.ERROR
+ ? {
+ errorMessage: string;
+ }
+ : never;
export type RepositoryPullRequestCreateFormVariant =
| {
@@ -88,8 +91,7 @@ export type RepositoryPullRequestCreateFormVariant =
data: RepositoryPullRequestCreateFormPropsByState<PullRequestFormState.ERROR>;
};
-export interface RepositoryPullRequestCreateFormProps
- extends RepositoryPullRequestCreateFormPropsCommon {
+export interface RepositoryPullRequestCreateFormProps extends RepositoryPullRequestCreateFormPropsCommon {
parentOrgSlug: string;
repoSlug: string;
themeScheme: AppThemeScheme;
@@ -98,42 +100,42 @@ export interface RepositoryPullRequestCreateFormProps
// PullRequestFormState.CONFIGURE
const isConfigureState = (
- s: PullRequestFormState
+ s: PullRequestFormState,
): s is PullRequestFormState.CONFIGURE =>
typeof s !== "undefined" && s != null && s === PullRequestFormState.CONFIGURE;
const isConfigureStateData = (
s: PullRequestFormState,
- i: unknown
+ i: unknown,
): i is RepositoryPullRequestCreateFormPropsByState<PullRequestFormState.CONFIGURE> =>
typeof i !== "undefined" && i != null && s === PullRequestFormState.CONFIGURE;
// PullRequestFormState.COMPARE
const isCompareState = (
- s: PullRequestFormState
+ s: PullRequestFormState,
): s is PullRequestFormState.COMPARE =>
typeof s !== "undefined" && s != null && s === PullRequestFormState.COMPARE;
const isCompareStateData = (
s: PullRequestFormState,
- i: unknown
+ i: unknown,
): i is RepositoryPullRequestCreateFormPropsByState<PullRequestFormState.COMPARE> =>
typeof i !== "undefined" && i != null && s === PullRequestFormState.COMPARE;
// PullRequestFormState.DETAILS
const isDetailsState = (
- s: PullRequestFormState
+ s: PullRequestFormState,
): s is PullRequestFormState.DETAILS =>
typeof s !== "undefined" && s != null && s === PullRequestFormState.DETAILS;
const isDetailsStateData = (
s: PullRequestFormState,
- i: unknown
+ i: unknown,
): i is RepositoryPullRequestCreateFormPropsByState<PullRequestFormState.DETAILS> =>
typeof i !== "undefined" && i != null && s === PullRequestFormState.DETAILS;
// PullRequestFormState.ERROR
const isErrorState = (
- s: PullRequestFormState
+ s: PullRequestFormState,
): s is PullRequestFormState.ERROR =>
typeof s !== "undefined" && s != null && s === PullRequestFormState.ERROR;
const isErrorStateData = (
s: PullRequestFormState,
- i: unknown
+ i: unknown,
): i is RepositoryPullRequestCreateFormPropsByState<PullRequestFormState.ERROR> =>
typeof i !== "undefined" && i != null && s === PullRequestFormState.ERROR;
@@ -149,14 +151,14 @@ const RepositoryPullRequestCreateForm: ReactIsland<
(ev: PullRequestSourceSelectionChangeEvent) => {
setSelectedSource(ev.data);
},
- [setSelectedSource]
+ [setSelectedSource],
);
const onTargetSelectionChange = useCallback(
(ev: PullRequestSourceSelectionChangeEvent) => {
setSelectedTarget(ev.data);
},
- [setSelectedTarget]
+ [setSelectedTarget],
);
const isCompareButtonEnabled = useMemo(() => {
@@ -186,7 +188,7 @@ const RepositoryPullRequestCreateForm: ReactIsland<
method={"POST"}
action={buildRouteLink(
AppRoute.REPOSITORY_PULL_REQUEST_CREATE_ACTION,
- { orgSlug: parentOrgSlug, repoSlug }
+ { orgSlug: parentOrgSlug, repoSlug },
)}
style={{ width: "100%" }}
>
@@ -212,10 +214,10 @@ const RepositoryPullRequestCreateForm: ReactIsland<
defaultSource={{
org: Object.values(data.sources)[0].org,
repo: Object.values(
- Object.values(data.sources)[0].repos
+ Object.values(data.sources)[0].repos,
)[0].repo,
branch: Object.values(
- Object.values(data.sources)[0].repos
+ Object.values(data.sources)[0].repos,
)[0].branches[0],
}}
sources={data.sources}
@@ -297,7 +299,7 @@ const RepositoryPullRequestCreateForm: ReactIsland<
method={"POST"}
action={buildRouteLink(
AppRoute.REPOSITORY_PULL_REQUEST_CREATE_ACTION,
- { orgSlug: parentOrgSlug, repoSlug }
+ { orgSlug: parentOrgSlug, repoSlug },
)}
style={{ width: "100%" }}
>
@@ -399,7 +401,7 @@ const RepositoryPullRequestCreateForm: ReactIsland<
method={"POST"}
action={buildRouteLink(
AppRoute.REPOSITORY_PULL_REQUEST_CREATE_ACTION,
- { orgSlug: parentOrgSlug, repoSlug }
+ { orgSlug: parentOrgSlug, repoSlug },
)}
>
<input type={"hidden"} name={"state_from"} value={state} />
@@ -66,7 +66,7 @@ const RepositoryTreeView: ReactIsland<
}),
};
},
- [orgSlug, repoSlug, currentPath, currentRef]
+ [orgSlug, repoSlug, currentPath, currentRef],
);
const currPathParts = currentPath.split("/");
@@ -105,7 +105,17 @@ const RepositoryTreeView: ReactIsland<
<Select
themeScheme={themeScheme}
title={"Branch"}
- //
+ onChange={(e) => {
+ console.log("branch changed to: ", e.currentTarget.value);
+ window.__router.push(
+ buildRouteLink(AppRoute.REPOSITORY_BROWSER_WITH_PATH, {
+ orgSlug: orgSlug,
+ repoSlug: repoSlug,
+ currentRef: e.currentTarget.value,
+ "*": currentPath === "/" ? "" : currentPath,
+ }),
+ );
+ }}
style={{
height: 32,
width: "auto",
@@ -119,11 +129,17 @@ const RepositoryTreeView: ReactIsland<
<option
key={branch}
value={branch}
- selected={branch == Const.PRIMARY_BRANCH_REF || idx == 0}
+ selected={
+ branches.findIndex((b) => b === currentRef) === idx ||
+ (currentRef === Const.DEFAULT_HEAD_REF &&
+ branch === Const.PRIMARY_BRANCH_REF)
+ ? true
+ : undefined
+ }
>
{branch}
</option>
- )
+ ),
)}
</Select>
{shouldShowPrevPath && (
@@ -153,12 +169,12 @@ const RepositoryTreeView: ReactIsland<
repoSlug,
currentRef,
"*": `${currPathParts.slice(0, idx + 1).join("/")}/`,
- }
+ },
)}
>
<TextEllipsis>{pathPart}/</TextEllipsis>
</a>
- )
+ ),
)}
</Grid.Row>
<Grid.Row nowrap alignItems={"center"}>
@@ -3,12 +3,12 @@ import { ReactIsland } from "@ethicdevs/react-monolith";
// 3rd-party
import React, { useState } from "react";
import { UserSSHKey } from "@prisma/client";
-// generated via script[generate:prisma]
-// import styled, { css } from "styled-components";
// app
import type { WithThemeSchemeProp } from "../types";
-import { Card, Grid } from "../components";
-import Code from "./Code";
+import { Card } from "../components/Card.styled";
+import { Grid } from "../components/Grid";
+
+// import Code from "./Code";
interface SSHKeyItemProps {
sshKey: UserSSHKey;
@@ -20,11 +20,7 @@ const SSHKeyItem: ReactIsland<SSHKeyItemProps & WithThemeSchemeProp> = ({
}) => {
const [show, setShow] = useState<boolean>(false);
return (
- <Card
- key={id}
- themeScheme={themeScheme}
- // style={{ marginTop: idx >= 1 ? 16 : 32 }}
- >
+ <Card key={id} themeScheme={themeScheme}>
<Grid.Col fluid nowrap gap={16}>
<Grid.Row
fluid
@@ -37,12 +33,14 @@ const SSHKeyItem: ReactIsland<SSHKeyItemProps & WithThemeSchemeProp> = ({
<div>{new Date(createdAt).toDateString()}</div>
</Grid.Row>
{show && (
- <Code
- language="plain"
- code={key}
- themeScheme={themeScheme}
+ <code
+ // language="plain"
+ // code={key}
+ // themeScheme={themeScheme}
style={{ whiteSpace: "break-spaces", wordBreak: "break-all" }}
- />
+ >
+ {key}
+ </code>
)}
</Grid.Col>
</Card>
@@ -557,15 +557,15 @@ export const AppRouteSchemas: Record<AppRoute, undefined | FastifySchema> = {
required: [
"parent_org_slug",
"repo_display_name",
- "repo_init_license_file",
- "repo_init_license_kind",
- "repo_init_readme_file",
+ // "repo_init_license_file",
+ // "repo_init_license_kind",
+ // "repo_init_readme_file",
"repo_keywords",
"repo_keywords_add",
- "repo_short_description",
+ // "repo_short_description",
"repo_slug",
- "repo_visibility",
- "repo_website_url",
+ // "repo_visibility",
+ // "repo_website_url",
],
additionalProperties: false,
properties: {
@@ -239,7 +239,7 @@ async function main(): Promise<AppServer> {
cleanupFastifyError(error);
console.error(
"Couldn't load Prism.JS languages, syntax highlighting will not work properly.",
- `Error: ${error.message}`
+ `Error: ${error.message}`,
);
}
@@ -389,7 +389,7 @@ main()
// safe because it wont start if null
const { $config, $host, $port } = server.reactMonolith!;
console.log(
- `[🚀][${$config.env}] App Server ready at http://${$host}:${$port} !`
+ `[🚀][${$config.env}] App Server ready at http://${$host}:${$port} !`,
);
})
.catch(async (err) => {
@@ -43,7 +43,7 @@ const makeOnPushEvent: ServiceMethodFactory<
return updatedRepo;
});
- const repoUrlPrefix = `${Env.DEPLOYMENT_SCHEME}://${Env.DEPLOYMENT_DOMAIN}`;
+ const repoUrlPrefix = `${Env.DEPLOYMENT_SCHEME}://${Env.DEPLOYMENT_DOMAIN}${Env.PORT != 80 && Env.PORT != 443 ? `:${Env.PORT}` : ""}`;
const repoUrlSuffix = `${orgSlug}/${repoSlug}`;
const repoUrlBase =
env === "production"
@@ -57,20 +57,21 @@ const makeOnPushEvent: ServiceMethodFactory<
message.write(`🔗 ${repoUrlBase}/show/${data.payload.commitId}\n`);
if (data.payload.refName !== Const.PRIMARY_BRANCH_REF) {
message.write(`\n`);
+ // todo: if pr already exist, link to it instead of new pr page
message.write(
- `🚀 Quickly create a pull-request from this branch at:\n`
+ `🚀 Quickly create a pull-request from this branch at:\n`,
);
message.write(
`🔗 ${repoUrlBase}/pulls/new?from_branch=${encodeURIComponent(
- data.payload.refName
- )}\n`
+ data.payload.refName,
+ )}\n`,
);
}
} else if (data.payload.refType === "tag") {
message.write(
`🏷 ${repoUrlBase}/tags/${encodeURIComponent(
- data.payload.refName
- )}\n`
+ data.payload.refName,
+ )}\n`,
);
}
}
@@ -24,7 +24,7 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
repo,
path = "",
ref = Const.DEFAULT_HEAD_REF,
- onlyLast = false
+ onlyLast = false,
) => {
const parentOrg = await request.prisma.organization.findUnique({
where: {
@@ -34,7 +34,7 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
if (parentOrg == null) {
throw new Error(
- `Could not find the parent organization for project "${repo.slug}".`
+ `Could not find the parent organization for project "${repo.slug}".`,
);
}
@@ -77,14 +77,14 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
let escapedJson = buffer.join("");
const fieldsToEscape = escapedJson.match(
- GIT_LOG_NEWLINEW_FINDER_REGEXP // Find the fields that may contain \n for escaping them
+ GIT_LOG_NEWLINEW_FINDER_REGEXP, // Find the fields that may contain \n for escaping them
);
if (fieldsToEscape != null && Array.isArray(fieldsToEscape)) {
fieldsToEscape.forEach((fieldTxt) => {
escapedJson = escapedJson.replace(
fieldTxt,
- fieldTxt.split("\n").join("\\n") // Escape newlines
+ fieldTxt.split("\n").join("\\n"), // Escape newlines
);
});
}
@@ -97,18 +97,21 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
resolve(
JSON.parse(
// create a valid JSON array of commit objects
- `[${escapedJson.substring(0, escapedJson.length - 1)}]`
- )
+ `[${escapedJson.substring(0, escapedJson.length - 1)}]`,
+ ),
);
} catch (err) {
resolve([]);
}
});
- }
+ },
);
return gitLogResult as RepositoryLog[];
} catch (err) {
+ if ((err as Error).message.includes("does not have any commits yet")) {
+ return [];
+ }
console.error("Cannot get git log", err);
return [];
}
@@ -35,7 +35,7 @@ const makeGetRepositoryHead: ServiceMethodFactory<
if (parentOrg == null) {
throw new Error(
- `Could not find the parent organization for project "${repo.slug}".`
+ `Could not find the parent organization for project "${repo.slug}".`,
);
}
@@ -44,6 +44,10 @@ const makeGetRepositoryHead: ServiceMethodFactory<
throw new Error(`Could not find a valid git repository at: ${repoPath}`);
}
+ if (ref === Const.DEFAULT_HEAD_REF) {
+ ref = Const.PRIMARY_BRANCH_REF;
+ }
+
const gitCatFileProcess = spawn("git", ["cat-file", "-p", ref], {
cwd: repoPath,
env: {
@@ -13,7 +13,7 @@ export const makeRequestHandler = {
return <T extends Record<string, unknown>>(
viewName: string,
props?: T & CommonViewProps,
- viewCtx?: ViewContext
+ viewCtx?: ViewContext,
) => {
const {
authenticated,
@@ -24,7 +24,7 @@ export const makeRequestHandler = {
flash_message,
} = request.session.data;
- const title = props != null ? props.title : "";
+ const title = props != null ? props.title : viewName;
const themeSchemeFromCookies =
"theme_scheme" in request.cookies
@@ -56,6 +56,8 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
const currPathParts = path.split("/");
const shouldShowRootPath = path !== "/";
+ console.log("currentRef:", currentRef);
+
return (
<Layout {...commonProps}>
<PageWrapper>
@@ -101,7 +103,17 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
<Select
themeScheme={commonProps.themeScheme}
title={"Branch"}
- //
+ onChange={(e) => {
+ console.log("branch changed to: ", e.currentTarget.value);
+ window.__router.push(
+ buildRouteLink(AppRoute.REPOSITORY_BROWSER_WITH_PATH, {
+ orgSlug: parentOrg.slug,
+ repoSlug: repo.slug,
+ currentRef: e.currentTarget.value,
+ "*": path,
+ }),
+ );
+ }}
style={{
height: 32,
width: "auto",
@@ -116,12 +128,16 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
key={branch}
value={branch}
selected={
- branch == Const.PRIMARY_BRANCH_REF || idx == 0
+ branches.findIndex((b) => b === currentRef) === idx ||
+ (currentRef === Const.DEFAULT_HEAD_REF &&
+ branch === Const.PRIMARY_BRANCH_REF)
+ ? true
+ : undefined
}
>
{branch}
</option>
- )
+ ),
)}
</Select>
{shouldShowRootPath && (
@@ -160,7 +176,7 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
? ""
: "/"
}`,
- }
+ },
)}
>
<TextEllipsis>
@@ -170,7 +186,7 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
: "/"}
</TextEllipsis>
</a>
- )
+ ),
)}
</Grid.Row>
<div
@@ -8,6 +8,7 @@ import { UserSSHKey } from "@prisma/client";
import type { CommonProps } from "../../types";
import { buildRouteLink } from "../../utils/shared";
import { AppRoute } from "../../routes.defs";
+import { Chip } from "../../components/Chip";
import {
ButtonAnchor,
Card,
@@ -35,7 +36,39 @@ const SettingsView: ReactView<SettingsViewProps> = ({
<Grid.Row fluid gap={16}>
<Grid.Col flex={0.33} nowrap>
<Card themeScheme={commonProps.themeScheme}>
- <div>master</div>
+ <Grid.Col fluid nowrap gap={8}>
+ <a
+ style={{ width: "100%" }}
+ aria-label={"Manage your profile"}
+ href={buildRouteLink(
+ AppRoute.USER_DETAILS,
+ {
+ username: commonProps.currentUserUsername!,
+ },
+ { encodeURIComponent: false },
+ )}
+ >
+ <Grid.Row fluid nowrap gap={8} alignItems={"center"}>
+ <span style={{ flex: 1 }}>My Profile</span>
+ </Grid.Row>
+ </a>
+ <a
+ style={{ width: "100%" }}
+ aria-label={"Manage your SSH keys"}
+ href={buildRouteLink(
+ AppRoute.SETTINGS_KEYS,
+ {
+ username: commonProps.currentUserUsername!,
+ },
+ { encodeURIComponent: false },
+ )}
+ >
+ <Grid.Row fluid nowrap gap={8} alignItems={"center"}>
+ <span style={{ flex: 1 }}>SSH Keys</span>
+ <Chip color={"white"}>{sshKeys.length}</Chip>
+ </Grid.Row>
+ </a>
+ </Grid.Col>
</Card>
</Grid.Col>
<Grid.Col fluid nowrap>
@@ -48,12 +81,12 @@ const SettingsView: ReactView<SettingsViewProps> = ({
gap={8}
alignItems="center"
>
- <h2 style={{ margin: 0 }}>Your SSH key</h2>
+ <h2 style={{ margin: 0 }}>Your SSH keys</h2>
<ButtonAnchor
href={buildRouteLink(
AppRoute.SETTINGS_KEY_ADD,
{ username: commonProps.currentUserUsername! },
- { encodeURIComponent: 0 }
+ { encodeURIComponent: 0 },
)}
>
Add
@@ -17,16 +17,14 @@ export interface UserDashboardViewProps extends CommonProps {
const UserDashboardView: ReactView<UserDashboardViewProps> = ({
commonProps,
- currentUser,
+ // currentUser,
repositories,
}) => {
return (
<Layout {...commonProps}>
<PageWrapper>
- <h1>Hey {currentUser.displayName || currentUser.username}, welcome!</h1>
- <h2 style={{ opacity: 0.67 }}>
- Repositories you own and/or contribute to
- </h2>
+ {/* <h1>Hey {currentUser.displayName || currentUser.username}, welcome!</h1> */}
+ <h1 style={{ opacity: 0.67 }}>Repositories</h1>
<div
data-islandid={`${RepositoriesList.name}$$0`}
style={{ width: "100%" }}
@@ -1 +1,3 @@
command="ssh_command wnemencha",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGo9GDFyJ8RJ4F+Y4Vxl2bCl8sskRYbiSWItmoBZoYFVR2qAvUyowDY2xlDa9JaG/+zbBB6sUwUr8oC/GdSaV+zp5CTP2RxcXDW2Aup6w1/a4qiilSKORMXBWvIgjyvVvHjG0TiCfeC0PfBbXCO8FhLxP5lgTrl1kVUduM0LR4/gcH3vIrrKbORWtfAC7Bw6z3qc/X9CysPxtQZYu6+AknJ1vwUtLAH2H9cKS8uwaJ5N/k0n8Sc8ANozdpp7EyodA12nFFwvf5oPakTdm5cBnnnEIe2p+GA4nP2DyybmtIR/wttJGMs6Bmz0bXO6AfFdhcGKbzwT2qEGRX5drQj0qUI+gLSZ42/9DsGN7kr2gRDpXG2ATx+c4H2XvR3fqS1cyFq+ZmezK4l32BH/KjQMR1zfgeX2Ky46YxOLQn84PvWILmpzYPLTJ02kXFr0pjofraX2h0E/0Ke2ZBPlOUcaNZOU2dJDYn/B0GVrJ0niopvseYpVXHoTzMPYpr+ReCfAc= admin@Admins-MacBook-Pro.local
+command="ssh_command willi.wonka38",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCbpfyW60ydd3p0xQAozzB2lecE4NG9KyUbd/mRl+EPEOm4pnh3oIqbGLs42QYgKc1H8bkEEddFvnayN+JHJIwsRBSv3YMMsbTRHp6onHgsVHMaO+nNyubONwb7eLfR+5PvZ4eeOwbJpgfLwW2tVpoqLiTRpF8DFijYQePqGqQzFwWXx9niHHb3s1pqDPGjiqlEqbJPT4MyIdHo66M8SJMFL12uIUq33Wm3PRCtPDMs4FdW0fpvQpaBqu6cb71WrH8MDRC5IGT2KC3MD7flVfayUoSsdo3I/zzkom8t34Ee0b7NkQ0jvcsVves/Vz36YCZ/W7pNiKYi18B3sLIxpwI9a9k+kYt5a/5kz5izmeVbiVK2PDk45GN2b0RCfMb3uT3v5MwcJjKf5h52WYVjh0Uzj8AC4ZOtW84BAVrnX4hkBirN6oOYJB8/8pHvtAq5WSFtJnPzz1rL/mOFSsr/HS5Jo8KSsrH8uZHz2QWr6T6PDDGOjiEc44JTPOxqywUXo7Cs5TvicLhqWXdPokTmVftoG0pRpVWi9ctvGc1GRXviEWgvJZyqx/yDdtvrjKWDNjIM3jww1Blrb0R1o/0wvvHFfTf8flvW4SC7POXG0bXp/ANSGnTXIiAQk9JGmU6ntCqVebtNis60Xvbfj5gMGsEv1rhM1cyMcvIfT20ASZo6hw== aremy.dev@gmail.com
+command="ssh_command willi.wonka38",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2gwbtNQtNTLbvyd8/B7k+dzOiYMYKfjbmr5x8DQUZr+K9367D3TzQ6wDMQBWnDu5FIKoKvAFTP3tHhV5p+3GMXqzS/2PCtzV7WHlUtJ7vVxsREoQVrHCS0KZ7+KT5F+daV4VKmnCqr6qfeirvCc1XS/feBnp+P9ctGjMj+PEdkaAv3JaOVpH3bROaokTiTdr4NPF73hM2jAhEo8V7IJwd6e/GlWM4X6rp1QL5cB38utbxIBqq8GYUeX021OLoQoRazXTC27Xwn3i1+w9uqA97KYfSk5pKwrv1+V9JfiHUmaQRB08+nd9hi0dDARJaiar5ipJZ6fioWTM+lqDhEFxBTz9Xfioa1HkpBfh8gW3nsQAJBYUaqUifn5ucJJCu3zZJwTynP4/CGe6g1K7uNjKCHXUx4Lnmw5wcQGCLsSEFc6Pc8QUxjuJ7R5pzvNOTC2omAAoZvHtinj+pHCG6mM4FmL0Wic8qDOLDCeyFS8zHMa2bzulFpwr2tyNcX3xGFT8= xana@blackstorm
@@ -40,3 +40,17 @@ services:
# - DEPLOYMENT_DOMAIN=local-app.localhost
# - DEPLOYMENT_SCHEME=http
# - GIT_REPOSITORIES_ROOT=/var/lib/gitfoss/repos
+ # git_ssh:
+ # container_name: gitfoss_git_ssh
+ # build:
+ # context: .
+ # dockerfile: Dockerfile.git-ssh
+ # depends_on:
+ # - web
+ # ports:
+ # - 22:22
+ # volumes:
+ # - ./data/gitfoss_repos:/var/lib/gitfoss/repos
+ # - ./data/gitfoss_repos:/home/git/repos
+ # - ./data/authorized_keys:/home/git/.ssh/authorized_keys
+ # env_file: .env.docker
@@ -1 +1,2 @@
-!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n||self).MarkdownToJSX=t(n.React)}(this || globalThis,function(n){function t(n){if(n&&n.t)return n;var t=Object.create(null);return n&&Object.keys(n).forEach(function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:!0,get:function(){return n[r]}})}}),t.default=n,t}var r=/*#__PURE__*/t(n);function e(){return(e=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}var o=["children","options"],u=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(n,t){return n[t.toLowerCase()]=t,n},{for:"htmlFor"}),a={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],i=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,f=/mailto:/i,l=/\n{2,}$/,s=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,_=/^ *> ?/gm,d=/^ {2,}\n/,p=/^(?:( *[-*_]) *){3,}(?:\n *)+\n/,g=/^\s*(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n?/,m=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,v=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,y=/^(?:\n *)*\n/,h=/\r\n?/g,k=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,x=/\f/g,S=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,w=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,z=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,O=/&([a-z]+);/g,j=/^<!--[\s\S]*?(?:-->)/,E=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,A=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,R=/^\{.*\}$/,T=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,I=/^<([^ >]+@[^ >]+)>/,M=/^<([^ >]+:\/[^ >]+)>/,B=/ *\n+$/,L=/(?:^|\n)( *)$/,C=/-([a-z])?/gi,D=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,N=/^\[([^\]]*)\]:\s*(\S+)\s*("([^"]*)")?/,Z=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,F=/^\[([^\]]*)\] ?\[([^\]]*)\]/,P=/(\[|\])/g,q=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,G=/\t/g,H=/^ *\| */,U=/(^ *\||\| *$)/g,V=/ *$/,W=/^ *:-+: *$/,Q=/^ *:-+ *$/,X=/^ *-+: *$/,J=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,K=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,nn=/^\\([^0-9A-Za-z\s])/,tn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,rn=/^\n+/,en=/^([ \t]*)/,on=/\\([^0-9A-Z\s])/gi,un="( *)((?:[*+-]|\\d+\\.)) +",an=new RegExp("^"+un),cn=new RegExp("^"+un+"[^\\n]*(?:\\n(?!\\1(?:[*+-]|\\d+\\.) )[^\\n]*)*(\\n|$)","gm"),fn=new RegExp("^( *)((?:[*+-]|\\d+\\.)) [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1(?:[*+-]|\\d+\\.) (?!(?:[*+-]|\\d+\\.) ))\\n*|\\s*\\n*$)"),ln="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",sn="\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",_n=new RegExp("^\\[("+ln+")\\]\\("+sn+"\\)"),dn=new RegExp("^!\\[("+ln+")\\]\\("+sn+"\\)"),pn=[s,m,g,$,w,j,cn,fn,D],gn=[].concat(pn,[/^[^\n]+(?: \n|\n{2,})/,z,A]);function mn(n){return n.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function vn(n){return X.test(n)?"right":W.test(n)?"center":Q.test(n)?"left":null}function yn(n,t,r){var e=r.o;r.o=!0;var o=t(n.trim(),r);r.o=e;var u=[[]];return o.forEach(function(n,t){"tableSeparator"===n.type?0!==t&&t!==o.length-1&&u.push([]):("text"!==n.type||null!=o[t+1]&&"tableSeparator"!==o[t+1].type||(n.content=n.content.replace(V,"")),u[u.length-1].push(n))}),u}function hn(n,t,r){r.u=!0;var e=yn(n[1],t,r),o=n[2].replace(U,"").split("|").map(vn),u=function(n,t,r){return n.trim().split("\n").map(function(n){return yn(n,t,r)})}(n[3],t,r);return r.u=!1,{align:o,cells:u,header:e,type:"table"}}function kn(n,t){return null==n.align[t]?{}:{textAlign:n.align[t]}}function bn(n){return function(t,r){return r.u?n.exec(t):null}}function xn(n){return function(t,r){return r.u||r.i?n.exec(t):null}}function Sn(n){return function(t,r){return r.u||r.i?null:n.exec(t)}}function $n(n){return function(t){return n.exec(t)}}function wn(n,t,r){if(t.u||t.i)return null;if(r&&!r.endsWith("\n"))return null;var e="";n.split("\n").every(function(n){return!pn.some(function(t){return t.test(n)})&&(e+=n+"\n",n.trim())});var o=e.trimEnd();return""==o?null:[e,o]}function zn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data):/i))return null}catch(n){return null}return n}function On(n){return n.replace(on,"$1")}function jn(n,t,r){var e=r.u||!1,o=r.i||!1;r.u=!0,r.i=!0;var u=n(t,r);return r.u=e,r.i=o,u}function En(n,t,r){var e=r.u||!1,o=r.i||!1;r.u=!1,r.i=!0;var u=n(t,r);return r.u=e,r.i=o,u}function An(n,t,r){return r.u=!1,n(t+"\n\n",r)}var Rn,Tn=function(n,t,r){return{content:jn(t,n[1],r)}};function In(){return{}}function Mn(){return null}function Bn(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Ln(n,t,r){for(var e=n,o=t.split(".");o.length&&void 0!==(e=e[o[0]]);)o.shift();return e||r}function Cn(n,t){var r=Ln(t,n);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Ln(t,n+".component",n):n}function Dn(n,t){void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||mn,t.namedCodesToUnicode=t.namedCodesToUnicode?e({},a,t.namedCodesToUnicode):a;var o=t.createElement||r.createElement;function U(n,r){var u=Ln(t.overrides,n+".props",{});return o.apply(void 0,[Cn(n,t.overrides),e({},r,u,{className:Bn(null==r?void 0:r.className,u.className)||void 0})].concat([].slice.call(arguments,2)))}function V(n){var e=!1;t.forceInline?e=!0:t.forceBlock||(e=!1===q.test(n));for(var o=sn(ln(e?n:n.trimEnd().replace(rn,"")+"\n\n",{u:e}));"string"==typeof o[o.length-1]&&!o[o.length-1].trim();)o.pop();if(null===t.wrapper)return o;var u,a=t.wrapper||(e?"span":"div");if(o.length>1||t.forceWrapper)u=o;else{if(1===o.length)return"string"==typeof(u=o[0])?U("span",{key:"outer"},u):u;u=null}return r.createElement(a,{key:"outer"},u)}function W(n){var t=n.match(i);return t?t.reduce(function(n,t,e){var o=t.indexOf("=");if(-1!==o){var a=function(n){return-1!==n.indexOf("-")&&null===n.match(E)&&(n=n.replace(C,function(n,t){return t.toUpperCase()})),n}(t.slice(0,o)).trim(),c=function(n){var t=n[0];return('"'===t||"'"===t)&&n.length>=2&&n[n.length-1]===t?n.slice(1,-1):n}(t.slice(o+1).trim()),i=u[a]||a,f=n[i]=function(n,t){return"style"===n?t.split(/;\s?/).reduce(function(n,t){var r=t.slice(0,t.indexOf(":"));return n[r.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=t.slice(r.length+1).trim(),n},{}):"href"===n?zn(t):(t.match(R)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(a,c);"string"==typeof f&&(z.test(f)||A.test(f))&&(n[i]=r.cloneElement(V(f.trim()),{key:e}))}else"style"!==t&&(n[u[t]||t]=!0);return n},{}):void 0}var Q=[],X={},on={blockQuote:{l:Sn(s),_:Rn.HIGH,p:function(n,t,r){return{content:t(n[0].replace(_,""),r)}},g:function(n,t,r){return U("blockquote",{key:r.m},t(n.content,r))}},breakLine:{l:$n(d),_:Rn.HIGH,p:In,g:function(n,t,r){return U("br",{key:r.m})}},breakThematic:{l:Sn(p),_:Rn.HIGH,p:In,g:function(n,t,r){return U("hr",{key:r.m})}},codeBlock:{l:Sn(m),_:Rn.MAX,p:function(n){return{content:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),lang:void 0}},g:function(n,t,r){return U("pre",{key:r.m},U("code",{className:n.lang?"lang-"+n.lang:""},n.content))}},codeFenced:{l:Sn(g),_:Rn.MAX,p:function(n){return{content:n[3],lang:n[2]||void 0,type:"codeBlock"}}},codeInline:{l:xn(v),_:Rn.LOW,p:function(n){return{content:n[2]}},g:function(n,t,r){return U("code",{key:r.m},n.content)}},footnote:{l:Sn(k),_:Rn.MAX,p:function(n){return Q.push({footnote:n[2],identifier:n[1]}),{}},g:Mn},footnoteReference:{l:bn(b),_:Rn.HIGH,p:function(n){return{content:n[1],target:"#"+t.slugify(n[1])}},g:function(n,t,r){return U("a",{key:r.m,href:zn(n.target)},U("sup",{key:r.m},n.content))}},gfmTask:{l:bn(S),_:Rn.HIGH,p:function(n){return{completed:"x"===n[1].toLowerCase()}},g:function(n,t,r){return U("input",{checked:n.completed,key:r.m,readOnly:!0,type:"checkbox"})}},heading:{l:Sn($),_:Rn.HIGH,p:function(n,r,e){return{content:jn(r,n[2],e),id:t.slugify(n[2]),level:n[1].length}},g:function(n,t,r){return n.tag="h"+n.level,U(n.tag,{id:n.id,key:r.m},t(n.content,r))}},headingSetext:{l:Sn(w),_:Rn.MAX,p:function(n,t,r){return{content:jn(t,n[1],r),level:"="===n[2]?1:2,type:"heading"}}},htmlComment:{l:$n(j),_:Rn.HIGH,p:function(){return{}},g:Mn},image:{l:xn(dn),_:Rn.HIGH,p:function(n){return{alt:n[1],target:On(n[2]),title:n[3]}},g:function(n,t,r){return U("img",{key:r.m,alt:n.alt||void 0,title:n.title||void 0,src:zn(n.target)})}},link:{l:bn(_n),_:Rn.LOW,p:function(n,t,r){return{content:En(t,n[1],r),target:On(n[2]),title:n[3]}},g:function(n,t,r){return U("a",{key:r.m,href:zn(n.target),title:n.title},t(n.content,r))}},linkAngleBraceStyleDetector:{l:bn(M),_:Rn.MAX,p:function(n){return{content:[{content:n[1],type:"text"}],target:n[1],type:"link"}}},linkBareUrlDetector:{l:function(n,t){return t.v?null:bn(T)(n,t)},_:Rn.MAX,p:function(n){return{content:[{content:n[1],type:"text"}],target:n[1],title:void 0,type:"link"}}},linkMailtoDetector:{l:bn(I),_:Rn.MAX,p:function(n){var t=n[1],r=n[1];return f.test(r)||(r="mailto:"+r),{content:[{content:t.replace("mailto:",""),type:"text"}],target:r,type:"link"}}},list:{l:function(n,t,r){var e=L.exec(r);return!e||!t.h&&t.u?null:fn.exec(n=e[1]+n)},_:Rn.HIGH,p:function(n,t,r){var e=n[2],o=e.length>1,u=o?+e:void 0,a=n[0].replace(l,"\n").match(cn),c=!1;return{items:a.map(function(n,e){var o=an.exec(n)[0].length,u=new RegExp("^ {1,"+o+"}","gm"),i=n.replace(u,"").replace(an,""),f=e===a.length-1,l=-1!==i.indexOf("\n\n")||f&&c;c=l;var s,_=r.u,d=r.h;r.h=!0,l?(r.u=!1,s=i.replace(B,"\n\n")):(r.u=!0,s=i.replace(B,""));var p=t(s,r);return r.u=_,r.h=d,p}),ordered:o,start:u}},g:function(n,t,r){return U(n.ordered?"ol":"ul",{key:r.m,start:n.start},n.items.map(function(n,e){return U("li",{key:e},t(n,r))}))}},newlineCoalescer:{l:Sn(y),_:Rn.LOW,p:In,g:function(){return"\n"}},paragraph:{l:wn,_:Rn.LOW,p:Tn,g:function(n,t,r){return U("p",{key:r.m},t(n.content,r))}},ref:{l:bn(N),_:Rn.MAX,p:function(n){return X[n[1]]={target:n[2],title:n[4]},{}},g:Mn},refImage:{l:xn(Z),_:Rn.MAX,p:function(n){return{alt:n[1]||void 0,ref:n[2]}},g:function(n,t,r){return U("img",{key:r.m,alt:n.alt,src:zn(X[n.ref].target),title:X[n.ref].title})}},refLink:{l:bn(F),_:Rn.MAX,p:function(n,t,r){return{content:t(n[1],r),fallbackContent:t(n[0].replace(P,"\\$1"),r),ref:n[2]}},g:function(n,t,r){return X[n.ref]?U("a",{key:r.m,href:zn(X[n.ref].target),title:X[n.ref].title},t(n.content,r)):U("span",{key:r.m},t(n.fallbackContent,r))}},table:{l:Sn(D),_:Rn.HIGH,p:hn,g:function(n,t,r){return U("table",{key:r.m},U("thead",null,U("tr",null,n.header.map(function(e,o){return U("th",{key:o,style:kn(n,o)},t(e,r))}))),U("tbody",null,n.cells.map(function(e,o){return U("tr",{key:o},e.map(function(e,o){return U("td",{key:o,style:kn(n,o)},t(e,r))}))})))}},tableSeparator:{l:function(n,t){return t.o?H.exec(n):null},_:Rn.HIGH,p:function(){return{type:"tableSeparator"}},g:function(){return" | "}},text:{l:$n(tn),_:Rn.MIN,p:function(n){return{content:n[0].replace(O,function(n,r){return t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:n})}},g:function(n){return n.content}},textBolded:{l:xn(J),_:Rn.MED,p:function(n,t,r){return{content:t(n[2],r)}},g:function(n,t,r){return U("strong",{key:r.m},t(n.content,r))}},textEmphasized:{l:xn(K),_:Rn.LOW,p:function(n,t,r){return{content:t(n[2],r)}},g:function(n,t,r){return U("em",{key:r.m},t(n.content,r))}},textEscaped:{l:xn(nn),_:Rn.HIGH,p:function(n){return{content:n[1],type:"text"}}},textStrikethroughed:{l:xn(Y),_:Rn.LOW,p:Tn,g:function(n,t,r){return U("del",{key:r.m},t(n.content,r))}}};!0!==t.disableParsingRawHTML&&(on.htmlBlock={l:$n(z),_:Rn.HIGH,p:function(n,t,r){var e,o=n[3].match(en),u=new RegExp("^"+o[1],"gm"),a=n[3].replace(u,""),i=(e=a,gn.some(function(n){return n.test(e)})?An:jn),f=n[1].toLowerCase(),l=-1!==c.indexOf(f);r.v=r.v||"a"===f;var s=l?n[3]:i(t,a,r);return r.v=!1,{attrs:W(n[2]),content:s,noInnerParse:l,tag:l?f:n[1]}},g:function(n,t,r){return U(n.tag,e({key:r.m},n.attrs),n.noInnerParse?n.content:t(n.content,r))}},on.htmlSelfClosing={l:$n(A),_:Rn.HIGH,p:function(n){return{attrs:W(n[2]||""),tag:n[1]}},g:function(n,t,r){return U(n.tag,e({},n.attrs,{key:r.m}))}});var un,ln=function(n){var t=Object.keys(n);function r(e,o){for(var u=[],a="";e;)for(var c=0;c<t.length;){var i=t[c],f=n[i],l=f.l(e,o,a);if(l){var s=l[0];e=e.substring(s.length);var _=f.p(l,r,o);null==_.type&&(_.type=i),u.push(_),a=s;break}c++}return u}return t.sort(function(t,r){var e=n[t]._,o=n[r]._;return e!==o?e-o:t<r?-1:1}),function(n,t){return r(function(n){return n.replace(h,"\n").replace(x,"").replace(G," ")}(n),t)}}(on),sn=(un=function(n){return function(t,r,e){return n[t.type].g(t,r,e)}}(on),function n(t,r){if(void 0===r&&(r={}),Array.isArray(t)){for(var e=r.m,o=[],u=!1,a=0;a<t.length;a++){r.m=a;var c=n(t[a],r),i="string"==typeof c;i&&u?o[o.length-1]+=c:null!==c&&o.push(c),u=i}return r.m=e,o}return un(t,n,r)}),pn=V(n);return Q.length?U("div",null,pn,U("footer",{key:"footer"},Q.map(function(n){return U("div",{id:t.slugify(n.identifier),key:n.identifier},n.identifier,sn(ln(n.footnote,{u:!0})))}))):pn}!function(n){n[n.MAX=0]="MAX",n[n.HIGH=1]="HIGH",n[n.MED=2]="MED",n[n.LOW=3]="LOW",n[n.MIN=4]="MIN"}(Rn||(Rn={}));var Nn=function(n){var t=n.children,e=n.options,u=function(n,t){if(null==n)return{};var r,e,o={},u=Object.keys(n);for(e=0;e<u.length;e++)t.indexOf(r=u[e])>=0||(o[r]=n[r]);return o}(n,o);return r.cloneElement(Dn(t,e),u)};return Object.assign(Nn,{compiler:Dn}),Nn});
+import*as t from"react";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}const n=["children","options"],r=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{for:"htmlFor"}),o={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],a=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,u=/mailto:/i,i=/\n{2,}$/,l=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,s=/^ *> ?/gm,_=/^ {2,}\n/,f=/^(?:( *[-*_]) *){3,}(?:\n *)+\n/,d=/^\s*(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n?/,p=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,g=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,m=/^(?:\n *)*\n/,y=/\r\n?/g,h=/^\[\^([^\]]+)](:.*)\n/,k=/^\[\^([^\]]+)]/,x=/\f/g,b=/^\s*?\[(x|\s)\]/,v=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,S=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,$=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,w=/&([a-z]+);/g,z=/^<!--[\s\S]*?(?:-->)/,E=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,A=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,R=/^\{.*\}$/,I=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,M=/^<([^ >]+@[^ >]+)>/,O=/^<([^ >]+:\/[^ >]+)>/,B=/ *\n+$/,L=/(?:^|\n)( *)$/,T=/-([a-z])?/gi,j=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,C=/^\[([^\]]*)\]:\s*(\S+)\s*("([^"]*)")?/,D=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,N=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Z=/(\[|\])/g,F=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,P=/\t/g,G=/^ *\| */,H=/(^ *\||\| *$)/g,q=/ *$/,U=/^ *:-+: *$/,V=/^ *:-+ *$/,W=/^ *-+: *$/,Q=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,X=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,J=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,K=/^\\([^0-9A-Za-z\s])/,Y=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,tt=/^\n+/,et=/^([ \t]*)/,nt=/\\([^0-9A-Z\s])/gi,rt=new RegExp("^( *)((?:[*+-]|\\d+\\.)) +"),ot=new RegExp("^( *)((?:[*+-]|\\d+\\.)) +[^\\n]*(?:\\n(?!\\1(?:[*+-]|\\d+\\.) )[^\\n]*)*(\\n|$)","gm"),ct=new RegExp("^( *)((?:[*+-]|\\d+\\.)) [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1(?:[*+-]|\\d+\\.) (?!(?:[*+-]|\\d+\\.) ))\\n*|\\s*\\n*$)"),at="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",ut=new RegExp("^\\[("+at+")\\]\\(\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),it=new RegExp("^!\\[("+at+")\\]\\(\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),lt=[l,p,d,v,S,z,ot,ct,j],st=[...lt,/^[^\n]+(?: \n|\n{2,})/,$,A];function _t(t){return t.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function ft(t){return W.test(t)?"right":U.test(t)?"center":V.test(t)?"left":null}function dt(t,e,n){const r=n.t;n.t=!0;const o=e(t.trim(),n);n.t=r;let c=[[]];return o.forEach(function(t,e){"tableSeparator"===t.type?0!==e&&e!==o.length-1&&c.push([]):("text"!==t.type||null!=o[e+1]&&"tableSeparator"!==o[e+1].type||(t.content=t.content.replace(q,"")),c[c.length-1].push(t))}),c}function pt(t,e,n){n.o=!0;const r=dt(t[1],e,n),o=t[2].replace(H,"").split("|").map(ft),c=function(t,e,n){return t.trim().split("\n").map(function(t){return dt(t,e,n)})}(t[3],e,n);return n.o=!1,{align:o,cells:c,header:r,type:"table"}}function gt(t,e){return null==t.align[e]?{}:{textAlign:t.align[e]}}function mt(t){return function(e,n){return n.o?t.exec(e):null}}function yt(t){return function(e,n){return n.o||n.u?t.exec(e):null}}function ht(t){return function(e,n){return n.o||n.u?null:t.exec(e)}}function kt(t){return function(e){return t.exec(e)}}function xt(t,e,n){if(e.o||e.u)return null;if(n&&!n.endsWith("\n"))return null;let r="";t.split("\n").every(t=>!lt.some(e=>e.test(t))&&(r+=t+"\n",t.trim()));const o=r.trimEnd();return""==o?null:[r,o]}function bt(t){try{if(decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data):/i))return null}catch(t){return null}return t}function vt(t){return t.replace(nt,"$1")}function St(t,e,n){const r=n.o||!1,o=n.u||!1;n.o=!0,n.u=!0;const c=t(e,n);return n.o=r,n.u=o,c}function $t(t,e,n){const r=n.o||!1,o=n.u||!1;n.o=!1,n.u=!0;const c=t(e,n);return n.o=r,n.u=o,c}function wt(t,e,n){return n.o=!1,t(e+"\n\n",n)}const zt=(t,e,n)=>({content:St(e,t[1],n)});function Et(){return{}}function At(){return null}function Rt(...t){return t.filter(Boolean).join(" ")}function It(t,e,n){let r=t;const o=e.split(".");for(;o.length&&(r=r[o[0]],void 0!==r);)o.shift();return r||n}var Mt;function Ot(n,H={}){H.overrides=H.overrides||{},H.slugify=H.slugify||_t,H.namedCodesToUnicode=H.namedCodesToUnicode?e({},o,H.namedCodesToUnicode):o;const q=H.createElement||t.createElement;function U(t,n,...r){const o=It(H.overrides,`${t}.props`,{});return q(function(t,e){const n=It(e,t);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:It(e,`${t}.component`,t):t}(t,H.overrides),e({},n,o,{className:Rt(null==n?void 0:n.className,o.className)||void 0}),...r)}function V(e){let n=!1;H.forceInline?n=!0:H.forceBlock||(n=!1===F.test(e));const r=dt(ft(n?e:`${e.trimEnd().replace(tt,"")}\n\n`,{o:n}));for(;"string"==typeof r[r.length-1]&&!r[r.length-1].trim();)r.pop();if(null===H.wrapper)return r;const o=H.wrapper||(n?"span":"div");let c;if(r.length>1||H.forceWrapper)c=r;else{if(1===r.length)return c=r[0],"string"==typeof c?U("span",{key:"outer"},c):c;c=null}return t.createElement(o,{key:"outer"},c)}function W(e){const n=e.match(a);return n?n.reduce(function(e,n,o){const c=n.indexOf("=");if(-1!==c){const a=function(t){return-1!==t.indexOf("-")&&null===t.match(E)&&(t=t.replace(T,function(t,e){return e.toUpperCase()})),t}(n.slice(0,c)).trim(),u=function(t){const e=t[0];return('"'===e||"'"===e)&&t.length>=2&&t[t.length-1]===e?t.slice(1,-1):t}(n.slice(c+1).trim()),i=r[a]||a,l=e[i]=function(t,e){return"style"===t?e.split(/;\s?/).reduce(function(t,e){const n=e.slice(0,e.indexOf(":"));return t[n.replace(/(-[a-z])/g,t=>t[1].toUpperCase())]=e.slice(n.length+1).trim(),t},{}):"href"===t?bt(e):(e.match(R)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e)}(a,u);"string"==typeof l&&($.test(l)||A.test(l))&&(e[i]=t.cloneElement(V(l.trim()),{key:o}))}else"style"!==n&&(e[r[n]||n]=!0);return e},{}):void 0}const nt=[],at={},lt={blockQuote:{i:ht(l),l:Mt.HIGH,_:(t,e,n)=>({content:e(t[0].replace(s,""),n)}),p:(t,e,n)=>U("blockquote",{key:n.g},e(t.content,n))},breakLine:{i:kt(_),l:Mt.HIGH,_:Et,p:(t,e,n)=>U("br",{key:n.g})},breakThematic:{i:ht(f),l:Mt.HIGH,_:Et,p:(t,e,n)=>U("hr",{key:n.g})},codeBlock:{i:ht(p),l:Mt.MAX,_:t=>({content:t[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),lang:void 0}),p:(t,e,n)=>U("pre",{key:n.g},U("code",{className:t.lang?`lang-${t.lang}`:""},t.content))},codeFenced:{i:ht(d),l:Mt.MAX,_:t=>({content:t[3],lang:t[2]||void 0,type:"codeBlock"})},codeInline:{i:yt(g),l:Mt.LOW,_:t=>({content:t[2]}),p:(t,e,n)=>U("code",{key:n.g},t.content)},footnote:{i:ht(h),l:Mt.MAX,_:t=>(nt.push({footnote:t[2],identifier:t[1]}),{}),p:At},footnoteReference:{i:mt(k),l:Mt.HIGH,_:t=>({content:t[1],target:`#${H.slugify(t[1])}`}),p:(t,e,n)=>U("a",{key:n.g,href:bt(t.target)},U("sup",{key:n.g},t.content))},gfmTask:{i:mt(b),l:Mt.HIGH,_:t=>({completed:"x"===t[1].toLowerCase()}),p:(t,e,n)=>U("input",{checked:t.completed,key:n.g,readOnly:!0,type:"checkbox"})},heading:{i:ht(v),l:Mt.HIGH,_:(t,e,n)=>({content:St(e,t[2],n),id:H.slugify(t[2]),level:t[1].length}),p:(t,e,n)=>(t.tag=`h${t.level}`,U(t.tag,{id:t.id,key:n.g},e(t.content,n)))},headingSetext:{i:ht(S),l:Mt.MAX,_:(t,e,n)=>({content:St(e,t[1],n),level:"="===t[2]?1:2,type:"heading"})},htmlComment:{i:kt(z),l:Mt.HIGH,_:()=>({}),p:At},image:{i:yt(it),l:Mt.HIGH,_:t=>({alt:t[1],target:vt(t[2]),title:t[3]}),p:(t,e,n)=>U("img",{key:n.g,alt:t.alt||void 0,title:t.title||void 0,src:bt(t.target)})},link:{i:mt(ut),l:Mt.LOW,_:(t,e,n)=>({content:$t(e,t[1],n),target:vt(t[2]),title:t[3]}),p:(t,e,n)=>U("a",{key:n.g,href:bt(t.target),title:t.title},e(t.content,n))},linkAngleBraceStyleDetector:{i:mt(O),l:Mt.MAX,_:t=>({content:[{content:t[1],type:"text"}],target:t[1],type:"link"})},linkBareUrlDetector:{i:(t,e)=>e.m?null:mt(I)(t,e),l:Mt.MAX,_:t=>({content:[{content:t[1],type:"text"}],target:t[1],title:void 0,type:"link"})},linkMailtoDetector:{i:mt(M),l:Mt.MAX,_(t){let e=t[1],n=t[1];return u.test(n)||(n="mailto:"+n),{content:[{content:e.replace("mailto:",""),type:"text"}],target:n,type:"link"}}},list:{i(t,e,n){const r=L.exec(n);return!r||!e.h&&e.o?null:ct.exec(t=r[1]+t)},l:Mt.HIGH,_(t,e,n){const r=t[2],o=r.length>1,c=o?+r:void 0,a=t[0].replace(i,"\n").match(ot);let u=!1;return{items:a.map(function(t,r){const o=rt.exec(t)[0].length,c=new RegExp("^ {1,"+o+"}","gm"),i=t.replace(c,"").replace(rt,""),l=r===a.length-1,s=-1!==i.indexOf("\n\n")||l&&u;u=s;const _=n.o,f=n.h;let d;n.h=!0,s?(n.o=!1,d=i.replace(B,"\n\n")):(n.o=!0,d=i.replace(B,""));const p=e(d,n);return n.o=_,n.h=f,p}),ordered:o,start:c}},p:(t,e,n)=>U(t.ordered?"ol":"ul",{key:n.g,start:t.start},t.items.map(function(t,r){return U("li",{key:r},e(t,n))}))},newlineCoalescer:{i:ht(m),l:Mt.LOW,_:Et,p:()=>"\n"},paragraph:{i:xt,l:Mt.LOW,_:zt,p:(t,e,n)=>U("p",{key:n.g},e(t.content,n))},ref:{i:mt(C),l:Mt.MAX,_:t=>(at[t[1]]={target:t[2],title:t[4]},{}),p:At},refImage:{i:yt(D),l:Mt.MAX,_:t=>({alt:t[1]||void 0,ref:t[2]}),p:(t,e,n)=>U("img",{key:n.g,alt:t.alt,src:bt(at[t.ref].target),title:at[t.ref].title})},refLink:{i:mt(N),l:Mt.MAX,_:(t,e,n)=>({content:e(t[1],n),fallbackContent:e(t[0].replace(Z,"\\$1"),n),ref:t[2]}),p:(t,e,n)=>at[t.ref]?U("a",{key:n.g,href:bt(at[t.ref].target),title:at[t.ref].title},e(t.content,n)):U("span",{key:n.g},e(t.fallbackContent,n))},table:{i:ht(j),l:Mt.HIGH,_:pt,p:(t,e,n)=>U("table",{key:n.g},U("thead",null,U("tr",null,t.header.map(function(r,o){return U("th",{key:o,style:gt(t,o)},e(r,n))}))),U("tbody",null,t.cells.map(function(r,o){return U("tr",{key:o},r.map(function(r,o){return U("td",{key:o,style:gt(t,o)},e(r,n))}))})))},tableSeparator:{i:function(t,e){return e.t?G.exec(t):null},l:Mt.HIGH,_:function(){return{type:"tableSeparator"}},p:()=>" | "},text:{i:kt(Y),l:Mt.MIN,_:t=>({content:t[0].replace(w,(t,e)=>H.namedCodesToUnicode[e]?H.namedCodesToUnicode[e]:t)}),p:t=>t.content},textBolded:{i:yt(Q),l:Mt.MED,_:(t,e,n)=>({content:e(t[2],n)}),p:(t,e,n)=>U("strong",{key:n.g},e(t.content,n))},textEmphasized:{i:yt(X),l:Mt.LOW,_:(t,e,n)=>({content:e(t[2],n)}),p:(t,e,n)=>U("em",{key:n.g},e(t.content,n))},textEscaped:{i:yt(K),l:Mt.HIGH,_:t=>({content:t[1],type:"text"})},textStrikethroughed:{i:yt(J),l:Mt.LOW,_:zt,p:(t,e,n)=>U("del",{key:n.g},e(t.content,n))}};!0!==H.disableParsingRawHTML&&(lt.htmlBlock={i:kt($),l:Mt.HIGH,_(t,e,n){const[,r]=t[3].match(et),o=new RegExp(`^${r}`,"gm"),a=t[3].replace(o,""),u=(i=a,st.some(t=>t.test(i))?wt:St);var i;const l=t[1].toLowerCase(),s=-1!==c.indexOf(l);n.m=n.m||"a"===l;const _=s?t[3]:u(e,a,n);return n.m=!1,{attrs:W(t[2]),content:_,noInnerParse:s,tag:s?l:t[1]}},p:(t,n,r)=>U(t.tag,e({key:r.g},t.attrs),t.noInnerParse?t.content:n(t.content,r))},lt.htmlSelfClosing={i:kt(A),l:Mt.HIGH,_:t=>({attrs:W(t[2]||""),tag:t[1]}),p:(t,n,r)=>U(t.tag,e({},t.attrs,{key:r.g}))});const ft=function(t){let e=Object.keys(t);function n(r,o){let c=[],a="";for(;r;){let u=0;for(;u<e.length;){const i=e[u],l=t[i],s=l.i(r,o,a);if(s){const t=s[0];r=r.substring(t.length);const e=l._(s,n,o);null==e.type&&(e.type=i),c.push(e),a=t;break}u++}}return c}return e.sort(function(e,n){let r=t[e].l,o=t[n].l;return r!==o?r-o:e<n?-1:1}),function(t,e){return n(function(t){return t.replace(y,"\n").replace(x,"").replace(P," ")}(t),e)}}(lt),dt=(Ot=function(t){return function(e,n,r){return t[e.type].p(e,n,r)}}(lt),function t(e,n={}){if(Array.isArray(e)){const r=n.g,o=[];let c=!1;for(let r=0;r<e.length;r++){n.g=r;const a=t(e[r],n),u="string"==typeof a;u&&c?o[o.length-1]+=a:null!==a&&o.push(a),c=u}return n.g=r,o}return Ot(e,t,n)});var Ot;const Bt=V(n);return nt.length?U("div",null,Bt,U("footer",{key:"footer"},nt.map(function(t){return U("div",{id:H.slugify(t.identifier),key:t.identifier},t.identifier,dt(ft(t.footnote,{o:!0})))}))):Bt}!function(t){t[t.MAX=0]="MAX",t[t.HIGH=1]="HIGH",t[t.MED=2]="MED",t[t.LOW=3]="LOW",t[t.MIN=4]="MIN"}(Mt||(Mt={}));export default e=>{let{children:r,options:o}=e,c=function(t,e){if(null==t)return{};var n,r,o={},c=Object.keys(t);for(r=0;r<c.length;r++)e.indexOf(n=c[r])>=0||(o[n]=t[n]);return o}(e,n);return t.cloneElement(Ot(r,o),c)};export{Ot as compiler};
+//# sourceMappingURL=index.modern.js.map
@@ -0,0 +1 @@
+!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(n||self).MarkdownToJSX=t(n.React)}(this || globalThis,function(n){function t(n){if(n&&n.t)return n;var t=Object.create(null);return n&&Object.keys(n).forEach(function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:!0,get:function(){return n[r]}})}}),t.default=n,t}var r=/*#__PURE__*/t(n);function e(){return(e=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n}).apply(this,arguments)}var o=["children","options"],u=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(n,t){return n[t.toLowerCase()]=t,n},{for:"htmlFor"}),a={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script"],i=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,f=/mailto:/i,l=/\n{2,}$/,s=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,_=/^ *> ?/gm,d=/^ {2,}\n/,p=/^(?:( *[-*_]) *){3,}(?:\n *)+\n/,g=/^\s*(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n?/,m=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,v=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,y=/^(?:\n *)*\n/,h=/\r\n?/g,k=/^\[\^([^\]]+)](:.*)\n/,b=/^\[\^([^\]]+)]/,x=/\f/g,S=/^\s*?\[(x|\s)\]/,$=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,w=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,z=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?([^>]*)\/{0}>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1)[\s\S])*?)<\/\1>\n*/i,O=/&([a-z]+);/g,j=/^<!--[\s\S]*?(?:-->)/,E=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,A=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,R=/^\{.*\}$/,T=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,I=/^<([^ >]+@[^ >]+)>/,M=/^<([^ >]+:\/[^ >]+)>/,B=/ *\n+$/,L=/(?:^|\n)( *)$/,C=/-([a-z])?/gi,D=/^(.*\|?.*)\n *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*)\n?/,N=/^\[([^\]]*)\]:\s*(\S+)\s*("([^"]*)")?/,Z=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,F=/^\[([^\]]*)\] ?\[([^\]]*)\]/,P=/(\[|\])/g,q=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,G=/\t/g,H=/^ *\| */,U=/(^ *\||\| *$)/g,V=/ *$/,W=/^ *:-+: *$/,Q=/^ *:-+ *$/,X=/^ *-+: *$/,J=/^([*_])\1((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1\1(?!\1)/,K=/^([*_])((?:\[.*?\][([].*?[)\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~+.*?~+|.)*?)\1(?!\1|\w)/,Y=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,nn=/^\\([^0-9A-Za-z\s])/,tn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,rn=/^\n+/,en=/^([ \t]*)/,on=/\\([^0-9A-Z\s])/gi,un="( *)((?:[*+-]|\\d+\\.)) +",an=new RegExp("^"+un),cn=new RegExp("^"+un+"[^\\n]*(?:\\n(?!\\1(?:[*+-]|\\d+\\.) )[^\\n]*)*(\\n|$)","gm"),fn=new RegExp("^( *)((?:[*+-]|\\d+\\.)) [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1(?:[*+-]|\\d+\\.) (?!(?:[*+-]|\\d+\\.) ))\\n*|\\s*\\n*$)"),ln="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",sn="\\s*<?((?:[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",_n=new RegExp("^\\[("+ln+")\\]\\("+sn+"\\)"),dn=new RegExp("^!\\[("+ln+")\\]\\("+sn+"\\)"),pn=[s,m,g,$,w,j,cn,fn,D],gn=[].concat(pn,[/^[^\n]+(?: \n|\n{2,})/,z,A]);function mn(n){return n.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function vn(n){return X.test(n)?"right":W.test(n)?"center":Q.test(n)?"left":null}function yn(n,t,r){var e=r.o;r.o=!0;var o=t(n.trim(),r);r.o=e;var u=[[]];return o.forEach(function(n,t){"tableSeparator"===n.type?0!==t&&t!==o.length-1&&u.push([]):("text"!==n.type||null!=o[t+1]&&"tableSeparator"!==o[t+1].type||(n.content=n.content.replace(V,"")),u[u.length-1].push(n))}),u}function hn(n,t,r){r.u=!0;var e=yn(n[1],t,r),o=n[2].replace(U,"").split("|").map(vn),u=function(n,t,r){return n.trim().split("\n").map(function(n){return yn(n,t,r)})}(n[3],t,r);return r.u=!1,{align:o,cells:u,header:e,type:"table"}}function kn(n,t){return null==n.align[t]?{}:{textAlign:n.align[t]}}function bn(n){return function(t,r){return r.u?n.exec(t):null}}function xn(n){return function(t,r){return r.u||r.i?n.exec(t):null}}function Sn(n){return function(t,r){return r.u||r.i?null:n.exec(t)}}function $n(n){return function(t){return n.exec(t)}}function wn(n,t,r){if(t.u||t.i)return null;if(r&&!r.endsWith("\n"))return null;var e="";n.split("\n").every(function(n){return!pn.some(function(t){return t.test(n)})&&(e+=n+"\n",n.trim())});var o=e.trimEnd();return""==o?null:[e,o]}function zn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data):/i))return null}catch(n){return null}return n}function On(n){return n.replace(on,"$1")}function jn(n,t,r){var e=r.u||!1,o=r.i||!1;r.u=!0,r.i=!0;var u=n(t,r);return r.u=e,r.i=o,u}function En(n,t,r){var e=r.u||!1,o=r.i||!1;r.u=!1,r.i=!0;var u=n(t,r);return r.u=e,r.i=o,u}function An(n,t,r){return r.u=!1,n(t+"\n\n",r)}var Rn,Tn=function(n,t,r){return{content:jn(t,n[1],r)}};function In(){return{}}function Mn(){return null}function Bn(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Ln(n,t,r){for(var e=n,o=t.split(".");o.length&&void 0!==(e=e[o[0]]);)o.shift();return e||r}function Cn(n,t){var r=Ln(t,n);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Ln(t,n+".component",n):n}function Dn(n,t){void 0===t&&(t={}),t.overrides=t.overrides||{},t.slugify=t.slugify||mn,t.namedCodesToUnicode=t.namedCodesToUnicode?e({},a,t.namedCodesToUnicode):a;var o=t.createElement||r.createElement;function U(n,r){var u=Ln(t.overrides,n+".props",{});return o.apply(void 0,[Cn(n,t.overrides),e({},r,u,{className:Bn(null==r?void 0:r.className,u.className)||void 0})].concat([].slice.call(arguments,2)))}function V(n){var e=!1;t.forceInline?e=!0:t.forceBlock||(e=!1===q.test(n));for(var o=sn(ln(e?n:n.trimEnd().replace(rn,"")+"\n\n",{u:e}));"string"==typeof o[o.length-1]&&!o[o.length-1].trim();)o.pop();if(null===t.wrapper)return o;var u,a=t.wrapper||(e?"span":"div");if(o.length>1||t.forceWrapper)u=o;else{if(1===o.length)return"string"==typeof(u=o[0])?U("span",{key:"outer"},u):u;u=null}return r.createElement(a,{key:"outer"},u)}function W(n){var t=n.match(i);return t?t.reduce(function(n,t,e){var o=t.indexOf("=");if(-1!==o){var a=function(n){return-1!==n.indexOf("-")&&null===n.match(E)&&(n=n.replace(C,function(n,t){return t.toUpperCase()})),n}(t.slice(0,o)).trim(),c=function(n){var t=n[0];return('"'===t||"'"===t)&&n.length>=2&&n[n.length-1]===t?n.slice(1,-1):n}(t.slice(o+1).trim()),i=u[a]||a,f=n[i]=function(n,t){return"style"===n?t.split(/;\s?/).reduce(function(n,t){var r=t.slice(0,t.indexOf(":"));return n[r.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=t.slice(r.length+1).trim(),n},{}):"href"===n?zn(t):(t.match(R)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(a,c);"string"==typeof f&&(z.test(f)||A.test(f))&&(n[i]=r.cloneElement(V(f.trim()),{key:e}))}else"style"!==t&&(n[u[t]||t]=!0);return n},{}):void 0}var Q=[],X={},on={blockQuote:{l:Sn(s),_:Rn.HIGH,p:function(n,t,r){return{content:t(n[0].replace(_,""),r)}},g:function(n,t,r){return U("blockquote",{key:r.m},t(n.content,r))}},breakLine:{l:$n(d),_:Rn.HIGH,p:In,g:function(n,t,r){return U("br",{key:r.m})}},breakThematic:{l:Sn(p),_:Rn.HIGH,p:In,g:function(n,t,r){return U("hr",{key:r.m})}},codeBlock:{l:Sn(m),_:Rn.MAX,p:function(n){return{content:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),lang:void 0}},g:function(n,t,r){return U("pre",{key:r.m},U("code",{className:n.lang?"lang-"+n.lang:""},n.content))}},codeFenced:{l:Sn(g),_:Rn.MAX,p:function(n){return{content:n[3],lang:n[2]||void 0,type:"codeBlock"}}},codeInline:{l:xn(v),_:Rn.LOW,p:function(n){return{content:n[2]}},g:function(n,t,r){return U("code",{key:r.m},n.content)}},footnote:{l:Sn(k),_:Rn.MAX,p:function(n){return Q.push({footnote:n[2],identifier:n[1]}),{}},g:Mn},footnoteReference:{l:bn(b),_:Rn.HIGH,p:function(n){return{content:n[1],target:"#"+t.slugify(n[1])}},g:function(n,t,r){return U("a",{key:r.m,href:zn(n.target)},U("sup",{key:r.m},n.content))}},gfmTask:{l:bn(S),_:Rn.HIGH,p:function(n){return{completed:"x"===n[1].toLowerCase()}},g:function(n,t,r){return U("input",{checked:n.completed,key:r.m,readOnly:!0,type:"checkbox"})}},heading:{l:Sn($),_:Rn.HIGH,p:function(n,r,e){return{content:jn(r,n[2],e),id:t.slugify(n[2]),level:n[1].length}},g:function(n,t,r){return n.tag="h"+n.level,U(n.tag,{id:n.id,key:r.m},t(n.content,r))}},headingSetext:{l:Sn(w),_:Rn.MAX,p:function(n,t,r){return{content:jn(t,n[1],r),level:"="===n[2]?1:2,type:"heading"}}},htmlComment:{l:$n(j),_:Rn.HIGH,p:function(){return{}},g:Mn},image:{l:xn(dn),_:Rn.HIGH,p:function(n){return{alt:n[1],target:On(n[2]),title:n[3]}},g:function(n,t,r){return U("img",{key:r.m,alt:n.alt||void 0,title:n.title||void 0,src:zn(n.target)})}},link:{l:bn(_n),_:Rn.LOW,p:function(n,t,r){return{content:En(t,n[1],r),target:On(n[2]),title:n[3]}},g:function(n,t,r){return U("a",{key:r.m,href:zn(n.target),title:n.title},t(n.content,r))}},linkAngleBraceStyleDetector:{l:bn(M),_:Rn.MAX,p:function(n){return{content:[{content:n[1],type:"text"}],target:n[1],type:"link"}}},linkBareUrlDetector:{l:function(n,t){return t.v?null:bn(T)(n,t)},_:Rn.MAX,p:function(n){return{content:[{content:n[1],type:"text"}],target:n[1],title:void 0,type:"link"}}},linkMailtoDetector:{l:bn(I),_:Rn.MAX,p:function(n){var t=n[1],r=n[1];return f.test(r)||(r="mailto:"+r),{content:[{content:t.replace("mailto:",""),type:"text"}],target:r,type:"link"}}},list:{l:function(n,t,r){var e=L.exec(r);return!e||!t.h&&t.u?null:fn.exec(n=e[1]+n)},_:Rn.HIGH,p:function(n,t,r){var e=n[2],o=e.length>1,u=o?+e:void 0,a=n[0].replace(l,"\n").match(cn),c=!1;return{items:a.map(function(n,e){var o=an.exec(n)[0].length,u=new RegExp("^ {1,"+o+"}","gm"),i=n.replace(u,"").replace(an,""),f=e===a.length-1,l=-1!==i.indexOf("\n\n")||f&&c;c=l;var s,_=r.u,d=r.h;r.h=!0,l?(r.u=!1,s=i.replace(B,"\n\n")):(r.u=!0,s=i.replace(B,""));var p=t(s,r);return r.u=_,r.h=d,p}),ordered:o,start:u}},g:function(n,t,r){return U(n.ordered?"ol":"ul",{key:r.m,start:n.start},n.items.map(function(n,e){return U("li",{key:e},t(n,r))}))}},newlineCoalescer:{l:Sn(y),_:Rn.LOW,p:In,g:function(){return"\n"}},paragraph:{l:wn,_:Rn.LOW,p:Tn,g:function(n,t,r){return U("p",{key:r.m},t(n.content,r))}},ref:{l:bn(N),_:Rn.MAX,p:function(n){return X[n[1]]={target:n[2],title:n[4]},{}},g:Mn},refImage:{l:xn(Z),_:Rn.MAX,p:function(n){return{alt:n[1]||void 0,ref:n[2]}},g:function(n,t,r){return U("img",{key:r.m,alt:n.alt,src:zn(X[n.ref].target),title:X[n.ref].title})}},refLink:{l:bn(F),_:Rn.MAX,p:function(n,t,r){return{content:t(n[1],r),fallbackContent:t(n[0].replace(P,"\\$1"),r),ref:n[2]}},g:function(n,t,r){return X[n.ref]?U("a",{key:r.m,href:zn(X[n.ref].target),title:X[n.ref].title},t(n.content,r)):U("span",{key:r.m},t(n.fallbackContent,r))}},table:{l:Sn(D),_:Rn.HIGH,p:hn,g:function(n,t,r){return U("table",{key:r.m},U("thead",null,U("tr",null,n.header.map(function(e,o){return U("th",{key:o,style:kn(n,o)},t(e,r))}))),U("tbody",null,n.cells.map(function(e,o){return U("tr",{key:o},e.map(function(e,o){return U("td",{key:o,style:kn(n,o)},t(e,r))}))})))}},tableSeparator:{l:function(n,t){return t.o?H.exec(n):null},_:Rn.HIGH,p:function(){return{type:"tableSeparator"}},g:function(){return" | "}},text:{l:$n(tn),_:Rn.MIN,p:function(n){return{content:n[0].replace(O,function(n,r){return t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:n})}},g:function(n){return n.content}},textBolded:{l:xn(J),_:Rn.MED,p:function(n,t,r){return{content:t(n[2],r)}},g:function(n,t,r){return U("strong",{key:r.m},t(n.content,r))}},textEmphasized:{l:xn(K),_:Rn.LOW,p:function(n,t,r){return{content:t(n[2],r)}},g:function(n,t,r){return U("em",{key:r.m},t(n.content,r))}},textEscaped:{l:xn(nn),_:Rn.HIGH,p:function(n){return{content:n[1],type:"text"}}},textStrikethroughed:{l:xn(Y),_:Rn.LOW,p:Tn,g:function(n,t,r){return U("del",{key:r.m},t(n.content,r))}}};!0!==t.disableParsingRawHTML&&(on.htmlBlock={l:$n(z),_:Rn.HIGH,p:function(n,t,r){var e,o=n[3].match(en),u=new RegExp("^"+o[1],"gm"),a=n[3].replace(u,""),i=(e=a,gn.some(function(n){return n.test(e)})?An:jn),f=n[1].toLowerCase(),l=-1!==c.indexOf(f);r.v=r.v||"a"===f;var s=l?n[3]:i(t,a,r);return r.v=!1,{attrs:W(n[2]),content:s,noInnerParse:l,tag:l?f:n[1]}},g:function(n,t,r){return U(n.tag,e({key:r.m},n.attrs),n.noInnerParse?n.content:t(n.content,r))}},on.htmlSelfClosing={l:$n(A),_:Rn.HIGH,p:function(n){return{attrs:W(n[2]||""),tag:n[1]}},g:function(n,t,r){return U(n.tag,e({},n.attrs,{key:r.m}))}});var un,ln=function(n){var t=Object.keys(n);function r(e,o){for(var u=[],a="";e;)for(var c=0;c<t.length;){var i=t[c],f=n[i],l=f.l(e,o,a);if(l){var s=l[0];e=e.substring(s.length);var _=f.p(l,r,o);null==_.type&&(_.type=i),u.push(_),a=s;break}c++}return u}return t.sort(function(t,r){var e=n[t]._,o=n[r]._;return e!==o?e-o:t<r?-1:1}),function(n,t){return r(function(n){return n.replace(h,"\n").replace(x,"").replace(G," ")}(n),t)}}(on),sn=(un=function(n){return function(t,r,e){return n[t.type].g(t,r,e)}}(on),function n(t,r){if(void 0===r&&(r={}),Array.isArray(t)){for(var e=r.m,o=[],u=!1,a=0;a<t.length;a++){r.m=a;var c=n(t[a],r),i="string"==typeof c;i&&u?o[o.length-1]+=c:null!==c&&o.push(c),u=i}return r.m=e,o}return un(t,n,r)}),pn=V(n);return Q.length?U("div",null,pn,U("footer",{key:"footer"},Q.map(function(n){return U("div",{id:t.slugify(n.identifier),key:n.identifier},n.identifier,sn(ln(n.footnote,{u:!0})))}))):pn}!function(n){n[n.MAX=0]="MAX",n[n.HIGH=1]="HIGH",n[n.MED=2]="MED",n[n.LOW=3]="LOW",n[n.MIN=4]="MIN"}(Rn||(Rn={}));var Nn=function(n){var t=n.children,e=n.options,u=function(n,t){if(null==n)return{};var r,e,o={},u=Object.keys(n);for(e=0;e<u.length;e++)t.indexOf(r=u[e])>=0||(o[r]=n[r]);return o}(n,o);return r.cloneElement(Dn(t,e),u)};return Object.assign(Nn,{compiler:Dn}),Nn});
@@ -0,0 +1,621 @@
+/* InstantRouter */ var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __propIsEnum = Object.prototype.propertyIsEnumerable;
+
+var __defNormalProp = (obj, key, value) =>
+ key in obj
+ ? __defProp(obj, key, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value,
+ })
+ : (obj[key] = value);
+
+var __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
+
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+
+var __name = (target, value) =>
+ __defProp(target, "name", {
+ value,
+ configurable: true,
+ });
+
+var __async = (__this, __arguments, generator) => {
+ return new Promise((resolve, reject) => {
+ var fulfilled = (value) => {
+ try {
+ step(generator.next(value));
+ } catch (e) {
+ reject(e);
+ }
+ };
+
+ var rejected = (value) => {
+ try {
+ step(generator.throw(value));
+ } catch (e) {
+ reject(e);
+ }
+ };
+
+ var step = (x) =>
+ x.done
+ ? resolve(x.value)
+ : Promise.resolve(x.value).then(fulfilled, rejected);
+
+ step((generator = generator.apply(__this, __arguments)).next());
+ });
+}; // node_modules/@ethicdevs/fastify-stream-react-views/src/instant-router/InstantRouterEvents.ts
+
+var InstantRouterEvents = {
+ LOADING: `instantroute_loading`,
+ LOADED: `instantroute_loaded`,
+ LOAD_ERROR: `instantroute_load_error`,
+ NAVIGATING: `instantroute_navigating`,
+ NAVIGATED: `instantroute_navigated`,
+ NAVIGATION_ERROR: `instantroute_navigation_error`,
+}; // node_modules/@ethicdevs/fastify-stream-react-views/src/instant-router/InstantRouter.ts
+
+var _InstantRouter = class {
+ constructor(opts) {
+ this.pageHref = window.location.href;
+ this.domParser = new DOMParser();
+ this.opts = __spreadValues(
+ __spreadValues({}, _InstantRouter.defaultOpts),
+ opts || {},
+ );
+ }
+
+ init() {
+ this.monkeyPatchLocationReplace();
+ document.addEventListener(
+ this.opts.fetchAnchorsOn,
+ this.onClientSideRouterMouseDown,
+ false,
+ );
+ document.addEventListener("submit", this.onClientSideRouterSubmit);
+ window.addEventListener("popstate", this.onClientSideRouterPopstate);
+ console.log(
+ `[${Date.now()}][InstantRouter] Ready to handle clicks & form submissions!`,
+ );
+ }
+
+ onClientSideRouterMouseDown(ev) {
+ console.log("mouse click:", ev);
+
+ let targetEl = ev.target;
+
+ if (ev == null || ev.button !== 0) {
+ return false;
+ }
+
+ if (targetEl == null) {
+ return false;
+ }
+
+ if (
+ targetEl.tagName.toLowerCase() !== "a" &&
+ targetEl.parentElement != null
+ ) {
+ const parentAnchor = targetEl.parentElement.closest("a");
+
+ if (parentAnchor != null) {
+ targetEl = parentAnchor;
+ }
+ }
+
+ if (
+ "href" in targetEl === false ||
+ targetEl.href == null ||
+ targetEl.href.trim() === ""
+ ) {
+ return false;
+ }
+
+ console.log("click on a link has been catched... processing...");
+
+ const targetDataset = targetEl.dataset;
+ const baseUrl = new URL(document.baseURI);
+ const targetUrl = new URL(targetEl.href, document.baseURI);
+ const isExternalUrl = baseUrl.origin !== targetUrl.origin;
+
+ if (isExternalUrl || targetDataset["externalLink"] === "true") {
+ return false;
+ }
+
+ const targetHash = targetUrl.hash;
+ const isHashChange = !!(
+ targetHash != null &&
+ targetHash.trim() !== "" &&
+ targetHash.startsWith("#")
+ );
+
+ if (isHashChange) {
+ const hashEl = document.querySelector(targetHash);
+
+ if (hashEl != null) {
+ ev.preventDefault();
+
+ if (targetDataset["smoothScroll"] !== "disabled") {
+ hashEl.scrollIntoView({
+ behavior: "smooth",
+ });
+ }
+
+ window.location.hash = targetHash;
+ return true;
+ }
+
+ return false;
+ }
+
+ console.log("not a hash, need navigation to new page");
+ ev.preventDefault();
+ ev.stopPropagation();
+
+ return __async(this, null, function* () {
+ let doNavigate = null;
+ let pollWaitFetchDoneIntervalId = null;
+
+ const navigateOrWait = /* @__PURE__ */ __name(() => {
+ if (doNavigate != null) {
+ doNavigate();
+
+ if (pollWaitFetchDoneIntervalId != null) {
+ clearTimeout(pollWaitFetchDoneIntervalId);
+ pollWaitFetchDoneIntervalId = null;
+ }
+
+ if (targetEl != null && onClickHandler != null) {
+ targetEl.removeEventListener("click", onClickHandler);
+ onClickHandler = null;
+ }
+ } else {
+ pollWaitFetchDoneIntervalId = setTimeout(() => {
+ if (pollWaitFetchDoneIntervalId != null) {
+ clearTimeout(pollWaitFetchDoneIntervalId);
+ pollWaitFetchDoneIntervalId = null;
+ }
+
+ navigateOrWait();
+ }, 10);
+ }
+ }, "navigateOrWait");
+
+ let onClickHandler = /* @__PURE__ */ __name((subEv) => {
+ subEv.preventDefault();
+ navigateOrWait();
+ return true;
+ }, "onClickHandler");
+
+ try {
+ targetEl.addEventListener("click", onClickHandler);
+ doNavigate = yield this.fetchAndPushState(
+ targetEl.href,
+ this.pageHref,
+ void 0,
+ void 0,
+ void 0,
+ targetDataset["smoothScroll"] !== "disabled",
+ );
+ } catch (_) {
+ targetEl.removeEventListener("click", onClickHandler);
+ onClickHandler = null;
+ doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = targetEl.href;
+ }, "doNavigate");
+ }
+
+ return true;
+ });
+ }
+
+ onClientSideRouterSubmit(ev) {
+ return __async(this, null, function* () {
+ const targetEl = ev.target;
+
+ if (targetEl == null || targetEl.tagName.toLowerCase() !== "form") {
+ return false;
+ }
+
+ const targetAction = targetEl.action;
+ const targetMethod = targetEl.method;
+
+ if (
+ targetAction == null ||
+ targetAction.trim() === "" ||
+ targetMethod == null ||
+ ["get", "post"].includes(targetMethod.toLowerCase()) === false
+ ) {
+ return false;
+ }
+
+ ev.preventDefault();
+ const headers = {
+ "content-type": "application/x-www-form-urlencoded",
+ };
+ const targetFormData = new FormData(targetEl);
+ let targetFormDataEntries = {};
+ targetFormData.forEach((v, k) => {
+ targetFormDataEntries = __spreadProps(
+ __spreadValues({}, targetFormDataEntries),
+ {
+ [k]: v,
+ },
+ );
+ });
+ const bodyFormEncoded = Object.entries(targetFormDataEntries)
+ .map(([k, v]) => `${k}=${v}`)
+ .join("&");
+
+ let doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = targetAction;
+ }, "doNavigate");
+
+ try {
+ doNavigate = yield this.fetchAndPushState(
+ targetAction,
+ this.pageHref,
+ targetMethod,
+ bodyFormEncoded,
+ headers,
+ );
+ } catch (_) {}
+
+ doNavigate();
+ return true;
+ });
+ }
+
+ onClientSideRouterPopstate(event) {
+ return __async(this, null, function* () {
+ setTimeout(
+ () =>
+ __async(this, null, function* () {
+ if (event.state) {
+ if (event.state.targetHref != null) {
+ let doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = event.state.targetHref;
+ }, "doNavigate");
+
+ try {
+ doNavigate = yield this.fetchAndPushState(
+ event.state.targetHref,
+ this.pageHref,
+ void 0,
+ void 0,
+ void 0,
+ false,
+ );
+ } catch (_) {}
+
+ doNavigate();
+ return true;
+ }
+
+ return false;
+ } else {
+ return false;
+ }
+ }),
+ 0,
+ );
+ });
+ }
+
+ monkeyPatchLocationReplace() {
+ window.location["hardReplace"] = window.location.replace;
+
+ const replace = /* @__PURE__ */ __name((url) => {
+ this.pageHref = window.location.href;
+ this.fetchAndPushState(url.toString(), this.pageHref)
+ .then((doNavigate) => doNavigate())
+ .catch(() => window.location["hardReplace"](url.toString()));
+ }, "replace");
+
+ try {
+ window.location.replace = replace;
+ Object.defineProperty(window.location, "replace", {
+ writable: true,
+ value: {
+ assign: replace,
+ },
+ });
+ } catch (_) {}
+ }
+
+ fetchAnchorHref(
+ anchorHref,
+ currentLocationHref,
+ method = "get",
+ body = void 0,
+ headers = void 0,
+ ) {
+ return __async(this, null, function* () {
+ const url =
+ method.toLowerCase() === "get" && body != null
+ ? `${anchorHref}?${body}`
+ : anchorHref;
+ const res = yield fetch(url, {
+ method,
+ body: method.toLowerCase() !== "get" ? body : void 0,
+ headers: __spreadProps(
+ __spreadValues(
+ __spreadValues({}, headers || {}),
+ anchorHref !== currentLocationHref
+ ? {
+ referer: currentLocationHref,
+ }
+ : {},
+ ),
+ {
+ accept: "text/html",
+ "accept-charset": "utf-8",
+ "x-requested-with": "XMLHttpRequest",
+ },
+ ),
+ });
+ return res;
+ });
+ }
+
+ fetchAndPushState(
+ targetHref,
+ refererHref,
+ method = "get",
+ body = void 0,
+ headers = void 0,
+ withAutoScroll = true,
+ ) {
+ return __async(this, null, function* () {
+ let targetHtml = null;
+
+ try {
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.LOADING, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ },
+ }),
+ );
+ let res = yield this.fetchAnchorHref(
+ targetHref,
+ refererHref,
+ method,
+ body,
+ headers,
+ );
+
+ if (res.status >= 301 && res.status <= 308) {
+ const locationHeaderHref = res.headers.get("location");
+
+ if (locationHeaderHref != null) {
+ targetHref = locationHeaderHref;
+ res = yield this.fetchAnchorHref(
+ targetHref,
+ refererHref,
+ method,
+ body,
+ headers,
+ );
+ }
+ } else {
+ targetHtml = yield res.text();
+ targetHref = res.url;
+ }
+
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.LOADED, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ html: targetHtml,
+ },
+ },
+ }),
+ );
+ } catch (err) {
+ const error = err;
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.LOAD_ERROR, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ error,
+ },
+ },
+ }),
+ );
+ }
+
+ if (targetHtml == null) {
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.LOAD_ERROR, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ error: new Error(
+ "Could not retrieve HTML to display, it was null.",
+ ),
+ },
+ },
+ }),
+ );
+ return () => void 0;
+ }
+
+ const targetDoc = this.domParser.parseFromString(targetHtml, "text/html");
+ const {
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ } = targetDoc;
+ const targetStyles = [];
+ targetHead.childNodes.forEach((node) => {
+ if (node.nodeType === 1 && node.nodeName.toLowerCase() === "style") {
+ targetStyles.push(node);
+ }
+ });
+ return () => {
+ var _a;
+
+ try {
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.NAVIGATING, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ },
+ }),
+ );
+ document.title = targetTitle;
+ document.body.innerHTML =
+ targetBody.innerHTML || document.body.innerHTML;
+
+ if (document.scrollingElement != null && withAutoScroll === true) {
+ document.scrollingElement.scrollTo({
+ behavior: "smooth",
+ top: 0,
+ });
+ }
+
+ if (
+ typeof window.history !== "undefined" &&
+ targetHref !==
+ ((_a = history.state) == null ? void 0 : _a.targetHref) &&
+ targetHref !== refererHref
+ ) {
+ const targetUrl = new URL(targetHref);
+ window.history.pushState(
+ {
+ targetHref,
+ },
+ "",
+ method.toLowerCase() === "get" && body != null
+ ? [
+ targetUrl.pathname,
+ targetUrl.search.trim() === ""
+ ? `?${body}`
+ : `${targetUrl.search}`,
+ ].join("")
+ : [targetUrl.pathname, targetUrl.search].join(""),
+ );
+ }
+
+ document.body.childNodes.forEach((childNode) => {
+ if (
+ childNode.nodeName.toLowerCase() === "script" &&
+ childNode.type === "module"
+ ) {
+ const islandsScriptTxt = childNode.textContent;
+
+ if (
+ islandsScriptTxt != null &&
+ islandsScriptTxt.includes("IslandsRuntime")
+ ) {
+ const nextScriptEl = document.createElement("script");
+ nextScriptEl.textContent = islandsScriptTxt;
+ nextScriptEl.type = "module";
+ childNode.remove();
+ document.body.appendChild(nextScriptEl);
+ }
+ }
+ });
+ this.pageHref = targetHref;
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.NAVIGATED, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ response: true,
+ },
+ }),
+ );
+ } catch (err) {
+ const error = err;
+ document.dispatchEvent(
+ new CustomEvent(InstantRouterEvents.NAVIGATION_ERROR, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ response: {
+ error,
+ },
+ },
+ }),
+ );
+ }
+ };
+ });
+ }
+};
+
+var InstantRouter = _InstantRouter;
+
+__name(InstantRouter, "InstantRouter");
+
+InstantRouter.defaultOpts = {
+ fetchAnchorsOn: "mousedown",
+}; // node_modules/@ethicdevs/fastify-stream-react-views/src/instant-router/index.ts
+
+// if (typeof window !== "undefined") {
+// window.InstantRouter = new InstantRouter({
+// fetchAnchorsOn: "mousedown"
+// });
+// window.InstantRouter.init();
+// }
+
+export { InstantRouter, InstantRouterEvents };
@@ -1,36 +1,42 @@
-/* InstantRouter */var __defProp = Object.defineProperty;
+/* InstantRouter */ var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
-var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
- enumerable: true,
- configurable: true,
- writable: true,
- value
-}) : obj[key] = value;
+var __defNormalProp = (obj, key, value) =>
+ key in obj
+ ? __defProp(obj, key, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value,
+ })
+ : (obj[key] = value);
var __spreadValues = (a, b) => {
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
- if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
- if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
- }
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
+ }
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
-var __name = (target, value) => __defProp(target, "name", {
- value,
- configurable: true
-});
+var __name = (target, value) =>
+ __defProp(target, "name", {
+ value,
+ configurable: true,
+ });
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
- var fulfilled = value => {
+ var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
@@ -38,7 +44,7 @@ var __async = (__this, __arguments, generator) => {
}
};
- var rejected = value => {
+ var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
@@ -46,28 +52,47 @@ var __async = (__this, __arguments, generator) => {
}
};
- var step = x => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
+ var step = (x) =>
+ x.done
+ ? resolve(x.value)
+ : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
}; // node_modules/@ethicdevs/react-monolith/dist/core/instant-router.js
-
var domParser = new DOMParser();
-function fetchAnchorHref(anchorHref, currentLocationHref, method = "get", body = void 0, headers = void 0) {
+function fetchAnchorHref(
+ anchorHref,
+ currentLocationHref,
+ method = "get",
+ body = void 0,
+ headers = void 0,
+) {
return __async(this, null, function* () {
- const url = method.toLowerCase() === "get" && body != null ? `${anchorHref}?${body}` : anchorHref;
+ const url =
+ method.toLowerCase() === "get" && body != null
+ ? `${anchorHref}?${body}`
+ : anchorHref;
const res = yield fetch(url, {
method,
body: method.toLowerCase() !== "get" ? body : void 0,
- headers: __spreadProps(__spreadValues(__spreadValues({}, headers || {}), anchorHref !== currentLocationHref ? {
- referer: currentLocationHref
- } : {}), {
- accept: "text/html",
- "accept-charset": "utf-8",
- "x-requested-with": "XMLHttpRequest"
- })
+ headers: __spreadProps(
+ __spreadValues(
+ __spreadValues({}, headers || {}),
+ anchorHref !== currentLocationHref
+ ? {
+ referer: currentLocationHref,
+ }
+ : {},
+ ),
+ {
+ accept: "text/html",
+ "accept-charset": "utf-8",
+ "x-requested-with": "XMLHttpRequest",
+ },
+ ),
});
return res;
});
@@ -75,83 +100,112 @@ function fetchAnchorHref(anchorHref, currentLocationHref, method = "get", body =
__name(fetchAnchorHref, "fetchAnchorHref");
-function fetchAndPushState(targetHref, refererHref, method = "get", body = void 0, headers = void 0, withAutoScroll = true) {
+function fetchAndPushState(
+ targetHref,
+ refererHref,
+ method = "get",
+ body = void 0,
+ headers = void 0,
+ withAutoScroll = true,
+) {
return __async(this, null, function* () {
let targetHtml = null;
try {
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.LOADING, {
- detail: {
- request: {
- method,
- url: targetHref,
- body,
- headers,
- referer: refererHref
- }
- }
- }));
- let res = yield fetchAnchorHref(targetHref, refererHref, method, body, headers);
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.LOADING, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ },
+ }),
+ );
+ let res = yield fetchAnchorHref(
+ targetHref,
+ refererHref,
+ method,
+ body,
+ headers,
+ );
if (res.status >= 301 && res.status <= 308) {
const locationHeaderHref = res.headers.get("location");
if (locationHeaderHref != null) {
targetHref = locationHeaderHref;
- res = yield fetchAnchorHref(targetHref, refererHref, method, body, headers);
+ res = yield fetchAnchorHref(
+ targetHref,
+ refererHref,
+ method,
+ body,
+ headers,
+ );
}
} else {
targetHtml = yield res.text();
targetHref = res.url;
}
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.LOADED, {
- detail: {
- request: {
- method,
- url: targetHref,
- body,
- headers,
- referer: refererHref
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.LOADED, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ html: targetHtml,
+ },
},
- response: {
- html: targetHtml
- }
- }
- }));
+ }),
+ );
} catch (err) {
const error = err;
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.LOAD_ERROR, {
- detail: {
- request: {
- method,
- url: targetHref,
- body,
- headers,
- referer: refererHref
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.LOAD_ERROR, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ error,
+ },
},
- response: {
- error
- }
- }
- }));
+ }),
+ );
}
if (targetHtml == null) {
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.LOAD_ERROR, {
- detail: {
- request: {
- method,
- url: targetHref,
- body,
- headers,
- referer: refererHref
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.LOAD_ERROR, {
+ detail: {
+ request: {
+ method,
+ url: targetHref,
+ body,
+ headers,
+ referer: refererHref,
+ },
+ response: {
+ error: new Error(
+ "Could not retrieve HTML to display, it was null.",
+ ),
+ },
},
- response: {
- error: new Error("Could not retrieve HTML to display, it was null.")
- }
- }
- }));
+ }),
+ );
return () => void 0;
}
@@ -159,10 +213,10 @@ function fetchAndPushState(targetHref, refererHref, method = "get", body = void
const {
body: targetBody,
head: targetHead,
- title: targetTitle
+ title: targetTitle,
} = targetDoc;
const targetStyles = [];
- targetHead.childNodes.forEach(node => {
+ targetHead.childNodes.forEach((node) => {
if (node.nodeType === 1 && node.nodeName.toLowerCase() === "style") {
targetStyles.push(node);
}
@@ -171,62 +225,82 @@ function fetchAndPushState(targetHref, refererHref, method = "get", body = void
var _a;
try {
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.NAVIGATING, {
- detail: {
- request: {
- url: targetHref,
- referer: refererHref,
- body: targetBody,
- head: targetHead,
- title: targetTitle
- }
- }
- }));
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.NAVIGATING, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ },
+ }),
+ );
document.title = targetTitle;
- document.body.innerHTML = targetBody.innerHTML || document.body.innerHTML;
+ document.body.innerHTML =
+ targetBody.innerHTML || document.body.innerHTML;
if (document.scrollingElement != null && withAutoScroll === true) {
document.scrollingElement.scrollTo({
behavior: "smooth",
- top: 0
+ top: 0,
});
}
- if (typeof window.history !== "undefined" && targetHref !== ((_a = history.state) === null || _a === void 0 ? void 0 : _a.targetHref) && targetHref !== refererHref) {
+ if (
+ typeof window.history !== "undefined" &&
+ targetHref !==
+ ((_a = history.state) === null || _a === void 0
+ ? void 0
+ : _a.targetHref) &&
+ targetHref !== refererHref
+ ) {
const targetUrl = new URL(targetHref);
- window.history.pushState({
- targetHref
- }, "", method.toLowerCase() === "get" && body != null ? [targetUrl.pathname, body].join("?") : targetUrl.pathname);
+ window.history.pushState(
+ {
+ targetHref,
+ },
+ "",
+ method.toLowerCase() === "get" && body != null
+ ? [targetUrl.pathname, body].join("?")
+ : targetUrl.pathname,
+ );
}
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.NAVIGATED, {
- detail: {
- request: {
- url: targetHref,
- referer: refererHref,
- body: targetBody,
- head: targetHead,
- title: targetTitle
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.NAVIGATED, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ response: true,
},
- response: true
- }
- }));
+ }),
+ );
} catch (err) {
const error = err;
- document.dispatchEvent(new CustomEvent(ClientSideRouterEvents.NAVIGATION_ERROR, {
- detail: {
- request: {
- url: targetHref,
- referer: refererHref,
- body: targetBody,
- head: targetHead,
- title: targetTitle
+ document.dispatchEvent(
+ new CustomEvent(ClientSideRouterEvents.NAVIGATION_ERROR, {
+ detail: {
+ request: {
+ url: targetHref,
+ referer: refererHref,
+ body: targetBody,
+ head: targetHead,
+ title: targetTitle,
+ },
+ response: {
+ error,
+ },
},
- response: {
- error
- }
- }
- }));
+ }),
+ );
}
};
});
@@ -235,167 +309,224 @@ function fetchAndPushState(targetHref, refererHref, method = "get", body = void
__name(fetchAndPushState, "fetchAndPushState");
function clientSideRouter() {
- return __async(this, arguments, function* (opts = {
- fetchAnchorsOn: "mousedown"
- }) {
- const pageHref = window.location.href;
-
- function onClientSideRouterMouseDown(ev) {
- return __async(this, null, function* () {
- const targetEl = ev.target;
+ return __async(
+ this,
+ arguments,
+ function* (
+ opts = {
+ fetchAnchorsOn: "mousedown",
+ },
+ ) {
+ const pageHref = window.location.href;
+
+ function onClientSideRouterMouseDown(ev) {
+ return __async(this, null, function* () {
+ const targetEl = ev.target;
+
+ if (
+ ev == null ||
+ ev.button !== 0 ||
+ targetEl == null ||
+ targetEl.tagName.toLowerCase() !== "a" ||
+ "href" in targetEl === false ||
+ targetEl.href == null ||
+ targetEl.href.trim() === ""
+ ) {
+ return false;
+ }
- if (ev == null || ev.button !== 0 || targetEl == null || targetEl.tagName.toLowerCase() !== "a" || "href" in targetEl === false || targetEl.href == null || targetEl.href.trim() === "") {
- return false;
- }
+ const targetDataset = targetEl.dataset;
+ const baseUrl = new URL(document.baseURI);
+ const targetUrl = new URL(targetEl.href, document.baseURI);
+ const isExternalUrl = baseUrl.origin !== targetUrl.origin;
- const targetDataset = targetEl.dataset;
- const baseUrl = new URL(document.baseURI);
- const targetUrl = new URL(targetEl.href, document.baseURI);
- const isExternalUrl = baseUrl.origin !== targetUrl.origin;
+ if (isExternalUrl || targetDataset["externalLink"] === "true") {
+ return false;
+ }
- if (isExternalUrl || targetDataset["externalLink"] === "true") {
- return false;
- }
+ const targetHash = targetUrl.hash;
+ const isHashChange = !!(
+ targetHash != null &&
+ targetHash.trim() !== "" &&
+ targetHash.startsWith("#")
+ );
- const targetHash = targetUrl.hash;
- const isHashChange = !!(targetHash != null && targetHash.trim() !== "" && targetHash.startsWith("#"));
+ if (isHashChange) {
+ const hashEl = document.querySelector(targetHash);
- if (isHashChange) {
- const hashEl = document.querySelector(targetHash);
+ if (hashEl != null) {
+ ev.preventDefault();
- if (hashEl != null) {
- ev.preventDefault();
+ if (targetDataset["smoothScroll"] !== "disabled") {
+ hashEl.scrollIntoView({
+ behavior: "smooth",
+ });
+ }
- if (targetDataset["smoothScroll"] !== "disabled") {
- hashEl.scrollIntoView({
- behavior: "smooth"
- });
+ window.location.hash = targetHash;
+ return true;
}
- window.location.hash = targetHash;
- return true;
+ return false;
}
- return false;
- }
-
- let doNavigate = null;
- let pollWaitFetchDoneIntervalId = null;
+ let doNavigate = null;
+ let pollWaitFetchDoneIntervalId = null;
- const navigateOrWait = /* @__PURE__ */__name(() => {
- if (doNavigate != null) {
- doNavigate();
+ const navigateOrWait = /* @__PURE__ */ __name(() => {
+ if (doNavigate != null) {
+ doNavigate();
- if (pollWaitFetchDoneIntervalId != null) {
- clearTimeout(pollWaitFetchDoneIntervalId);
- pollWaitFetchDoneIntervalId = null;
- }
-
- if (targetEl != null && onClickHandler != null) {
- targetEl.removeEventListener("click", onClickHandler);
- onClickHandler = null;
- }
- } else {
- pollWaitFetchDoneIntervalId = setTimeout(() => {
if (pollWaitFetchDoneIntervalId != null) {
clearTimeout(pollWaitFetchDoneIntervalId);
pollWaitFetchDoneIntervalId = null;
}
- navigateOrWait();
- }, 10);
+ if (targetEl != null && onClickHandler != null) {
+ targetEl.removeEventListener("click", onClickHandler);
+ onClickHandler = null;
+ }
+ } else {
+ pollWaitFetchDoneIntervalId = setTimeout(() => {
+ if (pollWaitFetchDoneIntervalId != null) {
+ clearTimeout(pollWaitFetchDoneIntervalId);
+ pollWaitFetchDoneIntervalId = null;
+ }
+
+ navigateOrWait();
+ }, 10);
+ }
+ }, "navigateOrWait");
+
+ let onClickHandler = /* @__PURE__ */ __name((subEv) => {
+ subEv.preventDefault();
+ navigateOrWait();
+ return true;
+ }, "onClickHandler");
+
+ try {
+ targetEl.addEventListener("click", onClickHandler);
+ doNavigate = yield fetchAndPushState(
+ targetEl.href,
+ pageHref,
+ void 0,
+ void 0,
+ void 0,
+ targetDataset["smoothScroll"] !== "disabled",
+ );
+ } catch (_) {
+ targetEl.removeEventListener("click", onClickHandler);
+ onClickHandler = null;
+ doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = targetEl.href;
+ }, "doNavigate");
}
- }, "navigateOrWait");
- let onClickHandler = /* @__PURE__ */__name(subEv => {
- subEv.preventDefault();
- navigateOrWait();
return true;
- }, "onClickHandler");
-
- try {
- targetEl.addEventListener("click", onClickHandler);
- doNavigate = yield fetchAndPushState(targetEl.href, pageHref, void 0, void 0, void 0, targetDataset["smoothScroll"] !== "disabled");
- } catch (_) {
- targetEl.removeEventListener("click", onClickHandler);
- onClickHandler = null;
- doNavigate = /* @__PURE__ */__name(() => {
- window.location.href = targetEl.href;
- }, "doNavigate");
- }
-
- return true;
- });
- }
+ });
+ }
- __name(onClientSideRouterMouseDown, "onClientSideRouterMouseDown");
+ __name(onClientSideRouterMouseDown, "onClientSideRouterMouseDown");
- function onClientSideRouterSubmit(ev) {
- return __async(this, null, function* () {
- const targetEl = ev.target;
+ function onClientSideRouterSubmit(ev) {
+ return __async(this, null, function* () {
+ const targetEl = ev.target;
- if (targetEl == null || targetEl.tagName.toLowerCase() !== "form") {
- return false;
- }
+ if (targetEl == null || targetEl.tagName.toLowerCase() !== "form") {
+ return false;
+ }
- const targetAction = targetEl.action;
- const targetMethod = targetEl.method;
+ const targetAction = targetEl.action;
+ const targetMethod = targetEl.method;
- if (targetAction == null || targetAction.trim() === "" || targetMethod == null || ["get", "post"].includes(targetMethod.toLowerCase()) === false) {
- return false;
- }
+ if (
+ targetAction == null ||
+ targetAction.trim() === "" ||
+ targetMethod == null ||
+ ["get", "post"].includes(targetMethod.toLowerCase()) === false
+ ) {
+ return false;
+ }
- ev.preventDefault();
- const headers = {
- "content-type": "application/x-www-form-urlencoded"
- };
- const targetFormData = new FormData(targetEl);
- let targetFormDataEntries = {};
- targetFormData.forEach((v, k) => {
- targetFormDataEntries = __spreadProps(__spreadValues({}, targetFormDataEntries), {
- [k]: v
+ ev.preventDefault();
+ const headers = {
+ "content-type": "application/x-www-form-urlencoded",
+ };
+ const targetFormData = new FormData(targetEl);
+ let targetFormDataEntries = {};
+ targetFormData.forEach((v, k) => {
+ targetFormDataEntries = __spreadProps(
+ __spreadValues({}, targetFormDataEntries),
+ {
+ [k]: v,
+ },
+ );
});
- });
- const bodyFormEncoded = Object.entries(targetFormDataEntries).map(([k, v]) => `${k}=${v}`).join("&");
-
- let doNavigate = /* @__PURE__ */__name(() => {
- window.location.href = targetAction;
- }, "doNavigate");
+ const bodyFormEncoded = Object.entries(targetFormDataEntries)
+ .map(([k, v]) => `${k}=${v}`)
+ .join("&");
- try {
- doNavigate = yield fetchAndPushState(targetAction, pageHref, targetMethod, bodyFormEncoded, headers);
- } catch (_) {}
-
- doNavigate();
- return true;
- });
- }
-
- __name(onClientSideRouterSubmit, "onClientSideRouterSubmit");
-
- document.addEventListener(opts.fetchAnchorsOn, onClientSideRouterMouseDown);
- document.addEventListener("submit", onClientSideRouterSubmit);
- window.addEventListener("popstate", event => setTimeout(() => __async(this, null, function* () {
- if (event.state) {
- if (event.state.targetHref != null) {
- let doNavigate = /* @__PURE__ */__name(() => {
- window.location.href = event.state.targetHref;
+ let doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = targetAction;
}, "doNavigate");
try {
- doNavigate = yield fetchAndPushState(event.state.targetHref, pageHref, void 0, void 0, void 0, false);
+ doNavigate = yield fetchAndPushState(
+ targetAction,
+ pageHref,
+ targetMethod,
+ bodyFormEncoded,
+ headers,
+ );
} catch (_) {}
doNavigate();
return true;
- }
-
- return false;
- } else {
- return false;
+ });
}
- }), 0));
- });
+
+ __name(onClientSideRouterSubmit, "onClientSideRouterSubmit");
+
+ document.addEventListener(
+ opts.fetchAnchorsOn,
+ onClientSideRouterMouseDown,
+ );
+ document.addEventListener("submit", onClientSideRouterSubmit);
+ window.addEventListener("popstate", (event) =>
+ setTimeout(
+ () =>
+ __async(this, null, function* () {
+ if (event.state) {
+ if (event.state.targetHref != null) {
+ let doNavigate = /* @__PURE__ */ __name(() => {
+ window.location.href = event.state.targetHref;
+ }, "doNavigate");
+
+ try {
+ doNavigate = yield fetchAndPushState(
+ event.state.targetHref,
+ pageHref,
+ void 0,
+ void 0,
+ void 0,
+ false,
+ );
+ } catch (_) {}
+
+ doNavigate();
+ return true;
+ }
+
+ return false;
+ } else {
+ return false;
+ }
+ }),
+ 0,
+ ),
+ );
+ },
+ );
}
__name(clientSideRouter, "clientSideRouter");
@@ -407,15 +538,15 @@ var ClientSideRouterEvents = {
LOAD_ERROR: `${ClientSideRouterEventPrefix}load_error`,
NAVIGATING: `${ClientSideRouterEventPrefix}navigating`,
NAVIGATED: `${ClientSideRouterEventPrefix}navigated`,
- NAVIGATION_ERROR: `${ClientSideRouterEventPrefix}navigation_error`
+ NAVIGATION_ERROR: `${ClientSideRouterEventPrefix}navigation_error`,
};
window.location["hardReplace"] = window.location.replace;
-window.location.replace = /* @__PURE__ */__name(function replace(url) {
- const pageHref = window.location.href;
- fetchAndPushState(url.toString(), pageHref).then(doNavigate => doNavigate()).catch(() => {
- window.location["hardReplace"](url.toString());
- });
-}, "replace");
+// window.location.replace = /* @__PURE__ */__name(function replace(url) {
+// const pageHref = window.location.href;
+// fetchAndPushState(url.toString(), pageHref).then(doNavigate => doNavigate()).catch(() => {
+// window.location["hardReplace"](url.toString());
+// });
+// }, "replace");
clientSideRouter({
- fetchAnchorsOn: "mousedown"
+ fetchAnchorsOn: "mousedown",
});
@@ -0,0 +1,14 @@
+todo:
+
+- [ ] make ssh server work every times
+- [x] make the islands runtime load dependencies properly
+- [ ] finish merge pull request feature
+- [x] add ssh key feature
+- [ ] add update/delete ssh key feature
+- [ ] add a function to change default branch -> update repo/HEAD ref, update config->init.defaultBranch
+- [ ] add a function to enable/disable fast forward push
+- [ ] (?) allow to write comments on a PR
+- [ ] update repo/description file when repo name or description is set (create, update)
+- [ ] add a select button to change branch/tag (repository browser)
+- [ ] make it possible to edit user profile (avatar, display name, email, password, etc)
+- [ ] make it possible to change app theme (colors) via config file