@senyao-design-system/editor 0.0.6 → 0.0.7

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.
@@ -1 +1 @@
1
- .senyao-editor{width:100%;border:1px solid #ddd;border-radius:4px;overflow:hidden;font-family:Menlo,Monaco,Courier New,monospace;transition:border-color .2s,box-shadow .2s}.senyao-editor:focus-within{border-color:#00ae87;box-shadow:0 0 0 2px #00ae8733}.senyao-editor .cm-editor{height:100%}.senyao-editor .cm-scroller{overflow:auto}.senyao-editor .cm-content{padding:8px 4px;text-align:left!important}.senyao-editor .cm-readonly{background-color:#f5f5f5}.senyao-editor .cm-readOnly{background-color:#0000000d!important;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}.senyao-editor .cm-activeLine{background-color:#0000000a}.senyao-editor .cm-panel.cm-search{background:#fff;border:1px solid #e1e5e9;border-radius:6px;box-shadow:0 4px 12px #0000001a;padding:12px;font-size:14px}.senyao-editor .cm-search label{font-size:13px;color:#6c757d;margin-right:8px}.senyao-editor .cm-search input[type=text]{border:1px solid #ced4da;border-radius:4px;padding:6px 8px;font-size:13px;margin-right:6px}.senyao-editor .cm-search input[type=text]:focus{outline:none;border-color:#00ae87;box-shadow:0 0 0 2px #00ae8733}.senyao-editor .cm-search button{background:#f8f9fa;border:1px solid #ced4da;border-radius:4px;padding:6px 10px;font-size:12px;cursor:pointer;margin-right:4px}.senyao-editor .cm-search button:hover{background:#e9ecef}.senyao-editor .cm-search button:active{background:#dee2e6}.senyao-editor .cm-searchMatch{background-color:#fff3cd;border:1px solid #ffeaa7;border-radius:2px;color:#856404}.senyao-editor .cm-searchMatch-selected{background-color:#ffc107;border-color:#ffb300;color:#212529}.senyao-editor .cm-selectionMatch{background-color:#00ae8726;border-radius:2px}
1
+ .senyao-editor{width:100%;border:1px solid #ddd;border-radius:4px;overflow:hidden;font-family:Menlo,Monaco,Courier New,monospace;transition:border-color .2s,box-shadow .2s}.senyao-editor:focus-within{border-color:#00ae87;box-shadow:0 0 0 2px #00ae8733}.senyao-editor .cm-editor{height:100%}.senyao-editor .cm-scroller{overflow:auto}.senyao-editor .cm-content{padding:8px 4px;text-align:left!important}.senyao-editor .cm-readonly{background-color:#f5f5f5}.senyao-editor .cm-readOnly{background-color:#0000000d!important;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.readonly{background-color:#fafafa;cursor:default}.senyao-editor.readonly .cm-content{cursor:default}.senyao-editor.readonly:focus-within{border-color:#d9d9d9;box-shadow:0 0 0 2px #0000000f}.senyao-editor .cm-placeholder{color:#999}.senyao-editor .cm-activeLine{background-color:#0000000a}.senyao-editor .cm-panel.cm-search{background:#fff;border:1px solid #e1e5e9;border-radius:6px;box-shadow:0 4px 12px #0000001a;padding:12px;font-size:14px}.senyao-editor .cm-search label{font-size:13px;color:#6c757d;margin-right:8px}.senyao-editor .cm-search input[type=text]{border:1px solid #ced4da;border-radius:4px;padding:6px 8px;font-size:13px;margin-right:6px}.senyao-editor .cm-search input[type=text]:focus{outline:none;border-color:#00ae87;box-shadow:0 0 0 2px #00ae8733}.senyao-editor .cm-search button{background:#f8f9fa;border:1px solid #ced4da;border-radius:4px;padding:6px 10px;font-size:12px;cursor:pointer;margin-right:4px}.senyao-editor .cm-search button:hover{background:#e9ecef}.senyao-editor .cm-search button:active{background:#dee2e6}.senyao-editor .cm-searchMatch{background-color:#fff3cd;border:1px solid #ffeaa7;border-radius:2px;color:#856404}.senyao-editor .cm-searchMatch-selected{background-color:#ffc107;border-color:#ffb300;color:#212529}.senyao-editor .cm-selectionMatch{background-color:#00ae8726;border-radius:2px}
@@ -4,6 +4,6 @@ import { EditorProps, EditorRef } from '../../../types';
4
4
  * 通用编辑器组件
5
5
  * 作为所有特定编辑器的基础组件
6
6
  */
7
- export declare const GenericEditor: ({ value, onChange, extensions, height, disabled, className, style, placeholder: placeholderText, showLineNumbers, onEditorViewCreated, locale, }: EditorProps, ref: React.Ref<EditorRef>) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const GenericEditor: ({ value, onChange, extensions, height, disabled, readOnly, className, style, placeholder: placeholderText, showLineNumbers, onEditorViewCreated, locale, }: EditorProps, ref: React.Ref<EditorRef>) => import("react/jsx-runtime").JSX.Element;
8
8
  declare const _default: import('../../react').ForwardRefExoticComponent<EditorProps & import('../../react').RefAttributes<EditorRef>>;
9
9
  export default _default;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),Fr=require("@codemirror/lang-sql"),Lr=require("@codemirror/lang-json"),x=require("@codemirror/view"),ge=require("@codemirror/commands"),Vt=require("@codemirror/autocomplete"),mr=require("@codemirror/lint"),se=require("@codemirror/language"),V=require("@lezer/highlight"),R=require("@codemirror/state");function Nn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const me=Nn(k);var Ot={exports:{}},Ye={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Fr=require("@codemirror/lang-sql"),Lr=require("@codemirror/lang-json"),x=require("@codemirror/view"),ge=require("@codemirror/commands"),Vt=require("@codemirror/autocomplete"),mr=require("@codemirror/lint"),se=require("@codemirror/language"),V=require("@lezer/highlight"),R=require("@codemirror/state");function Nn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const me=Nn(T);var Mt={exports:{}},Ye={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var yr;function In(){if(yr)return Ye;yr=1;var e=k,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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,l,d){var f,v={},T=null,p=null;d!==void 0&&(T=""+d),l.key!==void 0&&(T=""+l.key),l.ref!==void 0&&(p=l.ref);for(f in l)n.call(l,f)&&!i.hasOwnProperty(f)&&(v[f]=l[f]);if(c&&c.defaultProps)for(f in l=c.defaultProps,l)v[f]===void 0&&(v[f]=l[f]);return{$$typeof:t,type:c,key:T,ref:p,props:v,_owner:o.current}}return Ye.Fragment=r,Ye.jsx=s,Ye.jsxs=s,Ye}var ze={};/**
9
+ */var yr;function In(){if(yr)return Ye;yr=1;var e=T,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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,l,d){var f,m={},P=null,E=null;d!==void 0&&(P=""+d),l.key!==void 0&&(P=""+l.key),l.ref!==void 0&&(E=l.ref);for(f in l)n.call(l,f)&&!i.hasOwnProperty(f)&&(m[f]=l[f]);if(c&&c.defaultProps)for(f in l=c.defaultProps,l)m[f]===void 0&&(m[f]=l[f]);return{$$typeof:t,type:c,key:P,ref:E,props:m,_owner:o.current}}return Ye.Fragment=r,Ye.jsx=s,Ye.jsxs=s,Ye}var ze={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,38 +14,38 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var vr;function $n(){return vr||(vr=1,process.env.NODE_ENV!=="production"&&function(){var e=k,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=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"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),_=Symbol.iterator,m="@@iterator";function E(a){if(a===null||typeof a!="object")return null;var u=_&&a[_]||a[m];return typeof u=="function"?u:null}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(a){{for(var u=arguments.length,g=new Array(u>1?u-1:0),P=1;P<u;P++)g[P-1]=arguments[P];w("error",a,g)}}function w(a,u,g){{var P=C.ReactDebugCurrentFrame,W=P.getStackAddendum();W!==""&&(u+="%s",g=g.concat([W]));var Y=g.map(function(L){return String(L)});Y.unshift("Warning: "+u),Function.prototype.apply.call(console[a],console,Y)}}var O=!1,h=!1,z=!1,N=!1,Ie=!1,ve;ve=Symbol.for("react.module.reference");function Ce(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||Ie||a===o||a===d||a===f||N||a===p||O||h||z||typeof a=="object"&&a!==null&&(a.$$typeof===T||a.$$typeof===v||a.$$typeof===s||a.$$typeof===c||a.$$typeof===l||a.$$typeof===ve||a.getModuleId!==void 0))}function Re(a,u,g){var P=a.displayName;if(P)return P;var W=u.displayName||u.name||"";return W!==""?g+"("+W+")":g}function be(a){return a.displayName||"Context"}function ee(a){if(a==null)return null;if(typeof a.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var u=a;return be(u)+".Consumer";case s:var g=a;return be(g._context)+".Provider";case l:return Re(a,a.render,"ForwardRef");case v:var P=a.displayName||null;return P!==null?P:ee(a.type)||"Memo";case T:{var W=a,Y=W._payload,L=W._init;try{return ee(L(Y))}catch{return null}}}return null}var ce=Object.assign,he=0,b,M,A,D,U,G,ie;function de(){}de.__reactDisabledLog=!0;function bt(){{if(he===0){b=console.log,M=console.info,A=console.warn,D=console.error,U=console.group,G=console.groupCollapsed,ie=console.groupEnd;var a={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}he++}}function xt(){{if(he--,he===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ce({},a,{value:b}),info:ce({},a,{value:M}),warn:ce({},a,{value:A}),error:ce({},a,{value:D}),group:ce({},a,{value:U}),groupCollapsed:ce({},a,{value:G}),groupEnd:ce({},a,{value:ie})})}he<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=C.ReactCurrentDispatcher,We;function we(a,u,g){{if(We===void 0)try{throw Error()}catch(W){var P=W.stack.trim().match(/\n( *(at )?)/);We=P&&P[1]||""}return`
18
- `+We+a}}var je=!1,ke;{var Et=typeof WeakMap=="function"?WeakMap:Map;ke=new Et}function S(a,u){if(!a||je)return"";{var g=ke.get(a);if(g!==void 0)return g}var P;je=!0;var W=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=$e.current,$e.current=null,bt();try{if(u){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(te){P=te}Reflect.construct(a,[],L)}else{try{L.call()}catch(te){P=te}a.call(L.prototype)}}else{try{throw Error()}catch(te){P=te}a()}}catch(te){if(te&&P&&typeof te.stack=="string"){for(var F=te.stack.split(`
19
- `),Z=P.stack.split(`
17
+ */var vr;function $n(){return vr||(vr=1,process.env.NODE_ENV!=="production"&&function(){var e=T,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=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"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),w=Symbol.iterator,v="@@iterator";function y(a){if(a===null||typeof a!="object")return null;var u=w&&a[w]||a[v];return typeof u=="function"?u:null}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(a){{for(var u=arguments.length,p=new Array(u>1?u-1:0),_=1;_<u;_++)p[_-1]=arguments[_];C("error",a,p)}}function C(a,u,p){{var _=k.ReactDebugCurrentFrame,W=_.getStackAddendum();W!==""&&(u+="%s",p=p.concat([W]));var Y=p.map(function(L){return String(L)});Y.unshift("Warning: "+u),Function.prototype.apply.call(console[a],console,Y)}}var M=!1,h=!1,z=!1,N=!1,Ie=!1,ve;ve=Symbol.for("react.module.reference");function Ce(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||Ie||a===o||a===d||a===f||N||a===E||M||h||z||typeof a=="object"&&a!==null&&(a.$$typeof===P||a.$$typeof===m||a.$$typeof===s||a.$$typeof===c||a.$$typeof===l||a.$$typeof===ve||a.getModuleId!==void 0))}function Re(a,u,p){var _=a.displayName;if(_)return _;var W=u.displayName||u.name||"";return W!==""?p+"("+W+")":p}function be(a){return a.displayName||"Context"}function ee(a){if(a==null)return null;if(typeof a.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var u=a;return be(u)+".Consumer";case s:var p=a;return be(p._context)+".Provider";case l:return Re(a,a.render,"ForwardRef");case m:var _=a.displayName||null;return _!==null?_:ee(a.type)||"Memo";case P:{var W=a,Y=W._payload,L=W._init;try{return ee(L(Y))}catch{return null}}}return null}var ce=Object.assign,he=0,b,O,A,D,U,G,ie;function de(){}de.__reactDisabledLog=!0;function bt(){{if(he===0){b=console.log,O=console.info,A=console.warn,D=console.error,U=console.group,G=console.groupCollapsed,ie=console.groupEnd;var a={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}he++}}function xt(){{if(he--,he===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ce({},a,{value:b}),info:ce({},a,{value:O}),warn:ce({},a,{value:A}),error:ce({},a,{value:D}),group:ce({},a,{value:U}),groupCollapsed:ce({},a,{value:G}),groupEnd:ce({},a,{value:ie})})}he<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=k.ReactCurrentDispatcher,We;function we(a,u,p){{if(We===void 0)try{throw Error()}catch(W){var _=W.stack.trim().match(/\n( *(at )?)/);We=_&&_[1]||""}return`
18
+ `+We+a}}var je=!1,ke;{var Et=typeof WeakMap=="function"?WeakMap:Map;ke=new Et}function S(a,u){if(!a||je)return"";{var p=ke.get(a);if(p!==void 0)return p}var _;je=!0;var W=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=$e.current,$e.current=null,bt();try{if(u){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(te){_=te}Reflect.construct(a,[],L)}else{try{L.call()}catch(te){_=te}a.call(L.prototype)}}else{try{throw Error()}catch(te){_=te}a()}}catch(te){if(te&&_&&typeof te.stack=="string"){for(var F=te.stack.split(`
19
+ `),Z=_.stack.split(`
20
20
  `),B=F.length-1,H=Z.length-1;B>=1&&H>=0&&F[B]!==Z[H];)H--;for(;B>=1&&H>=0;B--,H--)if(F[B]!==Z[H]){if(B!==1||H!==1)do if(B--,H--,H<0||F[B]!==Z[H]){var ae=`
21
- `+F[B].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),typeof a=="function"&&ke.set(a,ae),ae}while(B>=1&&H>=0);break}}}finally{je=!1,$e.current=Y,xt(),Error.prepareStackTrace=W}var Pe=a?a.displayName||a.name:"",Ee=Pe?we(Pe):"";return typeof a=="function"&&ke.set(a,Ee),Ee}function qe(a,u,g){return S(a,!1)}function Te(a){var u=a.prototype;return!!(u&&u.isReactComponent)}function xe(a,u,g){if(a==null)return"";if(typeof a=="function")return S(a,Te(a));if(typeof a=="string")return we(a);switch(a){case d:return we("Suspense");case f:return we("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case l:return qe(a.render);case v:return xe(a.type,u,g);case T:{var P=a,W=P._payload,Y=P._init;try{return xe(Y(W),u,g)}catch{}}}return""}var Ve=Object.prototype.hasOwnProperty,rr={},nr=C.ReactDebugCurrentFrame;function Ze(a){if(a){var u=a._owner,g=xe(a.type,a._source,u?u.type:null);nr.setExtraStackFrame(g)}else nr.setExtraStackFrame(null)}function gn(a,u,g,P,W){{var Y=Function.call.bind(Ve);for(var L in a)if(Y(a,L)){var F=void 0;try{if(typeof a[L]!="function"){var Z=Error((P||"React class")+": "+g+" type `"+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[L]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}F=a[L](u,L,P,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(B){F=B}F&&!(F instanceof Error)&&(Ze(W),y("%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).",P||"React class",g,L,typeof F),Ze(null)),F instanceof Error&&!(F.message in rr)&&(rr[F.message]=!0,Ze(W),y("Failed %s type: %s",g,F.message),Ze(null))}}}var pn=Array.isArray;function St(a){return pn(a)}function mn(a){{var u=typeof Symbol=="function"&&Symbol.toStringTag,g=u&&a[Symbol.toStringTag]||a.constructor.name||"Object";return g}}function yn(a){try{return or(a),!1}catch{return!0}}function or(a){return""+a}function ir(a){if(yn(a))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mn(a)),or(a)}var ar=C.ReactCurrentOwner,vn={key:!0,ref:!0,__self:!0,__source:!0},sr,cr;function bn(a){if(Ve.call(a,"ref")){var u=Object.getOwnPropertyDescriptor(a,"ref").get;if(u&&u.isReactWarning)return!1}return a.ref!==void 0}function xn(a){if(Ve.call(a,"key")){var u=Object.getOwnPropertyDescriptor(a,"key").get;if(u&&u.isReactWarning)return!1}return a.key!==void 0}function En(a,u){typeof a.ref=="string"&&ar.current}function Sn(a,u){{var g=function(){sr||(sr=!0,y("%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))};g.isReactWarning=!0,Object.defineProperty(a,"key",{get:g,configurable:!0})}}function Cn(a,u){{var g=function(){cr||(cr=!0,y("%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))};g.isReactWarning=!0,Object.defineProperty(a,"ref",{get:g,configurable:!0})}}var Rn=function(a,u,g,P,W,Y,L){var F={$$typeof:t,type:a,key:u,ref:g,props:L,_owner:Y};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function wn(a,u,g,P,W){{var Y,L={},F=null,Z=null;g!==void 0&&(ir(g),F=""+g),xn(u)&&(ir(u.key),F=""+u.key),bn(u)&&(Z=u.ref,En(u,W));for(Y in u)Ve.call(u,Y)&&!vn.hasOwnProperty(Y)&&(L[Y]=u[Y]);if(a&&a.defaultProps){var B=a.defaultProps;for(Y in B)L[Y]===void 0&&(L[Y]=B[Y])}if(F||Z){var H=typeof a=="function"?a.displayName||a.name||"Unknown":a;F&&Sn(L,H),Z&&Cn(L,H)}return Rn(a,F,Z,W,P,ar.current,L)}}var Ct=C.ReactCurrentOwner,lr=C.ReactDebugCurrentFrame;function _e(a){if(a){var u=a._owner,g=xe(a.type,a._source,u?u.type:null);lr.setExtraStackFrame(g)}else lr.setExtraStackFrame(null)}var Rt;Rt=!1;function wt(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function ur(){{if(Ct.current){var a=ee(Ct.current.type);if(a)return`
21
+ `+F[B].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),typeof a=="function"&&ke.set(a,ae),ae}while(B>=1&&H>=0);break}}}finally{je=!1,$e.current=Y,xt(),Error.prepareStackTrace=W}var Pe=a?a.displayName||a.name:"",Ee=Pe?we(Pe):"";return typeof a=="function"&&ke.set(a,Ee),Ee}function qe(a,u,p){return S(a,!1)}function Te(a){var u=a.prototype;return!!(u&&u.isReactComponent)}function xe(a,u,p){if(a==null)return"";if(typeof a=="function")return S(a,Te(a));if(typeof a=="string")return we(a);switch(a){case d:return we("Suspense");case f:return we("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case l:return qe(a.render);case m:return xe(a.type,u,p);case P:{var _=a,W=_._payload,Y=_._init;try{return xe(Y(W),u,p)}catch{}}}return""}var Ve=Object.prototype.hasOwnProperty,rr={},nr=k.ReactDebugCurrentFrame;function Ze(a){if(a){var u=a._owner,p=xe(a.type,a._source,u?u.type:null);nr.setExtraStackFrame(p)}else nr.setExtraStackFrame(null)}function gn(a,u,p,_,W){{var Y=Function.call.bind(Ve);for(var L in a)if(Y(a,L)){var F=void 0;try{if(typeof a[L]!="function"){var Z=Error((_||"React class")+": "+p+" type `"+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[L]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}F=a[L](u,L,_,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(B){F=B}F&&!(F instanceof Error)&&(Ze(W),g("%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).",_||"React class",p,L,typeof F),Ze(null)),F instanceof Error&&!(F.message in rr)&&(rr[F.message]=!0,Ze(W),g("Failed %s type: %s",p,F.message),Ze(null))}}}var pn=Array.isArray;function St(a){return pn(a)}function mn(a){{var u=typeof Symbol=="function"&&Symbol.toStringTag,p=u&&a[Symbol.toStringTag]||a.constructor.name||"Object";return p}}function yn(a){try{return or(a),!1}catch{return!0}}function or(a){return""+a}function ir(a){if(yn(a))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mn(a)),or(a)}var ar=k.ReactCurrentOwner,vn={key:!0,ref:!0,__self:!0,__source:!0},sr,cr;function bn(a){if(Ve.call(a,"ref")){var u=Object.getOwnPropertyDescriptor(a,"ref").get;if(u&&u.isReactWarning)return!1}return a.ref!==void 0}function xn(a){if(Ve.call(a,"key")){var u=Object.getOwnPropertyDescriptor(a,"key").get;if(u&&u.isReactWarning)return!1}return a.key!==void 0}function En(a,u){typeof a.ref=="string"&&ar.current}function Sn(a,u){{var p=function(){sr||(sr=!0,g("%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))};p.isReactWarning=!0,Object.defineProperty(a,"key",{get:p,configurable:!0})}}function Cn(a,u){{var p=function(){cr||(cr=!0,g("%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))};p.isReactWarning=!0,Object.defineProperty(a,"ref",{get:p,configurable:!0})}}var Rn=function(a,u,p,_,W,Y,L){var F={$$typeof:t,type:a,key:u,ref:p,props:L,_owner:Y};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function wn(a,u,p,_,W){{var Y,L={},F=null,Z=null;p!==void 0&&(ir(p),F=""+p),xn(u)&&(ir(u.key),F=""+u.key),bn(u)&&(Z=u.ref,En(u,W));for(Y in u)Ve.call(u,Y)&&!vn.hasOwnProperty(Y)&&(L[Y]=u[Y]);if(a&&a.defaultProps){var B=a.defaultProps;for(Y in B)L[Y]===void 0&&(L[Y]=B[Y])}if(F||Z){var H=typeof a=="function"?a.displayName||a.name||"Unknown":a;F&&Sn(L,H),Z&&Cn(L,H)}return Rn(a,F,Z,W,_,ar.current,L)}}var Ct=k.ReactCurrentOwner,lr=k.ReactDebugCurrentFrame;function _e(a){if(a){var u=a._owner,p=xe(a.type,a._source,u?u.type:null);lr.setExtraStackFrame(p)}else lr.setExtraStackFrame(null)}var Rt;Rt=!1;function wt(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function ur(){{if(Ct.current){var a=ee(Ct.current.type);if(a)return`
22
22
 
23
- Check the render method of \``+a+"`."}return""}}function kn(a){return""}var fr={};function Tn(a){{var u=ur();if(!u){var g=typeof a=="string"?a:a.displayName||a.name;g&&(u=`
23
+ Check the render method of \``+a+"`."}return""}}function kn(a){return""}var fr={};function Tn(a){{var u=ur();if(!u){var p=typeof a=="string"?a:a.displayName||a.name;p&&(u=`
24
24
 
25
- Check the top-level render call using <`+g+">.")}return u}}function hr(a,u){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var g=Tn(u);if(fr[g])return;fr[g]=!0;var P="";a&&a._owner&&a._owner!==Ct.current&&(P=" It was passed a child from "+ee(a._owner.type)+"."),_e(a),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,P),_e(null)}}function dr(a,u){{if(typeof a!="object")return;if(St(a))for(var g=0;g<a.length;g++){var P=a[g];wt(P)&&hr(P,u)}else if(wt(a))a._store&&(a._store.validated=!0);else if(a){var W=E(a);if(typeof W=="function"&&W!==a.entries)for(var Y=W.call(a),L;!(L=Y.next()).done;)wt(L.value)&&hr(L.value,u)}}}function _n(a){{var u=a.type;if(u==null||typeof u=="string")return;var g;if(typeof u=="function")g=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===l||u.$$typeof===v))g=u.propTypes;else return;if(g){var P=ee(u);gn(g,a.props,"prop",P,a)}else if(u.PropTypes!==void 0&&!Rt){Rt=!0;var W=ee(u);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",W||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pn(a){{for(var u=Object.keys(a.props),g=0;g<u.length;g++){var P=u[g];if(P!=="children"&&P!=="key"){_e(a),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",P),_e(null);break}}a.ref!==null&&(_e(a),y("Invalid attribute `ref` supplied to `React.Fragment`."),_e(null))}}var gr={};function pr(a,u,g,P,W,Y){{var L=Ce(a);if(!L){var F="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(F+=" 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 Z=kn();Z?F+=Z:F+=ur();var B;a===null?B="null":St(a)?B="array":a!==void 0&&a.$$typeof===t?(B="<"+(ee(a.type)||"Unknown")+" />",F=" Did you accidentally export a JSX literal instead of a component?"):B=typeof a,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",B,F)}var H=wn(a,u,g,W,Y);if(H==null)return H;if(L){var ae=u.children;if(ae!==void 0)if(P)if(St(ae)){for(var Pe=0;Pe<ae.length;Pe++)dr(ae[Pe],a);Object.freeze&&Object.freeze(ae)}else y("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 dr(ae,a)}if(Ve.call(u,"key")){var Ee=ee(a),te=Object.keys(u).filter(function(Dn){return Dn!=="key"}),kt=te.length>0?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}";if(!gr[Ee+kt]){var Ln=te.length>0?"{"+te.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+p+">.")}return u}}function hr(a,u){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var p=Tn(u);if(fr[p])return;fr[p]=!0;var _="";a&&a._owner&&a._owner!==Ct.current&&(_=" It was passed a child from "+ee(a._owner.type)+"."),_e(a),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,_),_e(null)}}function dr(a,u){{if(typeof a!="object")return;if(St(a))for(var p=0;p<a.length;p++){var _=a[p];wt(_)&&hr(_,u)}else if(wt(a))a._store&&(a._store.validated=!0);else if(a){var W=y(a);if(typeof W=="function"&&W!==a.entries)for(var Y=W.call(a),L;!(L=Y.next()).done;)wt(L.value)&&hr(L.value,u)}}}function _n(a){{var u=a.type;if(u==null||typeof u=="string")return;var p;if(typeof u=="function")p=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===l||u.$$typeof===m))p=u.propTypes;else return;if(p){var _=ee(u);gn(p,a.props,"prop",_,a)}else if(u.PropTypes!==void 0&&!Rt){Rt=!0;var W=ee(u);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",W||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pn(a){{for(var u=Object.keys(a.props),p=0;p<u.length;p++){var _=u[p];if(_!=="children"&&_!=="key"){_e(a),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),_e(null);break}}a.ref!==null&&(_e(a),g("Invalid attribute `ref` supplied to `React.Fragment`."),_e(null))}}var gr={};function pr(a,u,p,_,W,Y){{var L=Ce(a);if(!L){var F="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(F+=" 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 Z=kn();Z?F+=Z:F+=ur();var B;a===null?B="null":St(a)?B="array":a!==void 0&&a.$$typeof===t?(B="<"+(ee(a.type)||"Unknown")+" />",F=" Did you accidentally export a JSX literal instead of a component?"):B=typeof a,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",B,F)}var H=wn(a,u,p,W,Y);if(H==null)return H;if(L){var ae=u.children;if(ae!==void 0)if(_)if(St(ae)){for(var Pe=0;Pe<ae.length;Pe++)dr(ae[Pe],a);Object.freeze&&Object.freeze(ae)}else g("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 dr(ae,a)}if(Ve.call(u,"key")){var Ee=ee(a),te=Object.keys(u).filter(function(Dn){return Dn!=="key"}),kt=te.length>0?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}";if(!gr[Ee+kt]){var Ln=te.length>0?"{"+te.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,kt,Ee,Ln,Ee),gr[Ee+kt]=!0}}return a===n?Pn(H):_n(H),H}}function On(a,u,g){return pr(a,u,g,!0)}function Mn(a,u,g){return pr(a,u,g,!1)}var An=Mn,Fn=On;ze.Fragment=n,ze.jsx=An,ze.jsxs=Fn}()),ze}process.env.NODE_ENV==="production"?Ot.exports=In():Ot.exports=$n();var br=Ot.exports;function Wn(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function jn(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var qn=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(jn(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Wn(o);try{i.insertRule(n,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}),this.tags=[],this.ctr=0},e}(),X="-ms-",at="-moz-",I="-webkit-",Dr="comm",Yt="rule",zt="decl",Vn="@import",Nr="@keyframes",Yn="@layer",zn=Math.abs,dt=String.fromCharCode,Un=Object.assign;function Bn(e,t){return Q(e,0)^45?(((t<<2^Q(e,0))<<2^Q(e,1))<<2^Q(e,2))<<2^Q(e,3):0}function Ir(e){return e.trim()}function Hn(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function Mt(e,t){return e.indexOf(t)}function Q(e,t){return e.charCodeAt(t)|0}function He(e,t,r){return e.slice(t,r)}function le(e){return e.length}function Ut(e){return e.length}function et(e,t){return t.push(e),e}function Kn(e,t){return e.map(t).join("")}var gt=1,Le=1,$r=0,re=0,K=0,Ne="";function pt(e,t,r,n,o,i,s){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:gt,column:Le,length:s,return:""}}function Ue(e,t){return Un(pt("",null,null,"",null,null,0),e,{length:-e.length},t)}function Gn(){return K}function Jn(){return K=re>0?Q(Ne,--re):0,Le--,K===10&&(Le=1,gt--),K}function oe(){return K=re<$r?Q(Ne,re++):0,Le++,K===10&&(Le=1,gt++),K}function fe(){return Q(Ne,re)}function nt(){return re}function Qe(e,t){return He(Ne,e,t)}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 Wr(e){return gt=Le=1,$r=le(Ne=e),re=0,[]}function jr(e){return Ne="",e}function ot(e){return Ir(Qe(re-1,At(e===91?e+2:e===40?e+1:e)))}function Qn(e){for(;(K=fe())&&K<33;)oe();return Ke(e)>2||Ke(K)>3?"":" "}function Xn(e,t){for(;--t&&oe()&&!(K<48||K>102||K>57&&K<65||K>70&&K<97););return Qe(e,nt()+(t<6&&fe()==32&&oe()==32))}function At(e){for(;oe();)switch(K){case e:return re;case 34:case 39:e!==34&&e!==39&&At(K);break;case 40:e===41&&At(e);break;case 92:oe();break}return re}function Zn(e,t){for(;oe()&&e+K!==57;)if(e+K===84&&fe()===47)break;return"/*"+Qe(t,re-1)+"*"+dt(e===47?e:oe())}function eo(e){for(;!Ke(fe());)oe();return Qe(e,re)}function to(e){return jr(it("",null,null,null,[""],e=Wr(e),0,[0],e))}function it(e,t,r,n,o,i,s,c,l){for(var d=0,f=0,v=s,T=0,p=0,_=0,m=1,E=1,C=1,y=0,w="",O=o,h=i,z=n,N=w;E;)switch(_=y,y=oe()){case 40:if(_!=108&&Q(N,v-1)==58){Mt(N+=$(ot(y),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:N+=ot(y);break;case 9:case 10:case 13:case 32:N+=Qn(_);break;case 92:N+=Xn(nt()-1,7);continue;case 47:switch(fe()){case 42:case 47:et(ro(Zn(oe(),nt()),t,r),l);break;default:N+="/"}break;case 123*m:c[d++]=le(N)*C;case 125*m:case 59:case 0:switch(y){case 0:case 125:E=0;case 59+f:C==-1&&(N=$(N,/\f/g,"")),p>0&&le(N)-v&&et(p>32?Er(N+";",n,r,v-1):Er($(N," ","")+";",n,r,v-2),l);break;case 59:N+=";";default:if(et(z=xr(N,t,r,d,f,o,c,w,O=[],h=[],v),i),y===123)if(f===0)it(N,t,z,z,O,i,v,c,h);else switch(T===99&&Q(N,3)===110?100:T){case 100:case 108:case 109:case 115:it(e,z,z,n&&et(xr(e,z,z,0,0,o,c,w,o,O=[],v),h),o,h,v,c,n?O:h);break;default:it(N,z,z,z,[""],h,0,c,h)}}d=f=p=0,m=C=1,w=N="",v=s;break;case 58:v=1+le(N),p=_;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&Jn()==125)continue}switch(N+=dt(y),y*m){case 38:C=f>0?1:(N+="\f",-1);break;case 44:c[d++]=(le(N)-1)*C,C=1;break;case 64:fe()===45&&(N+=ot(oe())),T=fe(),f=v=le(w=N+=eo(nt())),y++;break;case 45:_===45&&le(N)==2&&(m=0)}}return i}function xr(e,t,r,n,o,i,s,c,l,d,f){for(var v=o-1,T=o===0?i:[""],p=Ut(T),_=0,m=0,E=0;_<n;++_)for(var C=0,y=He(e,v+1,v=zn(m=s[_])),w=e;C<p;++C)(w=Ir(m>0?T[C]+" "+y:$(y,/&\f/g,T[C])))&&(l[E++]=w);return pt(e,t,r,o===0?Yt:c,l,d,f)}function ro(e,t,r){return pt(e,t,r,Dr,dt(Gn()),He(e,2,-2),0)}function Er(e,t,r,n){return pt(e,t,r,zt,He(e,0,n),He(e,n+1,-1),n)}function Ae(e,t){for(var r="",n=Ut(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function no(e,t,r,n){switch(e.type){case Yn:if(e.children.length)break;case Vn:case zt:return e.return=e.return||e.value;case Dr:return"";case Nr:return e.return=e.value+"{"+Ae(e.children,n)+"}";case Yt:e.value=e.props.join(",")}return le(r=Ae(e.children,n))?e.return=e.value+"{"+r+"}":""}function oo(e){var t=Ut(e);return function(r,n,o,i){for(var s="",c=0;c<t;c++)s+=e[c](r,n,o,i)||"";return s}}function io(e){return function(t){t.root||(t=t.return)&&e(t)}}function ao(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var so=function(t,r,n){for(var o=0,i=0;o=i,i=fe(),o===38&&i===12&&(r[n]=1),!Ke(i);)oe();return Qe(t,re)},co=function(t,r){var n=-1,o=44;do switch(Ke(o)){case 0:o===38&&fe()===12&&(r[n]=1),t[n]+=so(re-1,r,n);break;case 2:t[n]+=ot(o);break;case 4:if(o===44){t[++n]=fe()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=dt(o)}while(o=oe());return t},lo=function(t,r){return jr(co(Wr(t),r))},Sr=new WeakMap,uo=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!Sr.get(n))&&!o){Sr.set(t,!0);for(var i=[],s=lo(r,i),c=n.props,l=0,d=0;l<s.length;l++)for(var f=0;f<c.length;f++,d++)t.props[d]=i[l]?s[l].replace(/&\f/g,c[f]):c[f]+" "+s[l]}}},fo=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function qr(e,t){switch(Bn(e,t)){case 5103:return I+"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 I+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return I+e+at+e+X+e+e;case 6828:case 4268:return I+e+X+e+e;case 6165:return I+e+X+"flex-"+e+e;case 5187:return I+e+$(e,/(\w+).+(:[^]+)/,I+"box-$1$2"+X+"flex-$1$2")+e;case 5443:return I+e+X+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return I+e+X+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return I+e+X+$(e,"shrink","negative")+e;case 5292:return I+e+X+$(e,"basis","preferred-size")+e;case 6060:return I+"box-"+$(e,"-grow","")+I+e+X+$(e,"grow","positive")+e;case 4554:return I+$(e,/([^-])(transform)/g,"$1"+I+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,I+"$1"),/(image-set)/,I+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,I+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,I+"box-pack:$3"+X+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+I+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,I+"$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(le(e)-1-t>6)switch(Q(e,t+1)){case 109:if(Q(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+I+"$2-$3$1"+at+(Q(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Mt(e,"stretch")?qr($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Q(e,t+1)!==115)break;case 6444:switch(Q(e,le(e)-3-(~Mt(e,"!important")&&10))){case 107:return $(e,":",":"+I)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+I+(Q(e,14)===45?"inline-":"")+"box$3$1"+I+"$2$3$1"+X+"$2box$3")+e}break;case 5936:switch(Q(e,t+11)){case 114:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return I+e+X+e+e}return e}var ho=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case zt:t.return=qr(t.value,t.length);break;case Nr:return Ae([Ue(t,{value:$(t.value,"@","@"+I)})],o);case Yt:if(t.length)return Kn(t.props,function(i){switch(Hn(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ae([Ue(t,{props:[$(i,/:(read-\w+)/,":"+at+"$1")]})],o);case"::placeholder":return Ae([Ue(t,{props:[$(i,/:(plac\w+)/,":"+I+"input-$1")]}),Ue(t,{props:[$(i,/:(plac\w+)/,":"+at+"$1")]}),Ue(t,{props:[$(i,/:(plac\w+)/,X+"input-$1")]})],o)}return""})}},go=[ho],po=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var E=m.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||go,i={},s,c=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var E=m.getAttribute("data-emotion").split(" "),C=1;C<E.length;C++)i[E[C]]=!0;c.push(m)});var l,d=[uo,fo];{var f,v=[no,io(function(m){f.insert(m)})],T=oo(d.concat(o,v)),p=function(E){return Ae(to(E),T)};l=function(E,C,y,w){f=y,p(E?E+"{"+C.styles+"}":C.styles),w&&(_.inserted[C.name]=!0)}}var _={key:r,sheet:new qn({key:r,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return _.sheet.hydrate(c),_},Ft={exports:{}},j={};/** @license React v16.13.1
30
+ <%s key={someKey} {...props} />`,kt,Ee,Ln,Ee),gr[Ee+kt]=!0}}return a===n?Pn(H):_n(H),H}}function Mn(a,u,p){return pr(a,u,p,!0)}function On(a,u,p){return pr(a,u,p,!1)}var An=On,Fn=Mn;ze.Fragment=n,ze.jsx=An,ze.jsxs=Fn}()),ze}process.env.NODE_ENV==="production"?Mt.exports=In():Mt.exports=$n();var br=Mt.exports;function Wn(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function jn(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var qn=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(jn(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Wn(o);try{i.insertRule(n,i.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}),this.tags=[],this.ctr=0},e}(),X="-ms-",at="-moz-",I="-webkit-",Dr="comm",Yt="rule",zt="decl",Vn="@import",Nr="@keyframes",Yn="@layer",zn=Math.abs,dt=String.fromCharCode,Un=Object.assign;function Bn(e,t){return Q(e,0)^45?(((t<<2^Q(e,0))<<2^Q(e,1))<<2^Q(e,2))<<2^Q(e,3):0}function Ir(e){return e.trim()}function Hn(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function Ot(e,t){return e.indexOf(t)}function Q(e,t){return e.charCodeAt(t)|0}function He(e,t,r){return e.slice(t,r)}function le(e){return e.length}function Ut(e){return e.length}function et(e,t){return t.push(e),e}function Kn(e,t){return e.map(t).join("")}var gt=1,Le=1,$r=0,re=0,K=0,Ne="";function pt(e,t,r,n,o,i,s){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:gt,column:Le,length:s,return:""}}function Ue(e,t){return Un(pt("",null,null,"",null,null,0),e,{length:-e.length},t)}function Gn(){return K}function Jn(){return K=re>0?Q(Ne,--re):0,Le--,K===10&&(Le=1,gt--),K}function oe(){return K=re<$r?Q(Ne,re++):0,Le++,K===10&&(Le=1,gt++),K}function fe(){return Q(Ne,re)}function nt(){return re}function Qe(e,t){return He(Ne,e,t)}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 Wr(e){return gt=Le=1,$r=le(Ne=e),re=0,[]}function jr(e){return Ne="",e}function ot(e){return Ir(Qe(re-1,At(e===91?e+2:e===40?e+1:e)))}function Qn(e){for(;(K=fe())&&K<33;)oe();return Ke(e)>2||Ke(K)>3?"":" "}function Xn(e,t){for(;--t&&oe()&&!(K<48||K>102||K>57&&K<65||K>70&&K<97););return Qe(e,nt()+(t<6&&fe()==32&&oe()==32))}function At(e){for(;oe();)switch(K){case e:return re;case 34:case 39:e!==34&&e!==39&&At(K);break;case 40:e===41&&At(e);break;case 92:oe();break}return re}function Zn(e,t){for(;oe()&&e+K!==57;)if(e+K===84&&fe()===47)break;return"/*"+Qe(t,re-1)+"*"+dt(e===47?e:oe())}function eo(e){for(;!Ke(fe());)oe();return Qe(e,re)}function to(e){return jr(it("",null,null,null,[""],e=Wr(e),0,[0],e))}function it(e,t,r,n,o,i,s,c,l){for(var d=0,f=0,m=s,P=0,E=0,w=0,v=1,y=1,k=1,g=0,C="",M=o,h=i,z=n,N=C;y;)switch(w=g,g=oe()){case 40:if(w!=108&&Q(N,m-1)==58){Ot(N+=$(ot(g),"&","&\f"),"&\f")!=-1&&(k=-1);break}case 34:case 39:case 91:N+=ot(g);break;case 9:case 10:case 13:case 32:N+=Qn(w);break;case 92:N+=Xn(nt()-1,7);continue;case 47:switch(fe()){case 42:case 47:et(ro(Zn(oe(),nt()),t,r),l);break;default:N+="/"}break;case 123*v:c[d++]=le(N)*k;case 125*v:case 59:case 0:switch(g){case 0:case 125:y=0;case 59+f:k==-1&&(N=$(N,/\f/g,"")),E>0&&le(N)-m&&et(E>32?Er(N+";",n,r,m-1):Er($(N," ","")+";",n,r,m-2),l);break;case 59:N+=";";default:if(et(z=xr(N,t,r,d,f,o,c,C,M=[],h=[],m),i),g===123)if(f===0)it(N,t,z,z,M,i,m,c,h);else switch(P===99&&Q(N,3)===110?100:P){case 100:case 108:case 109:case 115:it(e,z,z,n&&et(xr(e,z,z,0,0,o,c,C,o,M=[],m),h),o,h,m,c,n?M:h);break;default:it(N,z,z,z,[""],h,0,c,h)}}d=f=E=0,v=k=1,C=N="",m=s;break;case 58:m=1+le(N),E=w;default:if(v<1){if(g==123)--v;else if(g==125&&v++==0&&Jn()==125)continue}switch(N+=dt(g),g*v){case 38:k=f>0?1:(N+="\f",-1);break;case 44:c[d++]=(le(N)-1)*k,k=1;break;case 64:fe()===45&&(N+=ot(oe())),P=fe(),f=m=le(C=N+=eo(nt())),g++;break;case 45:w===45&&le(N)==2&&(v=0)}}return i}function xr(e,t,r,n,o,i,s,c,l,d,f){for(var m=o-1,P=o===0?i:[""],E=Ut(P),w=0,v=0,y=0;w<n;++w)for(var k=0,g=He(e,m+1,m=zn(v=s[w])),C=e;k<E;++k)(C=Ir(v>0?P[k]+" "+g:$(g,/&\f/g,P[k])))&&(l[y++]=C);return pt(e,t,r,o===0?Yt:c,l,d,f)}function ro(e,t,r){return pt(e,t,r,Dr,dt(Gn()),He(e,2,-2),0)}function Er(e,t,r,n){return pt(e,t,r,zt,He(e,0,n),He(e,n+1,-1),n)}function Ae(e,t){for(var r="",n=Ut(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function no(e,t,r,n){switch(e.type){case Yn:if(e.children.length)break;case Vn:case zt:return e.return=e.return||e.value;case Dr:return"";case Nr:return e.return=e.value+"{"+Ae(e.children,n)+"}";case Yt:e.value=e.props.join(",")}return le(r=Ae(e.children,n))?e.return=e.value+"{"+r+"}":""}function oo(e){var t=Ut(e);return function(r,n,o,i){for(var s="",c=0;c<t;c++)s+=e[c](r,n,o,i)||"";return s}}function io(e){return function(t){t.root||(t=t.return)&&e(t)}}function ao(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var so=function(t,r,n){for(var o=0,i=0;o=i,i=fe(),o===38&&i===12&&(r[n]=1),!Ke(i);)oe();return Qe(t,re)},co=function(t,r){var n=-1,o=44;do switch(Ke(o)){case 0:o===38&&fe()===12&&(r[n]=1),t[n]+=so(re-1,r,n);break;case 2:t[n]+=ot(o);break;case 4:if(o===44){t[++n]=fe()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=dt(o)}while(o=oe());return t},lo=function(t,r){return jr(co(Wr(t),r))},Sr=new WeakMap,uo=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!Sr.get(n))&&!o){Sr.set(t,!0);for(var i=[],s=lo(r,i),c=n.props,l=0,d=0;l<s.length;l++)for(var f=0;f<c.length;f++,d++)t.props[d]=i[l]?s[l].replace(/&\f/g,c[f]):c[f]+" "+s[l]}}},fo=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function qr(e,t){switch(Bn(e,t)){case 5103:return I+"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 I+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return I+e+at+e+X+e+e;case 6828:case 4268:return I+e+X+e+e;case 6165:return I+e+X+"flex-"+e+e;case 5187:return I+e+$(e,/(\w+).+(:[^]+)/,I+"box-$1$2"+X+"flex-$1$2")+e;case 5443:return I+e+X+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return I+e+X+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return I+e+X+$(e,"shrink","negative")+e;case 5292:return I+e+X+$(e,"basis","preferred-size")+e;case 6060:return I+"box-"+$(e,"-grow","")+I+e+X+$(e,"grow","positive")+e;case 4554:return I+$(e,/([^-])(transform)/g,"$1"+I+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,I+"$1"),/(image-set)/,I+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,I+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,I+"box-pack:$3"+X+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+I+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,I+"$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(le(e)-1-t>6)switch(Q(e,t+1)){case 109:if(Q(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+I+"$2-$3$1"+at+(Q(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ot(e,"stretch")?qr($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Q(e,t+1)!==115)break;case 6444:switch(Q(e,le(e)-3-(~Ot(e,"!important")&&10))){case 107:return $(e,":",":"+I)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+I+(Q(e,14)===45?"inline-":"")+"box$3$1"+I+"$2$3$1"+X+"$2box$3")+e}break;case 5936:switch(Q(e,t+11)){case 114:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return I+e+X+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return I+e+X+e+e}return e}var ho=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case zt:t.return=qr(t.value,t.length);break;case Nr:return Ae([Ue(t,{value:$(t.value,"@","@"+I)})],o);case Yt:if(t.length)return Kn(t.props,function(i){switch(Hn(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ae([Ue(t,{props:[$(i,/:(read-\w+)/,":"+at+"$1")]})],o);case"::placeholder":return Ae([Ue(t,{props:[$(i,/:(plac\w+)/,":"+I+"input-$1")]}),Ue(t,{props:[$(i,/:(plac\w+)/,":"+at+"$1")]}),Ue(t,{props:[$(i,/:(plac\w+)/,X+"input-$1")]})],o)}return""})}},go=[ho],po=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var y=v.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var o=t.stylisPlugins||go,i={},s,c=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var y=v.getAttribute("data-emotion").split(" "),k=1;k<y.length;k++)i[y[k]]=!0;c.push(v)});var l,d=[uo,fo];{var f,m=[no,io(function(v){f.insert(v)})],P=oo(d.concat(o,m)),E=function(y){return Ae(to(y),P)};l=function(y,k,g,C){f=g,E(y?y+"{"+k.styles+"}":k.styles),C&&(w.inserted[k.name]=!0)}}var w={key:r,sheet:new qn({key:r,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return w.sheet.hydrate(c),w},Ft={exports:{}},j={};/** @license React v16.13.1
31
31
  * react-is.production.min.js
32
32
  *
33
33
  * Copyright (c) Facebook, Inc. and its affiliates.
34
34
  *
35
35
  * This source code is licensed under the MIT license found in the
36
36
  * LICENSE file in the root directory of this source tree.
37
- */var Cr;function mo(){if(Cr)return j;Cr=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=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,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,v=e?Symbol.for("react.suspense"):60113,T=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(h){if(typeof h=="object"&&h!==null){var z=h.$$typeof;switch(z){case t:switch(h=h.type,h){case l:case d:case n:case i:case o:case v:return h;default:switch(h=h&&h.$$typeof,h){case c:case f:case _:case p:case s:return h;default:return z}}case r:return z}}}function O(h){return w(h)===d}return j.AsyncMode=l,j.ConcurrentMode=d,j.ContextConsumer=c,j.ContextProvider=s,j.Element=t,j.ForwardRef=f,j.Fragment=n,j.Lazy=_,j.Memo=p,j.Portal=r,j.Profiler=i,j.StrictMode=o,j.Suspense=v,j.isAsyncMode=function(h){return O(h)||w(h)===l},j.isConcurrentMode=O,j.isContextConsumer=function(h){return w(h)===c},j.isContextProvider=function(h){return w(h)===s},j.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===t},j.isForwardRef=function(h){return w(h)===f},j.isFragment=function(h){return w(h)===n},j.isLazy=function(h){return w(h)===_},j.isMemo=function(h){return w(h)===p},j.isPortal=function(h){return w(h)===r},j.isProfiler=function(h){return w(h)===i},j.isStrictMode=function(h){return w(h)===o},j.isSuspense=function(h){return w(h)===v},j.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===n||h===d||h===i||h===o||h===v||h===T||typeof h=="object"&&h!==null&&(h.$$typeof===_||h.$$typeof===p||h.$$typeof===s||h.$$typeof===c||h.$$typeof===f||h.$$typeof===E||h.$$typeof===C||h.$$typeof===y||h.$$typeof===m)},j.typeOf=w,j}var q={};/** @license React v16.13.1
37
+ */var Cr;function mo(){if(Cr)return j;Cr=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=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,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,P=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function C(h){if(typeof h=="object"&&h!==null){var z=h.$$typeof;switch(z){case t:switch(h=h.type,h){case l:case d:case n:case i:case o:case m:return h;default:switch(h=h&&h.$$typeof,h){case c:case f:case w:case E:case s:return h;default:return z}}case r:return z}}}function M(h){return C(h)===d}return j.AsyncMode=l,j.ConcurrentMode=d,j.ContextConsumer=c,j.ContextProvider=s,j.Element=t,j.ForwardRef=f,j.Fragment=n,j.Lazy=w,j.Memo=E,j.Portal=r,j.Profiler=i,j.StrictMode=o,j.Suspense=m,j.isAsyncMode=function(h){return M(h)||C(h)===l},j.isConcurrentMode=M,j.isContextConsumer=function(h){return C(h)===c},j.isContextProvider=function(h){return C(h)===s},j.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===t},j.isForwardRef=function(h){return C(h)===f},j.isFragment=function(h){return C(h)===n},j.isLazy=function(h){return C(h)===w},j.isMemo=function(h){return C(h)===E},j.isPortal=function(h){return C(h)===r},j.isProfiler=function(h){return C(h)===i},j.isStrictMode=function(h){return C(h)===o},j.isSuspense=function(h){return C(h)===m},j.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===n||h===d||h===i||h===o||h===m||h===P||typeof h=="object"&&h!==null&&(h.$$typeof===w||h.$$typeof===E||h.$$typeof===s||h.$$typeof===c||h.$$typeof===f||h.$$typeof===y||h.$$typeof===k||h.$$typeof===g||h.$$typeof===v)},j.typeOf=C,j}var q={};/** @license React v16.13.1
38
38
  * react-is.development.js
39
39
  *
40
40
  * Copyright (c) Facebook, Inc. and its affiliates.
41
41
  *
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
- */var Rr;function yo(){return Rr||(Rr=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=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,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,v=e?Symbol.for("react.suspense"):60113,T=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(S){return typeof S=="string"||typeof S=="function"||S===n||S===d||S===i||S===o||S===v||S===T||typeof S=="object"&&S!==null&&(S.$$typeof===_||S.$$typeof===p||S.$$typeof===s||S.$$typeof===c||S.$$typeof===f||S.$$typeof===E||S.$$typeof===C||S.$$typeof===y||S.$$typeof===m)}function O(S){if(typeof S=="object"&&S!==null){var qe=S.$$typeof;switch(qe){case t:var Te=S.type;switch(Te){case l:case d:case n:case i:case o:case v:return Te;default:var xe=Te&&Te.$$typeof;switch(xe){case c:case f:case _:case p:case s:return xe;default:return qe}}case r:return qe}}}var h=l,z=d,N=c,Ie=s,ve=t,Ce=f,Re=n,be=_,ee=p,ce=r,he=i,b=o,M=v,A=!1;function D(S){return A||(A=!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.")),U(S)||O(S)===l}function U(S){return O(S)===d}function G(S){return O(S)===c}function ie(S){return O(S)===s}function de(S){return typeof S=="object"&&S!==null&&S.$$typeof===t}function bt(S){return O(S)===f}function xt(S){return O(S)===n}function $e(S){return O(S)===_}function We(S){return O(S)===p}function we(S){return O(S)===r}function je(S){return O(S)===i}function ke(S){return O(S)===o}function Et(S){return O(S)===v}q.AsyncMode=h,q.ConcurrentMode=z,q.ContextConsumer=N,q.ContextProvider=Ie,q.Element=ve,q.ForwardRef=Ce,q.Fragment=Re,q.Lazy=be,q.Memo=ee,q.Portal=ce,q.Profiler=he,q.StrictMode=b,q.Suspense=M,q.isAsyncMode=D,q.isConcurrentMode=U,q.isContextConsumer=G,q.isContextProvider=ie,q.isElement=de,q.isForwardRef=bt,q.isFragment=xt,q.isLazy=$e,q.isMemo=We,q.isPortal=we,q.isProfiler=je,q.isStrictMode=ke,q.isSuspense=Et,q.isValidElementType=w,q.typeOf=O}()),q}process.env.NODE_ENV==="production"?Ft.exports=mo():Ft.exports=yo();var vo=Ft.exports,Vr=vo,bo={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},xo={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yr={};Yr[Vr.ForwardRef]=bo;Yr[Vr.Memo]=xo;var Eo=!0;function So(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}var zr=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||Eo===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},Co=function(t,r,n){zr(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function Ro(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var wo={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},ko=/[A-Z]|^ms/g,To=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ur=function(t){return t.charCodeAt(1)===45},wr=function(t){return t!=null&&typeof t!="boolean"},Tt=ao(function(e){return Ur(e)?e:e.replace(ko,"-$&").toLowerCase()}),kr=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(To,function(n,o,i){return ue={name:o,styles:i,next:ue},o})}return wo[t]!==1&&!Ur(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ge(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return ue={name:o.name,styles:o.styles,next:ue},o.name;var i=r;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)ue={name:s.name,styles:s.styles,next:ue},s=s.next;var c=i.styles+";";return c}return _o(e,t,r)}case"function":{if(e!==void 0){var l=ue,d=r(e);return ue=l,Ge(e,t,d)}break}}var f=r;return f}function _o(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Ge(e,t,r[o])+";";else for(var i in r){var s=r[i];if(typeof s!="object"){var c=s;wr(c)&&(n+=Tt(i)+":"+kr(i,c)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)wr(s[l])&&(n+=Tt(i)+":"+kr(i,s[l])+";");else{var d=Ge(e,t,s);switch(i){case"animation":case"animationName":{n+=Tt(i)+":"+d+";";break}default:n+=i+"{"+d+"}"}}}return n}var Tr=/label:\s*([^\s;{]+)\s*(;|$)/g,ue;function Po(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";ue=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=Ge(r,t,i);else{var s=i;o+=s[0]}for(var c=1;c<e.length;c++)if(o+=Ge(r,t,e[c]),n){var l=i;o+=l[c]}Tr.lastIndex=0;for(var d="",f;(f=Tr.exec(o))!==null;)d+="-"+f[1];var v=Ro(o)+d;return{name:v,styles:o,next:ue}}var Oo=function(t){return t()},Mo=me.useInsertionEffect?me.useInsertionEffect:!1,Ao=Mo||Oo,Br=me.createContext(typeof HTMLElement<"u"?po({key:"css"}):null);Br.Provider;var Fo=function(t){return k.forwardRef(function(r,n){var o=k.useContext(Br);return t(r,o,n)})},Lo=me.createContext({}),Bt={}.hasOwnProperty,Lt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Do=function(t,r){var n={};for(var o in r)Bt.call(r,o)&&(n[o]=r[o]);return n[Lt]=t,n},No=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return zr(r,n,o),Ao(function(){return Co(r,n,o)}),null},Io=Fo(function(e,t,r){var n=e.css;typeof n=="string"&&t.registered[n]!==void 0&&(n=t.registered[n]);var o=e[Lt],i=[n],s="";typeof e.className=="string"?s=So(t.registered,i,e.className):e.className!=null&&(s=e.className+" ");var c=Po(i,void 0,me.useContext(Lo));s+=t.key+"-"+c.name;var l={};for(var d in e)Bt.call(e,d)&&d!=="css"&&d!==Lt&&(l[d]=e[d]);return l.className=s,r&&(l.ref=r),me.createElement(me.Fragment,null,me.createElement(No,{cache:t,serialized:c,isStringTag:typeof o=="string"}),me.createElement(o,l))}),$o=Io,mt=function(t,r,n){return Bt.call(r,"css")?br.jsx($o,Do(t,r),n):br.jsx(t,r,n)};function Hr(e){switch(e.toLowerCase()){case"sql":return Fr.sql();case"json":return Lr.json();default:return[]}}function Kr(e){return["sql","json"].includes(e.toLowerCase())}function Gr(e={}){return Vt.autocompletion(e)}function Wo(e){return[mr.lintGutter(),mr.linter(e)]}function Jr(){return x.keymap.of([ge.indentWithTab])}const jo=[Jr(),Gr()],qo=se.HighlightStyle.define([{tag:V.tags.keyword,color:"#1a1aa6",fontWeight:"bold"},{tag:V.tags.comment,color:"#008000",fontStyle:"italic"},{tag:V.tags.string,color:"#a31515"},{tag:V.tags.number,color:"#098658"},{tag:V.tags.operator,color:"#777777"},{tag:V.tags.propertyName,color:"#0451a5"},{tag:V.tags.variableName,color:"#001080"},{tag:V.tags.definition(V.tags.variableName),color:"#1a1aa6"},{tag:V.tags.typeName,color:"#267f99"},{tag:V.tags.className,color:"#267f99"},{tag:V.tags.meta,color:"#5c5c5c"},{tag:V.tags.regexp,color:"#811f3f"},{tag:V.tags.link,color:"#0563c1",textDecoration:"underline"}]),Dt=[x.EditorView.theme({"&":{backgroundColor:"#ffffff",color:"#333333",fontSize:"14px",height:"100%"},".cm-scroller":{fontFamily:'"Menlo", "Monaco", "Courier New", monospace',overflow:"auto"},".cm-content":{padding:"8px 0",caretColor:"#333",textAlign:"left"},".cm-gutters":{backgroundColor:"#f8f9fa",color:"#6e7781",borderRight:"1px solid #ddd"},".cm-lineNumbers":{minWidth:"40px"},".cm-lineNumbers .cm-gutterElement":{padding:"0 8px 0 4px",textAlign:"right",fontSize:"12px"},".cm-activeLine":{backgroundColor:"rgba(0, 0, 0, 0.04)"},".cm-activeLineGutter":{backgroundColor:"rgba(0, 0, 0, 0.04)"},".cm-selectionMatch":{backgroundColor:"rgba(181, 213, 255, 0.3)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#333333"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(181, 213, 255, 0.5)"}}),se.syntaxHighlighting(qo)],Vo=se.HighlightStyle.define([{tag:V.tags.keyword,color:"#569cd6",fontWeight:"bold"},{tag:V.tags.comment,color:"#6A9955",fontStyle:"italic"},{tag:V.tags.string,color:"#ce9178"},{tag:V.tags.number,color:"#b5cea8"},{tag:V.tags.operator,color:"#d4d4d4"},{tag:V.tags.propertyName,color:"#9cdcfe"},{tag:V.tags.variableName,color:"#9cdcfe"},{tag:V.tags.definition(V.tags.variableName),color:"#4fc1ff"},{tag:V.tags.typeName,color:"#4ec9b0"},{tag:V.tags.className,color:"#4ec9b0"},{tag:V.tags.meta,color:"#d4d4d4"},{tag:V.tags.regexp,color:"#d16969"},{tag:V.tags.link,color:"#4e94ce",textDecoration:"underline"}]),Qr=[x.EditorView.theme({"&":{backgroundColor:"#1e1e1e",color:"#d4d4d4",fontSize:"14px",height:"100%"},".cm-scroller":{fontFamily:'"Menlo", "Monaco", "Courier New", monospace',overflow:"auto"},".cm-content":{padding:"8px 0",caretColor:"#d4d4d4",textAlign:"left"},".cm-gutters":{backgroundColor:"#252526",color:"#858585",borderRight:"1px solid #404040"},".cm-lineNumbers":{minWidth:"40px"},".cm-lineNumbers .cm-gutterElement":{padding:"0 8px 0 4px",textAlign:"right",fontSize:"12px"},".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.1)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#d4d4d4"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(255, 255, 255, 0.1)"}}),se.syntaxHighlighting(Vo)];function Xr(e){switch(e){case"light":return Dt;case"dark":return Qr;default:return Dt}}const Nt=e=>{const t={value:"",readOnlyRanges:[]};let r=0;return e.forEach(n=>{const{content:o,editable:i}=n,s=o.replace(/\r\n/g,`
44
+ */var Rr;function yo(){return Rr||(Rr=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=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,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,P=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function C(S){return typeof S=="string"||typeof S=="function"||S===n||S===d||S===i||S===o||S===m||S===P||typeof S=="object"&&S!==null&&(S.$$typeof===w||S.$$typeof===E||S.$$typeof===s||S.$$typeof===c||S.$$typeof===f||S.$$typeof===y||S.$$typeof===k||S.$$typeof===g||S.$$typeof===v)}function M(S){if(typeof S=="object"&&S!==null){var qe=S.$$typeof;switch(qe){case t:var Te=S.type;switch(Te){case l:case d:case n:case i:case o:case m:return Te;default:var xe=Te&&Te.$$typeof;switch(xe){case c:case f:case w:case E:case s:return xe;default:return qe}}case r:return qe}}}var h=l,z=d,N=c,Ie=s,ve=t,Ce=f,Re=n,be=w,ee=E,ce=r,he=i,b=o,O=m,A=!1;function D(S){return A||(A=!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.")),U(S)||M(S)===l}function U(S){return M(S)===d}function G(S){return M(S)===c}function ie(S){return M(S)===s}function de(S){return typeof S=="object"&&S!==null&&S.$$typeof===t}function bt(S){return M(S)===f}function xt(S){return M(S)===n}function $e(S){return M(S)===w}function We(S){return M(S)===E}function we(S){return M(S)===r}function je(S){return M(S)===i}function ke(S){return M(S)===o}function Et(S){return M(S)===m}q.AsyncMode=h,q.ConcurrentMode=z,q.ContextConsumer=N,q.ContextProvider=Ie,q.Element=ve,q.ForwardRef=Ce,q.Fragment=Re,q.Lazy=be,q.Memo=ee,q.Portal=ce,q.Profiler=he,q.StrictMode=b,q.Suspense=O,q.isAsyncMode=D,q.isConcurrentMode=U,q.isContextConsumer=G,q.isContextProvider=ie,q.isElement=de,q.isForwardRef=bt,q.isFragment=xt,q.isLazy=$e,q.isMemo=We,q.isPortal=we,q.isProfiler=je,q.isStrictMode=ke,q.isSuspense=Et,q.isValidElementType=C,q.typeOf=M}()),q}process.env.NODE_ENV==="production"?Ft.exports=mo():Ft.exports=yo();var vo=Ft.exports,Vr=vo,bo={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},xo={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yr={};Yr[Vr.ForwardRef]=bo;Yr[Vr.Memo]=xo;var Eo=!0;function So(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}var zr=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||Eo===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},Co=function(t,r,n){zr(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function Ro(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var wo={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},ko=/[A-Z]|^ms/g,To=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ur=function(t){return t.charCodeAt(1)===45},wr=function(t){return t!=null&&typeof t!="boolean"},Tt=ao(function(e){return Ur(e)?e:e.replace(ko,"-$&").toLowerCase()}),kr=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(To,function(n,o,i){return ue={name:o,styles:i,next:ue},o})}return wo[t]!==1&&!Ur(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ge(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return ue={name:o.name,styles:o.styles,next:ue},o.name;var i=r;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)ue={name:s.name,styles:s.styles,next:ue},s=s.next;var c=i.styles+";";return c}return _o(e,t,r)}case"function":{if(e!==void 0){var l=ue,d=r(e);return ue=l,Ge(e,t,d)}break}}var f=r;return f}function _o(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Ge(e,t,r[o])+";";else for(var i in r){var s=r[i];if(typeof s!="object"){var c=s;wr(c)&&(n+=Tt(i)+":"+kr(i,c)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)wr(s[l])&&(n+=Tt(i)+":"+kr(i,s[l])+";");else{var d=Ge(e,t,s);switch(i){case"animation":case"animationName":{n+=Tt(i)+":"+d+";";break}default:n+=i+"{"+d+"}"}}}return n}var Tr=/label:\s*([^\s;{]+)\s*(;|$)/g,ue;function Po(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";ue=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=Ge(r,t,i);else{var s=i;o+=s[0]}for(var c=1;c<e.length;c++)if(o+=Ge(r,t,e[c]),n){var l=i;o+=l[c]}Tr.lastIndex=0;for(var d="",f;(f=Tr.exec(o))!==null;)d+="-"+f[1];var m=Ro(o)+d;return{name:m,styles:o,next:ue}}var Mo=function(t){return t()},Oo=me.useInsertionEffect?me.useInsertionEffect:!1,Ao=Oo||Mo,Br=me.createContext(typeof HTMLElement<"u"?po({key:"css"}):null);Br.Provider;var Fo=function(t){return T.forwardRef(function(r,n){var o=T.useContext(Br);return t(r,o,n)})},Lo=me.createContext({}),Bt={}.hasOwnProperty,Lt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Do=function(t,r){var n={};for(var o in r)Bt.call(r,o)&&(n[o]=r[o]);return n[Lt]=t,n},No=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return zr(r,n,o),Ao(function(){return Co(r,n,o)}),null},Io=Fo(function(e,t,r){var n=e.css;typeof n=="string"&&t.registered[n]!==void 0&&(n=t.registered[n]);var o=e[Lt],i=[n],s="";typeof e.className=="string"?s=So(t.registered,i,e.className):e.className!=null&&(s=e.className+" ");var c=Po(i,void 0,me.useContext(Lo));s+=t.key+"-"+c.name;var l={};for(var d in e)Bt.call(e,d)&&d!=="css"&&d!==Lt&&(l[d]=e[d]);return l.className=s,r&&(l.ref=r),me.createElement(me.Fragment,null,me.createElement(No,{cache:t,serialized:c,isStringTag:typeof o=="string"}),me.createElement(o,l))}),$o=Io,mt=function(t,r,n){return Bt.call(r,"css")?br.jsx($o,Do(t,r),n):br.jsx(t,r,n)};function Hr(e){switch(e.toLowerCase()){case"sql":return Fr.sql();case"json":return Lr.json();default:return[]}}function Kr(e){return["sql","json"].includes(e.toLowerCase())}function Gr(e={}){return Vt.autocompletion(e)}function Wo(e){return[mr.lintGutter(),mr.linter(e)]}function Jr(){return x.keymap.of([ge.indentWithTab])}const jo=[Jr(),Gr()],qo=se.HighlightStyle.define([{tag:V.tags.keyword,color:"#1a1aa6",fontWeight:"bold"},{tag:V.tags.comment,color:"#008000",fontStyle:"italic"},{tag:V.tags.string,color:"#a31515"},{tag:V.tags.number,color:"#098658"},{tag:V.tags.operator,color:"#777777"},{tag:V.tags.propertyName,color:"#0451a5"},{tag:V.tags.variableName,color:"#001080"},{tag:V.tags.definition(V.tags.variableName),color:"#1a1aa6"},{tag:V.tags.typeName,color:"#267f99"},{tag:V.tags.className,color:"#267f99"},{tag:V.tags.meta,color:"#5c5c5c"},{tag:V.tags.regexp,color:"#811f3f"},{tag:V.tags.link,color:"#0563c1",textDecoration:"underline"}]),Dt=[x.EditorView.theme({"&":{backgroundColor:"#ffffff",color:"#333333",fontSize:"14px",height:"100%"},".cm-scroller":{fontFamily:'"Menlo", "Monaco", "Courier New", monospace',overflow:"auto"},".cm-content":{padding:"8px 0",caretColor:"#333",textAlign:"left"},".cm-gutters":{backgroundColor:"#f8f9fa",color:"#6e7781",borderRight:"1px solid #ddd"},".cm-lineNumbers":{minWidth:"40px"},".cm-lineNumbers .cm-gutterElement":{padding:"0 8px 0 4px",textAlign:"right",fontSize:"12px"},".cm-activeLine":{backgroundColor:"rgba(0, 0, 0, 0.04)"},".cm-activeLineGutter":{backgroundColor:"rgba(0, 0, 0, 0.04)"},".cm-selectionMatch":{backgroundColor:"rgba(181, 213, 255, 0.3)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#333333"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(181, 213, 255, 0.5)"}}),se.syntaxHighlighting(qo)],Vo=se.HighlightStyle.define([{tag:V.tags.keyword,color:"#569cd6",fontWeight:"bold"},{tag:V.tags.comment,color:"#6A9955",fontStyle:"italic"},{tag:V.tags.string,color:"#ce9178"},{tag:V.tags.number,color:"#b5cea8"},{tag:V.tags.operator,color:"#d4d4d4"},{tag:V.tags.propertyName,color:"#9cdcfe"},{tag:V.tags.variableName,color:"#9cdcfe"},{tag:V.tags.definition(V.tags.variableName),color:"#4fc1ff"},{tag:V.tags.typeName,color:"#4ec9b0"},{tag:V.tags.className,color:"#4ec9b0"},{tag:V.tags.meta,color:"#d4d4d4"},{tag:V.tags.regexp,color:"#d16969"},{tag:V.tags.link,color:"#4e94ce",textDecoration:"underline"}]),Qr=[x.EditorView.theme({"&":{backgroundColor:"#1e1e1e",color:"#d4d4d4",fontSize:"14px",height:"100%"},".cm-scroller":{fontFamily:'"Menlo", "Monaco", "Courier New", monospace',overflow:"auto"},".cm-content":{padding:"8px 0",caretColor:"#d4d4d4",textAlign:"left"},".cm-gutters":{backgroundColor:"#252526",color:"#858585",borderRight:"1px solid #404040"},".cm-lineNumbers":{minWidth:"40px"},".cm-lineNumbers .cm-gutterElement":{padding:"0 8px 0 4px",textAlign:"right",fontSize:"12px"},".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.1)"},"&.cm-focused .cm-cursor":{borderLeftColor:"#d4d4d4"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(255, 255, 255, 0.1)"}}),se.syntaxHighlighting(Vo)];function Xr(e){switch(e){case"light":return Dt;case"dark":return Qr;default:return Dt}}const Nt=e=>{const t={value:"",readOnlyRanges:[]};let r=0;return e.forEach(n=>{const{content:o,editable:i}=n,s=o.replace(/\r\n/g,`
45
45
  `),c=r,l=c+s.length;t.value+=o,i||t.readOnlyRanges.push({start:c,end:l}),r=l}),t},st=R.StateEffect.define(),_r=R.StateField.define({create(){return x.Decoration.none},update(e,t){e=e.map(t.changes);for(const r of t.effects)if(r.is(st))return console.log(2939),Zr(r.value);return t.docChanged,e},provide(e){return x.EditorView.decorations.from(e)}});function Zr(e){const t=[];return console.log(e,9999299),e.forEach(r=>{r.start<r.end&&t.push(x.Decoration.mark({inclusive:!0,attributes:{class:"cm-readOnly",style:"background-color: rgba(0, 0, 0, 0.05);"},priority:-100}).range(r.start,r.end))}),x.Decoration.set(t)}const Ht=new WeakMap;function en(e){let t=e.map(r=>({...r}));return[_r.init(()=>Zr(t)),x.keymap.of([{key:"Enter",run:r=>{const n=r.state.selection.main,{from:o,to:i}=n;if(o!==i){for(const c of t)if(o<c.end&&i>c.start)return!1}let s=!1;for(const c of t)if(o>c.start&&o<c.end){s=!0;break}return s?!1:(r.dispatch({changes:{from:o,to:i,insert:`
46
46
  `},selection:{anchor:o+1}}),!0)}}]),R.EditorState.transactionFilter.of(r=>{if(!r.docChanged||r.isUserEvent("input.type.Enter")||r.isUserEvent("input.enter"))return r;let n=!1;return r.changes.iterChanges((o,i,s,c)=>{if(!(r.newDoc.sliceString(s,c)===`
47
- `&&o===i)){for(const f of t)if(o===i){if(o>f.start&&o<f.end){n=!0;break}}else if(o<f.end&&i>f.start||o===f.start&&i>o||i===f.end&&o<i){n=!0;break}}}),n?[]:r}),x.EditorView.updateListener.of(r=>{if(r.docChanged){const n=zo(t,r);!Yo(t,n)?(t=n,Ht.set(r.view,n),r.view.dispatch({effects:st.of(n)})):r.view.dispatch({effects:st.of(n)})}}),x.EditorView.updateListener.of(r=>{r.docChanged&&setTimeout(()=>{r.view.state.field(_r,!1)&&r.view.dispatch({})},10)})]}function Yo(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].start!==t[r].start||e[r].end!==t[r].end)return!1;return!0}function zo(e,t){var o;if(!t.docChanged)return e;let r=!1;const n=e.map(i=>{const s={...i};return t.changes.iterChanges((c,l,d,f)=>{const v=f-d,T=l-c,p=v-T;if(c===0&&(r=!0),c===0&&v>0&&i.start===0){s.start=v,s.end+=p;return}if(l<=i.start)s.start+=p,s.end+=p;else if(c>=i.start&&c<i.end&&l>=i.end)s.end=c;else if(!(c>=i.start&&l<=i.end)){if(c<i.end&&l>i.end){const _=i.end-c;s.end=c+Math.min(_,v)}}}),s});if(r&&n.length>0){const i=((o=t.changes.newDoc)==null?void 0:o.toString())||"";let s=0;for(let c=0;c<i.length&&/\s/.test(i[c]);c++)s++;n[0].start===0&&s>0&&(n[0].start=s)}return n.filter(i=>i.start<i.end)}function tn(e){return Ht.get(e)||[]}function pe(e,t){const r=t.map(n=>({...n}));Ht.set(e,r),e.dispatch({effects:st.of(r)}),setTimeout(()=>{e.dom&&document.contains(e.dom)&&e.dispatch({})},10)}function J(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var o=r[n];typeof o=="string"?e.setAttribute(n,o):o!=null&&(e[n]=o)}t++}for(;t<arguments.length;t++)rn(e,arguments[t]);return e}function rn(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var r=0;r<t.length;r++)rn(e,t[r]);else throw new RangeError("Unsupported child node: "+t)}const Pr=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class De{constructor(t,r,n=0,o=t.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,o),this.bufferStart=n,this.normalize=i?c=>i(Pr(c)):Pr,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return R.codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=R.fromCodePoint(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=R.codePointSize(t);let o=this.normalize(r);if(o.length)for(let i=0,s=n;;i++){let c=o.charCodeAt(i),l=this.match(c,s,this.bufferPos+this.bufferStart);if(i==o.length-1){if(l)return this.value=l,this;break}s==n&&i<r.length&&r.charCodeAt(i)==c&&s++}}}match(t,r,n){let o=null;for(let i=0;i<this.matches.length;i+=2){let s=this.matches[i],c=!1;this.query.charCodeAt(s)==t&&(s==this.query.length-1?o={from:this.matches[i+1],to:n}:(this.matches[i]++,c=!0)),c||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?o={from:r,to:n}:this.matches.push(1,r)),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(De.prototype[Symbol.iterator]=function(){return this});const nn={from:-1,to:-1,match:/.*/.exec("")},Kt="gm"+(/x/.unicode==null?"":"u");class on{constructor(t,r,n,o=0,i=t.length){if(this.text=t,this.to=i,this.curLine="",this.done=!1,this.value=nn,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new an(t,r,n,o,i);this.re=new RegExp(r,Kt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=t.iter();let s=t.lineAt(o);this.curLineStart=s.from,this.matchPos=ct(t,o),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,o=n+r[0].length;if(this.matchPos=ct(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<o||n>this.value.to)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const _t=new WeakMap;class Fe{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let o=_t.get(t);if(!o||o.from>=n||o.to<=r){let c=new Fe(r,t.sliceString(r,n));return _t.set(t,c),c}if(o.from==r&&o.to==n)return o;let{text:i,from:s}=o;return s>r&&(i=t.sliceString(r,s)+i,s=r),o.to<n&&(i+=t.sliceString(o.to,n)),_t.set(t,new Fe(s,i)),new Fe(r,i.slice(r-s,n-s))}}class an{constructor(t,r,n,o,i){this.text=t,this.to=i,this.done=!1,this.value=nn,this.matchPos=ct(t,o),this.re=new RegExp(r,Kt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Fe.get(t,o,this.chunkEnd(o+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,o=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,match:r},this.matchPos=ct(this.text,o+(n==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Fe.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(on.prototype[Symbol.iterator]=an.prototype[Symbol.iterator]=function(){return this});function Uo(e){try{return new RegExp(e,Kt),!0}catch{return!1}}function ct(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function It(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=J("input",{class:"cm-textfield",name:"line",value:t}),n=J("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),e.dispatch({effects:Be.of(!1)}),e.focus()):i.keyCode==13&&(i.preventDefault(),o())},onsubmit:i=>{i.preventDefault(),o()}},J("label",e.state.phrase("Go to line"),": ",r)," ",J("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),J("button",{name:"close",onclick:()=>{e.dispatch({effects:Be.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function o(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!i)return;let{state:s}=e,c=s.doc.lineAt(s.selection.main.head),[,l,d,f,v]=i,T=f?+f.slice(1):0,p=d?+d:c.number;if(d&&v){let E=p/100;l&&(E=E*(l=="-"?-1:1)+c.number/s.doc.lines),p=Math.round(s.doc.lines*E)}else d&&l&&(p=p*(l=="-"?-1:1)+c.number);let _=s.doc.line(Math.max(1,Math.min(s.doc.lines,p))),m=R.EditorSelection.cursor(_.from+Math.max(0,Math.min(T,_.length)));e.dispatch({effects:[Be.of(!1),x.EditorView.scrollIntoView(m.from,{y:"center"})],selection:m}),e.focus()}return{dom:n}}const Be=R.StateEffect.define(),Or=R.StateField.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(Be)&&(e=r.value);return e},provide:e=>x.showPanel.from(e,t=>t?It:null)}),Bo=e=>{let t=x.getPanel(e,It);if(!t){let r=[Be.of(!0)];e.state.field(Or,!1)==null&&r.push(R.StateEffect.appendConfig.of([Or,Ho])),e.dispatch({effects:r}),t=x.getPanel(e,It)}return t&&t.dom.querySelector("input").select(),!0},Ho=x.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Ko={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sn=R.Facet.define({combine(e){return R.combineConfig(e,Ko,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Zo,Xo];return e&&t.push(sn.of(e)),t}const Go=x.Decoration.mark({class:"cm-selectionMatch"}),Jo=x.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Mr(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=R.CharCategory.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=R.CharCategory.Word)}function Qo(e,t,r,n){return e(t.sliceDoc(r,r+1))==R.CharCategory.Word&&e(t.sliceDoc(n-1,n))==R.CharCategory.Word}const Xo=x.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(sn),{state:r}=e,n=r.selection;if(n.ranges.length>1)return x.Decoration.none;let o=n.main,i,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return x.Decoration.none;let l=r.wordAt(o.head);if(!l)return x.Decoration.none;s=r.charCategorizer(o.head),i=r.sliceDoc(l.from,l.to)}else{let l=o.to-o.from;if(l<t.minSelectionLength||l>200)return x.Decoration.none;if(t.wholeWords){if(i=r.sliceDoc(o.from,o.to),s=r.charCategorizer(o.head),!(Mr(s,r,o.from,o.to)&&Qo(s,r,o.from,o.to)))return x.Decoration.none}else if(i=r.sliceDoc(o.from,o.to),!i)return x.Decoration.none}let c=[];for(let l of e.visibleRanges){let d=new De(r.doc,i,l.from,l.to);for(;!d.next().done;){let{from:f,to:v}=d.value;if((!s||Mr(s,r,f,v))&&(o.empty&&f<=o.from&&v>=o.to?c.push(Jo.range(f,v)):(f>=o.to||v<=o.from)&&c.push(Go.range(f,v)),c.length>t.maxMatches))return x.Decoration.none}}return x.Decoration.set(c)}},{decorations:e=>e.decorations}),Zo=x.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ei=({state:e,dispatch:t})=>{let{selection:r}=e,n=R.EditorSelection.create(r.ranges.map(o=>e.wordAt(o.head)||R.EditorSelection.cursor(o.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function ti(e,t){let{main:r,ranges:n}=e.selection,o=e.wordAt(r.head),i=o&&o.from==r.from&&o.to==r.to;for(let s=!1,c=new De(e.doc,t,n[n.length-1].to);;)if(c.next(),c.done){if(s)return null;c=new De(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),s=!0}else{if(s&&n.some(l=>l.from==c.value.from))continue;if(i){let l=e.wordAt(c.value.from);if(!l||l.from!=c.value.from||l.to!=c.value.to)continue}return c.value}}const ri=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(i=>i.from===i.to))return ei({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(i=>e.sliceDoc(i.from,i.to)!=n))return!1;let o=ti(e,n);return o?(t(e.update({selection:e.selection.addRange(R.EditorSelection.range(o.from,o.to),!1),effects:x.EditorView.scrollIntoView(o.to)})),!0):!1},Se=R.Facet.define({combine(e){return R.combineConfig(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new di(t),scrollToMatch:t=>x.EditorView.scrollIntoView(t)})}});function Gt(e){return e?[Se.of(e),Wt]:Wt}class cn{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Uo(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
48
- `:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new ai(this):new oi(this)}getCursor(t,r=0,n){let o=t.doc?t:R.EditorState.create({doc:t});return n==null&&(n=o.doc.length),this.regexp?Me(this,o,r,n):Oe(this,o,r,n)}}class ln{constructor(t){this.spec=t}}function Oe(e,t,r,n){return new De(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:o=>o.toLowerCase(),e.wholeWord?ni(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function ni(e,t){return(r,n,o,i)=>((i>r||i+o.length<n)&&(i=Math.max(0,r-2),o=e.sliceString(i,Math.min(e.length,n+2))),(t(lt(o,r-i))!=R.CharCategory.Word||t(ut(o,r-i))!=R.CharCategory.Word)&&(t(ut(o,n-i))!=R.CharCategory.Word||t(lt(o,n-i))!=R.CharCategory.Word))}class oi extends ln{constructor(t){super(t)}nextMatch(t,r,n){let o=Oe(this.spec,t,n,t.doc.length).nextOverlapping();if(o.done){let i=Math.min(t.doc.length,r+this.spec.unquoted.length);o=Oe(this.spec,t,0,i).nextOverlapping()}return o.done||o.value.from==r&&o.value.to==n?null:o.value}prevMatchInRange(t,r,n){for(let o=n;;){let i=Math.max(r,o-1e4-this.spec.unquoted.length),s=Oe(this.spec,t,i,o),c=null;for(;!s.nextOverlapping().done;)c=s.value;if(c)return c;if(i==r)return null;o-=1e4}}prevMatch(t,r,n){let o=this.prevMatchInRange(t,0,r);return o||(o=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),o&&(o.from!=r||o.to!=n)?o:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=Oe(this.spec,t,0,t.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(t,r,n,o){let i=Oe(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}function Me(e,t,r,n){return new on(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ii(t.charCategorizer(t.selection.main.head)):void 0},r,n)}function lt(e,t){return e.slice(R.findClusterBreak(e,t,!1),t)}function ut(e,t){return e.slice(t,R.findClusterBreak(e,t))}function ii(e){return(t,r,n)=>!n[0].length||(e(lt(n.input,n.index))!=R.CharCategory.Word||e(ut(n.input,n.index))!=R.CharCategory.Word)&&(e(ut(n.input,n.index+n[0].length))!=R.CharCategory.Word||e(lt(n.input,n.index+n[0].length))!=R.CharCategory.Word)}class ai extends ln{nextMatch(t,r,n){let o=Me(this.spec,t,n,t.doc.length).next();return o.done&&(o=Me(this.spec,t,0,r).next()),o.done?null:o.value}prevMatchInRange(t,r,n){for(let o=1;;o++){let i=Math.max(r,n-o*1e4),s=Me(this.spec,t,i,n),c=null;for(;!s.next().done;)c=s.value;if(c&&(i==r||c.from>i+10))return c;if(i==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let o=n.length;o>0;o--){let i=+n.slice(0,o);if(i>0&&i<t.match.length)return t.match[i]+n.slice(o)}return r})}matchAll(t,r){let n=Me(this.spec,t,0,t.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(t,r,n,o){let i=Me(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}const Je=R.StateEffect.define(),Jt=R.StateEffect.define(),ye=R.StateField.define({create(e){return new Pt($t(e).create(),null)},update(e,t){for(let r of t.effects)r.is(Je)?e=new Pt(r.value.create(),e.panel):r.is(Jt)&&(e=new Pt(e.query,r.value?Qt:null));return e},provide:e=>x.showPanel.from(e,t=>t.panel)});class Pt{constructor(t,r){this.query=t,this.panel=r}}const si=x.Decoration.mark({class:"cm-searchMatch"}),ci=x.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),li=x.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ye))}update(e){let t=e.state.field(ye);(t!=e.startState.field(ye)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return x.Decoration.none;let{view:r}=this,n=new R.RangeSetBuilder;for(let o=0,i=r.visibleRanges,s=i.length;o<s;o++){let{from:c,to:l}=i[o];for(;o<s-1&&l>i[o+1].from-2*250;)l=i[++o].to;e.highlight(r.state,c,l,(d,f)=>{let v=r.state.selection.ranges.some(T=>T.from==d&&T.to==f);n.add(d,f,v?ci:si)})}return n.finish()}},{decorations:e=>e.decorations});function Xe(e){return t=>{let r=t.state.field(ye,!1);return r&&r.query.spec.valid?e(t,r):Xt(t)}}const ft=Xe((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let o=R.EditorSelection.single(n.from,n.to),i=e.state.facet(Se);return e.dispatch({selection:o,effects:[tr(e,n),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),fn(e),!0}),ht=Xe((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,o=t.prevMatch(r,n,n);if(!o)return!1;let i=R.EditorSelection.single(o.from,o.to),s=e.state.facet(Se);return e.dispatch({selection:i,effects:[tr(e,o),s.scrollToMatch(i.main,e)],userEvent:"select.search"}),fn(e),!0}),ui=Xe((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:R.EditorSelection.create(r.map(n=>R.EditorSelection.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),fi=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:o}=r.main,i=[],s=0;for(let c=new De(e.doc,e.sliceDoc(n,o));!c.next().done;){if(i.length>1e3)return!1;c.value.from==n&&(s=i.length),i.push(R.EditorSelection.range(c.value.from,c.value.to))}return t(e.update({selection:R.EditorSelection.create(i,s),userEvent:"select.search.matches"})),!0},Ar=Xe((e,{query:t})=>{let{state:r}=e,{from:n,to:o}=r.selection.main;if(r.readOnly)return!1;let i=t.nextMatch(r,n,n);if(!i)return!1;let s=i,c=[],l,d,f=[];s.from==n&&s.to==o&&(d=r.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:d}),s=t.nextMatch(r,s.from,s.to),f.push(x.EditorView.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let v=e.state.changes(c);return s&&(l=R.EditorSelection.single(s.from,s.to).map(v),f.push(tr(e,s)),f.push(r.facet(Se).scrollToMatch(l.main,e))),e.dispatch({changes:v,selection:l,effects:f,userEvent:"input.replace"}),!0}),hi=Xe((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(o=>{let{from:i,to:s}=o;return{from:i,to:s,insert:t.getReplacement(o)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:x.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0});function Qt(e){return e.state.facet(Se).createPanel(e)}function $t(e,t){var r,n,o,i,s;let c=e.selection.main,l=c.empty||c.to>c.from+100?"":e.sliceDoc(c.from,c.to);if(t&&!l)return t;let d=e.facet(Se);return new cn({search:((r=t==null?void 0:t.literal)!==null&&r!==void 0?r:d.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=t==null?void 0:t.caseSensitive)!==null&&n!==void 0?n:d.caseSensitive,literal:(o=t==null?void 0:t.literal)!==null&&o!==void 0?o:d.literal,regexp:(i=t==null?void 0:t.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(s=t==null?void 0:t.wholeWord)!==null&&s!==void 0?s:d.wholeWord})}function un(e){let t=x.getPanel(e,Qt);return t&&t.dom.querySelector("[main-field]")}function fn(e){let t=un(e);t&&t==e.root.activeElement&&t.select()}const Xt=e=>{let t=e.state.field(ye,!1);if(t&&t.panel){let r=un(e);if(r&&r!=e.root.activeElement){let n=$t(e.state,t.query.spec);n.valid&&e.dispatch({effects:Je.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Jt.of(!0),t?Je.of($t(e.state,t.query.spec)):R.StateEffect.appendConfig.of(Wt)]});return!0},Zt=e=>{let t=e.state.field(ye,!1);if(!t||!t.panel)return!1;let r=x.getPanel(e,Qt);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Jt.of(!1)}),!0},er=[{key:"Mod-f",run:Xt,scope:"editor search-panel"},{key:"F3",run:ft,shift:ht,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ft,shift:ht,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:fi},{key:"Mod-Alt-g",run:Bo},{key:"Mod-d",run:ri,preventDefault:!0}];class di{constructor(t){this.view=t;let r=this.query=t.state.field(ye).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:r.search,placeholder:ne(t,"Find"),"aria-label":ne(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:r.replace,placeholder:ne(t,"Replace"),"aria-label":ne(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(o,i,s){return J("button",{class:"cm-button",name:o,onclick:i,type:"button"},s)}this.dom=J("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,n("next",()=>ft(t),[ne(t,"next")]),n("prev",()=>ht(t),[ne(t,"previous")]),n("select",()=>ui(t),[ne(t,"all")]),J("label",null,[this.caseField,ne(t,"match case")]),J("label",null,[this.reField,ne(t,"regexp")]),J("label",null,[this.wordField,ne(t,"by word")]),...t.state.readOnly?[]:[J("br"),this.replaceField,n("replace",()=>Ar(t),[ne(t,"replace")]),n("replaceAll",()=>hi(t),[ne(t,"replace all")])],J("button",{name:"close",onclick:()=>Zt(t),"aria-label":ne(t,"close"),type:"button"},["×"])])}commit(){let t=new cn({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Je.of(t)}))}keydown(t){x.runScopeHandlers(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?ht:ft)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Ar(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(Je)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Se).top}}function ne(e,t){return e.state.phrase(t)}const tt=30,rt=/[\s\.,:;?!]/;function tr(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),o=e.state.doc.lineAt(r).to,i=Math.max(n.from,t-tt),s=Math.min(o,r+tt),c=e.state.sliceDoc(i,s);if(i!=n.from){for(let l=0;l<tt;l++)if(!rt.test(c[l+1])&&rt.test(c[l])){c=c.slice(l);break}}if(s!=o){for(let l=c.length-1;l>c.length-tt;l--)if(!rt.test(c[l-1])&&rt.test(c[l])){c=c.slice(0,l);break}}return x.EditorView.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${n.number}.`)}const gi=x.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Wt=[ye,R.Prec.low(li),gi],pi={Search:"搜索",Replace:"替换",Find:"查找","Replace all":"全部替换",Next:"下一个",Previous:"上一个",All:"全部",Close:"关闭",done:"完成","Match case":"区分大小写","Match whole word":"全字匹配","Use regular expression":"使用正则表达式","by word":"按单词",replace:"替换","Search for":"搜索内容","Replace with":"替换为","No matches":"无匹配结果","replaced $ matches":"已替换 $ 个匹配项","replaced match on line $":"已替换第 $ 行的匹配项","on line":"在第",line:"行","$ of $ matches":"第 $ 个,共 $ 个匹配","Invalid regular expression":"无效的正则表达式","Query too long":"查询内容过长","Search string too long":"搜索字符串过长"};function hn(){return x.EditorView.theme({".cm-panel.cm-search":{fontSize:"14px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},".cm-search label":{fontSize:"13px"},".cm-search input":{fontSize:"13px",fontFamily:"inherit"},".cm-search button":{fontSize:"12px",fontFamily:"inherit"}})}function dn(e){setTimeout(()=>{const t=e.dom.querySelector(".cm-panel.cm-search");if(!t)return;t.querySelectorAll("label").forEach(i=>{var c;switch((c=i.textContent)==null?void 0:c.trim()){case"Match case":i.textContent="区分大小写";break;case"Match whole word":i.textContent="全字匹配";break;case"Use regular expression":i.textContent="使用正则表达式";break}}),t.querySelectorAll("button").forEach(i=>{var c;switch((c=i.textContent)==null?void 0:c.trim()){case"Next":i.textContent="下一个";break;case"Previous":i.textContent="上一个";break;case"All":i.textContent="全部";break;case"Replace all":i.textContent="全部替换";break;case"Close":i.textContent="关闭";break;case"done":i.textContent="完成";break}}),t.querySelectorAll('input[type="text"]').forEach((i,s)=>{const c=i;s===0?c.placeholder="搜索内容":s===1&&(c.placeholder="替换为")})},100)}function jt(){return[hn(),Gt({top:!0}),yt(),x.keymap.of(er),x.EditorView.updateListener.of(e=>{e.view.dom.querySelector(".cm-panel.cm-search")&&dn(e.view)})]}function mi(){return[yt()]}function qt(){return[Gt({top:!0}),yt(),x.keymap.of(er)]}const yi=[{key:"Ctrl-f",mac:"Cmd-f",run:()=>!0},{key:"F3",run:()=>!0},{key:"Shift-F3",run:()=>!0}],vi=({value:e,onChange:t,extensions:r=[],height:n="300px",disabled:o=!1,className:i="",style:s={},placeholder:c="",showLineNumbers:l=!0,onEditorViewCreated:d,locale:f="zh-CN"},v)=>{const T=k.useRef(null),p=k.useRef();return k.useEffect(()=>{if(!T.current)return;const _=[ge.history(),x.keymap.of([...ge.historyKeymap,ge.indentWithTab,{key:"Enter",run:ge.insertNewlineAndIndent}]),x.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?x.placeholder(c):[],l?x.lineNumbers():[],x.EditorView.updateListener.of(C=>{if(C.docChanged&&t){const y={value:C.state.doc.toString(),readOnlyRanges:[]};t(y)}})];o&&_.push(R.EditorState.readOnly.of(!0));const m=R.EditorState.create({doc:e,extensions:[..._,...r]}),E=new x.EditorView({state:m,parent:T.current});return p.current=E,d&&d(E),()=>{var C;(C=p.current)==null||C.destroy()}},[]),k.useEffect(()=>{p.current&&e!==p.current.state.doc.toString()&&p.current.dispatch({changes:{from:0,to:p.current.state.doc.length,insert:e}})},[e]),k.useEffect(()=>{if(!p.current||!T.current)return;const _=p.current.state.doc.toString();p.current.destroy();const m=[ge.history(),x.keymap.of([...ge.historyKeymap,ge.indentWithTab,{key:"Enter",run:ge.insertNewlineAndIndent}]),x.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?x.placeholder(c):[],l?x.lineNumbers():[],x.EditorView.updateListener.of(y=>{if(y.docChanged&&t){const w={value:y.state.doc.toString(),readOnlyRanges:[]};t(w)}})];o&&m.push(R.EditorState.readOnly.of(!0));const E=R.EditorState.create({doc:_,extensions:[...m,...r]}),C=new x.EditorView({state:E,parent:T.current});p.current=C,d&&d(C)},[o,l]),k.useImperativeHandle(v,()=>({insertTextAtCursor:_=>{const m=p.current;m&&(m.dispatch(m.state.replaceSelection(_)),m.focus())},goToPosition:_=>{const m=p.current;if(m){const E=m.state.doc.length,C=Math.max(0,Math.min(_,E));m.dispatch({selection:{anchor:C,head:C},scrollIntoView:!0}),m.focus()}},goToLine:(_,m=0)=>{const E=p.current;if(E){const C=E.state.doc,y=Math.max(1,Math.min(_,C.lines)),w=C.line(y),O=Math.max(0,Math.min(m,w.length))+w.from;E.dispatch({selection:{anchor:O,head:O},scrollIntoView:!0}),E.focus()}},getEditorView:()=>p.current})),mt("div",{ref:T,className:`senyao-editor ${o?"disabled":""} ${i}`,style:{height:n,...s}})},vt=k.forwardRef(vi),bi=({value:e,onChange:t,language:r="json",extensions:n=[],theme:o="light",showLineNumbers:i=!0,...s},c)=>{const l=k.useMemo(()=>{const d=Kr(r)?Hr(r):[],f=Xr(o);return[d,f,...n]},[r,n,o]);return mt(vt,{ref:c,value:e,onChange:t,extensions:l,showLineNumbers:i,...s})},xi=k.forwardRef(bi),Ei=({value:e,onChange:t,extensions:r=[],readOnlyRanges:n,manageReadOnlyRanges:o=!0,showLineNumbers:i=!0,...s},c)=>{const l=k.useRef(null),f=(b=>b!=null&&typeof b=="object"&&"value"in b)(e),v=f?e.value:e,T=(f&&"readOnlyRanges"in e?e.readOnlyRanges:n)??[],[p,_]=k.useState(v??""),m=k.useRef(null),[E,C]=k.useState(T),y=k.useRef(p),[w,O]=k.useState(null),h=k.useRef(!1),z=k.useRef(new Map),N=k.useRef(!1);k.useEffect(()=>{if(o&&T.length>0&&!w){const b=[];let M=0;for(let A=0;A<T.length;A++){const D=T[A];D.start>M&&b.push({content:p.substring(M,D.start),editable:!0}),b.push({content:p.substring(D.start,D.end),editable:!1}),M=D.end}M<p.length&&b.push({content:p.substring(M),editable:!0}),O(b)}},[o,T,p,w]),k.useEffect(()=>{if(p){const b=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],M=new Map;b.forEach(A=>{const D=p.indexOf(A);D>=0&&M.set(A,D)}),z.current=M}},[]);const Ie=k.useMemo(()=>{const b=[Fr.sql(),Vt.autocompletion()];return E.length>0&&b.push(en(E)),[...b,...r]},[r,E]),ve=k.useCallback((b,M,A=0)=>{const D=b.indexOf(M,A);return D>=0?D:null},[]),Ce=k.useCallback((b,M)=>{if(!o||!b||b.length===0)return b;const A=[...b];let D=0;for(let G=0;G<b.length;G++){const ie=b[G];if(!ie.editable){const de=ve(M,ie.content,D);de!==null&&(G>0&&b[G-1].editable&&de>D&&(A[G-1]={...A[G-1],content:M.substring(D,de)}),D=de+ie.content.length)}}const U=b[b.length-1];return U.editable&&D<M.length&&(A[b.length-1]={...U,content:M.substring(D)}),A},[o,ve]),Re=k.useCallback(b=>{let M=!1;return z.current.forEach((A,D)=>{const U=b.indexOf(D);U>=0&&Math.abs(U-A)>0&&(z.current.set(D,U),U>A&&(A===0||A<15)&&(M=!0))}),M},[]),be=k.useCallback(()=>{if(!m.current)return;const b=m.current,M=b.state.doc.toString(),A=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],D=b.state.selection;let U=!1;for(const G of A){const ie=M.indexOf(G);if(ie>=0){b.dispatch({selection:{anchor:ie,head:ie+G.length},scrollIntoView:!1}),U=!0;break}}U&&setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({selection:D,scrollIntoView:!1})},10)},[]),ee=k.useCallback(()=>{if(!m.current)return;const b=m.current;E.length>0&&(pe(b,[]),setTimeout(()=>{b.dom&&document.contains(b.dom)&&(pe(b,E),setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({})},10))},10))},[E]),ce=k.useCallback(b=>{const M=b.value,A=y.current;_(M),A!==M&&(!A||M.length>(A==null?void 0:A.length)&&!A.startsWith(M.substring(0,5))&&M.includes(A.substring(0,10)))&&(h.current=!0,Re(M)&&setTimeout(()=>{be()},10)),y.current=M;const D=m.current?tn(m.current):E;if(o&&w){const U=Ce(w,M);O(U);const{readOnlyRanges:G}=Nt(U);C(G),m.current&&pe(m.current,G),t&&t({value:M,readOnlyRanges:G})}else t&&t({value:M,readOnlyRanges:D})},[t,o,w,E,Ce,Re,be]);k.useEffect(()=>{!o&&JSON.stringify(T)!==JSON.stringify(E)&&(C(T),m.current&&pe(m.current,T))},[T,E,o]),k.useEffect(()=>{if(o&&w){const{readOnlyRanges:b}=Nt(w);JSON.stringify(b)!==JSON.stringify(E)&&(C(b),m.current&&pe(m.current,b))}},[w,E,o]),k.useEffect(()=>{m.current&&h.current&&(h.current=!1,m.current.dispatch({}))},[p]),k.useEffect(()=>{m.current&&E.length>0&&!N.current&&(N.current=!0,setTimeout(()=>{ee()},50),setTimeout(()=>{ee()},200))},[ee,E]);const he=k.useCallback(b=>{if(m.current=b,E.length>0&&(pe(b,E),setTimeout(()=>{pe(b,[]),setTimeout(()=>{pe(b,E)},10)},50)),p){const M=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],A=new Map;M.forEach(D=>{const U=p.indexOf(D);U>=0&&A.set(D,U)}),z.current=A}},[E,p]);return mt(vt,{ref:l,value:p,onChange:ce,extensions:Ie,showLineNumbers:i,onEditorViewCreated:he,...s})},Si=k.forwardRef(Ei),Ci=(e,t)=>{const{value:r,onChange:n,extensions:o=[],showLineNumbers:i=!0,enableFormatting:s=!1,enableCodeFolding:c=!0,...l}=e,d=k.useRef(!0),f=k.useRef(null),v=k.useCallback(y=>{try{return y===""||JSON.parse(y),!0}catch{return!1}},[]),T=k.useCallback(y=>{try{if(!y.trim())return"";const w=JSON.parse(y);return JSON.stringify(w,null,2)}catch{return y}},[]),p=k.useCallback(()=>{if(!f.current)return!1;const y=f.current,w=y.state.doc.toString(),O=T(w);if(O===w)return!1;const h=y.state.update({changes:{from:0,to:y.state.doc.length,insert:O}});return y.dispatch(h),!0},[T]),_=k.useMemo(()=>x.keymap.of([{key:"Alt-f",mac:"Mod-Alt-f",run:()=>p()}]),[p]),m=k.useCallback(y=>{if(n){const w=v(y.value);d.current=w,n(y)}},[n,v]),E=k.useMemo(()=>{const y=[Lr.json(),se.bracketMatching(),Vt.closeBrackets(),R.Prec.highest(_),...o];return c&&y.push(se.codeFolding(),se.foldGutter({markerDOM:w=>{const O=document.createElement("span");return O.style.cssText=`
47
+ `&&o===i)){for(const f of t)if(o===i){if(o>f.start&&o<f.end){n=!0;break}}else if(o<f.end&&i>f.start||o===f.start&&i>o||i===f.end&&o<i){n=!0;break}}}),n?[]:r}),x.EditorView.updateListener.of(r=>{if(r.docChanged){const n=zo(t,r);!Yo(t,n)?(t=n,Ht.set(r.view,n),r.view.dispatch({effects:st.of(n)})):r.view.dispatch({effects:st.of(n)})}}),x.EditorView.updateListener.of(r=>{r.docChanged&&setTimeout(()=>{r.view.state.field(_r,!1)&&r.view.dispatch({})},10)})]}function Yo(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].start!==t[r].start||e[r].end!==t[r].end)return!1;return!0}function zo(e,t){var o;if(!t.docChanged)return e;let r=!1;const n=e.map(i=>{const s={...i};return t.changes.iterChanges((c,l,d,f)=>{const m=f-d,P=l-c,E=m-P;if(c===0&&(r=!0),c===0&&m>0&&i.start===0){s.start=m,s.end+=E;return}if(l<=i.start)s.start+=E,s.end+=E;else if(c>=i.start&&c<i.end&&l>=i.end)s.end=c;else if(!(c>=i.start&&l<=i.end)){if(c<i.end&&l>i.end){const w=i.end-c;s.end=c+Math.min(w,m)}}}),s});if(r&&n.length>0){const i=((o=t.changes.newDoc)==null?void 0:o.toString())||"";let s=0;for(let c=0;c<i.length&&/\s/.test(i[c]);c++)s++;n[0].start===0&&s>0&&(n[0].start=s)}return n.filter(i=>i.start<i.end)}function tn(e){return Ht.get(e)||[]}function pe(e,t){const r=t.map(n=>({...n}));Ht.set(e,r),e.dispatch({effects:st.of(r)}),setTimeout(()=>{e.dom&&document.contains(e.dom)&&e.dispatch({})},10)}function J(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var o=r[n];typeof o=="string"?e.setAttribute(n,o):o!=null&&(e[n]=o)}t++}for(;t<arguments.length;t++)rn(e,arguments[t]);return e}function rn(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var r=0;r<t.length;r++)rn(e,t[r]);else throw new RangeError("Unsupported child node: "+t)}const Pr=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class De{constructor(t,r,n=0,o=t.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,o),this.bufferStart=n,this.normalize=i?c=>i(Pr(c)):Pr,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return R.codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=R.fromCodePoint(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=R.codePointSize(t);let o=this.normalize(r);if(o.length)for(let i=0,s=n;;i++){let c=o.charCodeAt(i),l=this.match(c,s,this.bufferPos+this.bufferStart);if(i==o.length-1){if(l)return this.value=l,this;break}s==n&&i<r.length&&r.charCodeAt(i)==c&&s++}}}match(t,r,n){let o=null;for(let i=0;i<this.matches.length;i+=2){let s=this.matches[i],c=!1;this.query.charCodeAt(s)==t&&(s==this.query.length-1?o={from:this.matches[i+1],to:n}:(this.matches[i]++,c=!0)),c||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?o={from:r,to:n}:this.matches.push(1,r)),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(De.prototype[Symbol.iterator]=function(){return this});const nn={from:-1,to:-1,match:/.*/.exec("")},Kt="gm"+(/x/.unicode==null?"":"u");class on{constructor(t,r,n,o=0,i=t.length){if(this.text=t,this.to=i,this.curLine="",this.done=!1,this.value=nn,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new an(t,r,n,o,i);this.re=new RegExp(r,Kt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=t.iter();let s=t.lineAt(o);this.curLineStart=s.from,this.matchPos=ct(t,o),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,o=n+r[0].length;if(this.matchPos=ct(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<o||n>this.value.to)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const _t=new WeakMap;class Fe{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let o=_t.get(t);if(!o||o.from>=n||o.to<=r){let c=new Fe(r,t.sliceString(r,n));return _t.set(t,c),c}if(o.from==r&&o.to==n)return o;let{text:i,from:s}=o;return s>r&&(i=t.sliceString(r,s)+i,s=r),o.to<n&&(i+=t.sliceString(o.to,n)),_t.set(t,new Fe(s,i)),new Fe(r,i.slice(r-s,n-s))}}class an{constructor(t,r,n,o,i){this.text=t,this.to=i,this.done=!1,this.value=nn,this.matchPos=ct(t,o),this.re=new RegExp(r,Kt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Fe.get(t,o,this.chunkEnd(o+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,o=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,match:r},this.matchPos=ct(this.text,o+(n==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Fe.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(on.prototype[Symbol.iterator]=an.prototype[Symbol.iterator]=function(){return this});function Uo(e){try{return new RegExp(e,Kt),!0}catch{return!1}}function ct(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function It(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),r=J("input",{class:"cm-textfield",name:"line",value:t}),n=J("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),e.dispatch({effects:Be.of(!1)}),e.focus()):i.keyCode==13&&(i.preventDefault(),o())},onsubmit:i=>{i.preventDefault(),o()}},J("label",e.state.phrase("Go to line"),": ",r)," ",J("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),J("button",{name:"close",onclick:()=>{e.dispatch({effects:Be.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function o(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.value);if(!i)return;let{state:s}=e,c=s.doc.lineAt(s.selection.main.head),[,l,d,f,m]=i,P=f?+f.slice(1):0,E=d?+d:c.number;if(d&&m){let y=E/100;l&&(y=y*(l=="-"?-1:1)+c.number/s.doc.lines),E=Math.round(s.doc.lines*y)}else d&&l&&(E=E*(l=="-"?-1:1)+c.number);let w=s.doc.line(Math.max(1,Math.min(s.doc.lines,E))),v=R.EditorSelection.cursor(w.from+Math.max(0,Math.min(P,w.length)));e.dispatch({effects:[Be.of(!1),x.EditorView.scrollIntoView(v.from,{y:"center"})],selection:v}),e.focus()}return{dom:n}}const Be=R.StateEffect.define(),Mr=R.StateField.define({create(){return!0},update(e,t){for(let r of t.effects)r.is(Be)&&(e=r.value);return e},provide:e=>x.showPanel.from(e,t=>t?It:null)}),Bo=e=>{let t=x.getPanel(e,It);if(!t){let r=[Be.of(!0)];e.state.field(Mr,!1)==null&&r.push(R.StateEffect.appendConfig.of([Mr,Ho])),e.dispatch({effects:r}),t=x.getPanel(e,It)}return t&&t.dom.querySelector("input").select(),!0},Ho=x.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Ko={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sn=R.Facet.define({combine(e){return R.combineConfig(e,Ko,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Zo,Xo];return e&&t.push(sn.of(e)),t}const Go=x.Decoration.mark({class:"cm-selectionMatch"}),Jo=x.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Or(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=R.CharCategory.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=R.CharCategory.Word)}function Qo(e,t,r,n){return e(t.sliceDoc(r,r+1))==R.CharCategory.Word&&e(t.sliceDoc(n-1,n))==R.CharCategory.Word}const Xo=x.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(sn),{state:r}=e,n=r.selection;if(n.ranges.length>1)return x.Decoration.none;let o=n.main,i,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return x.Decoration.none;let l=r.wordAt(o.head);if(!l)return x.Decoration.none;s=r.charCategorizer(o.head),i=r.sliceDoc(l.from,l.to)}else{let l=o.to-o.from;if(l<t.minSelectionLength||l>200)return x.Decoration.none;if(t.wholeWords){if(i=r.sliceDoc(o.from,o.to),s=r.charCategorizer(o.head),!(Or(s,r,o.from,o.to)&&Qo(s,r,o.from,o.to)))return x.Decoration.none}else if(i=r.sliceDoc(o.from,o.to),!i)return x.Decoration.none}let c=[];for(let l of e.visibleRanges){let d=new De(r.doc,i,l.from,l.to);for(;!d.next().done;){let{from:f,to:m}=d.value;if((!s||Or(s,r,f,m))&&(o.empty&&f<=o.from&&m>=o.to?c.push(Jo.range(f,m)):(f>=o.to||m<=o.from)&&c.push(Go.range(f,m)),c.length>t.maxMatches))return x.Decoration.none}}return x.Decoration.set(c)}},{decorations:e=>e.decorations}),Zo=x.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ei=({state:e,dispatch:t})=>{let{selection:r}=e,n=R.EditorSelection.create(r.ranges.map(o=>e.wordAt(o.head)||R.EditorSelection.cursor(o.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function ti(e,t){let{main:r,ranges:n}=e.selection,o=e.wordAt(r.head),i=o&&o.from==r.from&&o.to==r.to;for(let s=!1,c=new De(e.doc,t,n[n.length-1].to);;)if(c.next(),c.done){if(s)return null;c=new De(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),s=!0}else{if(s&&n.some(l=>l.from==c.value.from))continue;if(i){let l=e.wordAt(c.value.from);if(!l||l.from!=c.value.from||l.to!=c.value.to)continue}return c.value}}const ri=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(i=>i.from===i.to))return ei({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(i=>e.sliceDoc(i.from,i.to)!=n))return!1;let o=ti(e,n);return o?(t(e.update({selection:e.selection.addRange(R.EditorSelection.range(o.from,o.to),!1),effects:x.EditorView.scrollIntoView(o.to)})),!0):!1},Se=R.Facet.define({combine(e){return R.combineConfig(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new di(t),scrollToMatch:t=>x.EditorView.scrollIntoView(t)})}});function Gt(e){return e?[Se.of(e),Wt]:Wt}class cn{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Uo(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
48
+ `:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new ai(this):new oi(this)}getCursor(t,r=0,n){let o=t.doc?t:R.EditorState.create({doc:t});return n==null&&(n=o.doc.length),this.regexp?Oe(this,o,r,n):Me(this,o,r,n)}}class ln{constructor(t){this.spec=t}}function Me(e,t,r,n){return new De(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:o=>o.toLowerCase(),e.wholeWord?ni(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function ni(e,t){return(r,n,o,i)=>((i>r||i+o.length<n)&&(i=Math.max(0,r-2),o=e.sliceString(i,Math.min(e.length,n+2))),(t(lt(o,r-i))!=R.CharCategory.Word||t(ut(o,r-i))!=R.CharCategory.Word)&&(t(ut(o,n-i))!=R.CharCategory.Word||t(lt(o,n-i))!=R.CharCategory.Word))}class oi extends ln{constructor(t){super(t)}nextMatch(t,r,n){let o=Me(this.spec,t,n,t.doc.length).nextOverlapping();if(o.done){let i=Math.min(t.doc.length,r+this.spec.unquoted.length);o=Me(this.spec,t,0,i).nextOverlapping()}return o.done||o.value.from==r&&o.value.to==n?null:o.value}prevMatchInRange(t,r,n){for(let o=n;;){let i=Math.max(r,o-1e4-this.spec.unquoted.length),s=Me(this.spec,t,i,o),c=null;for(;!s.nextOverlapping().done;)c=s.value;if(c)return c;if(i==r)return null;o-=1e4}}prevMatch(t,r,n){let o=this.prevMatchInRange(t,0,r);return o||(o=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),o&&(o.from!=r||o.to!=n)?o:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=Me(this.spec,t,0,t.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(t,r,n,o){let i=Me(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}function Oe(e,t,r,n){return new on(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ii(t.charCategorizer(t.selection.main.head)):void 0},r,n)}function lt(e,t){return e.slice(R.findClusterBreak(e,t,!1),t)}function ut(e,t){return e.slice(t,R.findClusterBreak(e,t))}function ii(e){return(t,r,n)=>!n[0].length||(e(lt(n.input,n.index))!=R.CharCategory.Word||e(ut(n.input,n.index))!=R.CharCategory.Word)&&(e(ut(n.input,n.index+n[0].length))!=R.CharCategory.Word||e(lt(n.input,n.index+n[0].length))!=R.CharCategory.Word)}class ai extends ln{nextMatch(t,r,n){let o=Oe(this.spec,t,n,t.doc.length).next();return o.done&&(o=Oe(this.spec,t,0,r).next()),o.done?null:o.value}prevMatchInRange(t,r,n){for(let o=1;;o++){let i=Math.max(r,n-o*1e4),s=Oe(this.spec,t,i,n),c=null;for(;!s.next().done;)c=s.value;if(c&&(i==r||c.from>i+10))return c;if(i==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let o=n.length;o>0;o--){let i=+n.slice(0,o);if(i>0&&i<t.match.length)return t.match[i]+n.slice(o)}return r})}matchAll(t,r){let n=Oe(this.spec,t,0,t.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(t,r,n,o){let i=Oe(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}const Je=R.StateEffect.define(),Jt=R.StateEffect.define(),ye=R.StateField.define({create(e){return new Pt($t(e).create(),null)},update(e,t){for(let r of t.effects)r.is(Je)?e=new Pt(r.value.create(),e.panel):r.is(Jt)&&(e=new Pt(e.query,r.value?Qt:null));return e},provide:e=>x.showPanel.from(e,t=>t.panel)});class Pt{constructor(t,r){this.query=t,this.panel=r}}const si=x.Decoration.mark({class:"cm-searchMatch"}),ci=x.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),li=x.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ye))}update(e){let t=e.state.field(ye);(t!=e.startState.field(ye)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return x.Decoration.none;let{view:r}=this,n=new R.RangeSetBuilder;for(let o=0,i=r.visibleRanges,s=i.length;o<s;o++){let{from:c,to:l}=i[o];for(;o<s-1&&l>i[o+1].from-2*250;)l=i[++o].to;e.highlight(r.state,c,l,(d,f)=>{let m=r.state.selection.ranges.some(P=>P.from==d&&P.to==f);n.add(d,f,m?ci:si)})}return n.finish()}},{decorations:e=>e.decorations});function Xe(e){return t=>{let r=t.state.field(ye,!1);return r&&r.query.spec.valid?e(t,r):Xt(t)}}const ft=Xe((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let o=R.EditorSelection.single(n.from,n.to),i=e.state.facet(Se);return e.dispatch({selection:o,effects:[tr(e,n),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),fn(e),!0}),ht=Xe((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,o=t.prevMatch(r,n,n);if(!o)return!1;let i=R.EditorSelection.single(o.from,o.to),s=e.state.facet(Se);return e.dispatch({selection:i,effects:[tr(e,o),s.scrollToMatch(i.main,e)],userEvent:"select.search"}),fn(e),!0}),ui=Xe((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:R.EditorSelection.create(r.map(n=>R.EditorSelection.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),fi=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:o}=r.main,i=[],s=0;for(let c=new De(e.doc,e.sliceDoc(n,o));!c.next().done;){if(i.length>1e3)return!1;c.value.from==n&&(s=i.length),i.push(R.EditorSelection.range(c.value.from,c.value.to))}return t(e.update({selection:R.EditorSelection.create(i,s),userEvent:"select.search.matches"})),!0},Ar=Xe((e,{query:t})=>{let{state:r}=e,{from:n,to:o}=r.selection.main;if(r.readOnly)return!1;let i=t.nextMatch(r,n,n);if(!i)return!1;let s=i,c=[],l,d,f=[];s.from==n&&s.to==o&&(d=r.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:d}),s=t.nextMatch(r,s.from,s.to),f.push(x.EditorView.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let m=e.state.changes(c);return s&&(l=R.EditorSelection.single(s.from,s.to).map(m),f.push(tr(e,s)),f.push(r.facet(Se).scrollToMatch(l.main,e))),e.dispatch({changes:m,selection:l,effects:f,userEvent:"input.replace"}),!0}),hi=Xe((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(o=>{let{from:i,to:s}=o;return{from:i,to:s,insert:t.getReplacement(o)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:x.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0});function Qt(e){return e.state.facet(Se).createPanel(e)}function $t(e,t){var r,n,o,i,s;let c=e.selection.main,l=c.empty||c.to>c.from+100?"":e.sliceDoc(c.from,c.to);if(t&&!l)return t;let d=e.facet(Se);return new cn({search:((r=t==null?void 0:t.literal)!==null&&r!==void 0?r:d.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=t==null?void 0:t.caseSensitive)!==null&&n!==void 0?n:d.caseSensitive,literal:(o=t==null?void 0:t.literal)!==null&&o!==void 0?o:d.literal,regexp:(i=t==null?void 0:t.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(s=t==null?void 0:t.wholeWord)!==null&&s!==void 0?s:d.wholeWord})}function un(e){let t=x.getPanel(e,Qt);return t&&t.dom.querySelector("[main-field]")}function fn(e){let t=un(e);t&&t==e.root.activeElement&&t.select()}const Xt=e=>{let t=e.state.field(ye,!1);if(t&&t.panel){let r=un(e);if(r&&r!=e.root.activeElement){let n=$t(e.state,t.query.spec);n.valid&&e.dispatch({effects:Je.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Jt.of(!0),t?Je.of($t(e.state,t.query.spec)):R.StateEffect.appendConfig.of(Wt)]});return!0},Zt=e=>{let t=e.state.field(ye,!1);if(!t||!t.panel)return!1;let r=x.getPanel(e,Qt);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Jt.of(!1)}),!0},er=[{key:"Mod-f",run:Xt,scope:"editor search-panel"},{key:"F3",run:ft,shift:ht,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ft,shift:ht,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:fi},{key:"Mod-Alt-g",run:Bo},{key:"Mod-d",run:ri,preventDefault:!0}];class di{constructor(t){this.view=t;let r=this.query=t.state.field(ye).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:r.search,placeholder:ne(t,"Find"),"aria-label":ne(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:r.replace,placeholder:ne(t,"Replace"),"aria-label":ne(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(o,i,s){return J("button",{class:"cm-button",name:o,onclick:i,type:"button"},s)}this.dom=J("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,n("next",()=>ft(t),[ne(t,"next")]),n("prev",()=>ht(t),[ne(t,"previous")]),n("select",()=>ui(t),[ne(t,"all")]),J("label",null,[this.caseField,ne(t,"match case")]),J("label",null,[this.reField,ne(t,"regexp")]),J("label",null,[this.wordField,ne(t,"by word")]),...t.state.readOnly?[]:[J("br"),this.replaceField,n("replace",()=>Ar(t),[ne(t,"replace")]),n("replaceAll",()=>hi(t),[ne(t,"replace all")])],J("button",{name:"close",onclick:()=>Zt(t),"aria-label":ne(t,"close"),type:"button"},["×"])])}commit(){let t=new cn({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Je.of(t)}))}keydown(t){x.runScopeHandlers(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?ht:ft)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Ar(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(Je)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Se).top}}function ne(e,t){return e.state.phrase(t)}const tt=30,rt=/[\s\.,:;?!]/;function tr(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),o=e.state.doc.lineAt(r).to,i=Math.max(n.from,t-tt),s=Math.min(o,r+tt),c=e.state.sliceDoc(i,s);if(i!=n.from){for(let l=0;l<tt;l++)if(!rt.test(c[l+1])&&rt.test(c[l])){c=c.slice(l);break}}if(s!=o){for(let l=c.length-1;l>c.length-tt;l--)if(!rt.test(c[l-1])&&rt.test(c[l])){c=c.slice(0,l);break}}return x.EditorView.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${n.number}.`)}const gi=x.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Wt=[ye,R.Prec.low(li),gi],pi={Search:"搜索",Replace:"替换",Find:"查找","Replace all":"全部替换",Next:"下一个",Previous:"上一个",All:"全部",Close:"关闭",done:"完成","Match case":"区分大小写","Match whole word":"全字匹配","Use regular expression":"使用正则表达式","by word":"按单词",replace:"替换","Search for":"搜索内容","Replace with":"替换为","No matches":"无匹配结果","replaced $ matches":"已替换 $ 个匹配项","replaced match on line $":"已替换第 $ 行的匹配项","on line":"在第",line:"行","$ of $ matches":"第 $ 个,共 $ 个匹配","Invalid regular expression":"无效的正则表达式","Query too long":"查询内容过长","Search string too long":"搜索字符串过长"};function hn(){return x.EditorView.theme({".cm-panel.cm-search":{fontSize:"14px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},".cm-search label":{fontSize:"13px"},".cm-search input":{fontSize:"13px",fontFamily:"inherit"},".cm-search button":{fontSize:"12px",fontFamily:"inherit"}})}function dn(e){setTimeout(()=>{const t=e.dom.querySelector(".cm-panel.cm-search");if(!t)return;t.querySelectorAll("label").forEach(i=>{var c;switch((c=i.textContent)==null?void 0:c.trim()){case"Match case":i.textContent="区分大小写";break;case"Match whole word":i.textContent="全字匹配";break;case"Use regular expression":i.textContent="使用正则表达式";break}}),t.querySelectorAll("button").forEach(i=>{var c;switch((c=i.textContent)==null?void 0:c.trim()){case"Next":i.textContent="下一个";break;case"Previous":i.textContent="上一个";break;case"All":i.textContent="全部";break;case"Replace all":i.textContent="全部替换";break;case"Close":i.textContent="关闭";break;case"done":i.textContent="完成";break}}),t.querySelectorAll('input[type="text"]').forEach((i,s)=>{const c=i;s===0?c.placeholder="搜索内容":s===1&&(c.placeholder="替换为")})},100)}function jt(){return[hn(),Gt({top:!0}),yt(),x.keymap.of(er),x.EditorView.updateListener.of(e=>{e.view.dom.querySelector(".cm-panel.cm-search")&&dn(e.view)})]}function mi(){return[yt()]}function qt(){return[Gt({top:!0}),yt(),x.keymap.of(er)]}const yi=[{key:"Ctrl-f",mac:"Cmd-f",run:()=>!0},{key:"F3",run:()=>!0},{key:"Shift-F3",run:()=>!0}],vi=({value:e,onChange:t,extensions:r=[],height:n="300px",disabled:o=!1,readOnly:i=!1,className:s="",style:c={},placeholder:l="",showLineNumbers:d=!0,onEditorViewCreated:f,locale:m="zh-CN"},P)=>{const E=T.useRef(null),w=T.useRef();return T.useEffect(()=>{if(!E.current)return;const v=[ge.history(),x.keymap.of([...ge.historyKeymap,ge.indentWithTab,{key:"Enter",run:ge.insertNewlineAndIndent}]),x.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),m==="zh-CN"?jt():qt(),l?x.placeholder(l):[],d?x.lineNumbers():[],x.EditorView.updateListener.of(g=>{if(g.docChanged&&t){const C={value:g.state.doc.toString(),readOnlyRanges:[]};t(C)}})];(o||i)&&v.push(R.EditorState.readOnly.of(!0));const y=R.EditorState.create({doc:e,extensions:[...v,...r]}),k=new x.EditorView({state:y,parent:E.current});return w.current=k,f&&f(k),()=>{var g;(g=w.current)==null||g.destroy()}},[]),T.useEffect(()=>{w.current&&e!==w.current.state.doc.toString()&&w.current.dispatch({changes:{from:0,to:w.current.state.doc.length,insert:e}})},[e]),T.useEffect(()=>{if(!w.current||!E.current)return;const v=w.current.state.doc.toString();w.current.destroy();const y=[ge.history(),x.keymap.of([...ge.historyKeymap,ge.indentWithTab,{key:"Enter",run:ge.insertNewlineAndIndent}]),x.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),m==="zh-CN"?jt():qt(),l?x.placeholder(l):[],d?x.lineNumbers():[],x.EditorView.updateListener.of(C=>{if(C.docChanged&&t){const M={value:C.state.doc.toString(),readOnlyRanges:[]};t(M)}})];(o||i)&&y.push(R.EditorState.readOnly.of(!0));const k=R.EditorState.create({doc:v,extensions:[...y,...r]}),g=new x.EditorView({state:k,parent:E.current});w.current=g,f&&f(g)},[o,i,d]),T.useImperativeHandle(P,()=>({insertTextAtCursor:v=>{const y=w.current;y&&(y.dispatch(y.state.replaceSelection(v)),y.focus())},goToPosition:v=>{const y=w.current;if(y){const k=y.state.doc.length,g=Math.max(0,Math.min(v,k));y.dispatch({selection:{anchor:g,head:g},scrollIntoView:!0}),y.focus()}},goToLine:(v,y=0)=>{const k=w.current;if(k){const g=k.state.doc,C=Math.max(1,Math.min(v,g.lines)),M=g.line(C),h=Math.max(0,Math.min(y,M.length))+M.from;k.dispatch({selection:{anchor:h,head:h},scrollIntoView:!0}),k.focus()}},getEditorView:()=>w.current})),mt("div",{ref:E,className:`senyao-editor ${o?"disabled":""} ${i?"readonly":""} ${s}`,style:{height:n,...c}})},vt=T.forwardRef(vi),bi=({value:e,onChange:t,language:r="json",extensions:n=[],theme:o="light",showLineNumbers:i=!0,...s},c)=>{const l=T.useMemo(()=>{const d=Kr(r)?Hr(r):[],f=Xr(o);return[d,f,...n]},[r,n,o]);return mt(vt,{ref:c,value:e,onChange:t,extensions:l,showLineNumbers:i,...s})},xi=T.forwardRef(bi),Ei=({value:e,onChange:t,extensions:r=[],readOnlyRanges:n,manageReadOnlyRanges:o=!0,showLineNumbers:i=!0,...s},c)=>{const l=T.useRef(null),f=(b=>b!=null&&typeof b=="object"&&"value"in b)(e),m=f?e.value:e,P=(f&&"readOnlyRanges"in e?e.readOnlyRanges:n)??[],[E,w]=T.useState(m??""),v=T.useRef(null),[y,k]=T.useState(P),g=T.useRef(E),[C,M]=T.useState(null),h=T.useRef(!1),z=T.useRef(new Map),N=T.useRef(!1);T.useEffect(()=>{if(o&&P.length>0&&!C){const b=[];let O=0;for(let A=0;A<P.length;A++){const D=P[A];D.start>O&&b.push({content:E.substring(O,D.start),editable:!0}),b.push({content:E.substring(D.start,D.end),editable:!1}),O=D.end}O<E.length&&b.push({content:E.substring(O),editable:!0}),M(b)}},[o,P,E,C]),T.useEffect(()=>{if(E){const b=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],O=new Map;b.forEach(A=>{const D=E.indexOf(A);D>=0&&O.set(A,D)}),z.current=O}},[]);const Ie=T.useMemo(()=>{const b=[Fr.sql(),Vt.autocompletion()];return y.length>0&&b.push(en(y)),[...b,...r]},[r,y]),ve=T.useCallback((b,O,A=0)=>{const D=b.indexOf(O,A);return D>=0?D:null},[]),Ce=T.useCallback((b,O)=>{if(!o||!b||b.length===0)return b;const A=[...b];let D=0;for(let G=0;G<b.length;G++){const ie=b[G];if(!ie.editable){const de=ve(O,ie.content,D);de!==null&&(G>0&&b[G-1].editable&&de>D&&(A[G-1]={...A[G-1],content:O.substring(D,de)}),D=de+ie.content.length)}}const U=b[b.length-1];return U.editable&&D<O.length&&(A[b.length-1]={...U,content:O.substring(D)}),A},[o,ve]),Re=T.useCallback(b=>{let O=!1;return z.current.forEach((A,D)=>{const U=b.indexOf(D);U>=0&&Math.abs(U-A)>0&&(z.current.set(D,U),U>A&&(A===0||A<15)&&(O=!0))}),O},[]),be=T.useCallback(()=>{if(!v.current)return;const b=v.current,O=b.state.doc.toString(),A=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],D=b.state.selection;let U=!1;for(const G of A){const ie=O.indexOf(G);if(ie>=0){b.dispatch({selection:{anchor:ie,head:ie+G.length},scrollIntoView:!1}),U=!0;break}}U&&setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({selection:D,scrollIntoView:!1})},10)},[]),ee=T.useCallback(()=>{if(!v.current)return;const b=v.current;y.length>0&&(pe(b,[]),setTimeout(()=>{b.dom&&document.contains(b.dom)&&(pe(b,y),setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({})},10))},10))},[y]),ce=T.useCallback(b=>{const O=b.value,A=g.current;w(O),A!==O&&(!A||O.length>(A==null?void 0:A.length)&&!A.startsWith(O.substring(0,5))&&O.includes(A.substring(0,10)))&&(h.current=!0,Re(O)&&setTimeout(()=>{be()},10)),g.current=O;const D=v.current?tn(v.current):y;if(o&&C){const U=Ce(C,O);M(U);const{readOnlyRanges:G}=Nt(U);k(G),v.current&&pe(v.current,G),t&&t({value:O,readOnlyRanges:G})}else t&&t({value:O,readOnlyRanges:D})},[t,o,C,y,Ce,Re,be]);T.useEffect(()=>{!o&&JSON.stringify(P)!==JSON.stringify(y)&&(k(P),v.current&&pe(v.current,P))},[P,y,o]),T.useEffect(()=>{if(o&&C){const{readOnlyRanges:b}=Nt(C);JSON.stringify(b)!==JSON.stringify(y)&&(k(b),v.current&&pe(v.current,b))}},[C,y,o]),T.useEffect(()=>{v.current&&h.current&&(h.current=!1,v.current.dispatch({}))},[E]),T.useEffect(()=>{v.current&&y.length>0&&!N.current&&(N.current=!0,setTimeout(()=>{ee()},50),setTimeout(()=>{ee()},200))},[ee,y]);const he=T.useCallback(b=>{if(v.current=b,y.length>0&&(pe(b,y),setTimeout(()=>{pe(b,[]),setTimeout(()=>{pe(b,y)},10)},50)),E){const O=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],A=new Map;O.forEach(D=>{const U=E.indexOf(D);U>=0&&A.set(D,U)}),z.current=A}},[y,E]);return mt(vt,{ref:l,value:E,onChange:ce,extensions:Ie,showLineNumbers:i,onEditorViewCreated:he,...s})},Si=T.forwardRef(Ei),Ci=(e,t)=>{const{value:r,onChange:n,extensions:o=[],showLineNumbers:i=!0,enableFormatting:s=!1,enableCodeFolding:c=!0,...l}=e,d=T.useRef(!0),f=T.useRef(null),m=T.useCallback(g=>{try{return g===""||JSON.parse(g),!0}catch{return!1}},[]),P=T.useCallback(g=>{try{if(!g.trim())return"";const C=JSON.parse(g);return JSON.stringify(C,null,2)}catch{return g}},[]),E=T.useCallback(()=>{if(!f.current)return!1;const g=f.current,C=g.state.doc.toString(),M=P(C);if(M===C)return!1;const h=g.state.update({changes:{from:0,to:g.state.doc.length,insert:M}});return g.dispatch(h),!0},[P]),w=T.useMemo(()=>x.keymap.of([{key:"Alt-f",mac:"Mod-Alt-f",run:()=>E()}]),[E]),v=T.useCallback(g=>{if(n){const C=m(g.value);d.current=C,n(g)}},[n,m]),y=T.useMemo(()=>{const g=[Lr.json(),se.bracketMatching(),Vt.closeBrackets(),R.Prec.highest(w),...o];return c&&g.push(se.codeFolding(),se.foldGutter({markerDOM:C=>{const M=document.createElement("span");return M.style.cssText=`
49
49
  display: inline-flex;
50
50
  align-items: center;
51
51
  justify-content: center;
@@ -57,4 +57,4 @@ React keys must be passed directly to JSX without using spread:
57
57
  transition: all 0.2s ease;
58
58
  user-select: none;
59
59
  border-radius: 2px;
60
- `,O.textContent=w?"▾":"▸",O.onmouseenter=()=>{O.style.backgroundColor="rgba(24, 144, 255, 0.08)"},O.onmouseleave=()=>{O.style.backgroundColor="transparent"},O}}),x.keymap.of(se.foldKeymap)),y},[_,o,c]),C=k.useCallback(y=>{f.current=y,s&&r&&setTimeout(()=>{p()},0)},[s,r,p]);return mt(vt,{ref:t,value:r,showLineNumbers:i,onChange:m,extensions:E,onEditorViewCreated:C,...l})},Ri=k.forwardRef(Ci);exports.Editor=xi;exports.GenericEditor=vt;exports.JSONEditor=Ri;exports.SQLEditor=Si;exports.applyChinese=dn;exports.blocksToEditorData=Nt;exports.chineseLanguageExtension=hn;exports.closeSearchPanel=Zt;exports.commonExtensions=jo;exports.createAutocompletionExtension=Gr;exports.createEnglishSearchExtension=qt;exports.createHighlightOnlyExtension=mi;exports.createKeymapExtension=Jr;exports.createLintExtension=Wo;exports.createSearchExtension=jt;exports.customSearchKeymap=yi;exports.darkTheme=Qr;exports.getCurrentReadOnlyRanges=tn;exports.getLanguageExtension=Hr;exports.getThemeExtension=Xr;exports.highlightSelectionMatches=yt;exports.isSupportedLanguage=Kr;exports.lightTheme=Dt;exports.openSearchPanel=Xt;exports.readOnlyRanges=en;exports.search=Gt;exports.searchKeymap=er;exports.searchTranslationsZhCN=pi;exports.updateReadOnlyRanges=pe;
60
+ `,M.textContent=C?"▾":"▸",M.onmouseenter=()=>{M.style.backgroundColor="rgba(24, 144, 255, 0.08)"},M.onmouseleave=()=>{M.style.backgroundColor="transparent"},M}}),x.keymap.of(se.foldKeymap)),g},[w,o,c]),k=T.useCallback(g=>{f.current=g,s&&r&&setTimeout(()=>{E()},0)},[s,r,E]);return mt(vt,{ref:t,value:r,showLineNumbers:i,onChange:v,extensions:y,onEditorViewCreated:k,...l})},Ri=T.forwardRef(Ci);exports.Editor=xi;exports.GenericEditor=vt;exports.JSONEditor=Ri;exports.SQLEditor=Si;exports.applyChinese=dn;exports.blocksToEditorData=Nt;exports.chineseLanguageExtension=hn;exports.closeSearchPanel=Zt;exports.commonExtensions=jo;exports.createAutocompletionExtension=Gr;exports.createEnglishSearchExtension=qt;exports.createHighlightOnlyExtension=mi;exports.createKeymapExtension=Jr;exports.createLintExtension=Wo;exports.createSearchExtension=jt;exports.customSearchKeymap=yi;exports.darkTheme=Qr;exports.getCurrentReadOnlyRanges=tn;exports.getLanguageExtension=Hr;exports.getThemeExtension=Xr;exports.highlightSelectionMatches=yt;exports.isSupportedLanguage=Kr;exports.lightTheme=Dt;exports.openSearchPanel=Xt;exports.readOnlyRanges=en;exports.search=Gt;exports.searchKeymap=er;exports.searchTranslationsZhCN=pi;exports.updateReadOnlyRanges=pe;