@senyao-design-system/editor 0.0.1
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/README.md +172 -0
- package/dist/components/Editor.d.ts +11 -0
- package/dist/components/GenericEditor.d.ts +8 -0
- package/dist/components/JSONEditor.d.ts +8 -0
- package/dist/components/SQLEditor.d.ts +8 -0
- package/dist/extensions/features.d.ts +23 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/language.d.ts +18 -0
- package/dist/extensions/readOnlyRanges.d.ts +37 -0
- package/dist/extensions/theme.d.ts +20 -0
- package/dist/extensions/utils.d.ts +36 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +46 -0
- package/dist/index.mjs +2192 -0
- package/dist/types/index.d.ts +110 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @senyao/editor
|
|
2
|
+
|
|
3
|
+
基于 CodeMirror 的编辑器组件,提供多种类型的编辑器和丰富的自定义功能。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @senyao/editor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 特性
|
|
12
|
+
|
|
13
|
+
- 多种类型的编辑器支持(SQL、JSON 等)
|
|
14
|
+
- 语法高亮和智能提示
|
|
15
|
+
- 可自定义主题和扩展
|
|
16
|
+
- 支持不可编辑区域
|
|
17
|
+
- TypeScript 类型支持
|
|
18
|
+
|
|
19
|
+
## 使用示例
|
|
20
|
+
|
|
21
|
+
### 通用编辑器
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Editor } from '@senyao/editor';
|
|
25
|
+
|
|
26
|
+
function App() {
|
|
27
|
+
const [value, setValue] = useState('console.log("Hello World");');
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Editor
|
|
31
|
+
value={value}
|
|
32
|
+
onChange={setValue}
|
|
33
|
+
language="javascript"
|
|
34
|
+
height="300px"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### SQL 编辑器
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { SQLEditor } from '@senyao/editor';
|
|
44
|
+
|
|
45
|
+
function App() {
|
|
46
|
+
const [value, setValue] = useState('SELECT * FROM users;');
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<SQLEditor
|
|
50
|
+
value={value}
|
|
51
|
+
onChange={setValue}
|
|
52
|
+
readOnlyRanges={[
|
|
53
|
+
{ start: 0, end: 7 } // "SELECT " 部分不可编辑
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### JSON 编辑器
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { JSONEditor } from '@senyao/editor';
|
|
64
|
+
|
|
65
|
+
function App() {
|
|
66
|
+
const [value, setValue] = useState('{"name": "John", "age": 30}');
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<JSONEditor
|
|
70
|
+
value={value}
|
|
71
|
+
onChange={setValue}
|
|
72
|
+
enableFormatting={true}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 自定义扩展
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { Editor, createAutocompletionExtension } from '@senyao/editor';
|
|
82
|
+
|
|
83
|
+
function App() {
|
|
84
|
+
const [value, setValue] = useState('console.log("Hello World");');
|
|
85
|
+
|
|
86
|
+
// 自定义自动补全
|
|
87
|
+
const customCompletions = createAutocompletionExtension({
|
|
88
|
+
override: [
|
|
89
|
+
(context) => {
|
|
90
|
+
return {
|
|
91
|
+
from: context.pos,
|
|
92
|
+
options: [
|
|
93
|
+
{ label: 'console.log', type: 'function' },
|
|
94
|
+
{ label: 'alert', type: 'function' },
|
|
95
|
+
{ label: 'document', type: 'variable' },
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Editor
|
|
104
|
+
value={value}
|
|
105
|
+
onChange={setValue}
|
|
106
|
+
language="javascript"
|
|
107
|
+
extensions={[customCompletions]}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## API
|
|
114
|
+
|
|
115
|
+
### 通用编辑器 `<Editor>`
|
|
116
|
+
|
|
117
|
+
| 属性 | 类型 | 默认值 | 描述 |
|
|
118
|
+
| --- | --- | --- | --- |
|
|
119
|
+
| value | string | - | 编辑器的值 |
|
|
120
|
+
| onChange | (value: string) => void | - | 编辑器值变化时的回调函数 |
|
|
121
|
+
| language | string | 'json' | 编辑器语言 |
|
|
122
|
+
| extensions | Extension[] | [] | 编辑器扩展 |
|
|
123
|
+
| height | string \| number | '300px' | 编辑器高度 |
|
|
124
|
+
| disabled | boolean | false | 是否禁用编辑器 |
|
|
125
|
+
| className | string | - | 编辑器样式类名 |
|
|
126
|
+
| style | React.CSSProperties | - | 编辑器内联样式 |
|
|
127
|
+
| placeholder | string | - | 占位文本 |
|
|
128
|
+
| theme | 'light' \| 'dark' | 'light' | 编辑器主题 |
|
|
129
|
+
|
|
130
|
+
### SQL 编辑器 `<SQLEditor>`
|
|
131
|
+
|
|
132
|
+
| 属性 | 类型 | 默认值 | 描述 |
|
|
133
|
+
| --- | --- | --- | --- |
|
|
134
|
+
| value | string | - | 编辑器的值 |
|
|
135
|
+
| onChange | (value: string) => void | - | 编辑器值变化时的回调函数 |
|
|
136
|
+
| extensions | Extension[] | [] | 编辑器扩展 |
|
|
137
|
+
| readOnlyRanges | Array<{ start: number; end: number }> | [] | 不可编辑区域范围 |
|
|
138
|
+
| height | string \| number | '300px' | 编辑器高度 |
|
|
139
|
+
| disabled | boolean | false | 是否禁用编辑器 |
|
|
140
|
+
| className | string | - | 编辑器样式类名 |
|
|
141
|
+
| style | React.CSSProperties | - | 编辑器内联样式 |
|
|
142
|
+
| placeholder | string | - | 占位文本 |
|
|
143
|
+
|
|
144
|
+
### JSON 编辑器 `<JSONEditor>`
|
|
145
|
+
|
|
146
|
+
| 属性 | 类型 | 默认值 | 描述 |
|
|
147
|
+
| --- | --- | --- | --- |
|
|
148
|
+
| value | string | - | 编辑器的值 |
|
|
149
|
+
| onChange | (value: string) => void | - | 编辑器值变化时的回调函数 |
|
|
150
|
+
| extensions | Extension[] | [] | 编辑器扩展 |
|
|
151
|
+
| enableFormatting | boolean | true | 是否启用格式化功能 |
|
|
152
|
+
| height | string \| number | '300px' | 编辑器高度 |
|
|
153
|
+
| disabled | boolean | false | 是否禁用编辑器 |
|
|
154
|
+
| className | string | - | 编辑器样式类名 |
|
|
155
|
+
| style | React.CSSProperties | - | 编辑器内联样式 |
|
|
156
|
+
| placeholder | string | - | 占位文本 |
|
|
157
|
+
|
|
158
|
+
## 工具函数
|
|
159
|
+
|
|
160
|
+
- `getLanguageExtension(language)`: 根据语言类型获取对应的语言扩展
|
|
161
|
+
- `createAutocompletionExtension(options)`: 创建自动补全扩展
|
|
162
|
+
- `createLintExtension(lintFunction)`: 创建错误检查扩展
|
|
163
|
+
- `createKeymapExtension()`: 创建键盘快捷键扩展
|
|
164
|
+
- `getThemeExtension(theme)`: 根据主题类型获取对应的主题扩展
|
|
165
|
+
|
|
166
|
+
## 贡献指南
|
|
167
|
+
|
|
168
|
+
欢迎提交 Issue 或 Pull Request 来完善本组件库。
|
|
169
|
+
|
|
170
|
+
## 许可证
|
|
171
|
+
|
|
172
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EditorProps } from '../../../types';
|
|
2
|
+
import { ThemeType } from '../../../extensions';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 通用编辑器组件
|
|
6
|
+
* 支持语言选择和主题切换
|
|
7
|
+
*/
|
|
8
|
+
export declare const Editor: ({ value, onChange, language, extensions, theme, ...rest }: EditorProps & {
|
|
9
|
+
theme?: ThemeType;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Editor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorProps } from '../../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 通用编辑器组件
|
|
5
|
+
* 作为所有特定编辑器的基础组件
|
|
6
|
+
*/
|
|
7
|
+
export declare const GenericEditor: ({ value, onChange, extensions, height, disabled, className, style, placeholder: placeholderText, onEditorViewCreated, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default GenericEditor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSONEditorProps } from '../../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* JSON 编辑器组件
|
|
5
|
+
* 提供 JSON 语法高亮和格式化功能
|
|
6
|
+
*/
|
|
7
|
+
export declare const JSONEditor: ({ value, onChange, extensions, enableFormatting, ...rest }: JSONEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default JSONEditor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SQLEditorProps } from '../../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SQL 编辑器组件
|
|
5
|
+
* 提供 SQL 语法高亮和智能提示
|
|
6
|
+
*/
|
|
7
|
+
export declare const SQLEditor: ({ value, onChange, extensions, readOnlyRanges: externalReadOnlyRanges, manageReadOnlyRanges, ...rest }: SQLEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default SQLEditor;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Extension } from '../../@codemirror/state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 创建自动补全扩展
|
|
5
|
+
* @param options 自动补全选项
|
|
6
|
+
* @returns 自动补全扩展
|
|
7
|
+
*/
|
|
8
|
+
export declare function createAutocompletionExtension(options?: any): Extension;
|
|
9
|
+
/**
|
|
10
|
+
* 创建错误检查扩展
|
|
11
|
+
* @param lintFunction 错误检查函数
|
|
12
|
+
* @returns 错误检查扩展
|
|
13
|
+
*/
|
|
14
|
+
export declare function createLintExtension(lintFunction: any): Extension[];
|
|
15
|
+
/**
|
|
16
|
+
* 创建键盘快捷键扩展
|
|
17
|
+
* @returns 键盘快捷键扩展
|
|
18
|
+
*/
|
|
19
|
+
export declare function createKeymapExtension(): Extension;
|
|
20
|
+
/**
|
|
21
|
+
* 常用编辑器扩展集合
|
|
22
|
+
*/
|
|
23
|
+
export declare const commonExtensions: Extension[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Extension } from '../../@codemirror/state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 支持的语言类型
|
|
5
|
+
*/
|
|
6
|
+
export type LanguageType = 'sql' | 'json' | string;
|
|
7
|
+
/**
|
|
8
|
+
* 根据语言类型获取对应的语言扩展
|
|
9
|
+
* @param language 语言类型
|
|
10
|
+
* @returns 对应的语言扩展
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLanguageExtension(language: LanguageType): Extension;
|
|
13
|
+
/**
|
|
14
|
+
* 检查语言类型是否受支持
|
|
15
|
+
* @param language 语言类型
|
|
16
|
+
* @returns 是否受支持
|
|
17
|
+
*/
|
|
18
|
+
export declare function isSupportedLanguage(language: string): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Extension } from '../../@codemirror/state';
|
|
2
|
+
import { EditorView } from '../../@codemirror/view';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 只读区域范围接口
|
|
6
|
+
*/
|
|
7
|
+
export interface ReadOnlyRange {
|
|
8
|
+
/**
|
|
9
|
+
* 开始位置
|
|
10
|
+
*/
|
|
11
|
+
start: number;
|
|
12
|
+
/**
|
|
13
|
+
* 结束位置
|
|
14
|
+
*/
|
|
15
|
+
end: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 处理只读区域
|
|
19
|
+
*
|
|
20
|
+
* @param ranges - 只读区域范围数组
|
|
21
|
+
* @returns 编辑器扩展
|
|
22
|
+
*/
|
|
23
|
+
export declare function readOnlyRanges(initialRanges: ReadOnlyRange[]): Extension;
|
|
24
|
+
/**
|
|
25
|
+
* 获取编辑器当前的只读区域
|
|
26
|
+
*
|
|
27
|
+
* @param view - 编辑器视图
|
|
28
|
+
* @returns 当前的只读区域范围
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCurrentReadOnlyRanges(view: EditorView): ReadOnlyRange[];
|
|
31
|
+
/**
|
|
32
|
+
* 更新编辑器中的只读区域
|
|
33
|
+
*
|
|
34
|
+
* @param view - 编辑器视图
|
|
35
|
+
* @param ranges - 新的只读区域范围
|
|
36
|
+
*/
|
|
37
|
+
export declare function updateReadOnlyRanges(view: EditorView, ranges: ReadOnlyRange[]): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '../../@codemirror/state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 编辑器主题类型
|
|
5
|
+
*/
|
|
6
|
+
export type ThemeType = 'light' | 'dark';
|
|
7
|
+
/**
|
|
8
|
+
* 亮色主题
|
|
9
|
+
*/
|
|
10
|
+
export declare const lightTheme: Extension;
|
|
11
|
+
/**
|
|
12
|
+
* 暗色主题
|
|
13
|
+
*/
|
|
14
|
+
export declare const darkTheme: Extension;
|
|
15
|
+
/**
|
|
16
|
+
* 根据主题类型获取对应的主题扩展
|
|
17
|
+
* @param theme 主题类型
|
|
18
|
+
* @returns 对应的主题扩展
|
|
19
|
+
*/
|
|
20
|
+
export declare function getThemeExtension(theme: ThemeType): Extension;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 区块内容项接口
|
|
3
|
+
*/
|
|
4
|
+
export interface ContentBlock {
|
|
5
|
+
/**
|
|
6
|
+
* 区块的文本内容
|
|
7
|
+
*/
|
|
8
|
+
content: string;
|
|
9
|
+
/**
|
|
10
|
+
* 区块是否可编辑
|
|
11
|
+
*/
|
|
12
|
+
editable: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 编辑器数据接口
|
|
16
|
+
*/
|
|
17
|
+
export interface EditorData {
|
|
18
|
+
/**
|
|
19
|
+
* 编辑器文本内容
|
|
20
|
+
*/
|
|
21
|
+
value: string;
|
|
22
|
+
/**
|
|
23
|
+
* 不可编辑区域范围
|
|
24
|
+
*/
|
|
25
|
+
readOnlyRanges: Array<{
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 将内容区块列表转换为编辑器数据对象
|
|
32
|
+
*
|
|
33
|
+
* @param blocks - 内容区块列表
|
|
34
|
+
* @returns 编辑器数据对象,包含完整文本和只读区域
|
|
35
|
+
*/
|
|
36
|
+
export declare const blocksToEditorData: (blocks: ContentBlock[]) => EditorData;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.senyao-editor{width:100%;border:1px solid #ddd;border-radius:4px;overflow:hidden;font-family:Menlo,Monaco,Courier New,monospace}.senyao-editor:focus-within{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.senyao-editor .cm-editor{height:100%}.senyao-editor .cm-scroller{overflow:auto}.senyao-editor .cm-readonly{background-color:#f5f5f5}.senyao-editor .cm-readOnly{background-color:#0000000d;border-radius:2px;position:relative;pointer-events:all;transition:background-color .2s;border-left:2px solid rgba(0,0,0,.1);z-index:1}.senyao-editor .cm-readOnly:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;cursor:not-allowed!important;z-index:10;pointer-events:auto}.senyao-editor .cm-readOnly:hover:after{background-color:#00000005}.senyao-editor .cm-diagnosticError{text-decoration:wavy underline #ff4d4f;text-decoration-skip-ink:none}.senyao-editor .cm-diagnosticWarning{text-decoration:wavy underline #faad14;text-decoration-skip-ink:none}.senyao-editor .cm-keyword{color:#00f!important;z-index:2;position:relative;background-color:transparent!important}.senyao-editor .cb,.senyao-editor .cm-content span.cb,.senyao-editor span.cm-keyword{color:#00f;font-weight:700;position:relative;background-color:transparent}.senyao-editor .cm-operator{color:#777!important;z-index:2;position:relative}.senyao-editor .cm-number{color:#098658!important;z-index:2;position:relative}.senyao-editor .cm-string{color:#a31515!important;z-index:2;position:relative}.senyao-editor .cm-comment{color:green!important;z-index:2;position:relative}.senyao-editor .cm-propertyName{color:#0451a5!important;z-index:2;position:relative}.senyao-editor.disabled{opacity:.7;cursor:not-allowed}.senyao-editor.disabled .cm-content{cursor:not-allowed}.senyao-editor .cm-placeholder{color:#999}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Editor } from '../components/Editor';
|
|
2
|
+
export { default as SQLEditor } from '../components/SQLEditor';
|
|
3
|
+
export { default as JSONEditor } from '../components/JSONEditor';
|
|
4
|
+
export { default as GenericEditor } from '../components/GenericEditor';
|
|
5
|
+
export * from '../extensions';
|
|
6
|
+
export * from '../types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),Br=require("@codemirror/lang-sql"),zr=require("@codemirror/lang-json"),q=require("@codemirror/view"),cr=require("@codemirror/commands"),Lt=require("@codemirror/autocomplete"),Ge=require("@codemirror/lint"),oe=require("@codemirror/state"),Ye=require("@codemirror/language");function Dt(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const ie=Dt(O);var ur={exports:{}},xe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var jr;function Yt(){if(jr)return xe;jr=1;var e=O,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(c,d,p){var f,y={},x=null,R=null;p!==void 0&&(x=""+p),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(R=d.ref);for(f in d)a.call(d,f)&&!i.hasOwnProperty(f)&&(y[f]=d[f]);if(c&&c.defaultProps)for(f in d=c.defaultProps,d)y[f]===void 0&&(y[f]=d[f]);return{$$typeof:r,type:c,key:x,ref:R,props:y,_owner:o.current}}return xe.Fragment=n,xe.jsx=s,xe.jsxs=s,xe}var _e={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Fr;function Wt(){return Fr||(Fr=1,process.env.NODE_ENV!=="production"&&function(){var e=O,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b=Symbol.iterator,C="@@iterator";function L(t){if(t===null||typeof t!="object")return null;var u=b&&t[b]||t[C];return typeof u=="function"?u:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(t){{for(var u=arguments.length,h=new Array(u>1?u-1:0),E=1;E<u;E++)h[E-1]=arguments[E];$("error",t,h)}}function $(t,u,h){{var E=_.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(u+="%s",h=h.concat([I]));var N=h.map(function(T){return String(T)});N.unshift("Warning: "+u),Function.prototype.apply.call(console[t],console,N)}}var D=!1,l=!1,g=!1,v=!1,k=!1,P;P=Symbol.for("react.module.reference");function Y(t){return!!(typeof t=="string"||typeof t=="function"||t===a||t===i||k||t===o||t===p||t===f||v||t===R||D||l||g||typeof t=="object"&&t!==null&&(t.$$typeof===x||t.$$typeof===y||t.$$typeof===s||t.$$typeof===c||t.$$typeof===d||t.$$typeof===P||t.getModuleId!==void 0))}function G(t,u,h){var E=t.displayName;if(E)return E;var I=u.displayName||u.name||"";return I!==""?h+"("+I+")":h}function Q(t){return t.displayName||"Context"}function z(t){if(t==null)return null;if(typeof t.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case a:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case p:return"Suspense";case f:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case c:var u=t;return Q(u)+".Consumer";case s:var h=t;return Q(h._context)+".Provider";case d:return G(t,t.render,"ForwardRef");case y:var E=t.displayName||null;return E!==null?E:z(t.type)||"Memo";case x:{var I=t,N=I._payload,T=I._init;try{return z(T(N))}catch{return null}}}return null}var ae=Object.assign,se=0,Ae,Ie,ye,je,Ee,Fe,Ne;function Le(){}Le.__reactDisabledLog=!0;function Qe(){{if(se===0){Ae=console.log,Ie=console.info,ye=console.warn,je=console.error,Ee=console.group,Fe=console.groupCollapsed,Ne=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Le,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}se++}}function er(){{if(se--,se===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},t,{value:Ae}),info:ae({},t,{value:Ie}),warn:ae({},t,{value:ye}),error:ae({},t,{value:je}),group:ae({},t,{value:Ee}),groupCollapsed:ae({},t,{value:Fe}),groupEnd:ae({},t,{value:Ne})})}se<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var be=_.ReactCurrentDispatcher,Se;function fe(t,u,h){{if(Se===void 0)try{throw Error()}catch(I){var E=I.stack.trim().match(/\n( *(at )?)/);Se=E&&E[1]||""}return`
|
|
18
|
+
`+Se+t}}var Re=!1,le;{var rr=typeof WeakMap=="function"?WeakMap:Map;le=new rr}function m(t,u){if(!t||Re)return"";{var h=le.get(t);if(h!==void 0)return h}var E;Re=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N;N=be.current,be.current=null,Qe();try{if(u){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(H){E=H}Reflect.construct(t,[],T)}else{try{T.call()}catch(H){E=H}t.call(T.prototype)}}else{try{throw Error()}catch(H){E=H}t()}}catch(H){if(H&&E&&typeof H.stack=="string"){for(var w=H.stack.split(`
|
|
19
|
+
`),K=E.stack.split(`
|
|
20
|
+
`),W=w.length-1,V=K.length-1;W>=1&&V>=0&&w[W]!==K[V];)V--;for(;W>=1&&V>=0;W--,V--)if(w[W]!==K[V]){if(W!==1||V!==1)do if(W--,V--,V<0||w[W]!==K[V]){var ee=`
|
|
21
|
+
`+w[W].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),typeof t=="function"&&le.set(t,ee),ee}while(W>=1&&V>=0);break}}}finally{Re=!1,be.current=N,er(),Error.prepareStackTrace=I}var pe=t?t.displayName||t.name:"",ue=pe?fe(pe):"";return typeof t=="function"&&le.set(t,ue),ue}function Ce(t,u,h){return m(t,!1)}function de(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function ce(t,u,h){if(t==null)return"";if(typeof t=="function")return m(t,de(t));if(typeof t=="string")return fe(t);switch(t){case p:return fe("Suspense");case f:return fe("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case d:return Ce(t.render);case y:return ce(t.type,u,h);case x:{var E=t,I=E._payload,N=E._init;try{return ce(N(I),u,h)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,Sr={},Rr=_.ReactDebugCurrentFrame;function De(t){if(t){var u=t._owner,h=ce(t.type,t._source,u?u.type:null);Rr.setExtraStackFrame(h)}else Rr.setExtraStackFrame(null)}function gt(t,u,h,E,I){{var N=Function.call.bind(we);for(var T in t)if(N(t,T)){var w=void 0;try{if(typeof t[T]!="function"){var K=Error((E||"React class")+": "+h+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw K.name="Invariant Violation",K}w=t[T](u,T,E,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){w=W}w&&!(w instanceof Error)&&(De(I),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",h,T,typeof w),De(null)),w instanceof Error&&!(w.message in Sr)&&(Sr[w.message]=!0,De(I),S("Failed %s type: %s",h,w.message),De(null))}}}var mt=Array.isArray;function tr(t){return mt(t)}function yt(t){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&t[Symbol.toStringTag]||t.constructor.name||"Object";return h}}function Et(t){try{return Cr(t),!1}catch{return!0}}function Cr(t){return""+t}function wr(t){if(Et(t))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",yt(t)),Cr(t)}var xr=_.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},_r,Tr;function St(t){if(we.call(t,"ref")){var u=Object.getOwnPropertyDescriptor(t,"ref").get;if(u&&u.isReactWarning)return!1}return t.ref!==void 0}function Rt(t){if(we.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function Ct(t,u){typeof t.ref=="string"&&xr.current}function wt(t,u){{var h=function(){_r||(_r=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};h.isReactWarning=!0,Object.defineProperty(t,"key",{get:h,configurable:!0})}}function xt(t,u){{var h=function(){Tr||(Tr=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};h.isReactWarning=!0,Object.defineProperty(t,"ref",{get:h,configurable:!0})}}var _t=function(t,u,h,E,I,N,T){var w={$$typeof:r,type:t,key:u,ref:h,props:T,_owner:N};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function Tt(t,u,h,E,I){{var N,T={},w=null,K=null;h!==void 0&&(wr(h),w=""+h),Rt(u)&&(wr(u.key),w=""+u.key),St(u)&&(K=u.ref,Ct(u,I));for(N in u)we.call(u,N)&&!bt.hasOwnProperty(N)&&(T[N]=u[N]);if(t&&t.defaultProps){var W=t.defaultProps;for(N in W)T[N]===void 0&&(T[N]=W[N])}if(w||K){var V=typeof t=="function"?t.displayName||t.name||"Unknown":t;w&&wt(T,V),K&&xt(T,V)}return _t(t,w,K,I,E,xr.current,T)}}var nr=_.ReactCurrentOwner,Or=_.ReactDebugCurrentFrame;function he(t){if(t){var u=t._owner,h=ce(t.type,t._source,u?u.type:null);Or.setExtraStackFrame(h)}else Or.setExtraStackFrame(null)}var ar;ar=!1;function or(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function Pr(){{if(nr.current){var t=z(nr.current.type);if(t)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+t+"`."}return""}}function Ot(t){return""}var kr={};function Pt(t){{var u=Pr();if(!u){var h=typeof t=="string"?t:t.displayName||t.name;h&&(u=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+h+">.")}return u}}function $r(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=Pt(u);if(kr[h])return;kr[h]=!0;var E="";t&&t._owner&&t._owner!==nr.current&&(E=" It was passed a child from "+z(t._owner.type)+"."),he(t),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,E),he(null)}}function Mr(t,u){{if(typeof t!="object")return;if(tr(t))for(var h=0;h<t.length;h++){var E=t[h];or(E)&&$r(E,u)}else if(or(t))t._store&&(t._store.validated=!0);else if(t){var I=L(t);if(typeof I=="function"&&I!==t.entries)for(var N=I.call(t),T;!(T=N.next()).done;)or(T.value)&&$r(T.value,u)}}}function kt(t){{var u=t.type;if(u==null||typeof u=="string")return;var h;if(typeof u=="function")h=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===d||u.$$typeof===y))h=u.propTypes;else return;if(h){var E=z(u);gt(h,t.props,"prop",E,t)}else if(u.PropTypes!==void 0&&!ar){ar=!0;var I=z(u);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",I||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(t){{for(var u=Object.keys(t.props),h=0;h<u.length;h++){var E=u[h];if(E!=="children"&&E!=="key"){he(t),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),he(null);break}}t.ref!==null&&(he(t),S("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var Ar={};function Ir(t,u,h,E,I,N){{var T=Y(t);if(!T){var w="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var K=Ot();K?w+=K:w+=Pr();var W;t===null?W="null":tr(t)?W="array":t!==void 0&&t.$$typeof===r?(W="<"+(z(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):W=typeof t,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,w)}var V=Tt(t,u,h,I,N);if(V==null)return V;if(T){var ee=u.children;if(ee!==void 0)if(E)if(tr(ee)){for(var pe=0;pe<ee.length;pe++)Mr(ee[pe],t);Object.freeze&&Object.freeze(ee)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Mr(ee,t)}if(we.call(u,"key")){var ue=z(t),H=Object.keys(u).filter(function(Nt){return Nt!=="key"}),ir=H.length>0?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}";if(!Ar[ue+ir]){var Ft=H.length>0?"{"+H.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ir,ue,Ft,ue),Ar[ue+ir]=!0}}return t===a?$t(V):kt(V),V}}function Mt(t,u,h){return Ir(t,u,h,!0)}function At(t,u,h){return Ir(t,u,h,!1)}var It=At,jt=Mt;_e.Fragment=a,_e.jsx=It,_e.jsxs=jt}()),_e}process.env.NODE_ENV==="production"?ur.exports=Yt():ur.exports=Wt();var Nr=ur.exports;function Vt(e){if(e.sheet)return e.sheet;for(var r=0;r<document.styleSheets.length;r++)if(document.styleSheets[r].ownerNode===e)return document.styleSheets[r]}function qt(e){var r=document.createElement("style");return r.setAttribute("data-emotion",e.key),e.nonce!==void 0&&r.setAttribute("nonce",e.nonce),r.appendChild(document.createTextNode("")),r.setAttribute("data-s",""),r}var Ut=function(){function e(n){var a=this;this._insertTag=function(o){var i;a.tags.length===0?a.insertionPoint?i=a.insertionPoint.nextSibling:a.prepend?i=a.container.firstChild:i=a.before:i=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(o,i),a.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var r=e.prototype;return r.hydrate=function(a){a.forEach(this._insertTag)},r.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(qt(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Vt(o);try{i.insertRule(a,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(a));this.ctr++},r.flush=function(){this.tags.forEach(function(a){var o;return(o=a.parentNode)==null?void 0:o.removeChild(a)}),this.tags=[],this.ctr=0},e}(),B="-ms-",Je="-moz-",M="-webkit-",Kr="comm",gr="rule",mr="decl",Gt="@import",Hr="@keyframes",Jt="@layer",Bt=Math.abs,ze=String.fromCharCode,zt=Object.assign;function Kt(e,r){return J(e,0)^45?(((r<<2^J(e,0))<<2^J(e,1))<<2^J(e,2))<<2^J(e,3):0}function Xr(e){return e.trim()}function Ht(e,r){return(e=r.exec(e))?e[0]:e}function A(e,r,n){return e.replace(r,n)}function fr(e,r){return e.indexOf(r)}function J(e,r){return e.charCodeAt(r)|0}function Pe(e,r,n){return e.slice(r,n)}function re(e){return e.length}function yr(e){return e.length}function We(e,r){return r.push(e),e}function Xt(e,r){return e.map(r).join("")}var Ke=1,ge=1,Zr=0,X=0,U=0,me="";function He(e,r,n,a,o,i,s){return{value:e,root:r,parent:n,type:a,props:o,children:i,line:Ke,column:ge,length:s,return:""}}function Te(e,r){return zt(He("",null,null,"",null,null,0),e,{length:-e.length},r)}function Zt(){return U}function Qt(){return U=X>0?J(me,--X):0,ge--,U===10&&(ge=1,Ke--),U}function Z(){return U=X<Zr?J(me,X++):0,ge++,U===10&&(ge=1,Ke++),U}function ne(){return J(me,X)}function Ve(){return X}function Me(e,r){return Pe(me,e,r)}function ke(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qr(e){return Ke=ge=1,Zr=re(me=e),X=0,[]}function et(e){return me="",e}function qe(e){return Xr(Me(X-1,lr(e===91?e+2:e===40?e+1:e)))}function en(e){for(;(U=ne())&&U<33;)Z();return ke(e)>2||ke(U)>3?"":" "}function rn(e,r){for(;--r&&Z()&&!(U<48||U>102||U>57&&U<65||U>70&&U<97););return Me(e,Ve()+(r<6&&ne()==32&&Z()==32))}function lr(e){for(;Z();)switch(U){case e:return X;case 34:case 39:e!==34&&e!==39&&lr(U);break;case 40:e===41&&lr(e);break;case 92:Z();break}return X}function tn(e,r){for(;Z()&&e+U!==57;)if(e+U===84&&ne()===47)break;return"/*"+Me(r,X-1)+"*"+ze(e===47?e:Z())}function nn(e){for(;!ke(ne());)Z();return Me(e,X)}function an(e){return et(Ue("",null,null,null,[""],e=Qr(e),0,[0],e))}function Ue(e,r,n,a,o,i,s,c,d){for(var p=0,f=0,y=s,x=0,R=0,b=0,C=1,L=1,_=1,S=0,$="",D=o,l=i,g=a,v=$;L;)switch(b=S,S=Z()){case 40:if(b!=108&&J(v,y-1)==58){fr(v+=A(qe(S),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:v+=qe(S);break;case 9:case 10:case 13:case 32:v+=en(b);break;case 92:v+=rn(Ve()-1,7);continue;case 47:switch(ne()){case 42:case 47:We(on(tn(Z(),Ve()),r,n),d);break;default:v+="/"}break;case 123*C:c[p++]=re(v)*_;case 125*C:case 59:case 0:switch(S){case 0:case 125:L=0;case 59+f:_==-1&&(v=A(v,/\f/g,"")),R>0&&re(v)-y&&We(R>32?Dr(v+";",a,n,y-1):Dr(A(v," ","")+";",a,n,y-2),d);break;case 59:v+=";";default:if(We(g=Lr(v,r,n,p,f,o,c,$,D=[],l=[],y),i),S===123)if(f===0)Ue(v,r,g,g,D,i,y,c,l);else switch(x===99&&J(v,3)===110?100:x){case 100:case 108:case 109:case 115:Ue(e,g,g,a&&We(Lr(e,g,g,0,0,o,c,$,o,D=[],y),l),o,l,y,c,a?D:l);break;default:Ue(v,g,g,g,[""],l,0,c,l)}}p=f=R=0,C=_=1,$=v="",y=s;break;case 58:y=1+re(v),R=b;default:if(C<1){if(S==123)--C;else if(S==125&&C++==0&&Qt()==125)continue}switch(v+=ze(S),S*C){case 38:_=f>0?1:(v+="\f",-1);break;case 44:c[p++]=(re(v)-1)*_,_=1;break;case 64:ne()===45&&(v+=qe(Z())),x=ne(),f=y=re($=v+=nn(Ve())),S++;break;case 45:b===45&&re(v)==2&&(C=0)}}return i}function Lr(e,r,n,a,o,i,s,c,d,p,f){for(var y=o-1,x=o===0?i:[""],R=yr(x),b=0,C=0,L=0;b<a;++b)for(var _=0,S=Pe(e,y+1,y=Bt(C=s[b])),$=e;_<R;++_)($=Xr(C>0?x[_]+" "+S:A(S,/&\f/g,x[_])))&&(d[L++]=$);return He(e,r,n,o===0?gr:c,d,p,f)}function on(e,r,n){return He(e,r,n,Kr,ze(Zt()),Pe(e,2,-2),0)}function Dr(e,r,n,a){return He(e,r,n,mr,Pe(e,0,a),Pe(e,a+1,-1),a)}function ve(e,r){for(var n="",a=yr(e),o=0;o<a;o++)n+=r(e[o],o,e,r)||"";return n}function sn(e,r,n,a){switch(e.type){case Jt:if(e.children.length)break;case Gt:case mr:return e.return=e.return||e.value;case Kr:return"";case Hr:return e.return=e.value+"{"+ve(e.children,a)+"}";case gr:e.value=e.props.join(",")}return re(n=ve(e.children,a))?e.return=e.value+"{"+n+"}":""}function cn(e){var r=yr(e);return function(n,a,o,i){for(var s="",c=0;c<r;c++)s+=e[c](n,a,o,i)||"";return s}}function un(e){return function(r){r.root||(r=r.return)&&e(r)}}function fn(e){var r=Object.create(null);return function(n){return r[n]===void 0&&(r[n]=e(n)),r[n]}}var ln=function(r,n,a){for(var o=0,i=0;o=i,i=ne(),o===38&&i===12&&(n[a]=1),!ke(i);)Z();return Me(r,X)},dn=function(r,n){var a=-1,o=44;do switch(ke(o)){case 0:o===38&&ne()===12&&(n[a]=1),r[a]+=ln(X-1,n,a);break;case 2:r[a]+=qe(o);break;case 4:if(o===44){r[++a]=ne()===58?"&\f":"",n[a]=r[a].length;break}default:r[a]+=ze(o)}while(o=Z());return r},hn=function(r,n){return et(dn(Qr(r),n))},Yr=new WeakMap,pn=function(r){if(!(r.type!=="rule"||!r.parent||r.length<1)){for(var n=r.value,a=r.parent,o=r.column===a.column&&r.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(r.props.length===1&&n.charCodeAt(0)!==58&&!Yr.get(a))&&!o){Yr.set(r,!0);for(var i=[],s=hn(n,i),c=a.props,d=0,p=0;d<s.length;d++)for(var f=0;f<c.length;f++,p++)r.props[p]=i[d]?s[d].replace(/&\f/g,c[f]):c[f]+" "+s[d]}}},vn=function(r){if(r.type==="decl"){var n=r.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(r.return="",r.value="")}};function rt(e,r){switch(Kt(e,r)){case 5103:return M+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return M+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return M+e+Je+e+B+e+e;case 6828:case 4268:return M+e+B+e+e;case 6165:return M+e+B+"flex-"+e+e;case 5187:return M+e+A(e,/(\w+).+(:[^]+)/,M+"box-$1$2"+B+"flex-$1$2")+e;case 5443:return M+e+B+"flex-item-"+A(e,/flex-|-self/,"")+e;case 4675:return M+e+B+"flex-line-pack"+A(e,/align-content|flex-|-self/,"")+e;case 5548:return M+e+B+A(e,"shrink","negative")+e;case 5292:return M+e+B+A(e,"basis","preferred-size")+e;case 6060:return M+"box-"+A(e,"-grow","")+M+e+B+A(e,"grow","positive")+e;case 4554:return M+A(e,/([^-])(transform)/g,"$1"+M+"$2")+e;case 6187:return A(A(A(e,/(zoom-|grab)/,M+"$1"),/(image-set)/,M+"$1"),e,"")+e;case 5495:case 3959:return A(e,/(image-set\([^]*)/,M+"$1$`$1");case 4968:return A(A(e,/(.+:)(flex-)?(.*)/,M+"box-pack:$3"+B+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+M+e+e;case 4095:case 3583:case 4068:case 2532:return A(e,/(.+)-inline(.+)/,M+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(re(e)-1-r>6)switch(J(e,r+1)){case 109:if(J(e,r+4)!==45)break;case 102:return A(e,/(.+:)(.+)-([^]+)/,"$1"+M+"$2-$3$1"+Je+(J(e,r+3)==108?"$3":"$2-$3"))+e;case 115:return~fr(e,"stretch")?rt(A(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(J(e,r+1)!==115)break;case 6444:switch(J(e,re(e)-3-(~fr(e,"!important")&&10))){case 107:return A(e,":",":"+M)+e;case 101:return A(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+M+(J(e,14)===45?"inline-":"")+"box$3$1"+M+"$2$3$1"+B+"$2box$3")+e}break;case 5936:switch(J(e,r+11)){case 114:return M+e+B+A(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return M+e+B+A(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return M+e+B+A(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return M+e+B+e+e}return e}var gn=function(r,n,a,o){if(r.length>-1&&!r.return)switch(r.type){case mr:r.return=rt(r.value,r.length);break;case Hr:return ve([Te(r,{value:A(r.value,"@","@"+M)})],o);case gr:if(r.length)return Xt(r.props,function(i){switch(Ht(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ve([Te(r,{props:[A(i,/:(read-\w+)/,":"+Je+"$1")]})],o);case"::placeholder":return ve([Te(r,{props:[A(i,/:(plac\w+)/,":"+M+"input-$1")]}),Te(r,{props:[A(i,/:(plac\w+)/,":"+Je+"$1")]}),Te(r,{props:[A(i,/:(plac\w+)/,B+"input-$1")]})],o)}return""})}},mn=[gn],yn=function(r){var n=r.key;if(n==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(C){var L=C.getAttribute("data-emotion");L.indexOf(" ")!==-1&&(document.head.appendChild(C),C.setAttribute("data-s",""))})}var o=r.stylisPlugins||mn,i={},s,c=[];s=r.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(C){for(var L=C.getAttribute("data-emotion").split(" "),_=1;_<L.length;_++)i[L[_]]=!0;c.push(C)});var d,p=[pn,vn];{var f,y=[sn,un(function(C){f.insert(C)})],x=cn(p.concat(o,y)),R=function(L){return ve(an(L),x)};d=function(L,_,S,$){f=S,R(L?L+"{"+_.styles+"}":_.styles),$&&(b.inserted[_.name]=!0)}}var b={key:n,sheet:new Ut({key:n,container:s,nonce:r.nonce,speedy:r.speedy,prepend:r.prepend,insertionPoint:r.insertionPoint}),nonce:r.nonce,inserted:i,registered:{},insert:d};return b.sheet.hydrate(c),b},dr={exports:{}},j={};/** @license React v16.13.1
|
|
31
|
+
* react-is.production.min.js
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/var Wr;function En(){if(Wr)return j;Wr=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,C=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function $(l){if(typeof l=="object"&&l!==null){var g=l.$$typeof;switch(g){case r:switch(l=l.type,l){case d:case p:case a:case i:case o:case y:return l;default:switch(l=l&&l.$$typeof,l){case c:case f:case b:case R:case s:return l;default:return g}}case n:return g}}}function D(l){return $(l)===p}return j.AsyncMode=d,j.ConcurrentMode=p,j.ContextConsumer=c,j.ContextProvider=s,j.Element=r,j.ForwardRef=f,j.Fragment=a,j.Lazy=b,j.Memo=R,j.Portal=n,j.Profiler=i,j.StrictMode=o,j.Suspense=y,j.isAsyncMode=function(l){return D(l)||$(l)===d},j.isConcurrentMode=D,j.isContextConsumer=function(l){return $(l)===c},j.isContextProvider=function(l){return $(l)===s},j.isElement=function(l){return typeof l=="object"&&l!==null&&l.$$typeof===r},j.isForwardRef=function(l){return $(l)===f},j.isFragment=function(l){return $(l)===a},j.isLazy=function(l){return $(l)===b},j.isMemo=function(l){return $(l)===R},j.isPortal=function(l){return $(l)===n},j.isProfiler=function(l){return $(l)===i},j.isStrictMode=function(l){return $(l)===o},j.isSuspense=function(l){return $(l)===y},j.isValidElementType=function(l){return typeof l=="string"||typeof l=="function"||l===a||l===p||l===i||l===o||l===y||l===x||typeof l=="object"&&l!==null&&(l.$$typeof===b||l.$$typeof===R||l.$$typeof===s||l.$$typeof===c||l.$$typeof===f||l.$$typeof===L||l.$$typeof===_||l.$$typeof===S||l.$$typeof===C)},j.typeOf=$,j}var F={};/** @license React v16.13.1
|
|
38
|
+
* react-is.development.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/var Vr;function bn(){return Vr||(Vr=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,C=e?Symbol.for("react.block"):60121,L=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function $(m){return typeof m=="string"||typeof m=="function"||m===a||m===p||m===i||m===o||m===y||m===x||typeof m=="object"&&m!==null&&(m.$$typeof===b||m.$$typeof===R||m.$$typeof===s||m.$$typeof===c||m.$$typeof===f||m.$$typeof===L||m.$$typeof===_||m.$$typeof===S||m.$$typeof===C)}function D(m){if(typeof m=="object"&&m!==null){var Ce=m.$$typeof;switch(Ce){case r:var de=m.type;switch(de){case d:case p:case a:case i:case o:case y:return de;default:var ce=de&&de.$$typeof;switch(ce){case c:case f:case b:case R:case s:return ce;default:return Ce}}case n:return Ce}}}var l=d,g=p,v=c,k=s,P=r,Y=f,G=a,Q=b,z=R,ae=n,se=i,Ae=o,Ie=y,ye=!1;function je(m){return ye||(ye=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Ee(m)||D(m)===d}function Ee(m){return D(m)===p}function Fe(m){return D(m)===c}function Ne(m){return D(m)===s}function Le(m){return typeof m=="object"&&m!==null&&m.$$typeof===r}function Qe(m){return D(m)===f}function er(m){return D(m)===a}function be(m){return D(m)===b}function Se(m){return D(m)===R}function fe(m){return D(m)===n}function Re(m){return D(m)===i}function le(m){return D(m)===o}function rr(m){return D(m)===y}F.AsyncMode=l,F.ConcurrentMode=g,F.ContextConsumer=v,F.ContextProvider=k,F.Element=P,F.ForwardRef=Y,F.Fragment=G,F.Lazy=Q,F.Memo=z,F.Portal=ae,F.Profiler=se,F.StrictMode=Ae,F.Suspense=Ie,F.isAsyncMode=je,F.isConcurrentMode=Ee,F.isContextConsumer=Fe,F.isContextProvider=Ne,F.isElement=Le,F.isForwardRef=Qe,F.isFragment=er,F.isLazy=be,F.isMemo=Se,F.isPortal=fe,F.isProfiler=Re,F.isStrictMode=le,F.isSuspense=rr,F.isValidElementType=$,F.typeOf=D}()),F}process.env.NODE_ENV==="production"?dr.exports=En():dr.exports=bn();var Sn=dr.exports,tt=Sn,Rn={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Cn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nt={};nt[tt.ForwardRef]=Rn;nt[tt.Memo]=Cn;var wn=!0;function xn(e,r,n){var a="";return n.split(" ").forEach(function(o){e[o]!==void 0?r.push(e[o]+";"):o&&(a+=o+" ")}),a}var at=function(r,n,a){var o=r.key+"-"+n.name;(a===!1||wn===!1)&&r.registered[o]===void 0&&(r.registered[o]=n.styles)},_n=function(r,n,a){at(r,n,a);var o=r.key+"-"+n.name;if(r.inserted[n.name]===void 0){var i=n;do r.insert(n===i?"."+o:"",i,r.sheet,!0),i=i.next;while(i!==void 0)}};function Tn(e){for(var r=0,n,a=0,o=e.length;o>=4;++a,o-=4)n=e.charCodeAt(a)&255|(e.charCodeAt(++a)&255)<<8|(e.charCodeAt(++a)&255)<<16|(e.charCodeAt(++a)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,r=(n&65535)*1540483477+((n>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(o){case 3:r^=(e.charCodeAt(a+2)&255)<<16;case 2:r^=(e.charCodeAt(a+1)&255)<<8;case 1:r^=e.charCodeAt(a)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}var On={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Pn=/[A-Z]|^ms/g,kn=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ot=function(r){return r.charCodeAt(1)===45},qr=function(r){return r!=null&&typeof r!="boolean"},sr=fn(function(e){return ot(e)?e:e.replace(Pn,"-$&").toLowerCase()}),Ur=function(r,n){switch(r){case"animation":case"animationName":if(typeof n=="string")return n.replace(kn,function(a,o,i){return te={name:o,styles:i,next:te},o})}return On[r]!==1&&!ot(r)&&typeof n=="number"&&n!==0?n+"px":n};function $e(e,r,n){if(n==null)return"";var a=n;if(a.__emotion_styles!==void 0)return a;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return te={name:o.name,styles:o.styles,next:te},o.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)te={name:s.name,styles:s.styles,next:te},s=s.next;var c=i.styles+";";return c}return $n(e,r,n)}case"function":{if(e!==void 0){var d=te,p=n(e);return te=d,$e(e,r,p)}break}}var f=n;return f}function $n(e,r,n){var a="";if(Array.isArray(n))for(var o=0;o<n.length;o++)a+=$e(e,r,n[o])+";";else for(var i in n){var s=n[i];if(typeof s!="object"){var c=s;qr(c)&&(a+=sr(i)+":"+Ur(i,c)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&r==null)for(var d=0;d<s.length;d++)qr(s[d])&&(a+=sr(i)+":"+Ur(i,s[d])+";");else{var p=$e(e,r,s);switch(i){case"animation":case"animationName":{a+=sr(i)+":"+p+";";break}default:a+=i+"{"+p+"}"}}}return a}var Gr=/label:\s*([^\s;{]+)\s*(;|$)/g,te;function Mn(e,r,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var a=!0,o="";te=void 0;var i=e[0];if(i==null||i.raw===void 0)a=!1,o+=$e(n,r,i);else{var s=i;o+=s[0]}for(var c=1;c<e.length;c++)if(o+=$e(n,r,e[c]),a){var d=i;o+=d[c]}Gr.lastIndex=0;for(var p="",f;(f=Gr.exec(o))!==null;)p+="-"+f[1];var y=Tn(o)+p;return{name:y,styles:o,next:te}}var An=function(r){return r()},In=ie.useInsertionEffect?ie.useInsertionEffect:!1,jn=In||An,it=ie.createContext(typeof HTMLElement<"u"?yn({key:"css"}):null);it.Provider;var Fn=function(r){return O.forwardRef(function(n,a){var o=O.useContext(it);return r(n,o,a)})},Nn=ie.createContext({}),Er={}.hasOwnProperty,hr="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ln=function(r,n){var a={};for(var o in n)Er.call(n,o)&&(a[o]=n[o]);return a[hr]=r,a},Dn=function(r){var n=r.cache,a=r.serialized,o=r.isStringTag;return at(n,a,o),jn(function(){return _n(n,a,o)}),null},Yn=Fn(function(e,r,n){var a=e.css;typeof a=="string"&&r.registered[a]!==void 0&&(a=r.registered[a]);var o=e[hr],i=[a],s="";typeof e.className=="string"?s=xn(r.registered,i,e.className):e.className!=null&&(s=e.className+" ");var c=Mn(i,void 0,ie.useContext(Nn));s+=r.key+"-"+c.name;var d={};for(var p in e)Er.call(e,p)&&p!=="css"&&p!==hr&&(d[p]=e[p]);return d.className=s,n&&(d.ref=n),ie.createElement(ie.Fragment,null,ie.createElement(Dn,{cache:r,serialized:c,isStringTag:typeof o=="string"}),ie.createElement(o,d))}),Wn=Yn,Xe=function(r,n,a){return Er.call(n,"css")?Nr.jsx(Wn,Ln(r,n),a):Nr.jsx(r,n,a)};function st(e){switch(e.toLowerCase()){case"sql":return Br.sql();case"json":return zr.json();default:return[]}}function ct(e){return["sql","json"].includes(e.toLowerCase())}function ut(e={}){return Lt.autocompletion(e)}function Vn(e){return[Ge.lintGutter(),Ge.linter(e)]}function ft(){return q.keymap.of([cr.indentWithTab])}const qn=[ft(),ut()],pr=q.EditorView.theme({"&":{backgroundColor:"#ffffff",color:"#333333"},".cm-gutters":{backgroundColor:"#f5f5f5",color:"#999999",border:"none"},".cm-activeLine":{backgroundColor:"rgba(0, 0, 0, 0.05)"},".cm-activeLineGutter":{backgroundColor:"rgba(0, 0, 0, 0.05)"},".cm-selectionMatch":{backgroundColor:"rgba(0, 0, 0, 0.05)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#333333"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(0, 0, 255, 0.1)"}}),lt=q.EditorView.theme({"&":{backgroundColor:"#1e1e1e",color:"#d4d4d4"},".cm-gutters":{backgroundColor:"#1e1e1e",color:"#8a8a8a",border:"none"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.07)"},".cm-activeLineGutter":{backgroundColor:"rgba(255, 255, 255, 0.07)"},".cm-selectionMatch":{backgroundColor:"rgba(255, 255, 255, 0.07)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#d4d4d4"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(255, 255, 255, 0.1)"}});function dt(e){switch(e){case"light":return pr;case"dark":return lt;default:return pr}}const vr=e=>{const r={value:"",readOnlyRanges:[]};let n=0;return e.forEach(a=>{const{content:o,editable:i}=a,s=n,c=s+o.length;r.value+=o,i||r.readOnlyRanges.push({start:s,end:c}),n=c}),r},Be=oe.StateEffect.define(),Jr=oe.StateField.define({create(){return q.Decoration.none},update(e,r){e=e.map(r.changes);for(const n of r.effects)if(n.is(Be))return console.log(2939),ht(n.value);return r.docChanged,e},provide(e){return q.EditorView.decorations.from(e)}});function ht(e){const r=[];return console.log(e,9999299),e.forEach(n=>{n.start<n.end&&r.push(q.Decoration.mark({inclusive:!0,attributes:{class:"cm-readOnly",style:"background-color: rgba(0, 0, 0, 0.05);"},priority:-100}).range(n.start,n.end))}),q.Decoration.set(r)}const br=new WeakMap;function pt(e){let r=e.map(n=>({...n}));return[Jr.init(()=>ht(r)),q.keymap.of([{key:"Enter",run:n=>{const a=n.state.selection.main,{from:o,to:i}=a;if(o!==i){for(const c of r)if(o<c.end&&i>c.start)return!1}let s=!1;for(const c of r)if(o>c.start&&o<c.end){s=!0;break}return s?!1:(n.dispatch({changes:{from:o,to:i,insert:`
|
|
45
|
+
`},selection:{anchor:o+1}}),!0)}}]),oe.EditorState.transactionFilter.of(n=>{if(!n.docChanged||n.isUserEvent("input.type.Enter")||n.isUserEvent("input.enter"))return n;let a=!1;return n.changes.iterChanges((o,i,s,c)=>{if(!(n.newDoc.sliceString(s,c)===`
|
|
46
|
+
`&&o===i)){for(const f of r)if(o===i){if(o>f.start&&o<f.end){a=!0;break}}else if(o<f.end&&i>f.start||o===f.start&&i>o||i===f.end&&o<i){a=!0;break}}}),a?[]:n}),q.EditorView.updateListener.of(n=>{if(n.docChanged){const a=Gn(r,n);!Un(r,a)?(r=a,br.set(n.view,a),n.view.dispatch({effects:Be.of(a)})):n.view.dispatch({effects:Be.of(a)})}}),q.EditorView.updateListener.of(n=>{n.docChanged&&setTimeout(()=>{n.view.state.field(Jr,!1)&&n.view.dispatch({})},10)})]}function Un(e,r){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n].start!==r[n].start||e[n].end!==r[n].end)return!1;return!0}function Gn(e,r){var o;if(!r.docChanged)return e;let n=!1;const a=e.map(i=>{const s={...i};return r.changes.iterChanges((c,d,p,f)=>{const y=f-p,x=d-c,R=y-x;if(c===0&&(n=!0),c===0&&y>0&&i.start===0){s.start=y,s.end+=R;return}if(d<=i.start)s.start+=R,s.end+=R;else if(c>=i.start&&c<i.end&&d>=i.end)s.end=c;else if(!(c>=i.start&&d<=i.end)){if(c<i.end&&d>i.end){const b=i.end-c;s.end=c+Math.min(b,y)}}}),s});if(n&&a.length>0){const i=((o=r.changes.newDoc)==null?void 0:o.toString())||"";let s=0;for(let c=0;c<i.length&&/\s/.test(i[c]);c++)s++;a[0].start===0&&s>0&&(a[0].start=s)}return a.filter(i=>i.start<i.end)}function vt(e){return br.get(e)||[]}function Oe(e,r){const n=r.map(a=>({...a}));br.set(e,n),e.dispatch({effects:Be.of(n)}),setTimeout(()=>{e.dom&&document.contains(e.dom)&&e.dispatch({})},10)}const Ze=({value:e,onChange:r,extensions:n=[],height:a="300px",disabled:o=!1,className:i="",style:s={},placeholder:c="",onEditorViewCreated:d})=>{const p=O.useRef(null),f=O.useRef();return O.useEffect(()=>{if(!p.current)return;const y=[q.keymap.of([cr.indentWithTab]),q.EditorView.lineWrapping,Ye.syntaxHighlighting(Ye.defaultHighlightStyle),oe.EditorState.allowMultipleSelections.of(!0),c?q.placeholder(c):[],q.EditorView.updateListener.of(b=>{if(b.docChanged&&r){const C={value:b.state.doc.toString(),readOnlyRanges:[]};r(C)}})];o&&y.push(oe.EditorState.readOnly.of(!0));const x=oe.EditorState.create({doc:e,extensions:[...y,...n]}),R=new q.EditorView({state:x,parent:p.current});return f.current=R,d&&d(R),()=>{var b;(b=f.current)==null||b.destroy()}},[]),O.useEffect(()=>{f.current&&e!==f.current.state.doc.toString()&&f.current.dispatch({changes:{from:0,to:f.current.state.doc.length,insert:e}})},[e]),O.useEffect(()=>{if(!f.current||!p.current)return;const y=f.current.state.doc.toString();f.current.destroy();const x=[q.keymap.of([cr.indentWithTab]),q.EditorView.lineWrapping,Ye.syntaxHighlighting(Ye.defaultHighlightStyle),oe.EditorState.allowMultipleSelections.of(!0),c?q.placeholder(c):[],q.EditorView.updateListener.of(C=>{if(C.docChanged&&r){const L={value:C.state.doc.toString(),readOnlyRanges:[]};r(L)}})];o&&x.push(oe.EditorState.readOnly.of(!0));const R=oe.EditorState.create({doc:y,extensions:[...x,...n]}),b=new q.EditorView({state:R,parent:p.current});f.current=b,d&&d(b)},[o]),Xe("div",{ref:p,className:`senyao-editor ${o?"disabled":""} ${i}`,style:{height:a,...s}})},Jn=({value:e,onChange:r,language:n="json",extensions:a=[],theme:o="light",...i})=>{const s=O.useMemo(()=>{const c=ct(n)?st(n):[],d=dt(o);return[c,d,...a]},[n,a,o]);return Xe(Ze,{value:e,onChange:r,extensions:s,...i})},Bn=({value:e,onChange:r,extensions:n=[],readOnlyRanges:a=[],manageReadOnlyRanges:o=!0,...i})=>{const s=O.useRef(null),[c,d]=O.useState(a),p=O.useRef(e),[f,y]=O.useState(null),x=O.useRef(!1),R=O.useRef(new Map);O.useEffect(()=>{if(o&&a.length>0&&!f){const g=[];let v=0;for(let k=0;k<a.length;k++){const P=a[k];P.start>v&&g.push({content:e.substring(v,P.start),editable:!0}),g.push({content:e.substring(P.start,P.end),editable:!1}),v=P.end}v<e.length&&g.push({content:e.substring(v),editable:!0}),y(g)}},[o,a,e,f]),O.useEffect(()=>{if(e){const g=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],v=new Map;g.forEach(k=>{const P=e.indexOf(k);P>=0&&v.set(k,P)}),R.current=v}},[]);const b=O.useMemo(()=>{const g=[Br.sql()];return c.length>0&&g.push(pt(c)),[...g,...n]},[n,c]),C=O.useCallback((g,v,k=0)=>{const P=g.indexOf(v,k);return P>=0?P:null},[]),L=O.useCallback((g,v)=>{if(!o||!g||g.length===0)return g;const k=[...g];let P=0;for(let G=0;G<g.length;G++){const Q=g[G];if(!Q.editable){const z=C(v,Q.content,P);z!==null&&(G>0&&g[G-1].editable&&z>P&&(k[G-1]={...k[G-1],content:v.substring(P,z)}),P=z+Q.content.length)}}const Y=g[g.length-1];return Y.editable&&P<v.length&&(k[g.length-1]={...Y,content:v.substring(P)}),k},[o,C]),_=O.useCallback(g=>{let v=!1;return R.current.forEach((k,P)=>{const Y=g.indexOf(P);Y>=0&&Math.abs(Y-k)>0&&(R.current.set(P,Y),Y>k&&(k===0||k<15)&&(v=!0))}),v},[]),S=O.useCallback(()=>{if(!s.current)return;const g=s.current,v=g.state.doc.toString(),k=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],P=g.state.selection;let Y=!1;for(const G of k){const Q=v.indexOf(G);if(Q>=0){g.dispatch({selection:{anchor:Q,head:Q+G.length},scrollIntoView:!1}),Y=!0;break}}Y&&setTimeout(()=>{g.dom&&document.contains(g.dom)&&g.dispatch({selection:P,scrollIntoView:!1})},10)},[]),$=O.useCallback(g=>{const v=g.value,k=p.current;k!==v&&v.length>k.length&&!k.startsWith(v.substring(0,5))&&v.includes(k.substring(0,10))&&(x.current=!0,_(v)&&setTimeout(()=>{S()},10)),p.current=v;const P=s.current?vt(s.current):c;if(o&&f){const Y=L(f,v);y(Y);const{readOnlyRanges:G}=vr(Y);d(G),s.current&&Oe(s.current,G),r&&r({value:v,readOnlyRanges:G})}else r&&r({value:v,readOnlyRanges:P})},[r,o,f,c,L,_,S]);O.useEffect(()=>{!o&&JSON.stringify(a)!==JSON.stringify(c)&&(d(a),s.current&&Oe(s.current,a))},[a,c,o]),O.useEffect(()=>{if(o&&f){const{readOnlyRanges:g}=vr(f);JSON.stringify(g)!==JSON.stringify(c)&&(d(g),s.current&&Oe(s.current,g))}},[f,c,o]),O.useEffect(()=>{s.current&&x.current&&(x.current=!1,s.current.dispatch({}))},[e]);const D=O.useCallback(g=>{if(s.current=g,c.length>0&&Oe(g,c),e){const v=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],k=new Map;v.forEach(P=>{const Y=e.indexOf(P);Y>=0&&k.set(P,Y)}),R.current=k}},[c,e]),l=O.useCallback(g=>{$(g),s.current&&setTimeout(()=>{s.current&&s.current.dispatch({})},0)},[$]);return Xe(Ze,{value:e,onChange:l,extensions:b,onEditorViewCreated:D,...i})},zn=({value:e,onChange:r,extensions:n=[],enableFormatting:a=!0,...o})=>{const i=O.useCallback(p=>{const f=p.state.doc.toString(),y=[];try{JSON.parse(f)}catch(x){x instanceof Error&&y.push({from:0,to:f.length,message:x.message,severity:"error"})}return y},[]),s=O.useCallback(p=>{try{const f=JSON.parse(p);return JSON.stringify(f,null,2)}catch{return p}},[]),c=O.useCallback(p=>{if(a){const f=s(p);if(f!==p){r==null||r(f);return}}r==null||r(p)},[a,s,r]),d=O.useMemo(()=>[zr.json(),Ge.lintGutter(),Ge.linter(i),...n],[i,n]);return Xe(Ze,{value:e,onChange:c,extensions:d,...o})};exports.Editor=Jn;exports.GenericEditor=Ze;exports.JSONEditor=zn;exports.SQLEditor=Bn;exports.blocksToEditorData=vr;exports.commonExtensions=qn;exports.createAutocompletionExtension=ut;exports.createKeymapExtension=ft;exports.createLintExtension=Vn;exports.darkTheme=lt;exports.getCurrentReadOnlyRanges=vt;exports.getLanguageExtension=st;exports.getThemeExtension=dt;exports.isSupportedLanguage=ct;exports.lightTheme=pr;exports.readOnlyRanges=pt;exports.updateReadOnlyRanges=Oe;
|