@senyao-design-system/editor 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -12
- package/dist/index.mjs +551 -543
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
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"),E=require("@codemirror/view"),Ue=require("@codemirror/commands"),Vt=require("@codemirror/autocomplete"),mr=require("@codemirror/lint"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),Fr=require("@codemirror/lang-sql"),Lr=require("@codemirror/lang-json"),E=require("@codemirror/view"),Ue=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 pe=Nn(k);var Ot={exports:{}},Ve={};/**
|
|
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 Ve;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,
|
|
9
|
+
*/var yr;function In(){if(yr)return Ve;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 Ve.Fragment=r,Ve.jsx=s,Ve.jsxs=s,Ve}var Ye={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,35 +14,35 @@
|
|
|
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"),
|
|
18
|
-
`+$e+a}}var We=!1,we;{var xt=typeof WeakMap=="function"?WeakMap:Map;we=new xt}function S(a,u){if(!a||We)return"";{var g=we.get(a);if(g!==void 0)return g}var
|
|
19
|
-
`),Z=
|
|
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 x(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(F){return String(F)});Y.unshift("Warning: "+u),Function.prototype.apply.call(console[a],console,Y)}}var D=!1,h=!1,z=!1,N=!1,Ne=!1,ye;ye=Symbol.for("react.module.reference");function Se(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||Ne||a===o||a===d||a===f||N||a===p||D||h||z||typeof a=="object"&&a!==null&&(a.$$typeof===T||a.$$typeof===v||a.$$typeof===s||a.$$typeof===c||a.$$typeof===l||a.$$typeof===ye||a.getModuleId!==void 0))}function Ce(a,u,g){var P=a.displayName;if(P)return P;var W=u.displayName||u.name||"";return W!==""?g+"("+W+")":g}function ve(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 ve(u)+".Consumer";case s:var g=a;return ve(g._context)+".Provider";case l:return Ce(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,F=W._init;try{return ee(F(Y))}catch{return null}}}return null}var ce=Object.assign,he=0,b,O,M,L,U,K,ie;function de(){}de.__reactDisabledLog=!0;function bt(){{if(he===0){b=console.log,O=console.info,M=console.warn,L=console.error,U=console.group,K=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 Et(){{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:M}),error:ce({},a,{value:L}),group:ce({},a,{value:U}),groupCollapsed:ce({},a,{value:K}),groupEnd:ce({},a,{value:ie})})}he<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ie=C.ReactCurrentDispatcher,$e;function Re(a,u,g){{if($e===void 0)try{throw Error()}catch(W){var P=W.stack.trim().match(/\n( *(at )?)/);$e=P&&P[1]||""}return`
|
|
18
|
+
`+$e+a}}var We=!1,we;{var xt=typeof WeakMap=="function"?WeakMap:Map;we=new xt}function S(a,u){if(!a||We)return"";{var g=we.get(a);if(g!==void 0)return g}var P;We=!0;var W=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=Ie.current,Ie.current=null,bt();try{if(u){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(te){P=te}Reflect.construct(a,[],F)}else{try{F.call()}catch(te){P=te}a.call(F.prototype)}}else{try{throw Error()}catch(te){P=te}a()}}catch(te){if(te&&P&&typeof te.stack=="string"){for(var A=te.stack.split(`
|
|
19
|
+
`),Z=P.stack.split(`
|
|
20
20
|
`),B=A.length-1,H=Z.length-1;B>=1&&H>=0&&A[B]!==Z[H];)H--;for(;B>=1&&H>=0;B--,H--)if(A[B]!==Z[H]){if(B!==1||H!==1)do if(B--,H--,H<0||A[B]!==Z[H]){var ae=`
|
|
21
|
-
`+A[B].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),typeof a=="function"&&we.set(a,ae),ae}while(B>=1&&H>=0);break}}}finally{We=!1,Ie.current=Y,Et(),Error.prepareStackTrace=W}var _e=a?a.displayName||a.name:"",Ee=_e?Re(_e):"";return typeof a=="function"&&we.set(a,Ee),Ee}function je(a,u,g){return S(a,!1)}function ke(a){var u=a.prototype;return!!(u&&u.isReactComponent)}function be(a,u,g){if(a==null)return"";if(typeof a=="function")return S(a,ke(a));if(typeof a=="string")return Re(a);switch(a){case
|
|
21
|
+
`+A[B].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),typeof a=="function"&&we.set(a,ae),ae}while(B>=1&&H>=0);break}}}finally{We=!1,Ie.current=Y,Et(),Error.prepareStackTrace=W}var _e=a?a.displayName||a.name:"",Ee=_e?Re(_e):"";return typeof a=="function"&&we.set(a,Ee),Ee}function je(a,u,g){return S(a,!1)}function ke(a){var u=a.prototype;return!!(u&&u.isReactComponent)}function be(a,u,g){if(a==null)return"";if(typeof a=="function")return S(a,ke(a));if(typeof a=="string")return Re(a);switch(a){case d:return Re("Suspense");case f:return Re("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case l:return je(a.render);case v:return be(a.type,u,g);case T:{var P=a,W=P._payload,Y=P._init;try{return be(Y(W),u,g)}catch{}}}return""}var qe=Object.prototype.hasOwnProperty,rr={},nr=C.ReactDebugCurrentFrame;function Ze(a){if(a){var u=a._owner,g=be(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(qe);for(var F in a)if(Y(a,F)){var A=void 0;try{if(typeof a[F]!="function"){var Z=Error((P||"React class")+": "+g+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}A=a[F](u,F,P,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(B){A=B}A&&!(A 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,F,typeof A),Ze(null)),A instanceof Error&&!(A.message in rr)&&(rr[A.message]=!0,Ze(W),y("Failed %s type: %s",g,A.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(qe.call(a,"ref")){var u=Object.getOwnPropertyDescriptor(a,"ref").get;if(u&&u.isReactWarning)return!1}return a.ref!==void 0}function En(a){if(qe.call(a,"key")){var u=Object.getOwnPropertyDescriptor(a,"key").get;if(u&&u.isReactWarning)return!1}return a.key!==void 0}function xn(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,F){var A={$$typeof:t,type:a,key:u,ref:g,props:F,_owner:Y};return A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(A,"_self",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.defineProperty(A,"_source",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A};function wn(a,u,g,P,W){{var Y,F={},A=null,Z=null;g!==void 0&&(ir(g),A=""+g),En(u)&&(ir(u.key),A=""+u.key),bn(u)&&(Z=u.ref,xn(u,W));for(Y in u)qe.call(u,Y)&&!vn.hasOwnProperty(Y)&&(F[Y]=u[Y]);if(a&&a.defaultProps){var B=a.defaultProps;for(Y in B)F[Y]===void 0&&(F[Y]=B[Y])}if(A||Z){var H=typeof a=="function"?a.displayName||a.name||"Unknown":a;A&&Sn(F,H),Z&&Cn(F,H)}return Rn(a,A,Z,W,P,ar.current,F)}}var Ct=C.ReactCurrentOwner,lr=C.ReactDebugCurrentFrame;function Te(a){if(a){var u=a._owner,g=be(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`
|
|
22
22
|
|
|
23
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=`
|
|
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
|
|
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)+"."),Te(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),Te(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=x(a);if(typeof W=="function"&&W!==a.entries)for(var Y=W.call(a),F;!(F=Y.next()).done;)wt(F.value)&&hr(F.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"){Te(a),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",P),Te(null);break}}a.ref!==null&&(Te(a),y("Invalid attribute `ref` supplied to `React.Fragment`."),Te(null))}}var gr={};function pr(a,u,g,P,W,Y){{var F=Se(a);if(!F){var A="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(A+=" 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?A+=Z:A+=ur();var B;a===null?B="null":St(a)?B="array":a!==void 0&&a.$$typeof===t?(B="<"+(ee(a.type)||"Unknown")+" />",A=" 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,A)}var H=wn(a,u,g,W,Y);if(H==null)return H;if(F){var ae=u.children;if(ae!==void 0)if(P)if(St(ae)){for(var _e=0;_e<ae.length;_e++)dr(ae[_e],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(qe.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:
|
|
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;Ye.Fragment=n,Ye.jsx=An,Ye.jsxs=Fn}()),Ye}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 ce(e){return e.length}function Ut(e){return e.length}function et(e,t){return t.push(e),e}function Gn(e,t){return e.map(t).join("")}var gt=1,Fe=1,$r=0,re=0,G=0,De="";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:Fe,length:s,return:""}}function ze(e,t){return Un(pt("",null,null,"",null,null,0),e,{length:-e.length},t)}function Kn(){return G}function Jn(){return G=re>0?Q(De,--re):0,Fe--,G===10&&(Fe=1,gt--),G}function oe(){return G=re<$r?Q(De,re++):0,Fe++,G===10&&(Fe=1,gt++),G}function ue(){return Q(De,re)}function nt(){return re}function Qe(e,t){return He(De,e,t)}function Ge(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=Fe=1,$r=ce(De=e),re=0,[]}function jr(e){return De="",e}function ot(e){return Ir(Qe(re-1,At(e===91?e+2:e===40?e+1:e)))}function Qn(e){for(;(G=ue())&&G<33;)oe();return Ge(e)>2||Ge(G)>3?"":" "}function Xn(e,t){for(;--t&&oe()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Qe(e,nt()+(t<6&&ue()==32&&oe()==32))}function At(e){for(;oe();)switch(G){case e:return re;case 34:case 39:e!==34&&e!==39&&At(G);break;case 40:e===41&&At(e);break;case 92:oe();break}return re}function Zn(e,t){for(;oe()&&e+G!==57;)if(e+G===84&&ue()===47)break;return"/*"+Qe(t,re-1)+"*"+dt(e===47?e:oe())}function eo(e){for(;!Ge(ue());)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 h=0,f=0,v=s,w=0,y=0,T=0,p=1,x=1,m=1,C=0,P="",N=o,d=i,z=n,D=P;x;)switch(T=C,C=oe()){case 40:if(T!=108&&Q(D,v-1)==58){Mt(D+=$(ot(C),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:D+=ot(C);break;case 9:case 10:case 13:case 32:D+=Qn(T);break;case 92:D+=Xn(nt()-1,7);continue;case 47:switch(ue()){case 42:case 47:et(ro(Zn(oe(),nt()),t,r),l);break;default:D+="/"}break;case 123*p:c[h++]=ce(D)*m;case 125*p:case 59:case 0:switch(C){case 0:case 125:x=0;case 59+f:m==-1&&(D=$(D,/\f/g,"")),y>0&&ce(D)-v&&et(y>32?xr(D+";",n,r,v-1):xr($(D," ","")+";",n,r,v-2),l);break;case 59:D+=";";default:if(et(z=Er(D,t,r,h,f,o,c,P,N=[],d=[],v),i),C===123)if(f===0)it(D,t,z,z,N,i,v,c,d);else switch(w===99&&Q(D,3)===110?100:w){case 100:case 108:case 109:case 115:it(e,z,z,n&&et(Er(e,z,z,0,0,o,c,P,o,N=[],v),d),o,d,v,c,n?N:d);break;default:it(D,z,z,z,[""],d,0,c,d)}}h=f=y=0,p=m=1,P=D="",v=s;break;case 58:v=1+ce(D),y=T;default:if(p<1){if(C==123)--p;else if(C==125&&p++==0&&Jn()==125)continue}switch(D+=dt(C),C*p){case 38:m=f>0?1:(D+="\f",-1);break;case 44:c[h++]=(ce(D)-1)*m,m=1;break;case 64:ue()===45&&(D+=ot(oe())),w=ue(),f=v=ce(P=D+=eo(nt())),C++;break;case 45:T===45&&ce(D)==2&&(p=0)}}return i}function Er(e,t,r,n,o,i,s,c,l,h,f){for(var v=o-1,w=o===0?i:[""],y=Ut(w),T=0,p=0,x=0;T<n;++T)for(var m=0,C=He(e,v+1,v=zn(p=s[T])),P=e;m<y;++m)(P=Ir(p>0?w[m]+" "+C:$(C,/&\f/g,w[m])))&&(l[x++]=P);return pt(e,t,r,o===0?Yt:c,l,h,f)}function ro(e,t,r){return pt(e,t,r,Dr,dt(Kn()),He(e,2,-2),0)}function xr(e,t,r,n){return pt(e,t,r,zt,He(e,0,n),He(e,n+1,-1),n)}function Me(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+"{"+Me(e.children,n)+"}";case Yt:e.value=e.props.join(",")}return ce(r=Me(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=ue(),o===38&&i===12&&(r[n]=1),!Ge(i);)oe();return Qe(t,re)},co=function(t,r){var n=-1,o=44;do switch(Ge(o)){case 0:o===38&&ue()===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]=ue()===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,h=0;l<s.length;l++)for(var f=0;f<c.length;f++,h++)t.props[h]=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(ce(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,ce(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 Me([ze(t,{value:$(t.value,"@","@"+I)})],o);case Yt:if(t.length)return Gn(t.props,function(i){switch(Hn(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Me([ze(t,{props:[$(i,/:(read-\w+)/,":"+at+"$1")]})],o);case"::placeholder":return Me([ze(t,{props:[$(i,/:(plac\w+)/,":"+I+"input-$1")]}),ze(t,{props:[$(i,/:(plac\w+)/,":"+at+"$1")]}),ze(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(p){var x=p.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(p),p.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(p){for(var x=p.getAttribute("data-emotion").split(" "),m=1;m<x.length;m++)i[x[m]]=!0;c.push(p)});var l,h=[uo,fo];{var f,v=[no,io(function(p){f.insert(p)})],w=oo(h.concat(o,v)),y=function(x){return Me(to(x),w)};l=function(x,m,C,P){f=C,y(x?x+"{"+m.styles+"}":m.styles),P&&(T.inserted[m.name]=!0)}}var T={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 T.sheet.hydrate(c),T},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 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;Ye.Fragment=n,Ye.jsx=An,Ye.jsxs=Fn}()),Ye}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 Gn(e,t){return e.map(t).join("")}var gt=1,Fe=1,$r=0,re=0,G=0,De="";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:Fe,length:s,return:""}}function ze(e,t){return Un(pt("",null,null,"",null,null,0),e,{length:-e.length},t)}function Kn(){return G}function Jn(){return G=re>0?Q(De,--re):0,Fe--,G===10&&(Fe=1,gt--),G}function oe(){return G=re<$r?Q(De,re++):0,Fe++,G===10&&(Fe=1,gt++),G}function fe(){return Q(De,re)}function nt(){return re}function Qe(e,t){return He(De,e,t)}function Ge(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=Fe=1,$r=le(De=e),re=0,[]}function jr(e){return De="",e}function ot(e){return Ir(Qe(re-1,At(e===91?e+2:e===40?e+1:e)))}function Qn(e){for(;(G=fe())&&G<33;)oe();return Ge(e)>2||Ge(G)>3?"":" "}function Xn(e,t){for(;--t&&oe()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Qe(e,nt()+(t<6&&fe()==32&&oe()==32))}function At(e){for(;oe();)switch(G){case e:return re;case 34:case 39:e!==34&&e!==39&&At(G);break;case 40:e===41&&At(e);break;case 92:oe();break}return re}function Zn(e,t){for(;oe()&&e+G!==57;)if(e+G===84&&fe()===47)break;return"/*"+Qe(t,re-1)+"*"+dt(e===47?e:oe())}function eo(e){for(;!Ge(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,x=1,C=1,y=0,w="",D=o,h=i,z=n,N=w;x;)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:x=0;case 59+f:C==-1&&(N=$(N,/\f/g,"")),p>0&&le(N)-v&&et(p>32?xr(N+";",n,r,v-1):xr($(N," ","")+";",n,r,v-2),l);break;case 59:N+=";";default:if(et(z=Er(N,t,r,d,f,o,c,w,D=[],h=[],v),i),y===123)if(f===0)it(N,t,z,z,D,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(Er(e,z,z,0,0,o,c,w,o,D=[],v),h),o,h,v,c,n?D: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 Er(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,x=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[x++]=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(Kn()),He(e,2,-2),0)}function xr(e,t,r,n){return pt(e,t,r,zt,He(e,0,n),He(e,n+1,-1),n)}function Me(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+"{"+Me(e.children,n)+"}";case Yt:e.value=e.props.join(",")}return le(r=Me(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),!Ge(i);)oe();return Qe(t,re)},co=function(t,r){var n=-1,o=44;do switch(Ge(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 Me([ze(t,{value:$(t.value,"@","@"+I)})],o);case Yt:if(t.length)return Gn(t.props,function(i){switch(Hn(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Me([ze(t,{props:[$(i,/:(read-\w+)/,":"+at+"$1")]})],o);case"::placeholder":return Me([ze(t,{props:[$(i,/:(plac\w+)/,":"+I+"input-$1")]}),ze(t,{props:[$(i,/:(plac\w+)/,":"+at+"$1")]}),ze(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 x=m.getAttribute("data-emotion");x.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 x=m.getAttribute("data-emotion").split(" "),C=1;C<x.length;C++)i[x[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(x){return Me(to(x),T)};l=function(x,C,y,w){f=y,p(x?x+"{"+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
|
|
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,
|
|
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,x=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 D(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 D(h)||w(h)===l},j.isConcurrentMode=D,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===x||h.$$typeof===C||h.$$typeof===y||h.$$typeof===m)},j.typeOf=w,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,h=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,v=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,T=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(S){return typeof S=="string"||typeof S=="function"||S===n||S===h||S===i||S===o||S===v||S===w||typeof S=="object"&&S!==null&&(S.$$typeof===T||S.$$typeof===y||S.$$typeof===s||S.$$typeof===c||S.$$typeof===f||S.$$typeof===x||S.$$typeof===m||S.$$typeof===C||S.$$typeof===p)}function N(S){if(typeof S=="object"&&S!==null){var je=S.$$typeof;switch(je){case t:var ke=S.type;switch(ke){case l:case h:case n:case i:case o:case v:return ke;default:var be=ke&&ke.$$typeof;switch(be){case c:case f:case T:case y:case s:return be;default:return je}}case r:return je}}}var d=l,z=h,D=c,Ne=s,ye=t,Se=f,Ce=n,ve=T,ee=y,se=r,fe=i,b=o,O=v,M=!1;function L(S){return M||(M=!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)||N(S)===l}function U(S){return N(S)===h}function K(S){return N(S)===c}function ie(S){return N(S)===s}function he(S){return typeof S=="object"&&S!==null&&S.$$typeof===t}function bt(S){return N(S)===f}function Et(S){return N(S)===n}function Ie(S){return N(S)===T}function $e(S){return N(S)===y}function Re(S){return N(S)===r}function We(S){return N(S)===i}function we(S){return N(S)===o}function xt(S){return N(S)===v}q.AsyncMode=d,q.ConcurrentMode=z,q.ContextConsumer=D,q.ContextProvider=Ne,q.Element=ye,q.ForwardRef=Se,q.Fragment=Ce,q.Lazy=ve,q.Memo=ee,q.Portal=se,q.Profiler=fe,q.StrictMode=b,q.Suspense=O,q.isAsyncMode=L,q.isConcurrentMode=U,q.isContextConsumer=K,q.isContextProvider=ie,q.isElement=he,q.isForwardRef=bt,q.isFragment=Et,q.isLazy=Ie,q.isMemo=$e,q.isPortal=Re,q.isProfiler=We,q.isStrictMode=we,q.isSuspense=xt,q.isValidElementType=P,q.typeOf=N}()),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},Eo={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yr={};Yr[Vr.ForwardRef]=bo;Yr[Vr.Memo]=Eo;var xo=!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||xo===!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 le={name:o,styles:i,next:le},o})}return wo[t]!==1&&!Ur(t)&&typeof r=="number"&&r!==0?r+"px":r};function Ke(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 le={name:o.name,styles:o.styles,next:le},o.name;var i=r;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)le={name:s.name,styles:s.styles,next:le},s=s.next;var c=i.styles+";";return c}return _o(e,t,r)}case"function":{if(e!==void 0){var l=le,h=r(e);return le=l,Ke(e,t,h)}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+=Ke(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 h=Ke(e,t,s);switch(i){case"animation":case"animationName":{n+=Tt(i)+":"+h+";";break}default:n+=i+"{"+h+"}"}}}return n}var Tr=/label:\s*([^\s;{]+)\s*(;|$)/g,le;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="";le=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=Ke(r,t,i);else{var s=i;o+=s[0]}for(var c=1;c<e.length;c++)if(o+=Ke(r,t,e[c]),n){var l=i;o+=l[c]}Tr.lastIndex=0;for(var h="",f;(f=Tr.exec(o))!==null;)h+="-"+f[1];var v=Ro(o)+h;return{name:v,styles:o,next:le}}var Oo=function(t){return t()},Mo=ge.useInsertionEffect?ge.useInsertionEffect:!1,Ao=Mo||Oo,Br=ge.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=ge.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,ge.useContext(Lo));s+=t.key+"-"+c.name;var l={};for(var h in e)Bt.call(e,h)&&h!=="css"&&h!==Lt&&(l[h]=e[h]);return l.className=s,r&&(l.ref=r),ge.createElement(ge.Fragment,null,ge.createElement(No,{cache:t,serialized:c,isStringTag:typeof o=="string"}),ge.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 Gr(e){return["sql","json"].includes(e.toLowerCase())}function Kr(e={}){return Vt.autocompletion(e)}function Wo(e){return[mr.lintGutter(),mr.linter(e)]}function Jr(){return E.keymap.of([Ue.indentWithTab])}const jo=[Jr(),Kr()],qo=pe.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=[E.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)"}}),pe.syntaxHighlighting(qo)],Vo=pe.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=[E.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)"}}),pe.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,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,x=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===x||S.$$typeof===C||S.$$typeof===y||S.$$typeof===m)}function D(S){if(typeof S=="object"&&S!==null){var je=S.$$typeof;switch(je){case t:var ke=S.type;switch(ke){case l:case d:case n:case i:case o:case v:return ke;default:var be=ke&&ke.$$typeof;switch(be){case c:case f:case _:case p:case s:return be;default:return je}}case r:return je}}}var h=l,z=d,N=c,Ne=s,ye=t,Se=f,Ce=n,ve=_,ee=p,ce=r,he=i,b=o,O=v,M=!1;function L(S){return M||(M=!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)||D(S)===l}function U(S){return D(S)===d}function K(S){return D(S)===c}function ie(S){return D(S)===s}function de(S){return typeof S=="object"&&S!==null&&S.$$typeof===t}function bt(S){return D(S)===f}function Et(S){return D(S)===n}function Ie(S){return D(S)===_}function $e(S){return D(S)===p}function Re(S){return D(S)===r}function We(S){return D(S)===i}function we(S){return D(S)===o}function xt(S){return D(S)===v}q.AsyncMode=h,q.ConcurrentMode=z,q.ContextConsumer=N,q.ContextProvider=Ne,q.Element=ye,q.ForwardRef=Se,q.Fragment=Ce,q.Lazy=ve,q.Memo=ee,q.Portal=ce,q.Profiler=he,q.StrictMode=b,q.Suspense=O,q.isAsyncMode=L,q.isConcurrentMode=U,q.isContextConsumer=K,q.isContextProvider=ie,q.isElement=de,q.isForwardRef=bt,q.isFragment=Et,q.isLazy=Ie,q.isMemo=$e,q.isPortal=Re,q.isProfiler=We,q.isStrictMode=we,q.isSuspense=xt,q.isValidElementType=w,q.typeOf=D}()),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},Eo={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yr={};Yr[Vr.ForwardRef]=bo;Yr[Vr.Memo]=Eo;var xo=!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||xo===!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 Ke(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,Ke(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+=Ke(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=Ke(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+=Ke(r,t,i);else{var s=i;o+=s[0]}for(var c=1;c<e.length;c++)if(o+=Ke(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=pe.useInsertionEffect?pe.useInsertionEffect:!1,Ao=Mo||Oo,Br=pe.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=pe.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,pe.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),pe.createElement(pe.Fragment,null,pe.createElement(No,{cache:t,serialized:c,isStringTag:typeof o=="string"}),pe.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 Gr(e){return["sql","json"].includes(e.toLowerCase())}function Kr(e={}){return Vt.autocompletion(e)}function Wo(e){return[mr.lintGutter(),mr.linter(e)]}function Jr(){return E.keymap.of([Ue.indentWithTab])}const jo=[Jr(),Kr()],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=[E.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=[E.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 E.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 E.EditorView.decorations.from(e)}});function Zr(e){const t=[];return console.log(e,9999299),e.forEach(r=>{r.start<r.end&&t.push(E.Decoration.mark({inclusive:!0,attributes:{class:"cm-readOnly",style:"background-color: rgba(0, 0, 0, 0.05);"},priority:-100}).range(r.start,r.end))}),E.Decoration.set(t)}const Ht=new WeakMap;function en(e){let t=e.map(r=>({...r}));return[_r.init(()=>Zr(t)),E.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}),E.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)})}}),E.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,h,f)=>{const v=f-h,w=l-c,y=v-w;if(c===0&&(r=!0),c===0&&v>0&&i.start===0){s.start=v,s.end+=y;return}if(l<=i.start)s.start+=y,s.end+=y;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 T=i.end-c;s.end=c+Math.min(T,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 de(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 Le{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"&&(Le.prototype[Symbol.iterator]=function(){return this});const nn={from:-1,to:-1,match:/.*/.exec("")},Gt="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,Gt+(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 Ae{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 Ae(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 Ae(s,i)),new Ae(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,Gt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Ae.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=Ae.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,Gt),!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,h,f,v]=i,w=f?+f.slice(1):0,y=h?+h:c.number;if(h&&v){let x=y/100;l&&(x=x*(l=="-"?-1:1)+c.number/s.doc.lines),y=Math.round(s.doc.lines*x)}else h&&l&&(y=y*(l=="-"?-1:1)+c.number);let T=s.doc.line(Math.max(1,Math.min(s.doc.lines,y))),p=R.EditorSelection.cursor(T.from+Math.max(0,Math.min(w,T.length)));e.dispatch({effects:[Be.of(!1),E.EditorView.scrollIntoView(p.from,{y:"center"})],selection:p}),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=>E.showPanel.from(e,t=>t?It:null)}),Bo=e=>{let t=E.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=E.getPanel(e,It)}return t&&t.dom.querySelector("input").select(),!0},Ho=E.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"}}}),Go={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sn=R.Facet.define({combine(e){return R.combineConfig(e,Go,{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 Ko=E.Decoration.mark({class:"cm-selectionMatch"}),Jo=E.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=E.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 E.Decoration.none;let o=n.main,i,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return E.Decoration.none;let l=r.wordAt(o.head);if(!l)return E.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 E.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 E.Decoration.none}else if(i=r.sliceDoc(o.from,o.to),!i)return E.Decoration.none}let c=[];for(let l of e.visibleRanges){let h=new Le(r.doc,i,l.from,l.to);for(;!h.next().done;){let{from:f,to:v}=h.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(Ko.range(f,v)),c.length>t.maxMatches))return E.Decoration.none}}return E.Decoration.set(c)}},{decorations:e=>e.decorations}),Zo=E.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 Le(e.doc,t,n[n.length-1].to);;)if(c.next(),c.done){if(s)return null;c=new Le(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:E.EditorView.scrollIntoView(o.to)})),!0):!1},xe=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=>E.EditorView.scrollIntoView(t)})}});function Kt(e){return e?[xe.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):Pe(this,o,r,n)}}class ln{constructor(t){this.spec=t}}function Pe(e,t,r,n){return new Le(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=Pe(this.spec,t,n,t.doc.length).nextOverlapping();if(o.done){let i=Math.min(t.doc.length,r+this.spec.unquoted.length);o=Pe(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=Pe(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=Pe(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=Pe(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(),me=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=>E.showPanel.from(e,t=>t.panel)});class Pt{constructor(t,r){this.query=t,this.panel=r}}const si=E.Decoration.mark({class:"cm-searchMatch"}),ci=E.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),li=E.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(me))}update(e){let t=e.state.field(me);(t!=e.startState.field(me)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return E.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,(h,f)=>{let v=r.state.selection.ranges.some(w=>w.from==h&&w.to==f);n.add(h,f,v?ci:si)})}return n.finish()}},{decorations:e=>e.decorations});function Xe(e){return t=>{let r=t.state.field(me,!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(xe);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(xe);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 Le(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,h,f=[];s.from==n&&s.to==o&&(h=r.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:h}),s=t.nextMatch(r,s.from,s.to),f.push(E.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(xe).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:E.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0});function Qt(e){return e.state.facet(xe).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 h=e.facet(xe);return new cn({search:((r=t==null?void 0:t.literal)!==null&&r!==void 0?r:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=t==null?void 0:t.caseSensitive)!==null&&n!==void 0?n:h.caseSensitive,literal:(o=t==null?void 0:t.literal)!==null&&o!==void 0?o:h.literal,regexp:(i=t==null?void 0:t.regexp)!==null&&i!==void 0?i:h.regexp,wholeWord:(s=t==null?void 0:t.wholeWord)!==null&&s!==void 0?s:h.wholeWord})}function un(e){let t=E.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(me,!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(me,!1);if(!t||!t.panel)return!1;let r=E.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(me).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){E.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(xe).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 E.EditorView.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${n.number}.`)}const gi=E.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=[me,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 E.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(),Kt({top:!0}),yt(),E.keymap.of(er),E.EditorView.updateListener.of(e=>{e.view.dom.querySelector(".cm-panel.cm-search")&&dn(e.view)})]}function mi(){return[yt()]}function qt(){return[Kt({top:!0}),yt(),E.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:h,locale:f="zh-CN"},v)=>{const w=k.useRef(null),y=k.useRef();return k.useEffect(()=>{if(!w.current)return;const T=[E.keymap.of([Ue.indentWithTab,{key:"Enter",run:Ue.insertNewlineAndIndent}]),E.EditorView.lineWrapping,pe.syntaxHighlighting(pe.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?E.placeholder(c):[],l?E.lineNumbers():[],E.EditorView.updateListener.of(m=>{if(m.docChanged&&t){const C={value:m.state.doc.toString(),readOnlyRanges:[]};t(C)}})];o&&T.push(R.EditorState.readOnly.of(!0));const p=R.EditorState.create({doc:e,extensions:[...T,...r]}),x=new E.EditorView({state:p,parent:w.current});return y.current=x,h&&h(x),()=>{var m;(m=y.current)==null||m.destroy()}},[]),k.useEffect(()=>{y.current&&e!==y.current.state.doc.toString()&&y.current.dispatch({changes:{from:0,to:y.current.state.doc.length,insert:e}})},[e]),k.useEffect(()=>{if(!y.current||!w.current)return;const T=y.current.state.doc.toString();y.current.destroy();const p=[E.keymap.of([Ue.indentWithTab,{key:"Enter",run:Ue.insertNewlineAndIndent}]),E.EditorView.lineWrapping,pe.syntaxHighlighting(pe.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?E.placeholder(c):[],l?E.lineNumbers():[],E.EditorView.updateListener.of(C=>{if(C.docChanged&&t){const P={value:C.state.doc.toString(),readOnlyRanges:[]};t(P)}})];o&&p.push(R.EditorState.readOnly.of(!0));const x=R.EditorState.create({doc:T,extensions:[...p,...r]}),m=new E.EditorView({state:x,parent:w.current});y.current=m,h&&h(m)},[o,l]),k.useImperativeHandle(v,()=>({insertTextAtCursor:T=>{const p=y.current;p&&(p.dispatch(p.state.replaceSelection(T)),p.focus())},goToPosition:T=>{const p=y.current;if(p){const x=p.state.doc.length,m=Math.max(0,Math.min(T,x));p.dispatch({selection:{anchor:m,head:m},scrollIntoView:!0}),p.focus()}},goToLine:(T,p=0)=>{const x=y.current;if(x){const m=x.state.doc,C=Math.max(1,Math.min(T,m.lines)),P=m.line(C),N=Math.max(0,Math.min(p,P.length))+P.from;x.dispatch({selection:{anchor:N,head:N},scrollIntoView:!0}),x.focus()}},getEditorView:()=>y.current})),mt("div",{ref:w,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 h=Gr(r)?Hr(r):[],f=Xr(o);return[h,f,...n]},[r,n,o]);return mt(vt,{ref:c,value:e,onChange:t,extensions:l,showLineNumbers:i,...s})},Ei=k.forwardRef(bi),xi=({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,w=(f&&"readOnlyRanges"in e?e.readOnlyRanges:n)??[],[y,T]=k.useState(v??""),p=k.useRef(null),[x,m]=k.useState(w),C=k.useRef(y),[P,N]=k.useState(null),d=k.useRef(!1),z=k.useRef(new Map),D=k.useRef(!1);k.useEffect(()=>{if(o&&w.length>0&&!P){const b=[];let O=0;for(let M=0;M<w.length;M++){const L=w[M];L.start>O&&b.push({content:y.substring(O,L.start),editable:!0}),b.push({content:y.substring(L.start,L.end),editable:!1}),O=L.end}O<y.length&&b.push({content:y.substring(O),editable:!0}),N(b)}},[o,w,y,P]),k.useEffect(()=>{if(y){const b=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],O=new Map;b.forEach(M=>{const L=y.indexOf(M);L>=0&&O.set(M,L)}),z.current=O}},[]);const Ne=k.useMemo(()=>{const b=[Fr.sql(),Vt.autocompletion()];return x.length>0&&b.push(en(x)),[...b,...r]},[r,x]),ye=k.useCallback((b,O,M=0)=>{const L=b.indexOf(O,M);return L>=0?L:null},[]),Se=k.useCallback((b,O)=>{if(!o||!b||b.length===0)return b;const M=[...b];let L=0;for(let K=0;K<b.length;K++){const ie=b[K];if(!ie.editable){const he=ye(O,ie.content,L);he!==null&&(K>0&&b[K-1].editable&&he>L&&(M[K-1]={...M[K-1],content:O.substring(L,he)}),L=he+ie.content.length)}}const U=b[b.length-1];return U.editable&&L<O.length&&(M[b.length-1]={...U,content:O.substring(L)}),M},[o,ye]),Ce=k.useCallback(b=>{let O=!1;return z.current.forEach((M,L)=>{const U=b.indexOf(L);U>=0&&Math.abs(U-M)>0&&(z.current.set(L,U),U>M&&(M===0||M<15)&&(O=!0))}),O},[]),ve=k.useCallback(()=>{if(!p.current)return;const b=p.current,O=b.state.doc.toString(),M=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],L=b.state.selection;let U=!1;for(const K of M){const ie=O.indexOf(K);if(ie>=0){b.dispatch({selection:{anchor:ie,head:ie+K.length},scrollIntoView:!1}),U=!0;break}}U&&setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({selection:L,scrollIntoView:!1})},10)},[]),ee=k.useCallback(()=>{if(!p.current)return;const b=p.current;x.length>0&&(de(b,[]),setTimeout(()=>{b.dom&&document.contains(b.dom)&&(de(b,x),setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({})},10))},10))},[x]),se=k.useCallback(b=>{const O=b.value,M=C.current;T(O),M!==O&&(!M||O.length>(M==null?void 0:M.length)&&!M.startsWith(O.substring(0,5))&&O.includes(M.substring(0,10)))&&(d.current=!0,Ce(O)&&setTimeout(()=>{ve()},10)),C.current=O;const L=p.current?tn(p.current):x;if(o&&P){const U=Se(P,O);N(U);const{readOnlyRanges:K}=Nt(U);m(K),p.current&&de(p.current,K),t&&t({value:O,readOnlyRanges:K})}else t&&t({value:O,readOnlyRanges:L})},[t,o,P,x,Se,Ce,ve]);k.useEffect(()=>{!o&&JSON.stringify(w)!==JSON.stringify(x)&&(m(w),p.current&&de(p.current,w))},[w,x,o]),k.useEffect(()=>{if(o&&P){const{readOnlyRanges:b}=Nt(P);JSON.stringify(b)!==JSON.stringify(x)&&(m(b),p.current&&de(p.current,b))}},[P,x,o]),k.useEffect(()=>{p.current&&d.current&&(d.current=!1,p.current.dispatch({}))},[y]),k.useEffect(()=>{p.current&&x.length>0&&!D.current&&(D.current=!0,setTimeout(()=>{ee()},50),setTimeout(()=>{ee()},200))},[ee,x]);const fe=k.useCallback(b=>{if(p.current=b,x.length>0&&(de(b,x),setTimeout(()=>{de(b,[]),setTimeout(()=>{de(b,x)},10)},50)),y){const O=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],M=new Map;O.forEach(L=>{const U=y.indexOf(L);U>=0&&M.set(L,U)}),z.current=M}},[x,y]);return mt(vt,{ref:l,value:y,onChange:se,extensions:Ne,showLineNumbers:i,onEditorViewCreated:fe,...s})},Si=k.forwardRef(xi),Ci=(e,t)=>{const{value:r,onChange:n,extensions:o=[],showLineNumbers:i=!0,enableFormatting:s=!1,...c}=e,l=k.useRef(!0),h=k.useRef(null),f=k.useCallback(m=>{try{return m===""||JSON.parse(m),!0}catch{return!1}},[]),v=k.useCallback(m=>{try{if(!m.trim())return"";const C=JSON.parse(m);return JSON.stringify(C,null,2)}catch{return m}},[]),w=k.useCallback(()=>{if(!h.current)return!1;const m=h.current,C=m.state.doc.toString(),P=v(C);if(P===C)return!1;const N=m.state.update({changes:{from:0,to:m.state.doc.length,insert:P}});return m.dispatch(N),!0},[v]),y=k.useMemo(()=>E.keymap.of([{key:"Alt-f",mac:"Mod-Alt-f",run:()=>w()}]),[w]),T=k.useCallback(m=>{if(n){const C=f(m.value);l.current=C,n(m)}},[n,f]),p=k.useMemo(()=>[Lr.json(),pe.bracketMatching(),Vt.closeBrackets(),R.Prec.highest(y),...o],[y,o]),x=k.useCallback(m=>{h.current=m,s&&r&&setTimeout(()=>{w()},0)},[s,r,w]);return mt(vt,{ref:t,value:r,showLineNumbers:i,onChange:T,extensions:p,onEditorViewCreated:x,...c})},Ri=k.forwardRef(Ci);exports.Editor=Ei;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=Kr;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=Gr;exports.lightTheme=Dt;exports.openSearchPanel=Xt;exports.readOnlyRanges=en;exports.search=Kt;exports.searchKeymap=er;exports.searchTranslationsZhCN=pi;exports.updateReadOnlyRanges=de;
|
|
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}),E.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)})}}),E.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 ge(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 Le{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"&&(Le.prototype[Symbol.iterator]=function(){return this});const nn={from:-1,to:-1,match:/.*/.exec("")},Gt="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,Gt+(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 Ae{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 Ae(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 Ae(s,i)),new Ae(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,Gt+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Ae.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=Ae.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,Gt),!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 x=p/100;l&&(x=x*(l=="-"?-1:1)+c.number/s.doc.lines),p=Math.round(s.doc.lines*x)}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),E.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=>E.showPanel.from(e,t=>t?It:null)}),Bo=e=>{let t=E.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=E.getPanel(e,It)}return t&&t.dom.querySelector("input").select(),!0},Ho=E.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"}}}),Go={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},sn=R.Facet.define({combine(e){return R.combineConfig(e,Go,{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 Ko=E.Decoration.mark({class:"cm-selectionMatch"}),Jo=E.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=E.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 E.Decoration.none;let o=n.main,i,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return E.Decoration.none;let l=r.wordAt(o.head);if(!l)return E.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 E.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 E.Decoration.none}else if(i=r.sliceDoc(o.from,o.to),!i)return E.Decoration.none}let c=[];for(let l of e.visibleRanges){let d=new Le(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(Ko.range(f,v)),c.length>t.maxMatches))return E.Decoration.none}}return E.Decoration.set(c)}},{decorations:e=>e.decorations}),Zo=E.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 Le(e.doc,t,n[n.length-1].to);;)if(c.next(),c.done){if(s)return null;c=new Le(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:E.EditorView.scrollIntoView(o.to)})),!0):!1},xe=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=>E.EditorView.scrollIntoView(t)})}});function Kt(e){return e?[xe.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):Pe(this,o,r,n)}}class ln{constructor(t){this.spec=t}}function Pe(e,t,r,n){return new Le(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=Pe(this.spec,t,n,t.doc.length).nextOverlapping();if(o.done){let i=Math.min(t.doc.length,r+this.spec.unquoted.length);o=Pe(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=Pe(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=Pe(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=Pe(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(),me=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=>E.showPanel.from(e,t=>t.panel)});class Pt{constructor(t,r){this.query=t,this.panel=r}}const si=E.Decoration.mark({class:"cm-searchMatch"}),ci=E.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),li=E.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(me))}update(e){let t=e.state.field(me);(t!=e.startState.field(me)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return E.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(me,!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(xe);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(xe);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 Le(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(E.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(xe).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:E.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0});function Qt(e){return e.state.facet(xe).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(xe);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=E.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(me,!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(me,!1);if(!t||!t.panel)return!1;let r=E.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(me).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){E.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(xe).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 E.EditorView.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${n.number}.`)}const gi=E.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=[me,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 E.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(),Kt({top:!0}),yt(),E.keymap.of(er),E.EditorView.updateListener.of(e=>{e.view.dom.querySelector(".cm-panel.cm-search")&&dn(e.view)})]}function mi(){return[yt()]}function qt(){return[Kt({top:!0}),yt(),E.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 _=[E.keymap.of([Ue.indentWithTab,{key:"Enter",run:Ue.insertNewlineAndIndent}]),E.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?E.placeholder(c):[],l?E.lineNumbers():[],E.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]}),x=new E.EditorView({state:m,parent:T.current});return p.current=x,d&&d(x),()=>{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=[E.keymap.of([Ue.indentWithTab,{key:"Enter",run:Ue.insertNewlineAndIndent}]),E.EditorView.lineWrapping,se.syntaxHighlighting(se.defaultHighlightStyle),R.EditorState.allowMultipleSelections.of(!0),f==="zh-CN"?jt():qt(),c?E.placeholder(c):[],l?E.lineNumbers():[],E.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 x=R.EditorState.create({doc:_,extensions:[...m,...r]}),C=new E.EditorView({state:x,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 x=m.state.doc.length,C=Math.max(0,Math.min(_,x));m.dispatch({selection:{anchor:C,head:C},scrollIntoView:!0}),m.focus()}},goToLine:(_,m=0)=>{const x=p.current;if(x){const C=x.state.doc,y=Math.max(1,Math.min(_,C.lines)),w=C.line(y),D=Math.max(0,Math.min(m,w.length))+w.from;x.dispatch({selection:{anchor:D,head:D},scrollIntoView:!0}),x.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=Gr(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})},Ei=k.forwardRef(bi),xi=({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),[x,C]=k.useState(T),y=k.useRef(p),[w,D]=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 O=0;for(let M=0;M<T.length;M++){const L=T[M];L.start>O&&b.push({content:p.substring(O,L.start),editable:!0}),b.push({content:p.substring(L.start,L.end),editable:!1}),O=L.end}O<p.length&&b.push({content:p.substring(O),editable:!0}),D(b)}},[o,T,p,w]),k.useEffect(()=>{if(p){const b=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],O=new Map;b.forEach(M=>{const L=p.indexOf(M);L>=0&&O.set(M,L)}),z.current=O}},[]);const Ne=k.useMemo(()=>{const b=[Fr.sql(),Vt.autocompletion()];return x.length>0&&b.push(en(x)),[...b,...r]},[r,x]),ye=k.useCallback((b,O,M=0)=>{const L=b.indexOf(O,M);return L>=0?L:null},[]),Se=k.useCallback((b,O)=>{if(!o||!b||b.length===0)return b;const M=[...b];let L=0;for(let K=0;K<b.length;K++){const ie=b[K];if(!ie.editable){const de=ye(O,ie.content,L);de!==null&&(K>0&&b[K-1].editable&&de>L&&(M[K-1]={...M[K-1],content:O.substring(L,de)}),L=de+ie.content.length)}}const U=b[b.length-1];return U.editable&&L<O.length&&(M[b.length-1]={...U,content:O.substring(L)}),M},[o,ye]),Ce=k.useCallback(b=>{let O=!1;return z.current.forEach((M,L)=>{const U=b.indexOf(L);U>=0&&Math.abs(U-M)>0&&(z.current.set(L,U),U>M&&(M===0||M<15)&&(O=!0))}),O},[]),ve=k.useCallback(()=>{if(!m.current)return;const b=m.current,O=b.state.doc.toString(),M=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],L=b.state.selection;let U=!1;for(const K of M){const ie=O.indexOf(K);if(ie>=0){b.dispatch({selection:{anchor:ie,head:ie+K.length},scrollIntoView:!1}),U=!0;break}}U&&setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({selection:L,scrollIntoView:!1})},10)},[]),ee=k.useCallback(()=>{if(!m.current)return;const b=m.current;x.length>0&&(ge(b,[]),setTimeout(()=>{b.dom&&document.contains(b.dom)&&(ge(b,x),setTimeout(()=>{b.dom&&document.contains(b.dom)&&b.dispatch({})},10))},10))},[x]),ce=k.useCallback(b=>{const O=b.value,M=y.current;_(O),M!==O&&(!M||O.length>(M==null?void 0:M.length)&&!M.startsWith(O.substring(0,5))&&O.includes(M.substring(0,10)))&&(h.current=!0,Ce(O)&&setTimeout(()=>{ve()},10)),y.current=O;const L=m.current?tn(m.current):x;if(o&&w){const U=Se(w,O);D(U);const{readOnlyRanges:K}=Nt(U);C(K),m.current&&ge(m.current,K),t&&t({value:O,readOnlyRanges:K})}else t&&t({value:O,readOnlyRanges:L})},[t,o,w,x,Se,Ce,ve]);k.useEffect(()=>{!o&&JSON.stringify(T)!==JSON.stringify(x)&&(C(T),m.current&&ge(m.current,T))},[T,x,o]),k.useEffect(()=>{if(o&&w){const{readOnlyRanges:b}=Nt(w);JSON.stringify(b)!==JSON.stringify(x)&&(C(b),m.current&&ge(m.current,b))}},[w,x,o]),k.useEffect(()=>{m.current&&h.current&&(h.current=!1,m.current.dispatch({}))},[p]),k.useEffect(()=>{m.current&&x.length>0&&!N.current&&(N.current=!0,setTimeout(()=>{ee()},50),setTimeout(()=>{ee()},200))},[ee,x]);const he=k.useCallback(b=>{if(m.current=b,x.length>0&&(ge(b,x),setTimeout(()=>{ge(b,[]),setTimeout(()=>{ge(b,x)},10)},50)),p){const O=["SELECT","FROM","WHERE","GROUP","ORDER","HAVING","JOIN"],M=new Map;O.forEach(L=>{const U=p.indexOf(L);U>=0&&M.set(L,U)}),z.current=M}},[x,p]);return mt(vt,{ref:l,value:p,onChange:ce,extensions:Ne,showLineNumbers:i,onEditorViewCreated:he,...s})},Si=k.forwardRef(xi),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(),D=T(w);if(D===w)return!1;const h=y.state.update({changes:{from:0,to:y.state.doc.length,insert:D}});return y.dispatch(h),!0},[T]),_=k.useMemo(()=>E.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]),x=k.useMemo(()=>{const y=[Lr.json(),se.bracketMatching(),Vt.closeBrackets(),R.Prec.highest(_),...o];return c&&y.push(se.codeFolding(),se.foldGutter({openText:"▼",closedText:"▶"}),E.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:x,onEditorViewCreated:C,...l})},Ri=k.forwardRef(Ci);exports.Editor=Ei;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=Kr;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=Gr;exports.lightTheme=Dt;exports.openSearchPanel=Xt;exports.readOnlyRanges=en;exports.search=Kt;exports.searchKeymap=er;exports.searchTranslationsZhCN=pi;exports.updateReadOnlyRanges=ge;
|