@chaaskit/server 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/api/admin.js +211 -0
- package/dist/api/admin.js.map +1 -1
- package/dist/api/auth.js +91 -6
- package/dist/api/auth.js.map +1 -1
- package/dist/api/chat.js +51 -3
- package/dist/api/chat.js.map +1 -1
- package/dist/api/config.js +25 -14
- package/dist/api/config.js.map +1 -1
- package/dist/api/credits.js +122 -0
- package/dist/api/credits.js.map +1 -0
- package/dist/api/payments.js +94 -11
- package/dist/api/payments.js.map +1 -1
- package/dist/api/user.js +3 -4
- package/dist/api/user.js.map +1 -1
- package/dist/app.js +15 -6
- package/dist/app.js.map +1 -1
- package/dist/config/loader.js +62 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/extensions/loader.js +1 -0
- package/dist/extensions/loader.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/middleware/apiKeyAuth.js +2 -1
- package/dist/middleware/apiKeyAuth.js.map +1 -1
- package/dist/middleware/auth.js +29 -5
- package/dist/middleware/auth.js.map +1 -1
- package/dist/queue/cli.js +0 -0
- package/dist/secrets/index.js +147 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/services/credits.js +206 -0
- package/dist/services/credits.js.map +1 -0
- package/dist/services/email/templates.js +116 -0
- package/dist/services/email/templates.js.map +1 -1
- package/dist/services/metering.js +24 -0
- package/dist/services/metering.js.map +1 -0
- package/dist/services/referrals.js +133 -0
- package/dist/services/referrals.js.map +1 -0
- package/dist/services/usage.js +42 -29
- package/dist/services/usage.js.map +1 -1
- package/dist/services/waitlist.js +142 -0
- package/dist/services/waitlist.js.map +1 -0
- package/package.json +26 -12
- package/dist/api/upload.js +0 -57
- package/dist/api/upload.js.map +0 -1
- package/dist/ssr/build.js +0 -90
- package/dist/ssr/build.js.map +0 -1
- package/dist/ssr/components/SSRMessageList.js +0 -120
- package/dist/ssr/components/SSRMessageList.js.map +0 -1
- package/dist/ssr/entry.client.js +0 -8
- package/dist/ssr/entry.client.js.map +0 -1
- package/dist/ssr/entry.server.js +0 -71
- package/dist/ssr/entry.server.js.map +0 -1
- package/dist/ssr/handler.js +0 -51
- package/dist/ssr/handler.js.map +0 -1
- package/dist/ssr/root.js +0 -184
- package/dist/ssr/root.js.map +0 -1
- package/dist/ssr/routes/login.js +0 -140
- package/dist/ssr/routes/login.js.map +0 -1
- package/dist/ssr/routes/pricing.js +0 -195
- package/dist/ssr/routes/pricing.js.map +0 -1
- package/dist/ssr/routes/privacy.js +0 -39
- package/dist/ssr/routes/privacy.js.map +0 -1
- package/dist/ssr/routes/register.js +0 -148
- package/dist/ssr/routes/register.js.map +0 -1
- package/dist/ssr/routes/shared.$shareId.js +0 -153
- package/dist/ssr/routes/shared.$shareId.js.map +0 -1
- package/dist/ssr/routes/terms.js +0 -39
- package/dist/ssr/routes/terms.js.map +0 -1
package/dist/ssr/build.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remix Build Configuration
|
|
3
|
-
*
|
|
4
|
-
* This module exports the server build for Remix.
|
|
5
|
-
* Routes are statically defined here for the Express integration.
|
|
6
|
-
*/
|
|
7
|
-
// Import entry point
|
|
8
|
-
import * as serverEntry from './entry.server.js';
|
|
9
|
-
// Import root
|
|
10
|
-
import * as root from './root.js';
|
|
11
|
-
// Import routes
|
|
12
|
-
import * as sharedRoute from './routes/shared.$shareId.js';
|
|
13
|
-
import * as pricingRoute from './routes/pricing.js';
|
|
14
|
-
import * as loginRoute from './routes/login.js';
|
|
15
|
-
import * as registerRoute from './routes/register.js';
|
|
16
|
-
import * as privacyRoute from './routes/privacy.js';
|
|
17
|
-
import * as termsRoute from './routes/terms.js';
|
|
18
|
-
// Build the routes object - use type assertion to avoid strict type checking
|
|
19
|
-
// The Remix runtime will validate modules at runtime
|
|
20
|
-
const routes = {
|
|
21
|
-
root: {
|
|
22
|
-
id: 'root',
|
|
23
|
-
path: '',
|
|
24
|
-
module: root,
|
|
25
|
-
},
|
|
26
|
-
'routes/shared.$shareId': {
|
|
27
|
-
id: 'routes/shared.$shareId',
|
|
28
|
-
parentId: 'root',
|
|
29
|
-
path: 'shared/:shareId',
|
|
30
|
-
module: sharedRoute,
|
|
31
|
-
},
|
|
32
|
-
'routes/pricing': {
|
|
33
|
-
id: 'routes/pricing',
|
|
34
|
-
parentId: 'root',
|
|
35
|
-
path: 'pricing',
|
|
36
|
-
module: pricingRoute,
|
|
37
|
-
},
|
|
38
|
-
'routes/login': {
|
|
39
|
-
id: 'routes/login',
|
|
40
|
-
parentId: 'root',
|
|
41
|
-
path: 'login',
|
|
42
|
-
module: loginRoute,
|
|
43
|
-
},
|
|
44
|
-
'routes/register': {
|
|
45
|
-
id: 'routes/register',
|
|
46
|
-
parentId: 'root',
|
|
47
|
-
path: 'register',
|
|
48
|
-
module: registerRoute,
|
|
49
|
-
},
|
|
50
|
-
'routes/privacy': {
|
|
51
|
-
id: 'routes/privacy',
|
|
52
|
-
parentId: 'root',
|
|
53
|
-
path: 'privacy',
|
|
54
|
-
module: privacyRoute,
|
|
55
|
-
},
|
|
56
|
-
'routes/terms': {
|
|
57
|
-
id: 'routes/terms',
|
|
58
|
-
parentId: 'root',
|
|
59
|
-
path: 'terms',
|
|
60
|
-
module: termsRoute,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
// Construct the server build using type assertion
|
|
64
|
-
export const build = {
|
|
65
|
-
entry: {
|
|
66
|
-
module: serverEntry,
|
|
67
|
-
},
|
|
68
|
-
routes,
|
|
69
|
-
assets: {
|
|
70
|
-
entry: {
|
|
71
|
-
module: '/build/entry.client.js',
|
|
72
|
-
imports: [],
|
|
73
|
-
},
|
|
74
|
-
routes: {},
|
|
75
|
-
url: '/build/manifest.json',
|
|
76
|
-
version: '1',
|
|
77
|
-
},
|
|
78
|
-
publicPath: '/build/',
|
|
79
|
-
assetsBuildDirectory: 'public/build',
|
|
80
|
-
future: {
|
|
81
|
-
v3_fetcherPersist: false,
|
|
82
|
-
v3_relativeSplatPath: false,
|
|
83
|
-
v3_throwAbortReason: false,
|
|
84
|
-
v3_lazyRouteDiscovery: false,
|
|
85
|
-
v3_singleFetch: false,
|
|
86
|
-
},
|
|
87
|
-
isSpaMode: false,
|
|
88
|
-
mode: process.env.NODE_ENV || 'development',
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=build.js.map
|
package/dist/ssr/build.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/ssr/build.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,qBAAqB;AACrB,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEjD,cAAc;AACd,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,gBAAgB;AAChB,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,6EAA6E;AAC7E,qDAAqD;AACrD,MAAM,MAAM,GAAG;IACb,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,IAAI;KACb;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,wBAAwB;QAC5B,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,WAAW;KACpB;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,YAAY;KACrB;IACD,cAAc,EAAE;QACd,EAAE,EAAE,cAAc;QAClB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;KACnB;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iBAAiB;QACrB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,aAAa;KACtB;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,YAAY;KACrB;IACD,cAAc,EAAE;QACd,EAAE,EAAE,cAAc;QAClB,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,UAAU;KACnB;CACuB,CAAC;AAE3B,kDAAkD;AAClD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE;QACL,MAAM,EAAE,WAOP;KACF;IACD,MAAM;IACN,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,wBAAwB;YAChC,OAAO,EAAE,EAAE;SACZ;QACD,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EAAE,GAAG;KACb;IACD,UAAU,EAAE,SAAS;IACrB,oBAAoB,EAAE,cAAc;IACpC,MAAM,EAAE;QACN,iBAAiB,EAAE,KAAK;QACxB,oBAAoB,EAAE,KAAK;QAC3B,mBAAmB,EAAE,KAAK;QAC1B,qBAAqB,EAAE,KAAK;QAC5B,cAAc,EAAE,KAAK;KACtB;IACD,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa;CAC7B,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
function UserIcon() {
|
|
3
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }), _jsx("circle", { cx: "12", cy: "7", r: "4" })] }));
|
|
4
|
-
}
|
|
5
|
-
function BotIcon() {
|
|
6
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M12 8V4H8" }), _jsx("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }), _jsx("path", { d: "M2 14h2" }), _jsx("path", { d: "M20 14h2" }), _jsx("path", { d: "M15 13v2" }), _jsx("path", { d: "M9 13v2" })] }));
|
|
7
|
-
}
|
|
8
|
-
// Simple markdown-like rendering for SSR
|
|
9
|
-
function SimpleMarkdown({ content }) {
|
|
10
|
-
// Split into paragraphs and render
|
|
11
|
-
const paragraphs = content.split('\n\n');
|
|
12
|
-
return (_jsx(_Fragment, { children: paragraphs.map((para, i) => {
|
|
13
|
-
// Check for code blocks
|
|
14
|
-
if (para.startsWith('```')) {
|
|
15
|
-
const lines = para.split('\n');
|
|
16
|
-
const lang = lines[0]?.slice(3) || 'text';
|
|
17
|
-
const code = lines.slice(1, -1).join('\n');
|
|
18
|
-
return (_jsxs("div", { style: {
|
|
19
|
-
margin: '1rem 0',
|
|
20
|
-
borderRadius: '0.5rem',
|
|
21
|
-
border: '1px solid rgb(var(--color-border))',
|
|
22
|
-
overflow: 'hidden',
|
|
23
|
-
}, children: [_jsx("div", { style: {
|
|
24
|
-
backgroundColor: 'rgb(var(--color-background-secondary))',
|
|
25
|
-
padding: '0.5rem 1rem',
|
|
26
|
-
fontSize: '0.75rem',
|
|
27
|
-
fontWeight: 500,
|
|
28
|
-
color: 'rgb(var(--color-text-muted))',
|
|
29
|
-
textTransform: 'uppercase',
|
|
30
|
-
}, children: lang }), _jsx("pre", { style: {
|
|
31
|
-
margin: 0,
|
|
32
|
-
padding: '1rem',
|
|
33
|
-
overflow: 'auto',
|
|
34
|
-
backgroundColor: 'rgb(var(--color-background-secondary))',
|
|
35
|
-
}, children: _jsx("code", { style: {
|
|
36
|
-
fontFamily: 'var(--font-mono)',
|
|
37
|
-
fontSize: '0.875rem',
|
|
38
|
-
whiteSpace: 'pre',
|
|
39
|
-
}, children: code }) })] }, i));
|
|
40
|
-
}
|
|
41
|
-
// Regular paragraph with inline formatting
|
|
42
|
-
return (_jsx("p", { style: { marginBottom: i < paragraphs.length - 1 ? '1rem' : 0 }, children: para.split('\n').map((line, j) => (_jsxs("span", { children: [j > 0 && _jsx("br", {}), line] }, j))) }, i));
|
|
43
|
-
}) }));
|
|
44
|
-
}
|
|
45
|
-
function SSRMessageItem({ message }) {
|
|
46
|
-
const isUser = message.role === 'user';
|
|
47
|
-
if (isUser) {
|
|
48
|
-
return (_jsxs("div", { style: {
|
|
49
|
-
display: 'flex',
|
|
50
|
-
gap: '0.75rem',
|
|
51
|
-
flexDirection: 'row-reverse',
|
|
52
|
-
}, children: [_jsx("div", { style: {
|
|
53
|
-
display: 'flex',
|
|
54
|
-
height: '1.5rem',
|
|
55
|
-
width: '1.5rem',
|
|
56
|
-
flexShrink: 0,
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
borderRadius: '9999px',
|
|
60
|
-
backgroundColor: 'rgb(var(--color-primary))',
|
|
61
|
-
color: 'white',
|
|
62
|
-
}, children: _jsx(UserIcon, {}) }), _jsx("div", { style: {
|
|
63
|
-
display: 'flex',
|
|
64
|
-
maxWidth: '85%',
|
|
65
|
-
flexDirection: 'column',
|
|
66
|
-
alignItems: 'flex-end',
|
|
67
|
-
}, children: _jsx("div", { style: {
|
|
68
|
-
backgroundColor: 'rgb(var(--color-user-message-bg))',
|
|
69
|
-
color: 'rgb(var(--color-user-message-text))',
|
|
70
|
-
borderRadius: '0.5rem',
|
|
71
|
-
padding: '0.5rem 0.75rem',
|
|
72
|
-
}, children: _jsx("p", { style: {
|
|
73
|
-
whiteSpace: 'pre-wrap',
|
|
74
|
-
fontSize: '0.875rem',
|
|
75
|
-
margin: 0,
|
|
76
|
-
}, children: message.content }) }) })] }));
|
|
77
|
-
}
|
|
78
|
-
// Assistant message
|
|
79
|
-
return (_jsxs("div", { style: {
|
|
80
|
-
display: 'flex',
|
|
81
|
-
gap: '0.75rem',
|
|
82
|
-
}, children: [_jsx("div", { style: {
|
|
83
|
-
display: 'flex',
|
|
84
|
-
height: '1.5rem',
|
|
85
|
-
width: '1.5rem',
|
|
86
|
-
flexShrink: 0,
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
justifyContent: 'center',
|
|
89
|
-
borderRadius: '9999px',
|
|
90
|
-
backgroundColor: 'rgb(var(--color-secondary))',
|
|
91
|
-
color: 'white',
|
|
92
|
-
}, children: _jsx(BotIcon, {}) }), _jsx("div", { style: {
|
|
93
|
-
display: 'flex',
|
|
94
|
-
maxWidth: '85%',
|
|
95
|
-
flexDirection: 'column',
|
|
96
|
-
alignItems: 'flex-start',
|
|
97
|
-
}, children: _jsx("div", { style: {
|
|
98
|
-
backgroundColor: 'rgb(var(--color-assistant-message-bg))',
|
|
99
|
-
color: 'rgb(var(--color-assistant-message-text))',
|
|
100
|
-
borderRadius: '0.5rem',
|
|
101
|
-
padding: '0.5rem 0.75rem',
|
|
102
|
-
}, children: _jsx("div", { style: {
|
|
103
|
-
fontSize: '0.875rem',
|
|
104
|
-
lineHeight: 1.625,
|
|
105
|
-
}, children: _jsx(SimpleMarkdown, { content: message.content }) }) }) })] }));
|
|
106
|
-
}
|
|
107
|
-
export function SSRMessageList({ messages }) {
|
|
108
|
-
return (_jsx("div", { style: {
|
|
109
|
-
maxWidth: '48rem',
|
|
110
|
-
marginLeft: 'auto',
|
|
111
|
-
marginRight: 'auto',
|
|
112
|
-
padding: '1.5rem 1rem',
|
|
113
|
-
}, children: _jsx("div", { style: {
|
|
114
|
-
display: 'flex',
|
|
115
|
-
flexDirection: 'column',
|
|
116
|
-
gap: '1rem',
|
|
117
|
-
}, children: messages.map((message) => (_jsx(SSRMessageItem, { message: message }, message.id))) }) }));
|
|
118
|
-
}
|
|
119
|
-
export default SSRMessageList;
|
|
120
|
-
//# sourceMappingURL=SSRMessageList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SSRMessageList.js","sourceRoot":"","sources":["../../../src/ssr/components/SSRMessageList.tsx"],"names":[],"mappings":";AAoBA,SAAS,QAAQ;IACf,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,aAEtB,eAAM,CAAC,EAAC,2CAA2C,GAAG,EACtD,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,IAC3B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,OAAO;IACd,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,aAEtB,eAAM,CAAC,EAAC,WAAW,GAAG,EACtB,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,GAAG,EAClD,eAAM,CAAC,EAAC,SAA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EAAE;YACL,QAAQ,EAAE,OAAO;YACjB,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE,MAAM;YACnB,OAAO,EAAE,aAAa;SACvB,YAED,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;gBACvB,GAAG,EAAE,MAAM;aACZ,YAEA,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACzB,KAAC,cAAc,IAAkB,OAAO,EAAE,OAAO,IAA5B,OAAO,CAAC,EAAE,CAAsB,CACtD,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
package/dist/ssr/entry.client.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { RemixBrowser } from '@remix-run/react';
|
|
3
|
-
import { startTransition, StrictMode } from 'react';
|
|
4
|
-
import { hydrateRoot } from 'react-dom/client';
|
|
5
|
-
startTransition(() => {
|
|
6
|
-
hydrateRoot(document, _jsx(StrictMode, { children: _jsx(RemixBrowser, {}) }));
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=entry.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry.client.js","sourceRoot":"","sources":["../../src/ssr/entry.client.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAe,CAAC,GAAG,EAAE;IACnB,WAAW,CACT,QAAQ,EACR,KAAC,UAAU,cACT,KAAC,YAAY,KAAG,GACL,CACd,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/dist/ssr/entry.server.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PassThrough } from 'node:stream';
|
|
3
|
-
import { createReadableStreamFromReadable } from '@remix-run/node';
|
|
4
|
-
import { RemixServer } from '@remix-run/react';
|
|
5
|
-
import { isbot } from 'isbot';
|
|
6
|
-
import { renderToPipeableStream } from 'react-dom/server';
|
|
7
|
-
const ABORT_DELAY = 5_000;
|
|
8
|
-
export default function handleRequest(request, responseStatusCode, responseHeaders, remixContext) {
|
|
9
|
-
const userAgent = request.headers.get('user-agent');
|
|
10
|
-
const isBotRequest = userAgent ? isbot(userAgent) : false;
|
|
11
|
-
return isBotRequest
|
|
12
|
-
? handleBotRequest(request, responseStatusCode, responseHeaders, remixContext)
|
|
13
|
-
: handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext);
|
|
14
|
-
}
|
|
15
|
-
function handleBotRequest(request, responseStatusCode, responseHeaders, remixContext) {
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
let shellRendered = false;
|
|
18
|
-
const { pipe, abort } = renderToPipeableStream(_jsx(RemixServer, { context: remixContext, url: request.url, abortDelay: ABORT_DELAY }), {
|
|
19
|
-
onAllReady() {
|
|
20
|
-
shellRendered = true;
|
|
21
|
-
const body = new PassThrough();
|
|
22
|
-
const stream = createReadableStreamFromReadable(body);
|
|
23
|
-
responseHeaders.set('Content-Type', 'text/html');
|
|
24
|
-
resolve(new Response(stream, {
|
|
25
|
-
headers: responseHeaders,
|
|
26
|
-
status: responseStatusCode,
|
|
27
|
-
}));
|
|
28
|
-
pipe(body);
|
|
29
|
-
},
|
|
30
|
-
onShellError(error) {
|
|
31
|
-
reject(error);
|
|
32
|
-
},
|
|
33
|
-
onError(error) {
|
|
34
|
-
responseStatusCode = 500;
|
|
35
|
-
if (shellRendered) {
|
|
36
|
-
console.error(error);
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
setTimeout(abort, ABORT_DELAY);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext) {
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
let shellRendered = false;
|
|
46
|
-
const { pipe, abort } = renderToPipeableStream(_jsx(RemixServer, { context: remixContext, url: request.url, abortDelay: ABORT_DELAY }), {
|
|
47
|
-
onShellReady() {
|
|
48
|
-
shellRendered = true;
|
|
49
|
-
const body = new PassThrough();
|
|
50
|
-
const stream = createReadableStreamFromReadable(body);
|
|
51
|
-
responseHeaders.set('Content-Type', 'text/html');
|
|
52
|
-
resolve(new Response(stream, {
|
|
53
|
-
headers: responseHeaders,
|
|
54
|
-
status: responseStatusCode,
|
|
55
|
-
}));
|
|
56
|
-
pipe(body);
|
|
57
|
-
},
|
|
58
|
-
onShellError(error) {
|
|
59
|
-
reject(error);
|
|
60
|
-
},
|
|
61
|
-
onError(error) {
|
|
62
|
-
responseStatusCode = 500;
|
|
63
|
-
if (shellRendered) {
|
|
64
|
-
console.error(error);
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
setTimeout(abort, ABORT_DELAY);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=entry.server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry.server.js","sourceRoot":"","sources":["../../src/ssr/entry.server.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,OAAgB,EAChB,kBAA0B,EAC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F,CAAC;QAEF,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/ssr/handler.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remix SSR Handler for Express
|
|
3
|
-
*
|
|
4
|
-
* This module creates a Remix request handler that integrates with Express.
|
|
5
|
-
* It handles specific routes with SSR while allowing other routes to fall through to the SPA.
|
|
6
|
-
*/
|
|
7
|
-
import { createRequestHandler } from '@remix-run/express';
|
|
8
|
-
// SSR routes - these will be rendered on the server
|
|
9
|
-
// All other routes fall through to the SPA
|
|
10
|
-
const SSR_ROUTES = [
|
|
11
|
-
'/shared/', // Shared threads (SEO-critical)
|
|
12
|
-
'/pricing', // Pricing page
|
|
13
|
-
'/login', // Login page
|
|
14
|
-
'/register', // Register page
|
|
15
|
-
'/privacy', // Privacy policy
|
|
16
|
-
'/terms', // Terms of service
|
|
17
|
-
];
|
|
18
|
-
/**
|
|
19
|
-
* Check if a request path should be handled by SSR
|
|
20
|
-
*/
|
|
21
|
-
export function isSSRRoute(path) {
|
|
22
|
-
return SSR_ROUTES.some((route) => {
|
|
23
|
-
if (route.endsWith('/')) {
|
|
24
|
-
return path.startsWith(route);
|
|
25
|
-
}
|
|
26
|
-
return path === route || path.startsWith(route + '/') || path.startsWith(route + '?');
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Create Express middleware for Remix SSR
|
|
31
|
-
*/
|
|
32
|
-
export function createRemixHandler(build) {
|
|
33
|
-
return createRequestHandler({
|
|
34
|
-
build,
|
|
35
|
-
mode: process.env.NODE_ENV,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Conditionally apply Remix handler for SSR routes only
|
|
40
|
-
*/
|
|
41
|
-
export function createConditionalRemixHandler(build) {
|
|
42
|
-
const remixHandler = createRemixHandler(build);
|
|
43
|
-
return (req, res, next) => {
|
|
44
|
-
if (isSSRRoute(req.path)) {
|
|
45
|
-
return remixHandler(req, res, next);
|
|
46
|
-
}
|
|
47
|
-
// Let non-SSR routes fall through to SPA or other handlers
|
|
48
|
-
next();
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=handler.js.map
|
package/dist/ssr/handler.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/ssr/handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAI1D,oDAAoD;AACpD,2CAA2C;AAC3C,MAAM,UAAU,GAAG;IACjB,UAAU,EAAG,gCAAgC;IAC7C,UAAU,EAAG,eAAe;IAC5B,QAAQ,EAAK,aAAa;IAC1B,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAG,iBAAiB;IAC9B,QAAQ,EAAK,mBAAmB;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAkB;IACnD,OAAO,oBAAoB,CAAC;QAC1B,KAAK;QACL,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;KAC3B,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAAkB;IAC9D,MAAM,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE/C,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACxB,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QACD,2DAA2D;QAC3D,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/ssr/root.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useLoaderData, } from '@remix-run/react';
|
|
3
|
-
import { json } from '@remix-run/node';
|
|
4
|
-
import { getConfig } from '../config/loader.js';
|
|
5
|
-
// Generate CSS variables from theme config
|
|
6
|
-
function generateThemeCSS(config, theme) {
|
|
7
|
-
const themeConfig = config.theming.themes[theme];
|
|
8
|
-
if (!themeConfig)
|
|
9
|
-
return '';
|
|
10
|
-
const hexToRgb = (hex) => {
|
|
11
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
12
|
-
if (!result)
|
|
13
|
-
return '';
|
|
14
|
-
return `${parseInt(result[1], 16)} ${parseInt(result[2], 16)} ${parseInt(result[3], 16)}`;
|
|
15
|
-
};
|
|
16
|
-
const cssVars = Object.entries(themeConfig.colors)
|
|
17
|
-
.map(([key, value]) => {
|
|
18
|
-
const cssKey = `--color-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
|
|
19
|
-
return `${cssKey}: ${hexToRgb(value)};`;
|
|
20
|
-
})
|
|
21
|
-
.join('\n ');
|
|
22
|
-
return `
|
|
23
|
-
:root {
|
|
24
|
-
${cssVars}
|
|
25
|
-
--font-sans: ${config.theming.fonts.sans};
|
|
26
|
-
--font-mono: ${config.theming.fonts.mono};
|
|
27
|
-
--radius-sm: ${config.theming.borderRadius.sm};
|
|
28
|
-
--radius-md: ${config.theming.borderRadius.md};
|
|
29
|
-
--radius-lg: ${config.theming.borderRadius.lg};
|
|
30
|
-
--radius-full: ${config.theming.borderRadius.full};
|
|
31
|
-
}`;
|
|
32
|
-
}
|
|
33
|
-
export const links = () => {
|
|
34
|
-
return [
|
|
35
|
-
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
|
36
|
-
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossOrigin: 'anonymous' },
|
|
37
|
-
{
|
|
38
|
-
rel: 'stylesheet',
|
|
39
|
-
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap',
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
};
|
|
43
|
-
export async function loader({ request }) {
|
|
44
|
-
const config = getConfig();
|
|
45
|
-
const theme = config.theming.defaultTheme;
|
|
46
|
-
return json({
|
|
47
|
-
config: {
|
|
48
|
-
app: config.app,
|
|
49
|
-
ui: config.ui,
|
|
50
|
-
theming: config.theming,
|
|
51
|
-
legal: config.legal,
|
|
52
|
-
sharing: config.sharing,
|
|
53
|
-
payments: config.payments,
|
|
54
|
-
auth: config.auth,
|
|
55
|
-
},
|
|
56
|
-
theme,
|
|
57
|
-
themeCSS: generateThemeCSS(config, theme),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export default function App() {
|
|
61
|
-
const { config, theme, themeCSS } = useLoaderData();
|
|
62
|
-
return (_jsxs("html", { lang: "en", "data-theme": theme, children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), _jsx(Meta, {}), _jsx(Links, {}), _jsx("style", { dangerouslySetInnerHTML: { __html: themeCSS } }), _jsx("style", { dangerouslySetInnerHTML: { __html: `
|
|
63
|
-
/* Base styles */
|
|
64
|
-
html { font-family: var(--font-sans); }
|
|
65
|
-
body {
|
|
66
|
-
background-color: rgb(var(--color-background));
|
|
67
|
-
color: rgb(var(--color-text-primary));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Utility classes */
|
|
71
|
-
.bg-background { background-color: rgb(var(--color-background)); }
|
|
72
|
-
.bg-background-secondary { background-color: rgb(var(--color-background-secondary)); }
|
|
73
|
-
.text-text-primary { color: rgb(var(--color-text-primary)); }
|
|
74
|
-
.text-text-secondary { color: rgb(var(--color-text-secondary)); }
|
|
75
|
-
.text-text-muted { color: rgb(var(--color-text-muted)); }
|
|
76
|
-
.text-white { color: white; }
|
|
77
|
-
.border-border { border-color: rgb(var(--color-border)); }
|
|
78
|
-
.bg-primary { background-color: rgb(var(--color-primary)); }
|
|
79
|
-
.hover\\:bg-primary-hover:hover { background-color: rgb(var(--color-primary-hover)); }
|
|
80
|
-
.bg-assistant-message-bg { background-color: rgb(var(--color-assistant-message-bg)); }
|
|
81
|
-
.text-assistant-message-text { color: rgb(var(--color-assistant-message-text)); }
|
|
82
|
-
.bg-user-message-bg { background-color: rgb(var(--color-user-message-bg)); }
|
|
83
|
-
.text-user-message-text { color: rgb(var(--color-user-message-text)); }
|
|
84
|
-
|
|
85
|
-
/* Layout utilities */
|
|
86
|
-
.min-h-screen { min-height: 100vh; }
|
|
87
|
-
.flex { display: flex; }
|
|
88
|
-
.flex-col { flex-direction: column; }
|
|
89
|
-
.items-center { align-items: center; }
|
|
90
|
-
.justify-center { justify-content: center; }
|
|
91
|
-
.justify-between { justify-content: space-between; }
|
|
92
|
-
.gap-3 { gap: 0.75rem; }
|
|
93
|
-
.mx-auto { margin-left: auto; margin-right: auto; }
|
|
94
|
-
.max-w-3xl { max-width: 48rem; }
|
|
95
|
-
.px-4 { padding-left: 1rem; padding-right: 1rem; }
|
|
96
|
-
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
|
|
97
|
-
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
|
|
98
|
-
.pb-8 { padding-bottom: 2rem; }
|
|
99
|
-
.p-4 { padding: 1rem; }
|
|
100
|
-
.mb-2 { margin-bottom: 0.5rem; }
|
|
101
|
-
.mb-6 { margin-bottom: 1.5rem; }
|
|
102
|
-
.space-y-3 > * + * { margin-top: 0.75rem; }
|
|
103
|
-
.space-y-4 > * + * { margin-top: 1rem; }
|
|
104
|
-
|
|
105
|
-
/* Typography */
|
|
106
|
-
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
|
|
107
|
-
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
|
|
108
|
-
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
|
|
109
|
-
.text-center { text-align: center; }
|
|
110
|
-
.font-semibold { font-weight: 600; }
|
|
111
|
-
.font-bold { font-weight: 700; }
|
|
112
|
-
|
|
113
|
-
/* Borders */
|
|
114
|
-
.border-b { border-bottom-width: 1px; }
|
|
115
|
-
.border-t { border-top-width: 1px; }
|
|
116
|
-
.rounded-lg { border-radius: 0.5rem; }
|
|
117
|
-
.rounded-full { border-radius: 9999px; }
|
|
118
|
-
|
|
119
|
-
/* Flex utilities */
|
|
120
|
-
.flex-shrink-0 { flex-shrink: 0; }
|
|
121
|
-
|
|
122
|
-
/* Sizing */
|
|
123
|
-
.h-6 { height: 1.5rem; }
|
|
124
|
-
.w-6 { width: 1.5rem; }
|
|
125
|
-
.h-8 { height: 2rem; }
|
|
126
|
-
.w-8 { width: 2rem; }
|
|
127
|
-
.max-w-\\[85\\%\\] { max-width: 85%; }
|
|
128
|
-
|
|
129
|
-
/* Animations */
|
|
130
|
-
.animate-spin {
|
|
131
|
-
animation: spin 1s linear infinite;
|
|
132
|
-
}
|
|
133
|
-
@keyframes spin {
|
|
134
|
-
from { transform: rotate(0deg); }
|
|
135
|
-
to { transform: rotate(360deg); }
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* Message bubbles */
|
|
139
|
-
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
|
|
140
|
-
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
|
|
141
|
-
|
|
142
|
-
/* Markdown content */
|
|
143
|
-
.markdown-content { line-height: 1.625; }
|
|
144
|
-
.markdown-content p { margin-bottom: 1rem; }
|
|
145
|
-
.markdown-content p:last-child { margin-bottom: 0; }
|
|
146
|
-
.markdown-content pre {
|
|
147
|
-
background-color: rgb(var(--color-background-secondary));
|
|
148
|
-
padding: 1rem;
|
|
149
|
-
border-radius: 0.5rem;
|
|
150
|
-
overflow-x: auto;
|
|
151
|
-
margin: 1rem 0;
|
|
152
|
-
}
|
|
153
|
-
.markdown-content code {
|
|
154
|
-
font-family: var(--font-mono);
|
|
155
|
-
font-size: 0.875rem;
|
|
156
|
-
}
|
|
157
|
-
.markdown-content ul, .markdown-content ol {
|
|
158
|
-
padding-left: 1.5rem;
|
|
159
|
-
margin-bottom: 1rem;
|
|
160
|
-
}
|
|
161
|
-
.markdown-content ul { list-style-type: disc; }
|
|
162
|
-
.markdown-content ol { list-style-type: decimal; }
|
|
163
|
-
.markdown-content li { margin-bottom: 0.25rem; }
|
|
164
|
-
` } })] }), _jsxs("body", { children: [_jsx(Outlet, { context: { config } }), _jsx(ScrollRestoration, {}), _jsx(Scripts, {})] })] }));
|
|
165
|
-
}
|
|
166
|
-
// Error boundary for SSR routes
|
|
167
|
-
export function ErrorBoundary() {
|
|
168
|
-
return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), _jsx("title", { children: "Error" }), _jsx(Meta, {}), _jsx(Links, {})] }), _jsxs("body", { children: [_jsxs("div", { style: {
|
|
169
|
-
display: 'flex',
|
|
170
|
-
flexDirection: 'column',
|
|
171
|
-
alignItems: 'center',
|
|
172
|
-
justifyContent: 'center',
|
|
173
|
-
minHeight: '100vh',
|
|
174
|
-
padding: '1rem',
|
|
175
|
-
fontFamily: 'system-ui, sans-serif'
|
|
176
|
-
}, children: [_jsx("h1", { style: { fontSize: '1.5rem', fontWeight: 'bold', marginBottom: '0.5rem' }, children: "Something went wrong" }), _jsx("p", { style: { color: '#666', marginBottom: '1.5rem' }, children: "We're sorry, but an error occurred while loading this page." }), _jsx("a", { href: "/", style: {
|
|
177
|
-
backgroundColor: '#6366f1',
|
|
178
|
-
color: 'white',
|
|
179
|
-
padding: '0.5rem 1rem',
|
|
180
|
-
borderRadius: '0.5rem',
|
|
181
|
-
textDecoration: 'none',
|
|
182
|
-
}, children: "Go to Home" })] }), _jsx(Scripts, {})] })] }));
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=root.js.map
|
package/dist/ssr/root.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/ssr/root.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,2CAA2C;AAC3C,SAAS,gBAAgB,CAAC,MAAiB,EAAE,KAAa;IACxD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAE5B,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE;QACvC,MAAM,MAAM,GAAG,2CAA2C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QACvB,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CA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