@illuma-ai/codeviz 1.0.0
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/CodeViz.d.ts +17 -0
- package/dist/CodeViz.d.ts.map +1 -0
- package/dist/EditorPane.d.ts +25 -0
- package/dist/EditorPane.d.ts.map +1 -0
- package/dist/Loader.d.ts +11 -0
- package/dist/Loader.d.ts.map +1 -0
- package/dist/PreviewPane.d.ts +27 -0
- package/dist/PreviewPane.d.ts.map +1 -0
- package/dist/StatusBar.d.ts +16 -0
- package/dist/StatusBar.d.ts.map +1 -0
- package/dist/Toolbar.d.ts +28 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/agentContext.d.ts +71 -0
- package/dist/agentContext.d.ts.map +1 -0
- package/dist/importMap.d.ts +27 -0
- package/dist/importMap.d.ts.map +1 -0
- package/dist/index.cjs +1699 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20791 -0
- package/dist/index.js.map +1 -0
- package/dist/previewTemplate.d.ts +19 -0
- package/dist/previewTemplate.d.ts.map +1 -0
- package/dist/templates.d.ts +36 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/transpiler.d.ts +25 -0
- package/dist/transpiler.d.ts.map +1 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +69 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1699 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),I=require("react");function hs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,s=Array(t);r<t;r++)s[r]=e[r];return s}function Mi(e){if(Array.isArray(e))return e}function Fi(e,t,r){return(t=Vi(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $i(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var s,i,a,u,d=[],h=!0,f=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(h=(s=a.call(r)).done)&&(d.push(s.value),d.length!==t);h=!0);}catch(k){f=!0,i=k}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(f)throw i}}return d}}function Bi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,s)}return r}function gs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ms(Object(r),!0).forEach(function(s){Fi(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ms(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function zi(e,t){if(e==null)return{};var r,s,i=qi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function qi(e,t){if(e==null)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;r[s]=e[s]}return r}function Ui(e,t){return Mi(e)||$i(e,t)||Wi(e,t)||Bi()}function Hi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vi(e){var t=Hi(e,"string");return typeof t=="symbol"?t:t+""}function Wi(e,t){if(e){if(typeof e=="string")return hs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hs(e,t):void 0}}function Gi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ks(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,s)}return r}function xs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ks(Object(r),!0).forEach(function(s){Gi(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ks(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Xi(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(s){return t.reduceRight(function(i,a){return a(i)},s)}}function Ut(e){return function t(){for(var r=this,s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];return i.length>=e.length?e.apply(this,i):function(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];return t.apply(r,[].concat(i,d))}}}function bn(e){return{}.toString.call(e).includes("Object")}function Ji(e){return!Object.keys(e).length}function Xt(e){return typeof e=="function"}function Yi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Qi(e,t){return bn(t)||rt("changeType"),Object.keys(t).some(function(r){return!Yi(e,r)})&&rt("changeField"),t}function Ki(e){Xt(e)||rt("selectorType")}function Zi(e){Xt(e)||bn(e)||rt("handlerType"),bn(e)&&Object.values(e).some(function(t){return!Xt(t)})&&rt("handlersType")}function ea(e){e||rt("initialIsRequired"),bn(e)||rt("initialType"),Ji(e)&&rt("initialContent")}function ta(e,t){throw new Error(e[t]||e.default)}var na={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},rt=Ut(ta)(na),ln={changes:Qi,selector:Ki,handler:Zi,initial:ea};function ra(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ln.initial(e),ln.handler(t);var r={current:e},s=Ut(ia)(r,t),i=Ut(oa)(r),a=Ut(ln.changes)(e),u=Ut(sa)(r);function d(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(k){return k};return ln.selector(f),f(r.current)}function h(f){Xi(s,i,a,u)(f)}return[d,h]}function sa(e,t){return Xt(t)?t(e.current):t}function oa(e,t){return e.current=xs(xs({},e.current),t),t}function ia(e,t,r){return Xt(t)?t(e.current):Object.keys(r).forEach(function(s){var i;return(i=t[s])===null||i===void 0?void 0:i.call(t,e.current[s])}),r}var aa={create:ra},ca={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function la(e){return function t(){for(var r=this,s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];return i.length>=e.length?e.apply(this,i):function(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];return t.apply(r,[].concat(i,d))}}}function ua(e){return{}.toString.call(e).includes("Object")}function pa(e){return e||bs("configIsRequired"),ua(e)||bs("configType"),e.urls?(da(),{paths:{vs:e.urls.monacoBase}}):e}function da(){console.warn(Ws.deprecation)}function fa(e,t){throw new Error(e[t]||e.default)}var Ws={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
|
+
You are using deprecated way of configuration.
|
|
4
|
+
|
|
5
|
+
Instead of using
|
|
6
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
7
|
+
use
|
|
8
|
+
monaco.config({ paths: { vs: '...' } })
|
|
9
|
+
|
|
10
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
|
+
`},bs=la(fa)(Ws),ha={config:pa},ma=function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return function(i){return r.reduceRight(function(a,u){return u(a)},i)}};function Gs(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],Gs(e[r],t[r]))}),gs(gs({},e),t)}var ga={type:"cancelation",msg:"operation is manually canceled"};function fr(e){var t=!1,r=new Promise(function(s,i){e.then(function(a){return t?i(ga):s(a)}),e.catch(i)});return r.cancel=function(){return t=!0},r}var ka=["monaco"],xa=aa.create({config:ca,isInitialized:!1,resolve:null,reject:null,monaco:null}),Xs=Ui(xa,2),tn=Xs[0],Cn=Xs[1];function ba(e){var t=ha.config(e),r=t.monaco,s=zi(t,ka);Cn(function(i){return{config:Gs(i.config,s),monaco:r}})}function ya(){var e=tn(function(t){var r=t.monaco,s=t.isInitialized,i=t.resolve;return{monaco:r,isInitialized:s,resolve:i}});if(!e.isInitialized){if(Cn({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),fr(hr);if(window.monaco&&window.monaco.editor)return Js(window.monaco),e.resolve(window.monaco),fr(hr);ma(va,_a)(Ia)}return fr(hr)}function va(e){return document.body.appendChild(e)}function wa(e){var t=document.createElement("script");return e&&(t.src=e),t}function _a(e){var t=tn(function(s){var i=s.config,a=s.reject;return{config:i,reject:a}}),r=wa("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Ia(){var e=tn(function(r){var s=r.config,i=r.resolve,a=r.reject;return{config:s,resolve:i,reject:a}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var s=r.m||r;Js(s),e.resolve(s)},function(r){e.reject(r)})}function Js(e){tn().monaco||Cn({monaco:e})}function Sa(){return tn(function(e){var t=e.monaco;return t})}var hr=new Promise(function(e,t){return Cn({resolve:e,reject:t})}),Ys={config:ba,init:ya,__getMonacoInstance:Sa},Ta={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},mr=Ta,Aa={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Ea=Aa;function Ca({children:e}){return I.createElement("div",{style:Ea.container},e)}var Na=Ca,Pa=Na;function Ra({width:e,height:t,isEditorReady:r,loading:s,_ref:i,className:a,wrapperProps:u}){return I.createElement("section",{style:{...mr.wrapper,width:e,height:t},...u},!r&&I.createElement(Pa,null,s),I.createElement("div",{ref:i,style:{...mr.fullWidth,...!r&&mr.hide},className:a}))}var Da=Ra,Qs=I.memo(Da);function La(e){I.useEffect(e,[])}var Ks=La;function ja(e,t,r=!0){let s=I.useRef(!0);I.useEffect(s.current||!r?()=>{s.current=!1}:e,t)}var Me=ja;function Vt(){}function Ct(e,t,r,s){return Oa(e,s)||Ma(e,t,r,s)}function Oa(e,t){return e.editor.getModel(Zs(e,t))}function Ma(e,t,r,s){return e.editor.createModel(t,r,s?Zs(e,s):void 0)}function Zs(e,t){return e.Uri.parse(t)}function Fa({original:e,modified:t,language:r,originalLanguage:s,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:u,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:h=!1,theme:f="light",loading:k="Loading...",options:w={},height:C="100%",width:R="100%",className:q,wrapperProps:L={},beforeMount:te=Vt,onMount:Z=Vt}){let[S,N]=I.useState(!1),[v,O]=I.useState(!0),U=I.useRef(null),j=I.useRef(null),ce=I.useRef(null),V=I.useRef(Z),H=I.useRef(te),pe=I.useRef(!1);Ks(()=>{let M=Ys.init();return M.then(ee=>(j.current=ee)&&O(!1)).catch(ee=>(ee==null?void 0:ee.type)!=="cancelation"&&console.error("Monaco initialization: error:",ee)),()=>U.current?be():M.cancel()}),Me(()=>{if(U.current&&j.current){let M=U.current.getOriginalEditor(),ee=Ct(j.current,e||"",s||r||"text",a||"");ee!==M.getModel()&&M.setModel(ee)}},[a],S),Me(()=>{if(U.current&&j.current){let M=U.current.getModifiedEditor(),ee=Ct(j.current,t||"",i||r||"text",u||"");ee!==M.getModel()&&M.setModel(ee)}},[u],S),Me(()=>{let M=U.current.getModifiedEditor();M.getOption(j.current.editor.EditorOption.readOnly)?M.setValue(t||""):t!==M.getValue()&&(M.executeEdits("",[{range:M.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),M.pushUndoStop())},[t],S),Me(()=>{var M,ee;(ee=(M=U.current)==null?void 0:M.getModel())==null||ee.original.setValue(e||"")},[e],S),Me(()=>{let{original:M,modified:ee}=U.current.getModel();j.current.editor.setModelLanguage(M,s||r||"text"),j.current.editor.setModelLanguage(ee,i||r||"text")},[r,s,i],S),Me(()=>{var M;(M=j.current)==null||M.editor.setTheme(f)},[f],S),Me(()=>{var M;(M=U.current)==null||M.updateOptions(w)},[w],S);let we=I.useCallback(()=>{var ge;if(!j.current)return;H.current(j.current);let M=Ct(j.current,e||"",s||r||"text",a||""),ee=Ct(j.current,t||"",i||r||"text",u||"");(ge=U.current)==null||ge.setModel({original:M,modified:ee})},[r,t,i,e,s,a,u]),he=I.useCallback(()=>{var M;!pe.current&&ce.current&&(U.current=j.current.editor.createDiffEditor(ce.current,{automaticLayout:!0,...w}),we(),(M=j.current)==null||M.editor.setTheme(f),N(!0),pe.current=!0)},[w,f,we]);I.useEffect(()=>{S&&V.current(U.current,j.current)},[S]),I.useEffect(()=>{!v&&!S&&he()},[v,S,he]);function be(){var ee,ge,X,_e;let M=(ee=U.current)==null?void 0:ee.getModel();d||((ge=M==null?void 0:M.original)==null||ge.dispose()),h||((X=M==null?void 0:M.modified)==null||X.dispose()),(_e=U.current)==null||_e.dispose()}return I.createElement(Qs,{width:R,height:C,isEditorReady:S,loading:k,_ref:ce,className:q,wrapperProps:L})}var $a=Fa;I.memo($a);function Ba(e){let t=I.useRef();return I.useEffect(()=>{t.current=e},[e]),t.current}var za=Ba,un=new Map;function qa({defaultValue:e,defaultLanguage:t,defaultPath:r,value:s,language:i,path:a,theme:u="light",line:d,loading:h="Loading...",options:f={},overrideServices:k={},saveViewState:w=!0,keepCurrentModel:C=!1,width:R="100%",height:q="100%",className:L,wrapperProps:te={},beforeMount:Z=Vt,onMount:S=Vt,onChange:N,onValidate:v=Vt}){let[O,U]=I.useState(!1),[j,ce]=I.useState(!0),V=I.useRef(null),H=I.useRef(null),pe=I.useRef(null),we=I.useRef(S),he=I.useRef(Z),be=I.useRef(),M=I.useRef(s),ee=za(a),ge=I.useRef(!1),X=I.useRef(!1);Ks(()=>{let J=Ys.init();return J.then(ne=>(V.current=ne)&&ce(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>H.current?Ae():J.cancel()}),Me(()=>{var ne,fe,Re,g;let J=Ct(V.current,e||s||"",t||i||"",a||r||"");J!==((ne=H.current)==null?void 0:ne.getModel())&&(w&&un.set(ee,(fe=H.current)==null?void 0:fe.saveViewState()),(Re=H.current)==null||Re.setModel(J),w&&((g=H.current)==null||g.restoreViewState(un.get(a))))},[a],O),Me(()=>{var J;(J=H.current)==null||J.updateOptions(f)},[f],O),Me(()=>{!H.current||s===void 0||(H.current.getOption(V.current.editor.EditorOption.readOnly)?H.current.setValue(s):s!==H.current.getValue()&&(X.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:s,forceMoveMarkers:!0}]),H.current.pushUndoStop(),X.current=!1))},[s],O),Me(()=>{var ne,fe;let J=(ne=H.current)==null?void 0:ne.getModel();J&&i&&((fe=V.current)==null||fe.editor.setModelLanguage(J,i))},[i],O),Me(()=>{var J;d!==void 0&&((J=H.current)==null||J.revealLine(d))},[d],O),Me(()=>{var J;(J=V.current)==null||J.editor.setTheme(u)},[u],O);let _e=I.useCallback(()=>{var J;if(!(!pe.current||!V.current)&&!ge.current){he.current(V.current);let ne=a||r,fe=Ct(V.current,s||e||"",t||i||"",ne||"");H.current=(J=V.current)==null?void 0:J.editor.create(pe.current,{model:fe,automaticLayout:!0,...f},k),w&&H.current.restoreViewState(un.get(ne)),V.current.editor.setTheme(u),d!==void 0&&H.current.revealLine(d),U(!0),ge.current=!0}},[e,t,r,s,i,a,f,k,w,u,d]);I.useEffect(()=>{O&&we.current(H.current,V.current)},[O]),I.useEffect(()=>{!j&&!O&&_e()},[j,O,_e]),M.current=s,I.useEffect(()=>{var J,ne;O&&N&&((J=be.current)==null||J.dispose(),be.current=(ne=H.current)==null?void 0:ne.onDidChangeModelContent(fe=>{X.current||N(H.current.getValue(),fe)}))},[O,N]),I.useEffect(()=>{if(O){let J=V.current.editor.onDidChangeMarkers(ne=>{var Re;let fe=(Re=H.current.getModel())==null?void 0:Re.uri;if(fe&&ne.find(g=>g.path===fe.path)){let g=V.current.editor.getModelMarkers({resource:fe});v==null||v(g)}});return()=>{J==null||J.dispose()}}return()=>{}},[O,v]);function Ae(){var J,ne;(J=be.current)==null||J.dispose(),C?w&&un.set(a,H.current.saveViewState()):(ne=H.current.getModel())==null||ne.dispose(),H.current.dispose()}return I.createElement(Qs,{width:R,height:q,isEditorReady:O,loading:h,_ref:pe,className:L,wrapperProps:te})}var Ua=qa,Ha=I.memo(Ua),Va=Ha;const jr=I.memo(function({size:t="md",label:r="Loading preview..."}){const s=t==="sm"?8:t==="md"?12:16,i=t==="sm"?4:t==="md"?6:8;return P.jsxs("div",{style:pn.container,children:[P.jsx("div",{style:{...pn.cubes,gap:i},children:[0,1,2].map(a=>P.jsx("div",{style:{...pn.cube,width:s,height:s,animationDelay:`${a*.15}s`}},a))}),r&&P.jsx("div",{style:pn.label,children:r}),P.jsx("style",{children:Wa})]})}),Wa=`
|
|
12
|
+
@keyframes codevizBounce {
|
|
13
|
+
0%, 80%, 100% {
|
|
14
|
+
transform: scale(0.6);
|
|
15
|
+
opacity: 0.4;
|
|
16
|
+
}
|
|
17
|
+
40% {
|
|
18
|
+
transform: scale(1);
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@keyframes codevizPulse {
|
|
23
|
+
0%, 100% { opacity: 0.5; }
|
|
24
|
+
50% { opacity: 1; }
|
|
25
|
+
}
|
|
26
|
+
`,pn={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,width:"100%",height:"100%",minHeight:120},cubes:{display:"flex",alignItems:"center"},cube:{borderRadius:2,backgroundColor:"#6366f1",animation:"codevizBounce 1.2s infinite ease-in-out"},label:{fontSize:12,color:"#94a3b8",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',animation:"codevizPulse 2s infinite ease-in-out"}},eo=I.memo(function({code:t,language:r,onChange:s,theme:i="dark",readOnly:a=!1,options:u,editorRef:d,baseCode:h}){const f=I.useRef(null),k=I.useRef([]),w=I.useCallback(L=>{const te=L.languages.typescript.typescriptDefaults,Z=L.languages.typescript.javascriptDefaults,S={noSemanticValidation:!0,noSyntaxValidation:!0,noSuggestionDiagnostics:!0};te.setDiagnosticsOptions(S),Z.setDiagnosticsOptions(S);const N={jsx:L.languages.typescript.JsxEmit.ReactJSX,allowJs:!0,allowNonTsExtensions:!0,esModuleInterop:!0,noEmit:!0,target:L.languages.typescript.ScriptTarget.ESNext,moduleResolution:L.languages.typescript.ModuleResolutionKind.NodeJs};te.setCompilerOptions(N),Z.setCompilerOptions(N)},[]),C=I.useCallback(L=>{f.current=L,d&&(d.current=L),Xa()},[d]),R=I.useCallback(L=>{s==null||s(L??"")},[s]);I.useEffect(()=>{const L=f.current;if(!L||h==null){L&&k.current.length>0&&(k.current=L.deltaDecorations(k.current,[]));return}const te=Ga(h,t);k.current=L.deltaDecorations(k.current,te)},[h,t]);const q=Ja(r);return P.jsx("div",{style:Ya.container,children:P.jsx(Va,{height:"100%",language:q,value:t,theme:i==="dark"?"vs-dark":"vs",onChange:R,beforeMount:w,onMount:C,loading:P.jsx(jr,{size:"sm",label:"Loading editor..."}),options:{minimap:{enabled:!1},fontSize:13,lineHeight:20,padding:{top:8},scrollBeyondLastLine:!1,wordWrap:"on",tabSize:2,automaticLayout:!0,readOnly:a,domReadOnly:a,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,glyphMargin:!0,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},...u}})})});function Ga(e,t){const r=e.split(`
|
|
27
|
+
`),s=t.split(`
|
|
28
|
+
`),i=[];for(let a=0;a<s.length;a++){const u=a+1;a>=r.length?i.push({range:{startLineNumber:u,startColumn:1,endLineNumber:u,endColumn:1},options:{isWholeLine:!0,linesDecorationsClassName:"lp-diff-added-gutter",className:"lp-diff-added-line",overviewRuler:{color:"#22c55e",position:1}}}):s[a]!==r[a]&&i.push({range:{startLineNumber:u,startColumn:1,endLineNumber:u,endColumn:1},options:{isWholeLine:!0,linesDecorationsClassName:"lp-diff-modified-gutter",className:"lp-diff-modified-line",overviewRuler:{color:"#3b82f6",position:1}}})}if(r.length>s.length&&s.length>0){const a=s.length;i.push({range:{startLineNumber:a,startColumn:1,endLineNumber:a,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"lp-diff-deleted-gutter",overviewRuler:{color:"#ef4444",position:1}}})}return i}let ys=!1;function Xa(){if(ys)return;ys=!0;const e=document.createElement("style");e.textContent=`
|
|
29
|
+
/* Green bar — added lines */
|
|
30
|
+
.lp-diff-added-gutter {
|
|
31
|
+
background-color: #22c55e !important;
|
|
32
|
+
width: 3px !important;
|
|
33
|
+
margin-left: 3px;
|
|
34
|
+
border-radius: 1px;
|
|
35
|
+
}
|
|
36
|
+
.lp-diff-added-line {
|
|
37
|
+
background-color: rgba(34, 197, 94, 0.08) !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Blue bar — modified lines */
|
|
41
|
+
.lp-diff-modified-gutter {
|
|
42
|
+
background-color: #3b82f6 !important;
|
|
43
|
+
width: 3px !important;
|
|
44
|
+
margin-left: 3px;
|
|
45
|
+
border-radius: 1px;
|
|
46
|
+
}
|
|
47
|
+
.lp-diff-modified-line {
|
|
48
|
+
background-color: rgba(59, 130, 246, 0.06) !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Red triangle — deleted lines indicator */
|
|
52
|
+
.lp-diff-deleted-gutter {
|
|
53
|
+
border-left: 3px solid #ef4444 !important;
|
|
54
|
+
margin-left: 3px;
|
|
55
|
+
}
|
|
56
|
+
`,document.head.appendChild(e)}function Ja(e){return{tsx:"typescript",ts:"typescript",jsx:"javascript",js:"javascript",html:"html",css:"css",json:"json",md:"markdown",markdown:"markdown",mermaid:"markdown",mmd:"markdown",svg:"xml",csv:"plaintext",tsv:"plaintext"}[e]||e}const Ya={container:{width:"100%",height:"100%",overflow:"hidden"}};var l;(function(e){e[e.NONE=0]="NONE";const r=1;e[e._abstract=r]="_abstract";const s=r+1;e[e._accessor=s]="_accessor";const i=s+1;e[e._as=i]="_as";const a=i+1;e[e._assert=a]="_assert";const u=a+1;e[e._asserts=u]="_asserts";const d=u+1;e[e._async=d]="_async";const h=d+1;e[e._await=h]="_await";const f=h+1;e[e._checks=f]="_checks";const k=f+1;e[e._constructor=k]="_constructor";const w=k+1;e[e._declare=w]="_declare";const C=w+1;e[e._enum=C]="_enum";const R=C+1;e[e._exports=R]="_exports";const q=R+1;e[e._from=q]="_from";const L=q+1;e[e._get=L]="_get";const te=L+1;e[e._global=te]="_global";const Z=te+1;e[e._implements=Z]="_implements";const S=Z+1;e[e._infer=S]="_infer";const N=S+1;e[e._interface=N]="_interface";const v=N+1;e[e._is=v]="_is";const O=v+1;e[e._keyof=O]="_keyof";const U=O+1;e[e._mixins=U]="_mixins";const j=U+1;e[e._module=j]="_module";const ce=j+1;e[e._namespace=ce]="_namespace";const V=ce+1;e[e._of=V]="_of";const H=V+1;e[e._opaque=H]="_opaque";const pe=H+1;e[e._out=pe]="_out";const we=pe+1;e[e._override=we]="_override";const he=we+1;e[e._private=he]="_private";const be=he+1;e[e._protected=be]="_protected";const M=be+1;e[e._proto=M]="_proto";const ee=M+1;e[e._public=ee]="_public";const ge=ee+1;e[e._readonly=ge]="_readonly";const X=ge+1;e[e._require=X]="_require";const _e=X+1;e[e._satisfies=_e]="_satisfies";const Ae=_e+1;e[e._set=Ae]="_set";const J=Ae+1;e[e._static=J]="_static";const ne=J+1;e[e._symbol=ne]="_symbol";const fe=ne+1;e[e._type=fe]="_type";const Re=fe+1;e[e._unique=Re]="_unique";const g=Re+1;e[e._using=g]="_using"})(l||(l={}));var n;(function(e){e[e.PRECEDENCE_MASK=15]="PRECEDENCE_MASK";const r=16;e[e.IS_KEYWORD=r]="IS_KEYWORD";const s=32;e[e.IS_ASSIGN=s]="IS_ASSIGN";const i=64;e[e.IS_RIGHT_ASSOCIATIVE=i]="IS_RIGHT_ASSOCIATIVE";const a=128;e[e.IS_PREFIX=a]="IS_PREFIX";const u=256;e[e.IS_POSTFIX=u]="IS_POSTFIX";const d=512;e[e.IS_EXPRESSION_START=d]="IS_EXPRESSION_START";const h=512;e[e.num=h]="num";const f=1536;e[e.bigint=f]="bigint";const k=2560;e[e.decimal=k]="decimal";const w=3584;e[e.regexp=w]="regexp";const C=4608;e[e.string=C]="string";const R=5632;e[e.name=R]="name";const q=6144;e[e.eof=q]="eof";const L=7680;e[e.bracketL=L]="bracketL";const te=8192;e[e.bracketR=te]="bracketR";const Z=9728;e[e.braceL=Z]="braceL";const S=10752;e[e.braceBarL=S]="braceBarL";const N=11264;e[e.braceR=N]="braceR";const v=12288;e[e.braceBarR=v]="braceBarR";const O=13824;e[e.parenL=O]="parenL";const U=14336;e[e.parenR=U]="parenR";const j=15360;e[e.comma=j]="comma";const ce=16384;e[e.semi=ce]="semi";const V=17408;e[e.colon=V]="colon";const H=18432;e[e.doubleColon=H]="doubleColon";const pe=19456;e[e.dot=pe]="dot";const we=20480;e[e.question=we]="question";const he=21504;e[e.questionDot=he]="questionDot";const be=22528;e[e.arrow=be]="arrow";const M=23552;e[e.template=M]="template";const ee=24576;e[e.ellipsis=ee]="ellipsis";const ge=25600;e[e.backQuote=ge]="backQuote";const X=27136;e[e.dollarBraceL=X]="dollarBraceL";const _e=27648;e[e.at=_e]="at";const Ae=29184;e[e.hash=Ae]="hash";const J=29728;e[e.eq=J]="eq";const ne=30752;e[e.assign=ne]="assign";const fe=32640;e[e.preIncDec=fe]="preIncDec";const Re=33664;e[e.postIncDec=Re]="postIncDec";const g=34432;e[e.bang=g]="bang";const y=35456;e[e.tilde=y]="tilde";const _=35841;e[e.pipeline=_]="pipeline";const T=36866;e[e.nullishCoalescing=T]="nullishCoalescing";const E=37890;e[e.logicalOR=E]="logicalOR";const $=38915;e[e.logicalAND=$]="logicalAND";const B=39940;e[e.bitwiseOR=B]="bitwiseOR";const se=40965;e[e.bitwiseXOR=se]="bitwiseXOR";const de=41990;e[e.bitwiseAND=de]="bitwiseAND";const le=43015;e[e.equality=le]="equality";const Ie=44040;e[e.lessThan=Ie]="lessThan";const Se=45064;e[e.greaterThan=Se]="greaterThan";const oe=46088;e[e.relationalOrEqual=oe]="relationalOrEqual";const Ee=47113;e[e.bitShiftL=Ee]="bitShiftL";const ve=48137;e[e.bitShiftR=ve]="bitShiftR";const Be=49802;e[e.plus=Be]="plus";const tt=50826;e[e.minus=tt]="minus";const lt=51723;e[e.modulo=lt]="modulo";const Lt=52235;e[e.star=Lt]="star";const jt=53259;e[e.slash=jt]="slash";const Ot=54348;e[e.exponent=Ot]="exponent";const ut=55296;e[e.jsxName=ut]="jsxName";const _t=56320;e[e.jsxText=_t]="jsxText";const It=57344;e[e.jsxEmptyText=It]="jsxEmptyText";const Mt=58880;e[e.jsxTagStart=Mt]="jsxTagStart";const Ft=59392;e[e.jsxTagEnd=Ft]="jsxTagEnd";const St=60928;e[e.typeParameterStart=St]="typeParameterStart";const $t=61440;e[e.nonNullAssertion=$t]="nonNullAssertion";const Bt=62480;e[e._break=Bt]="_break";const Y=63504;e[e._case=Y]="_case";const Ce=64528;e[e._catch=Ce]="_catch";const De=65552;e[e._continue=De]="_continue";const Ke=66576;e[e._debugger=Ke]="_debugger";const qe=67600;e[e._default=qe]="_default";const Tt=68624;e[e._do=Tt]="_do";const Ze=69648;e[e._else=Ze]="_else";const $n=70672;e[e._finally=$n]="_finally";const Bn=71696;e[e._for=Bn]="_for";const zn=73232;e[e._function=zn]="_function";const qn=73744;e[e._if=qn]="_if";const Un=74768;e[e._return=Un]="_return";const Hn=75792;e[e._switch=Hn]="_switch";const Vn=77456;e[e._throw=Vn]="_throw";const Wn=77840;e[e._try=Wn]="_try";const Gn=78864;e[e._var=Gn]="_var";const Xn=79888;e[e._let=Xn]="_let";const Jn=80912;e[e._const=Jn]="_const";const Yn=81936;e[e._while=Yn]="_while";const Qn=82960;e[e._with=Qn]="_with";const Kn=84496;e[e._new=Kn]="_new";const Zn=85520;e[e._this=Zn]="_this";const er=86544;e[e._super=er]="_super";const tr=87568;e[e._class=tr]="_class";const nr=88080;e[e._extends=nr]="_extends";const rr=89104;e[e._export=rr]="_export";const sr=90640;e[e._import=sr]="_import";const or=91664;e[e._yield=or]="_yield";const ir=92688;e[e._null=ir]="_null";const ar=93712;e[e._true=ar]="_true";const cr=94736;e[e._false=cr]="_false";const lr=95256;e[e._in=lr]="_in";const ur=96280;e[e._instanceof=ur]="_instanceof";const pr=97936;e[e._typeof=pr]="_typeof";const dr=98960;e[e._void=dr]="_void";const vi=99984;e[e._delete=vi]="_delete";const wi=100880;e[e._async=wi]="_async";const _i=101904;e[e._get=_i]="_get";const Ii=102928;e[e._set=Ii]="_set";const Si=103952;e[e._declare=Si]="_declare";const Ti=104976;e[e._readonly=Ti]="_readonly";const Ai=106e3;e[e._abstract=Ai]="_abstract";const Ei=107024;e[e._static=Ei]="_static";const Ci=107536;e[e._public=Ci]="_public";const Ni=108560;e[e._private=Ni]="_private";const Pi=109584;e[e._protected=Pi]="_protected";const Ri=110608;e[e._override=Ri]="_override";const Di=112144;e[e._as=Di]="_as";const Li=113168;e[e._enum=Li]="_enum";const ji=114192;e[e._type=ji]="_type";const Oi=115216;e[e._implements=Oi]="_implements"})(n||(n={}));function Qa(e){switch(e){case n.num:return"num";case n.bigint:return"bigint";case n.decimal:return"decimal";case n.regexp:return"regexp";case n.string:return"string";case n.name:return"name";case n.eof:return"eof";case n.bracketL:return"[";case n.bracketR:return"]";case n.braceL:return"{";case n.braceBarL:return"{|";case n.braceR:return"}";case n.braceBarR:return"|}";case n.parenL:return"(";case n.parenR:return")";case n.comma:return",";case n.semi:return";";case n.colon:return":";case n.doubleColon:return"::";case n.dot:return".";case n.question:return"?";case n.questionDot:return"?.";case n.arrow:return"=>";case n.template:return"template";case n.ellipsis:return"...";case n.backQuote:return"`";case n.dollarBraceL:return"${";case n.at:return"@";case n.hash:return"#";case n.eq:return"=";case n.assign:return"_=";case n.preIncDec:return"++/--";case n.postIncDec:return"++/--";case n.bang:return"!";case n.tilde:return"~";case n.pipeline:return"|>";case n.nullishCoalescing:return"??";case n.logicalOR:return"||";case n.logicalAND:return"&&";case n.bitwiseOR:return"|";case n.bitwiseXOR:return"^";case n.bitwiseAND:return"&";case n.equality:return"==/!=";case n.lessThan:return"<";case n.greaterThan:return">";case n.relationalOrEqual:return"<=/>=";case n.bitShiftL:return"<<";case n.bitShiftR:return">>/>>>";case n.plus:return"+";case n.minus:return"-";case n.modulo:return"%";case n.star:return"*";case n.slash:return"/";case n.exponent:return"**";case n.jsxName:return"jsxName";case n.jsxText:return"jsxText";case n.jsxEmptyText:return"jsxEmptyText";case n.jsxTagStart:return"jsxTagStart";case n.jsxTagEnd:return"jsxTagEnd";case n.typeParameterStart:return"typeParameterStart";case n.nonNullAssertion:return"nonNullAssertion";case n._break:return"break";case n._case:return"case";case n._catch:return"catch";case n._continue:return"continue";case n._debugger:return"debugger";case n._default:return"default";case n._do:return"do";case n._else:return"else";case n._finally:return"finally";case n._for:return"for";case n._function:return"function";case n._if:return"if";case n._return:return"return";case n._switch:return"switch";case n._throw:return"throw";case n._try:return"try";case n._var:return"var";case n._let:return"let";case n._const:return"const";case n._while:return"while";case n._with:return"with";case n._new:return"new";case n._this:return"this";case n._super:return"super";case n._class:return"class";case n._extends:return"extends";case n._export:return"export";case n._import:return"import";case n._yield:return"yield";case n._null:return"null";case n._true:return"true";case n._false:return"false";case n._in:return"in";case n._instanceof:return"instanceof";case n._typeof:return"typeof";case n._void:return"void";case n._delete:return"delete";case n._async:return"async";case n._get:return"get";case n._set:return"set";case n._declare:return"declare";case n._readonly:return"readonly";case n._abstract:return"abstract";case n._static:return"static";case n._public:return"public";case n._private:return"private";case n._protected:return"protected";case n._override:return"override";case n._as:return"as";case n._enum:return"enum";case n._type:return"type";case n._implements:return"implements";default:return""}}class Ye{constructor(t,r,s){this.startTokenIndex=t,this.endTokenIndex=r,this.isFunctionScope=s}}class Ka{constructor(t,r,s,i,a,u,d,h,f,k,w,C,R){this.potentialArrowAt=t,this.noAnonFunctionType=r,this.inDisallowConditionalTypesContext=s,this.tokensLength=i,this.scopesLength=a,this.pos=u,this.type=d,this.contextualKeyword=h,this.start=f,this.end=k,this.isType=w,this.scopeDepth=C,this.error=R}}class Le{constructor(){Le.prototype.__init.call(this),Le.prototype.__init2.call(this),Le.prototype.__init3.call(this),Le.prototype.__init4.call(this),Le.prototype.__init5.call(this),Le.prototype.__init6.call(this),Le.prototype.__init7.call(this),Le.prototype.__init8.call(this),Le.prototype.__init9.call(this),Le.prototype.__init10.call(this),Le.prototype.__init11.call(this),Le.prototype.__init12.call(this),Le.prototype.__init13.call(this)}__init(){this.potentialArrowAt=-1}__init2(){this.noAnonFunctionType=!1}__init3(){this.inDisallowConditionalTypesContext=!1}__init4(){this.tokens=[]}__init5(){this.scopes=[]}__init6(){this.pos=0}__init7(){this.type=n.eof}__init8(){this.contextualKeyword=l.NONE}__init9(){this.start=0}__init10(){this.end=0}__init11(){this.isType=!1}__init12(){this.scopeDepth=0}__init13(){this.error=null}snapshot(){return new Ka(this.potentialArrowAt,this.noAnonFunctionType,this.inDisallowConditionalTypesContext,this.tokens.length,this.scopes.length,this.pos,this.type,this.contextualKeyword,this.start,this.end,this.isType,this.scopeDepth,this.error)}restoreFromSnapshot(t){this.potentialArrowAt=t.potentialArrowAt,this.noAnonFunctionType=t.noAnonFunctionType,this.inDisallowConditionalTypesContext=t.inDisallowConditionalTypesContext,this.tokens.length=t.tokensLength,this.scopes.length=t.scopesLength,this.pos=t.pos,this.type=t.type,this.contextualKeyword=t.contextualKeyword,this.start=t.start,this.end=t.end,this.isType=t.isType,this.scopeDepth=t.scopeDepth,this.error=t.error}}var p;(function(e){e[e.backSpace=8]="backSpace";const r=10;e[e.lineFeed=r]="lineFeed";const s=9;e[e.tab=s]="tab";const i=13;e[e.carriageReturn=i]="carriageReturn";const a=14;e[e.shiftOut=a]="shiftOut";const u=32;e[e.space=u]="space";const d=33;e[e.exclamationMark=d]="exclamationMark";const h=34;e[e.quotationMark=h]="quotationMark";const f=35;e[e.numberSign=f]="numberSign";const k=36;e[e.dollarSign=k]="dollarSign";const w=37;e[e.percentSign=w]="percentSign";const C=38;e[e.ampersand=C]="ampersand";const R=39;e[e.apostrophe=R]="apostrophe";const q=40;e[e.leftParenthesis=q]="leftParenthesis";const L=41;e[e.rightParenthesis=L]="rightParenthesis";const te=42;e[e.asterisk=te]="asterisk";const Z=43;e[e.plusSign=Z]="plusSign";const S=44;e[e.comma=S]="comma";const N=45;e[e.dash=N]="dash";const v=46;e[e.dot=v]="dot";const O=47;e[e.slash=O]="slash";const U=48;e[e.digit0=U]="digit0";const j=49;e[e.digit1=j]="digit1";const ce=50;e[e.digit2=ce]="digit2";const V=51;e[e.digit3=V]="digit3";const H=52;e[e.digit4=H]="digit4";const pe=53;e[e.digit5=pe]="digit5";const we=54;e[e.digit6=we]="digit6";const he=55;e[e.digit7=he]="digit7";const be=56;e[e.digit8=be]="digit8";const M=57;e[e.digit9=M]="digit9";const ee=58;e[e.colon=ee]="colon";const ge=59;e[e.semicolon=ge]="semicolon";const X=60;e[e.lessThan=X]="lessThan";const _e=61;e[e.equalsTo=_e]="equalsTo";const Ae=62;e[e.greaterThan=Ae]="greaterThan";const J=63;e[e.questionMark=J]="questionMark";const ne=64;e[e.atSign=ne]="atSign";const fe=65;e[e.uppercaseA=fe]="uppercaseA";const Re=66;e[e.uppercaseB=Re]="uppercaseB";const g=67;e[e.uppercaseC=g]="uppercaseC";const y=68;e[e.uppercaseD=y]="uppercaseD";const _=69;e[e.uppercaseE=_]="uppercaseE";const T=70;e[e.uppercaseF=T]="uppercaseF";const E=71;e[e.uppercaseG=E]="uppercaseG";const $=72;e[e.uppercaseH=$]="uppercaseH";const B=73;e[e.uppercaseI=B]="uppercaseI";const se=74;e[e.uppercaseJ=se]="uppercaseJ";const de=75;e[e.uppercaseK=de]="uppercaseK";const le=76;e[e.uppercaseL=le]="uppercaseL";const Ie=77;e[e.uppercaseM=Ie]="uppercaseM";const Se=78;e[e.uppercaseN=Se]="uppercaseN";const oe=79;e[e.uppercaseO=oe]="uppercaseO";const Ee=80;e[e.uppercaseP=Ee]="uppercaseP";const ve=81;e[e.uppercaseQ=ve]="uppercaseQ";const Be=82;e[e.uppercaseR=Be]="uppercaseR";const tt=83;e[e.uppercaseS=tt]="uppercaseS";const lt=84;e[e.uppercaseT=lt]="uppercaseT";const Lt=85;e[e.uppercaseU=Lt]="uppercaseU";const jt=86;e[e.uppercaseV=jt]="uppercaseV";const Ot=87;e[e.uppercaseW=Ot]="uppercaseW";const ut=88;e[e.uppercaseX=ut]="uppercaseX";const _t=89;e[e.uppercaseY=_t]="uppercaseY";const It=90;e[e.uppercaseZ=It]="uppercaseZ";const Mt=91;e[e.leftSquareBracket=Mt]="leftSquareBracket";const Ft=92;e[e.backslash=Ft]="backslash";const St=93;e[e.rightSquareBracket=St]="rightSquareBracket";const $t=94;e[e.caret=$t]="caret";const Bt=95;e[e.underscore=Bt]="underscore";const Y=96;e[e.graveAccent=Y]="graveAccent";const Ce=97;e[e.lowercaseA=Ce]="lowercaseA";const De=98;e[e.lowercaseB=De]="lowercaseB";const Ke=99;e[e.lowercaseC=Ke]="lowercaseC";const qe=100;e[e.lowercaseD=qe]="lowercaseD";const Tt=101;e[e.lowercaseE=Tt]="lowercaseE";const Ze=102;e[e.lowercaseF=Ze]="lowercaseF";const $n=103;e[e.lowercaseG=$n]="lowercaseG";const Bn=104;e[e.lowercaseH=Bn]="lowercaseH";const zn=105;e[e.lowercaseI=zn]="lowercaseI";const qn=106;e[e.lowercaseJ=qn]="lowercaseJ";const Un=107;e[e.lowercaseK=Un]="lowercaseK";const Hn=108;e[e.lowercaseL=Hn]="lowercaseL";const Vn=109;e[e.lowercaseM=Vn]="lowercaseM";const Wn=110;e[e.lowercaseN=Wn]="lowercaseN";const Gn=111;e[e.lowercaseO=Gn]="lowercaseO";const Xn=112;e[e.lowercaseP=Xn]="lowercaseP";const Jn=113;e[e.lowercaseQ=Jn]="lowercaseQ";const Yn=114;e[e.lowercaseR=Yn]="lowercaseR";const Qn=115;e[e.lowercaseS=Qn]="lowercaseS";const Kn=116;e[e.lowercaseT=Kn]="lowercaseT";const Zn=117;e[e.lowercaseU=Zn]="lowercaseU";const er=118;e[e.lowercaseV=er]="lowercaseV";const tr=119;e[e.lowercaseW=tr]="lowercaseW";const nr=120;e[e.lowercaseX=nr]="lowercaseX";const rr=121;e[e.lowercaseY=rr]="lowercaseY";const sr=122;e[e.lowercaseZ=sr]="lowercaseZ";const or=123;e[e.leftCurlyBrace=or]="leftCurlyBrace";const ir=124;e[e.verticalBar=ir]="verticalBar";const ar=125;e[e.rightCurlyBrace=ar]="rightCurlyBrace";const cr=126;e[e.tilde=cr]="tilde";const lr=160;e[e.nonBreakingSpace=lr]="nonBreakingSpace";const ur=5760;e[e.oghamSpaceMark=ur]="oghamSpaceMark";const pr=8232;e[e.lineSeparator=pr]="lineSeparator";const dr=8233;e[e.paragraphSeparator=dr]="paragraphSeparator"})(p||(p={}));let Nn,re,ie,o,A,to;function Jt(){return to++}function Za(e){if("pos"in e){const t=t1(e.pos);e.message+=` (${t.line}:${t.column})`,e.loc=t}return e}class e1{constructor(t,r){this.line=t,this.column=r}}function t1(e){let t=1,r=1;for(let s=0;s<e;s++)A.charCodeAt(s)===p.lineFeed?(t++,r=1):r++;return new e1(t,r)}function n1(e,t,r,s){A=e,o=new Le,to=1,Nn=t,re=r,ie=s}function D(e){return o.contextualKeyword===e}function Or(e){const t=rn();return t.type===n.name&&t.contextualKeyword===e}function Te(e){return o.contextualKeyword===e&&m(n.name)}function ye(e){Te(e)||G()}function Fe(){return c(n.eof)||c(n.braceR)||je()}function je(){const e=o.tokens[o.tokens.length-1],t=e?e.end:0;for(let r=t;r<o.start;r++){const s=A.charCodeAt(r);if(s===p.lineFeed||s===p.carriageReturn||s===8232||s===8233)return!0}return!1}function no(){const e=Mr();for(let t=o.end;t<e;t++){const r=A.charCodeAt(t);if(r===p.lineFeed||r===p.carriageReturn||r===8232||r===8233)return!0}return!1}function Ge(){return m(n.semi)||Fe()}function me(){Ge()||G('Unexpected token, expected ";"')}function x(e){m(e)||G(`Unexpected token, expected "${Qa(e)}"`)}function G(e="Unexpected token",t=o.start){if(o.error)return;const r=new SyntaxError(e);r.pos=t,o.error=r,o.pos=A.length,W(n.eof)}const ro=[9,11,12,p.space,p.nonBreakingSpace,p.oghamSpaceMark,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],vs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,so=new Uint8Array(65536);for(const e of ro)so[e]=1;function r1(e){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<128)return!1;throw new Error("Should not be called with non-ASCII char code.")}const He=new Uint8Array(65536);for(let e=0;e<128;e++)He[e]=r1(e)?1:0;for(let e=128;e<65536;e++)He[e]=1;for(const e of ro)He[e]=0;He[8232]=0;He[8233]=0;const nn=He.slice();for(let e=p.digit0;e<=p.digit9;e++)nn[e]=0;const ws=new Int32Array([-1,27,783,918,1755,2376,2862,3483,-1,3699,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8775,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8802,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(n._with<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8856,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8883,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8910,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8937,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(n._yield<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);function s1(){let e=0,t=0,r=o.pos;for(;r<A.length&&(t=A.charCodeAt(r),!(t<p.lowercaseA||t>p.lowercaseZ));){const i=ws[e+(t-p.lowercaseA)+1];if(i===-1)break;e=i,r++}const s=ws[e];if(s>-1&&!He[t]){o.pos=r,s&1?W(s>>>1):W(n.name,s>>>1);return}for(;r<A.length;){const i=A.charCodeAt(r);if(He[i])r++;else if(i===p.backslash){if(r+=2,A.charCodeAt(r)===p.leftCurlyBrace){for(;r<A.length&&A.charCodeAt(r)!==p.rightCurlyBrace;)r++;r++}}else if(i===p.atSign&&A.charCodeAt(r+1)===p.atSign)r+=2;else break}o.pos=r,W(n.name)}var F;(function(e){e[e.Access=0]="Access";const r=1;e[e.ExportAccess=r]="ExportAccess";const s=r+1;e[e.TopLevelDeclaration=s]="TopLevelDeclaration";const i=s+1;e[e.FunctionScopedDeclaration=i]="FunctionScopedDeclaration";const a=i+1;e[e.BlockScopedDeclaration=a]="BlockScopedDeclaration";const u=a+1;e[e.ObjectShorthandTopLevelDeclaration=u]="ObjectShorthandTopLevelDeclaration";const d=u+1;e[e.ObjectShorthandFunctionScopedDeclaration=d]="ObjectShorthandFunctionScopedDeclaration";const h=d+1;e[e.ObjectShorthandBlockScopedDeclaration=h]="ObjectShorthandBlockScopedDeclaration";const f=h+1;e[e.ObjectShorthand=f]="ObjectShorthand";const k=f+1;e[e.ImportDeclaration=k]="ImportDeclaration";const w=k+1;e[e.ObjectKey=w]="ObjectKey";const C=w+1;e[e.ImportAccess=C]="ImportAccess"})(F||(F={}));var Ue;(function(e){e[e.NoChildren=0]="NoChildren";const r=1;e[e.OneChild=r]="OneChild";const s=r+1;e[e.StaticChildren=s]="StaticChildren";const i=s+1;e[e.KeyAfterPropSpread=i]="KeyAfterPropSpread"})(Ue||(Ue={}));function oo(e){const t=e.identifierRole;return t===F.TopLevelDeclaration||t===F.FunctionScopedDeclaration||t===F.BlockScopedDeclaration||t===F.ObjectShorthandTopLevelDeclaration||t===F.ObjectShorthandFunctionScopedDeclaration||t===F.ObjectShorthandBlockScopedDeclaration}function o1(e){const t=e.identifierRole;return t===F.FunctionScopedDeclaration||t===F.BlockScopedDeclaration||t===F.ObjectShorthandFunctionScopedDeclaration||t===F.ObjectShorthandBlockScopedDeclaration}function io(e){const t=e.identifierRole;return t===F.TopLevelDeclaration||t===F.ObjectShorthandTopLevelDeclaration||t===F.ImportDeclaration}function i1(e){const t=e.identifierRole;return t===F.TopLevelDeclaration||t===F.BlockScopedDeclaration||t===F.ObjectShorthandTopLevelDeclaration||t===F.ObjectShorthandBlockScopedDeclaration}function a1(e){const t=e.identifierRole;return t===F.FunctionScopedDeclaration||t===F.ObjectShorthandFunctionScopedDeclaration}function c1(e){return e.identifierRole===F.ObjectShorthandTopLevelDeclaration||e.identifierRole===F.ObjectShorthandBlockScopedDeclaration||e.identifierRole===F.ObjectShorthandFunctionScopedDeclaration}class Pn{constructor(){this.type=o.type,this.contextualKeyword=o.contextualKeyword,this.start=o.start,this.end=o.end,this.scopeDepth=o.scopeDepth,this.isType=o.isType,this.identifierRole=null,this.jsxRole=null,this.shadowsGlobal=!1,this.isAsyncOperation=!1,this.contextId=null,this.rhsEndIndex=null,this.isExpression=!1,this.numNullishCoalesceStarts=0,this.numNullishCoalesceEnds=0,this.isOptionalChainStart=!1,this.isOptionalChainEnd=!1,this.subscriptStartIndex=null,this.nullishStartIndex=null}}function b(){o.tokens.push(new Pn),uo()}function nt(){o.tokens.push(new Pn),o.start=o.pos,S1()}function l1(){o.type===n.assign&&--o.pos,w1()}function K(e){for(let r=o.tokens.length-e;r<o.tokens.length;r++)o.tokens[r].isType=!0;const t=o.isType;return o.isType=!0,t}function Q(e){o.isType=e}function m(e){return c(e)?(b(),!0):!1}function ao(e){const t=o.isType;o.isType=!0,m(e),o.isType=t}function c(e){return o.type===e}function ke(){const e=o.snapshot();b();const t=o.type;return o.restoreFromSnapshot(e),t}class u1{constructor(t,r){this.type=t,this.contextualKeyword=r}}function rn(){const e=o.snapshot();b();const t=o.type,r=o.contextualKeyword;return o.restoreFromSnapshot(e),new u1(t,r)}function Mr(){return co(o.pos)}function co(e){vs.lastIndex=e;const t=vs.exec(A);return e+t[0].length}function lo(){return A.charCodeAt(Mr())}function uo(){if(fo(),o.start=o.pos,o.pos>=A.length){const e=o.tokens;e.length>=2&&e[e.length-1].start>=A.length&&e[e.length-2].start>=A.length&&G("Unexpectedly reached the end of input."),W(n.eof);return}p1(A.charCodeAt(o.pos))}function p1(e){nn[e]||e===p.backslash||e===p.atSign&&A.charCodeAt(o.pos+1)===p.atSign?s1():go(e)}function d1(){for(;A.charCodeAt(o.pos)!==p.asterisk||A.charCodeAt(o.pos+1)!==p.slash;)if(o.pos++,o.pos>A.length){G("Unterminated comment",o.pos-2);return}o.pos+=2}function po(e){let t=A.charCodeAt(o.pos+=e);if(o.pos<A.length)for(;t!==p.lineFeed&&t!==p.carriageReturn&&t!==p.lineSeparator&&t!==p.paragraphSeparator&&++o.pos<A.length;)t=A.charCodeAt(o.pos)}function fo(){for(;o.pos<A.length;){const e=A.charCodeAt(o.pos);switch(e){case p.carriageReturn:A.charCodeAt(o.pos+1)===p.lineFeed&&++o.pos;case p.lineFeed:case p.lineSeparator:case p.paragraphSeparator:++o.pos;break;case p.slash:switch(A.charCodeAt(o.pos+1)){case p.asterisk:o.pos+=2,d1();break;case p.slash:po(2);break;default:return}break;default:if(so[e])++o.pos;else return}}}function W(e,t=l.NONE){o.end=o.pos,o.type=e,o.contextualKeyword=t}function f1(){const e=A.charCodeAt(o.pos+1);if(e>=p.digit0&&e<=p.digit9){ko(!0);return}e===p.dot&&A.charCodeAt(o.pos+2)===p.dot?(o.pos+=3,W(n.ellipsis)):(++o.pos,W(n.dot))}function h1(){A.charCodeAt(o.pos+1)===p.equalsTo?ae(n.assign,2):ae(n.slash,1)}function m1(e){let t=e===p.asterisk?n.star:n.modulo,r=1,s=A.charCodeAt(o.pos+1);e===p.asterisk&&s===p.asterisk&&(r++,s=A.charCodeAt(o.pos+2),t=n.exponent),s===p.equalsTo&&A.charCodeAt(o.pos+2)!==p.greaterThan&&(r++,t=n.assign),ae(t,r)}function g1(e){const t=A.charCodeAt(o.pos+1);if(t===e){A.charCodeAt(o.pos+2)===p.equalsTo?ae(n.assign,3):ae(e===p.verticalBar?n.logicalOR:n.logicalAND,2);return}if(e===p.verticalBar){if(t===p.greaterThan){ae(n.pipeline,2);return}else if(t===p.rightCurlyBrace&&ie){ae(n.braceBarR,2);return}}if(t===p.equalsTo){ae(n.assign,2);return}ae(e===p.verticalBar?n.bitwiseOR:n.bitwiseAND,1)}function k1(){A.charCodeAt(o.pos+1)===p.equalsTo?ae(n.assign,2):ae(n.bitwiseXOR,1)}function x1(e){const t=A.charCodeAt(o.pos+1);if(t===e){ae(n.preIncDec,2);return}t===p.equalsTo?ae(n.assign,2):e===p.plusSign?ae(n.plus,1):ae(n.minus,1)}function b1(){const e=A.charCodeAt(o.pos+1);if(e===p.lessThan){if(A.charCodeAt(o.pos+2)===p.equalsTo){ae(n.assign,3);return}o.isType?ae(n.lessThan,1):ae(n.bitShiftL,2);return}e===p.equalsTo?ae(n.relationalOrEqual,2):ae(n.lessThan,1)}function ho(){if(o.isType){ae(n.greaterThan,1);return}const e=A.charCodeAt(o.pos+1);if(e===p.greaterThan){const t=A.charCodeAt(o.pos+2)===p.greaterThan?3:2;if(A.charCodeAt(o.pos+t)===p.equalsTo){ae(n.assign,t+1);return}ae(n.bitShiftR,t);return}e===p.equalsTo?ae(n.relationalOrEqual,2):ae(n.greaterThan,1)}function mo(){o.type===n.greaterThan&&(o.pos-=1,ho())}function y1(e){const t=A.charCodeAt(o.pos+1);if(t===p.equalsTo){ae(n.equality,A.charCodeAt(o.pos+2)===p.equalsTo?3:2);return}if(e===p.equalsTo&&t===p.greaterThan){o.pos+=2,W(n.arrow);return}ae(e===p.equalsTo?n.eq:n.bang,1)}function v1(){const e=A.charCodeAt(o.pos+1),t=A.charCodeAt(o.pos+2);e===p.questionMark&&!(ie&&o.isType)?t===p.equalsTo?ae(n.assign,3):ae(n.nullishCoalescing,2):e===p.dot&&!(t>=p.digit0&&t<=p.digit9)?(o.pos+=2,W(n.questionDot)):(++o.pos,W(n.question))}function go(e){switch(e){case p.numberSign:++o.pos,W(n.hash);return;case p.dot:f1();return;case p.leftParenthesis:++o.pos,W(n.parenL);return;case p.rightParenthesis:++o.pos,W(n.parenR);return;case p.semicolon:++o.pos,W(n.semi);return;case p.comma:++o.pos,W(n.comma);return;case p.leftSquareBracket:++o.pos,W(n.bracketL);return;case p.rightSquareBracket:++o.pos,W(n.bracketR);return;case p.leftCurlyBrace:ie&&A.charCodeAt(o.pos+1)===p.verticalBar?ae(n.braceBarL,2):(++o.pos,W(n.braceL));return;case p.rightCurlyBrace:++o.pos,W(n.braceR);return;case p.colon:A.charCodeAt(o.pos+1)===p.colon?ae(n.doubleColon,2):(++o.pos,W(n.colon));return;case p.questionMark:v1();return;case p.atSign:++o.pos,W(n.at);return;case p.graveAccent:++o.pos,W(n.backQuote);return;case p.digit0:{const t=A.charCodeAt(o.pos+1);if(t===p.lowercaseX||t===p.uppercaseX||t===p.lowercaseO||t===p.uppercaseO||t===p.lowercaseB||t===p.uppercaseB){_1();return}}case p.digit1:case p.digit2:case p.digit3:case p.digit4:case p.digit5:case p.digit6:case p.digit7:case p.digit8:case p.digit9:ko(!1);return;case p.quotationMark:case p.apostrophe:I1(e);return;case p.slash:h1();return;case p.percentSign:case p.asterisk:m1(e);return;case p.verticalBar:case p.ampersand:g1(e);return;case p.caret:k1();return;case p.plusSign:case p.dash:x1(e);return;case p.lessThan:b1();return;case p.greaterThan:ho();return;case p.equalsTo:case p.exclamationMark:y1(e);return;case p.tilde:ae(n.tilde,1);return}G(`Unexpected character '${String.fromCharCode(e)}'`,o.pos)}function ae(e,t){o.pos+=t,W(e)}function w1(){const e=o.pos;let t=!1,r=!1;for(;;){if(o.pos>=A.length){G("Unterminated regular expression",e);return}const s=A.charCodeAt(o.pos);if(t)t=!1;else{if(s===p.leftSquareBracket)r=!0;else if(s===p.rightSquareBracket&&r)r=!1;else if(s===p.slash&&!r)break;t=s===p.backslash}++o.pos}++o.pos,T1(),W(n.regexp)}function gr(){for(;;){const e=A.charCodeAt(o.pos);if(e>=p.digit0&&e<=p.digit9||e===p.underscore)o.pos++;else break}}function _1(){for(o.pos+=2;;){const t=A.charCodeAt(o.pos);if(t>=p.digit0&&t<=p.digit9||t>=p.lowercaseA&&t<=p.lowercaseF||t>=p.uppercaseA&&t<=p.uppercaseF||t===p.underscore)o.pos++;else break}A.charCodeAt(o.pos)===p.lowercaseN?(++o.pos,W(n.bigint)):W(n.num)}function ko(e){let t=!1,r=!1;e||gr();let s=A.charCodeAt(o.pos);if(s===p.dot&&(++o.pos,gr(),s=A.charCodeAt(o.pos)),(s===p.uppercaseE||s===p.lowercaseE)&&(s=A.charCodeAt(++o.pos),(s===p.plusSign||s===p.dash)&&++o.pos,gr(),s=A.charCodeAt(o.pos)),s===p.lowercaseN?(++o.pos,t=!0):s===p.lowercaseM&&(++o.pos,r=!0),t){W(n.bigint);return}if(r){W(n.decimal);return}W(n.num)}function I1(e){for(o.pos++;;){if(o.pos>=A.length){G("Unterminated string constant");return}const t=A.charCodeAt(o.pos);if(t===p.backslash)o.pos++;else if(t===e)break;o.pos++}o.pos++,W(n.string)}function S1(){for(;;){if(o.pos>=A.length){G("Unterminated template");return}const e=A.charCodeAt(o.pos);if(e===p.graveAccent||e===p.dollarSign&&A.charCodeAt(o.pos+1)===p.leftCurlyBrace){if(o.pos===o.start&&c(n.template))if(e===p.dollarSign){o.pos+=2,W(n.dollarBraceL);return}else{++o.pos,W(n.backQuote);return}W(n.template);return}e===p.backslash&&o.pos++,o.pos++}}function T1(){for(;o.pos<A.length;){const e=A.charCodeAt(o.pos);if(He[e])o.pos++;else if(e===p.backslash){if(o.pos+=2,A.charCodeAt(o.pos)===p.leftCurlyBrace){for(;o.pos<A.length&&A.charCodeAt(o.pos)!==p.rightCurlyBrace;)o.pos++;o.pos++}}else break}}function Yt(e,t=e.currentIndex()){let r=t+1;if(dn(e,r)){const s=e.identifierNameAtIndex(t);return{isType:!1,leftName:s,rightName:s,endIndex:r}}if(r++,dn(e,r))return{isType:!0,leftName:null,rightName:null,endIndex:r};if(r++,dn(e,r))return{isType:!1,leftName:e.identifierNameAtIndex(t),rightName:e.identifierNameAtIndex(t+2),endIndex:r};if(r++,dn(e,r))return{isType:!0,leftName:null,rightName:null,endIndex:r};throw new Error(`Unexpected import/export specifier at ${t}`)}function dn(e,t){const r=e.tokens[t];return r.type===n.braceR||r.type===n.comma}const A1=new Map([["quot",'"'],["amp","&"],["apos","'"],["lt","<"],["gt",">"],["nbsp"," "],["iexcl","¡"],["cent","¢"],["pound","£"],["curren","¤"],["yen","¥"],["brvbar","¦"],["sect","§"],["uml","¨"],["copy","©"],["ordf","ª"],["laquo","«"],["not","¬"],["shy",""],["reg","®"],["macr","¯"],["deg","°"],["plusmn","±"],["sup2","²"],["sup3","³"],["acute","´"],["micro","µ"],["para","¶"],["middot","·"],["cedil","¸"],["sup1","¹"],["ordm","º"],["raquo","»"],["frac14","¼"],["frac12","½"],["frac34","¾"],["iquest","¿"],["Agrave","À"],["Aacute","Á"],["Acirc","Â"],["Atilde","Ã"],["Auml","Ä"],["Aring","Å"],["AElig","Æ"],["Ccedil","Ç"],["Egrave","È"],["Eacute","É"],["Ecirc","Ê"],["Euml","Ë"],["Igrave","Ì"],["Iacute","Í"],["Icirc","Î"],["Iuml","Ï"],["ETH","Ð"],["Ntilde","Ñ"],["Ograve","Ò"],["Oacute","Ó"],["Ocirc","Ô"],["Otilde","Õ"],["Ouml","Ö"],["times","×"],["Oslash","Ø"],["Ugrave","Ù"],["Uacute","Ú"],["Ucirc","Û"],["Uuml","Ü"],["Yacute","Ý"],["THORN","Þ"],["szlig","ß"],["agrave","à"],["aacute","á"],["acirc","â"],["atilde","ã"],["auml","ä"],["aring","å"],["aelig","æ"],["ccedil","ç"],["egrave","è"],["eacute","é"],["ecirc","ê"],["euml","ë"],["igrave","ì"],["iacute","í"],["icirc","î"],["iuml","ï"],["eth","ð"],["ntilde","ñ"],["ograve","ò"],["oacute","ó"],["ocirc","ô"],["otilde","õ"],["ouml","ö"],["divide","÷"],["oslash","ø"],["ugrave","ù"],["uacute","ú"],["ucirc","û"],["uuml","ü"],["yacute","ý"],["thorn","þ"],["yuml","ÿ"],["OElig","Œ"],["oelig","œ"],["Scaron","Š"],["scaron","š"],["Yuml","Ÿ"],["fnof","ƒ"],["circ","ˆ"],["tilde","˜"],["Alpha","Α"],["Beta","Β"],["Gamma","Γ"],["Delta","Δ"],["Epsilon","Ε"],["Zeta","Ζ"],["Eta","Η"],["Theta","Θ"],["Iota","Ι"],["Kappa","Κ"],["Lambda","Λ"],["Mu","Μ"],["Nu","Ν"],["Xi","Ξ"],["Omicron","Ο"],["Pi","Π"],["Rho","Ρ"],["Sigma","Σ"],["Tau","Τ"],["Upsilon","Υ"],["Phi","Φ"],["Chi","Χ"],["Psi","Ψ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["iota","ι"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["omicron","ο"],["pi","π"],["rho","ρ"],["sigmaf","ς"],["sigma","σ"],["tau","τ"],["upsilon","υ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"],["thetasym","ϑ"],["upsih","ϒ"],["piv","ϖ"],["ensp"," "],["emsp"," "],["thinsp"," "],["zwnj",""],["zwj",""],["lrm",""],["rlm",""],["ndash","–"],["mdash","—"],["lsquo","‘"],["rsquo","’"],["sbquo","‚"],["ldquo","“"],["rdquo","”"],["bdquo","„"],["dagger","†"],["Dagger","‡"],["bull","•"],["hellip","…"],["permil","‰"],["prime","′"],["Prime","″"],["lsaquo","‹"],["rsaquo","›"],["oline","‾"],["frasl","⁄"],["euro","€"],["image","ℑ"],["weierp","℘"],["real","ℜ"],["trade","™"],["alefsym","ℵ"],["larr","←"],["uarr","↑"],["rarr","→"],["darr","↓"],["harr","↔"],["crarr","↵"],["lArr","⇐"],["uArr","⇑"],["rArr","⇒"],["dArr","⇓"],["hArr","⇔"],["forall","∀"],["part","∂"],["exist","∃"],["empty","∅"],["nabla","∇"],["isin","∈"],["notin","∉"],["ni","∋"],["prod","∏"],["sum","∑"],["minus","−"],["lowast","∗"],["radic","√"],["prop","∝"],["infin","∞"],["ang","∠"],["and","∧"],["or","∨"],["cap","∩"],["cup","∪"],["int","∫"],["there4","∴"],["sim","∼"],["cong","≅"],["asymp","≈"],["ne","≠"],["equiv","≡"],["le","≤"],["ge","≥"],["sub","⊂"],["sup","⊃"],["nsub","⊄"],["sube","⊆"],["supe","⊇"],["oplus","⊕"],["otimes","⊗"],["perp","⊥"],["sdot","⋅"],["lceil","⌈"],["rceil","⌉"],["lfloor","⌊"],["rfloor","⌋"],["lang","〈"],["rang","〉"],["loz","◊"],["spades","♠"],["clubs","♣"],["hearts","♥"],["diams","♦"]]);function xo(e){const[t,r]=_s(e.jsxPragma||"React.createElement"),[s,i]=_s(e.jsxFragmentPragma||"React.Fragment");return{base:t,suffix:r,fragmentBase:s,fragmentSuffix:i}}function _s(e){let t=e.indexOf(".");return t===-1&&(t=e.length),[e.slice(0,t),e.slice(t)]}class Ve{getPrefixCode(){return""}getHoistedCode(){return""}getSuffixCode(){return""}}class ft extends Ve{__init(){this.lastLineNumber=1}__init2(){this.lastIndex=0}__init3(){this.filenameVarName=null}__init4(){this.esmAutomaticImportNameResolutions={}}__init5(){this.cjsAutomaticModuleNameResolutions={}}constructor(t,r,s,i,a){super(),this.rootTransformer=t,this.tokens=r,this.importProcessor=s,this.nameManager=i,this.options=a,ft.prototype.__init.call(this),ft.prototype.__init2.call(this),ft.prototype.__init3.call(this),ft.prototype.__init4.call(this),ft.prototype.__init5.call(this),this.jsxPragmaInfo=xo(a),this.isAutomaticRuntime=a.jsxRuntime==="automatic",this.jsxImportSource=a.jsxImportSource||"react"}process(){return this.tokens.matches1(n.jsxTagStart)?(this.processJSXTag(),!0):!1}getPrefixCode(){let t="";if(this.filenameVarName&&(t+=`const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath||"")};`),this.isAutomaticRuntime)if(this.importProcessor)for(const[r,s]of Object.entries(this.cjsAutomaticModuleNameResolutions))t+=`var ${s} = require("${r}");`;else{const{createElement:r,...s}=this.esmAutomaticImportNameResolutions;r&&(t+=`import {createElement as ${r}} from "${this.jsxImportSource}";`);const i=Object.entries(s).map(([a,u])=>`${a} as ${u}`).join(", ");if(i){const a=this.jsxImportSource+(this.options.production?"/jsx-runtime":"/jsx-dev-runtime");t+=`import {${i}} from "${a}";`}}return t}processJSXTag(){const{jsxRole:t,start:r}=this.tokens.currentToken(),s=this.options.production?null:this.getElementLocationCode(r);this.isAutomaticRuntime&&t!==Ue.KeyAfterPropSpread?this.transformTagToJSXFunc(s,t):this.transformTagToCreateElement(s)}getElementLocationCode(t){return`lineNumber: ${this.getLineNumberForIndex(t)}`}getLineNumberForIndex(t){const r=this.tokens.code;for(;this.lastIndex<t&&this.lastIndex<r.length;)r[this.lastIndex]===`
|
|
57
|
+
`&&this.lastLineNumber++,this.lastIndex++;return this.lastLineNumber}transformTagToJSXFunc(t,r){const s=r===Ue.StaticChildren;this.tokens.replaceToken(this.getJSXFuncInvocationCode(s));let i=null;if(this.tokens.matches1(n.jsxTagEnd))this.tokens.replaceToken(`${this.getFragmentCode()}, {`),this.processAutomaticChildrenAndEndProps(r);else{if(this.processTagIntro(),this.tokens.appendCode(", {"),i=this.processProps(!0),this.tokens.matches2(n.slash,n.jsxTagEnd))this.tokens.appendCode("}");else if(this.tokens.matches1(n.jsxTagEnd))this.tokens.removeToken(),this.processAutomaticChildrenAndEndProps(r);else throw new Error("Expected either /> or > at the end of the tag.");i&&this.tokens.appendCode(`, ${i}`)}for(this.options.production||(i===null&&this.tokens.appendCode(", void 0"),this.tokens.appendCode(`, ${s}, ${this.getDevSource(t)}, this`)),this.tokens.removeInitialToken();!this.tokens.matches1(n.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(")")}transformTagToCreateElement(t){if(this.tokens.replaceToken(this.getCreateElementInvocationCode()),this.tokens.matches1(n.jsxTagEnd))this.tokens.replaceToken(`${this.getFragmentCode()}, null`),this.processChildren(!0);else if(this.processTagIntro(),this.processPropsObjectWithDevInfo(t),!this.tokens.matches2(n.slash,n.jsxTagEnd))if(this.tokens.matches1(n.jsxTagEnd))this.tokens.removeToken(),this.processChildren(!0);else throw new Error("Expected either /> or > at the end of the tag.");for(this.tokens.removeInitialToken();!this.tokens.matches1(n.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(")")}getJSXFuncInvocationCode(t){return this.options.production?t?this.claimAutoImportedFuncInvocation("jsxs","/jsx-runtime"):this.claimAutoImportedFuncInvocation("jsx","/jsx-runtime"):this.claimAutoImportedFuncInvocation("jsxDEV","/jsx-dev-runtime")}getCreateElementInvocationCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedFuncInvocation("createElement","");{const{jsxPragmaInfo:t}=this;return`${this.importProcessor&&this.importProcessor.getIdentifierReplacement(t.base)||t.base}${t.suffix}(`}}getFragmentCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedName("Fragment",this.options.production?"/jsx-runtime":"/jsx-dev-runtime");{const{jsxPragmaInfo:t}=this;return(this.importProcessor&&this.importProcessor.getIdentifierReplacement(t.fragmentBase)||t.fragmentBase)+t.fragmentSuffix}}claimAutoImportedFuncInvocation(t,r){const s=this.claimAutoImportedName(t,r);return this.importProcessor?`${s}.call(void 0, `:`${s}(`}claimAutoImportedName(t,r){if(this.importProcessor){const s=this.jsxImportSource+r;return this.cjsAutomaticModuleNameResolutions[s]||(this.cjsAutomaticModuleNameResolutions[s]=this.importProcessor.getFreeIdentifierForPath(s)),`${this.cjsAutomaticModuleNameResolutions[s]}.${t}`}else return this.esmAutomaticImportNameResolutions[t]||(this.esmAutomaticImportNameResolutions[t]=this.nameManager.claimFreeName(`_${t}`)),this.esmAutomaticImportNameResolutions[t]}processTagIntro(){let t=this.tokens.currentIndex()+1;for(;this.tokens.tokens[t].isType||!this.tokens.matches2AtIndex(t-1,n.jsxName,n.jsxName)&&!this.tokens.matches2AtIndex(t-1,n.greaterThan,n.jsxName)&&!this.tokens.matches1AtIndex(t,n.braceL)&&!this.tokens.matches1AtIndex(t,n.jsxTagEnd)&&!this.tokens.matches2AtIndex(t,n.slash,n.jsxTagEnd);)t++;if(t===this.tokens.currentIndex()+1){const r=this.tokens.identifierName();bo(r)&&this.tokens.replaceToken(`'${r}'`)}for(;this.tokens.currentIndex()<t;)this.rootTransformer.processToken()}processPropsObjectWithDevInfo(t){const r=this.options.production?"":`__self: this, __source: ${this.getDevSource(t)}`;if(!this.tokens.matches1(n.jsxName)&&!this.tokens.matches1(n.braceL)){r?this.tokens.appendCode(`, {${r}}`):this.tokens.appendCode(", null");return}this.tokens.appendCode(", {"),this.processProps(!1),r?this.tokens.appendCode(` ${r}}`):this.tokens.appendCode("}")}processProps(t){let r=null;for(;;){if(this.tokens.matches2(n.jsxName,n.eq)){const s=this.tokens.identifierName();if(t&&s==="key"){r!==null&&this.tokens.appendCode(r.replace(/[^\n]/g,"")),this.tokens.removeToken(),this.tokens.removeToken();const i=this.tokens.snapshot();this.processPropValue(),r=this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(i);continue}else this.processPropName(s),this.tokens.replaceToken(": "),this.processPropValue()}else if(this.tokens.matches1(n.jsxName)){const s=this.tokens.identifierName();this.processPropName(s),this.tokens.appendCode(": true")}else if(this.tokens.matches1(n.braceL))this.tokens.replaceToken(""),this.rootTransformer.processBalancedCode(),this.tokens.replaceToken("");else break;this.tokens.appendCode(",")}return r}processPropName(t){t.includes("-")?this.tokens.replaceToken(`'${t}'`):this.tokens.copyToken()}processPropValue(){this.tokens.matches1(n.braceL)?(this.tokens.replaceToken(""),this.rootTransformer.processBalancedCode(),this.tokens.replaceToken("")):this.tokens.matches1(n.jsxTagStart)?this.processJSXTag():this.processStringPropValue()}processStringPropValue(){const t=this.tokens.currentToken(),r=this.tokens.code.slice(t.start+1,t.end-1),s=Is(r),i=C1(r);this.tokens.replaceToken(i+s)}processAutomaticChildrenAndEndProps(t){t===Ue.StaticChildren?(this.tokens.appendCode(" children: ["),this.processChildren(!1),this.tokens.appendCode("]}")):(t===Ue.OneChild&&this.tokens.appendCode(" children: "),this.processChildren(!1),this.tokens.appendCode("}"))}processChildren(t){let r=t;for(;;){if(this.tokens.matches2(n.jsxTagStart,n.slash))return;let s=!1;if(this.tokens.matches1(n.braceL))this.tokens.matches2(n.braceL,n.braceR)?(this.tokens.replaceToken(""),this.tokens.replaceToken("")):(this.tokens.replaceToken(r?", ":""),this.rootTransformer.processBalancedCode(),this.tokens.replaceToken(""),s=!0);else if(this.tokens.matches1(n.jsxTagStart))this.tokens.appendCode(r?", ":""),this.processJSXTag(),s=!0;else if(this.tokens.matches1(n.jsxText)||this.tokens.matches1(n.jsxEmptyText))s=this.processChildTextElement(r);else throw new Error("Unexpected token when processing JSX children.");s&&(r=!0)}}processChildTextElement(t){const r=this.tokens.currentToken(),s=this.tokens.code.slice(r.start,r.end),i=Is(s),a=E1(s);return a==='""'?(this.tokens.replaceToken(i),!1):(this.tokens.replaceToken(`${t?", ":""}${a}${i}`),!0)}getDevSource(t){return`{fileName: ${this.getFilenameVarName()}, ${t}}`}getFilenameVarName(){return this.filenameVarName||(this.filenameVarName=this.nameManager.claimFreeName("_jsxFileName")),this.filenameVarName}}function bo(e){const t=e.charCodeAt(0);return t>=p.lowercaseA&&t<=p.lowercaseZ}function E1(e){let t="",r="",s=!1,i=!1;for(let a=0;a<e.length;a++){const u=e[a];if(u===" "||u===" "||u==="\r")s||(r+=u);else if(u===`
|
|
58
|
+
`)r="",s=!0;else{if(i&&s&&(t+=" "),t+=r,r="",u==="&"){const{entity:d,newI:h}=yo(e,a+1);a=h-1,t+=d}else t+=u;i=!0,s=!1}}return s||(t+=r),JSON.stringify(t)}function Is(e){let t=0,r=0;for(const s of e)s===`
|
|
59
|
+
`?(t++,r=0):s===" "&&r++;return`
|
|
60
|
+
`.repeat(t)+" ".repeat(r)}function C1(e){let t="";for(let r=0;r<e.length;r++){const s=e[r];if(s===`
|
|
61
|
+
`)if(/\s/.test(e[r+1]))for(t+=" ";r<e.length&&/\s/.test(e[r+1]);)r++;else t+=`
|
|
62
|
+
`;else if(s==="&"){const{entity:i,newI:a}=yo(e,r+1);t+=i,r=a-1}else t+=s}return JSON.stringify(t)}function yo(e,t){let r="",s=0,i,a=t;if(e[a]==="#"){let u=10;a++;let d;if(e[a]==="x")for(u=16,a++,d=a;a<e.length&&P1(e.charCodeAt(a));)a++;else for(d=a;a<e.length&&N1(e.charCodeAt(a));)a++;if(e[a]===";"){const h=e.slice(d,a);h&&(a++,i=String.fromCodePoint(parseInt(h,u)))}}else for(;a<e.length&&s++<10;){const u=e[a];if(a++,u===";"){i=A1.get(r);break}r+=u}return i?{entity:i,newI:a}:{entity:"&",newI:t}}function N1(e){return e>=p.digit0&&e<=p.digit9}function P1(e){return e>=p.digit0&&e<=p.digit9||e>=p.lowercaseA&&e<=p.lowercaseF||e>=p.uppercaseA&&e<=p.uppercaseF}function vo(e,t){const r=xo(t),s=new Set;for(let i=0;i<e.tokens.length;i++){const a=e.tokens[i];if(a.type===n.name&&!a.isType&&(a.identifierRole===F.Access||a.identifierRole===F.ObjectShorthand||a.identifierRole===F.ExportAccess)&&!a.shadowsGlobal&&s.add(e.identifierNameForToken(a)),a.type===n.jsxTagStart&&s.add(r.base),a.type===n.jsxTagStart&&i+1<e.tokens.length&&e.tokens[i+1].type===n.jsxTagEnd&&(s.add(r.base),s.add(r.fragmentBase)),a.type===n.jsxName&&a.identifierRole===F.Access){const u=e.identifierNameForToken(a);(!bo(u)||e.tokens[i+1].type===n.dot)&&s.add(e.identifierNameForToken(a))}}return s}class ht{__init(){this.nonTypeIdentifiers=new Set}__init2(){this.importInfoByPath=new Map}__init3(){this.importsToReplace=new Map}__init4(){this.identifierReplacements=new Map}__init5(){this.exportBindingsByLocalName=new Map}constructor(t,r,s,i,a,u,d){this.nameManager=t,this.tokens=r,this.enableLegacyTypeScriptModuleInterop=s,this.options=i,this.isTypeScriptTransformEnabled=a,this.keepUnusedImports=u,this.helperManager=d,ht.prototype.__init.call(this),ht.prototype.__init2.call(this),ht.prototype.__init3.call(this),ht.prototype.__init4.call(this),ht.prototype.__init5.call(this)}preprocessTokens(){for(let t=0;t<this.tokens.tokens.length;t++)this.tokens.matches1AtIndex(t,n._import)&&!this.tokens.matches3AtIndex(t,n._import,n.name,n.eq)&&this.preprocessImportAtIndex(t),this.tokens.matches1AtIndex(t,n._export)&&!this.tokens.matches2AtIndex(t,n._export,n.eq)&&this.preprocessExportAtIndex(t);this.generateImportReplacements()}pruneTypeOnlyImports(){this.nonTypeIdentifiers=vo(this.tokens,this.options);for(const[t,r]of this.importInfoByPath.entries()){if(r.hasBareImport||r.hasStarExport||r.exportStarNames.length>0||r.namedExports.length>0)continue;[...r.defaultNames,...r.wildcardNames,...r.namedImports.map(({localName:i})=>i)].every(i=>this.shouldAutomaticallyElideImportedName(i))&&this.importsToReplace.set(t,"")}}shouldAutomaticallyElideImportedName(t){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(t)}generateImportReplacements(){for(const[t,r]of this.importInfoByPath.entries()){const{defaultNames:s,wildcardNames:i,namedImports:a,namedExports:u,exportStarNames:d,hasStarExport:h}=r;if(s.length===0&&i.length===0&&a.length===0&&u.length===0&&d.length===0&&!h){this.importsToReplace.set(t,`require('${t}');`);continue}const f=this.getFreeIdentifierForPath(t);let k;this.enableLegacyTypeScriptModuleInterop?k=f:k=i.length>0?i[0]:this.getFreeIdentifierForPath(t);let w=`var ${f} = require('${t}');`;if(i.length>0)for(const C of i){const R=this.enableLegacyTypeScriptModuleInterop?f:`${this.helperManager.getHelperName("interopRequireWildcard")}(${f})`;w+=` var ${C} = ${R};`}else d.length>0&&k!==f?w+=` var ${k} = ${this.helperManager.getHelperName("interopRequireWildcard")}(${f});`:s.length>0&&k!==f&&(w+=` var ${k} = ${this.helperManager.getHelperName("interopRequireDefault")}(${f});`);for(const{importedName:C,localName:R}of u)w+=` ${this.helperManager.getHelperName("createNamedExportFrom")}(${f}, '${R}', '${C}');`;for(const C of d)w+=` exports.${C} = ${k};`;h&&(w+=` ${this.helperManager.getHelperName("createStarExport")}(${f});`),this.importsToReplace.set(t,w);for(const C of s)this.identifierReplacements.set(C,`${k}.default`);for(const{importedName:C,localName:R}of a)this.identifierReplacements.set(R,`${f}.${C}`)}}getFreeIdentifierForPath(t){const r=t.split("/"),i=r[r.length-1].replace(/\W/g,"");return this.nameManager.claimFreeName(`_${i}`)}preprocessImportAtIndex(t){const r=[],s=[],i=[];if(t++,(this.tokens.matchesContextualAtIndex(t,l._type)||this.tokens.matches1AtIndex(t,n._typeof))&&!this.tokens.matches1AtIndex(t+1,n.comma)&&!this.tokens.matchesContextualAtIndex(t+1,l._from)||this.tokens.matches1AtIndex(t,n.parenL))return;if(this.tokens.matches1AtIndex(t,n.name)&&(r.push(this.tokens.identifierNameAtIndex(t)),t++,this.tokens.matches1AtIndex(t,n.comma)&&t++),this.tokens.matches1AtIndex(t,n.star)&&(t+=2,s.push(this.tokens.identifierNameAtIndex(t)),t++),this.tokens.matches1AtIndex(t,n.braceL)){const d=this.getNamedImports(t+1);t=d.newIndex;for(const h of d.namedImports)h.importedName==="default"?r.push(h.localName):i.push(h)}if(this.tokens.matchesContextualAtIndex(t,l._from)&&t++,!this.tokens.matches1AtIndex(t,n.string))throw new Error("Expected string token at the end of import statement.");const a=this.tokens.stringValueAtIndex(t),u=this.getImportInfo(a);u.defaultNames.push(...r),u.wildcardNames.push(...s),u.namedImports.push(...i),r.length===0&&s.length===0&&i.length===0&&(u.hasBareImport=!0)}preprocessExportAtIndex(t){if(this.tokens.matches2AtIndex(t,n._export,n._var)||this.tokens.matches2AtIndex(t,n._export,n._let)||this.tokens.matches2AtIndex(t,n._export,n._const))this.preprocessVarExportAtIndex(t);else if(this.tokens.matches2AtIndex(t,n._export,n._function)||this.tokens.matches2AtIndex(t,n._export,n._class)){const r=this.tokens.identifierNameAtIndex(t+2);this.addExportBinding(r,r)}else if(this.tokens.matches3AtIndex(t,n._export,n.name,n._function)){const r=this.tokens.identifierNameAtIndex(t+3);this.addExportBinding(r,r)}else this.tokens.matches2AtIndex(t,n._export,n.braceL)?this.preprocessNamedExportAtIndex(t):this.tokens.matches2AtIndex(t,n._export,n.star)&&this.preprocessExportStarAtIndex(t)}preprocessVarExportAtIndex(t){let r=0;for(let s=t+2;;s++)if(this.tokens.matches1AtIndex(s,n.braceL)||this.tokens.matches1AtIndex(s,n.dollarBraceL)||this.tokens.matches1AtIndex(s,n.bracketL))r++;else if(this.tokens.matches1AtIndex(s,n.braceR)||this.tokens.matches1AtIndex(s,n.bracketR))r--;else{if(r===0&&!this.tokens.matches1AtIndex(s,n.name))break;if(this.tokens.matches1AtIndex(1,n.eq)){const i=this.tokens.currentToken().rhsEndIndex;if(i==null)throw new Error("Expected = token with an end index.");s=i-1}else{const i=this.tokens.tokens[s];if(oo(i)){const a=this.tokens.identifierNameAtIndex(s);this.identifierReplacements.set(a,`exports.${a}`)}}}}preprocessNamedExportAtIndex(t){t+=2;const{newIndex:r,namedImports:s}=this.getNamedImports(t);if(t=r,this.tokens.matchesContextualAtIndex(t,l._from))t++;else{for(const{importedName:u,localName:d}of s)this.addExportBinding(u,d);return}if(!this.tokens.matches1AtIndex(t,n.string))throw new Error("Expected string token at the end of import statement.");const i=this.tokens.stringValueAtIndex(t);this.getImportInfo(i).namedExports.push(...s)}preprocessExportStarAtIndex(t){let r=null;if(this.tokens.matches3AtIndex(t,n._export,n.star,n._as)?(t+=3,r=this.tokens.identifierNameAtIndex(t),t+=2):t+=3,!this.tokens.matches1AtIndex(t,n.string))throw new Error("Expected string token at the end of star export statement.");const s=this.tokens.stringValueAtIndex(t),i=this.getImportInfo(s);r!==null?i.exportStarNames.push(r):i.hasStarExport=!0}getNamedImports(t){const r=[];for(;;){if(this.tokens.matches1AtIndex(t,n.braceR)){t++;break}const s=Yt(this.tokens,t);if(t=s.endIndex,s.isType||r.push({importedName:s.leftName,localName:s.rightName}),this.tokens.matches2AtIndex(t,n.comma,n.braceR)){t+=2;break}else if(this.tokens.matches1AtIndex(t,n.braceR)){t++;break}else if(this.tokens.matches1AtIndex(t,n.comma))t++;else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[t])}`)}return{newIndex:t,namedImports:r}}getImportInfo(t){const r=this.importInfoByPath.get(t);if(r)return r;const s={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(t,s),s}addExportBinding(t,r){this.exportBindingsByLocalName.has(t)||this.exportBindingsByLocalName.set(t,[]),this.exportBindingsByLocalName.get(t).push(r)}claimImportCode(t){const r=this.importsToReplace.get(t);return this.importsToReplace.set(t,""),r||""}getIdentifierReplacement(t){return this.identifierReplacements.get(t)||null}resolveExportBinding(t){const r=this.exportBindingsByLocalName.get(t);return!r||r.length===0?null:r.map(s=>`exports.${s}`).join(" = ")}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}}var R1=44,D1=59,Ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wo=new Uint8Array(64),L1=new Uint8Array(128);for(let e=0;e<Ss.length;e++){const t=Ss.charCodeAt(e);wo[e]=t,L1[t]=e}function zt(e,t,r){let s=t-r;s=s<0?-s<<1|1:s<<1;do{let i=s&31;s>>>=5,s>0&&(i|=32),e.write(wo[i])}while(s>0);return t}var Ts=1024*16,As=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}},j1=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Ts)}write(e){const{buffer:t}=this;t[this.pos++]=e,this.pos===Ts&&(this.out+=As.decode(t),this.pos=0)}flush(){const{buffer:e,out:t,pos:r}=this;return r>0?t+As.decode(e.subarray(0,r)):t}};function O1(e){const t=new j1;let r=0,s=0,i=0,a=0;for(let u=0;u<e.length;u++){const d=e[u];if(u>0&&t.write(D1),d.length===0)continue;let h=0;for(let f=0;f<d.length;f++){const k=d[f];f>0&&t.write(R1),h=zt(t,k[0],h),k.length!==1&&(r=zt(t,k[1],r),s=zt(t,k[2],s),i=zt(t,k[3],i),k.length!==4&&(a=zt(t,k[4],a)))}}return t.flush()}var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},M1={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(gt,function(){const r=/^[\w+.-]+:\/\//,s=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,i=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function a(S){return r.test(S)}function u(S){return S.startsWith("//")}function d(S){return S.startsWith("/")}function h(S){return S.startsWith("file:")}function f(S){return/^[.?#]/.test(S)}function k(S){const N=s.exec(S);return C(N[1],N[2]||"",N[3],N[4]||"",N[5]||"/",N[6]||"",N[7]||"")}function w(S){const N=i.exec(S),v=N[2];return C("file:","",N[1]||"","",d(v)?v:"/"+v,N[3]||"",N[4]||"")}function C(S,N,v,O,U,j,ce){return{scheme:S,user:N,host:v,port:O,path:U,query:j,hash:ce,type:7}}function R(S){if(u(S)){const v=k("http:"+S);return v.scheme="",v.type=6,v}if(d(S)){const v=k("http://foo.com"+S);return v.scheme="",v.host="",v.type=5,v}if(h(S))return w(S);if(a(S))return k(S);const N=k("http://foo.com/"+S);return N.scheme="",N.host="",N.type=S?S.startsWith("?")?3:S.startsWith("#")?2:4:1,N}function q(S){if(S.endsWith("/.."))return S;const N=S.lastIndexOf("/");return S.slice(0,N+1)}function L(S,N){te(N,N.type),S.path==="/"?S.path=N.path:S.path=q(N.path)+S.path}function te(S,N){const v=N<=4,O=S.path.split("/");let U=1,j=0,ce=!1;for(let H=1;H<O.length;H++){const pe=O[H];if(!pe){ce=!0;continue}if(ce=!1,pe!=="."){if(pe===".."){j?(ce=!0,j--,U--):v&&(O[U++]=pe);continue}O[U++]=pe,j++}}let V="";for(let H=1;H<U;H++)V+="/"+O[H];(!V||ce&&!V.endsWith("/.."))&&(V+="/"),S.path=V}function Z(S,N){if(!S&&!N)return"";const v=R(S);let O=v.type;if(N&&O!==7){const j=R(N),ce=j.type;switch(O){case 1:v.hash=j.hash;case 2:v.query=j.query;case 3:case 4:L(v,j);case 5:v.user=j.user,v.host=j.host,v.port=j.port;case 6:v.scheme=j.scheme}ce>O&&(O=ce)}te(v,O);const U=v.query+v.hash;switch(O){case 2:case 3:return U;case 4:{const j=v.path.slice(1);return j?f(N||S)&&!f(j)?"./"+j+U:j+U:U||"."}case 5:return v.path+U;default:return v.scheme+"//"+v.user+v.host+v.port+v.path+U}}return Z})})(M1);var kr=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function F1(e,t){return e._indexes[t]}function $1(e,t){const r=F1(e,t);if(r!==void 0)return r;const{array:s,_indexes:i}=e,a=s.push(t);return i[t]=a-1}var B1=0,z1=1,q1=2,U1=3,H1=4,_o=-1,V1=class{constructor({file:e,sourceRoot:t}={}){this._names=new kr,this._sources=new kr,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=t,this._ignoreList=new kr}};var xr=(e,t,r,s,i,a,u,d)=>X1(!0,e,t,r,s,i,a);function W1(e){const{_mappings:t,_sources:r,_sourcesContent:s,_names:i,_ignoreList:a}=e;return Q1(t),{version:3,file:e.file||void 0,names:i.array,sourceRoot:e.sourceRoot||void 0,sources:r.array,sourcesContent:s,mappings:t,ignoreList:a.array}}function G1(e){const t=W1(e);return Object.assign({},t,{mappings:O1(t.mappings)})}function X1(e,t,r,s,i,a,u,d,h){const{_mappings:f,_sources:k,_sourcesContent:w,_names:C}=t,R=J1(f,r),q=Y1(R,s);if(!i)return K1(R,q)?void 0:Es(R,q,[s]);const L=$1(k,i),te=_o;if(L===w.length&&(w[L]=null),!Z1(R,q,L,a,u,te))return Es(R,q,[s,L,a,u])}function J1(e,t){for(let r=e.length;r<=t;r++)e[r]=[];return e[t]}function Y1(e,t){let r=e.length;for(let s=r-1;s>=0;r=s--){const i=e[s];if(t>=i[B1])break}return r}function Es(e,t,r){for(let s=e.length;s>t;s--)e[s]=e[s-1];e[t]=r}function Q1(e){const{length:t}=e;let r=t;for(let s=r-1;s>=0&&!(e[s].length>0);r=s,s--);r<t&&(e.length=r)}function K1(e,t){return t===0?!0:e[t-1].length===1}function Z1(e,t,r,s,i,a){if(t===0)return!1;const u=e[t-1];return u.length===1?!1:r===u[z1]&&s===u[q1]&&i===u[U1]&&a===(u.length===5?u[H1]:_o)}function ec({code:e,mappings:t},r,s,i,a){const u=tc(i,a),d=new V1({file:s.compiledFilename});let h=0,f=t[0];for(;f===void 0&&h<t.length-1;)h++,f=t[h];let k=0,w=0;f!==w&&xr(d,k,0,r,k,0);for(let L=0;L<e.length;L++){if(L===f){const te=f-w,Z=u[h];for(xr(d,k,te,r,k,Z);(f===L||f===void 0)&&h<t.length-1;)h++,f=t[h]}e.charCodeAt(L)===p.lineFeed&&(k++,w=L+1,f!==w&&xr(d,k,0,r,k,0))}const{sourceRoot:C,sourcesContent:R,...q}=G1(d);return q}function tc(e,t){const r=new Array(t.length);let s=0,i=t[s].start,a=0;for(let u=0;u<e.length;u++)u===i&&(r[s]=i-a,s++,i=t[s].start),e.charCodeAt(u)===p.lineFeed&&(a=u+1);return r}const nc={require:`
|
|
63
|
+
import {createRequire as CREATE_REQUIRE_NAME} from "module";
|
|
64
|
+
const require = CREATE_REQUIRE_NAME(import.meta.url);
|
|
65
|
+
`,interopRequireWildcard:`
|
|
66
|
+
function interopRequireWildcard(obj) {
|
|
67
|
+
if (obj && obj.__esModule) {
|
|
68
|
+
return obj;
|
|
69
|
+
} else {
|
|
70
|
+
var newObj = {};
|
|
71
|
+
if (obj != null) {
|
|
72
|
+
for (var key in obj) {
|
|
73
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
74
|
+
newObj[key] = obj[key];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
newObj.default = obj;
|
|
79
|
+
return newObj;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`,interopRequireDefault:`
|
|
83
|
+
function interopRequireDefault(obj) {
|
|
84
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
85
|
+
}
|
|
86
|
+
`,createNamedExportFrom:`
|
|
87
|
+
function createNamedExportFrom(obj, localName, importedName) {
|
|
88
|
+
Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]});
|
|
89
|
+
}
|
|
90
|
+
`,createStarExport:`
|
|
91
|
+
function createStarExport(obj) {
|
|
92
|
+
Object.keys(obj)
|
|
93
|
+
.filter((key) => key !== "default" && key !== "__esModule")
|
|
94
|
+
.forEach((key) => {
|
|
95
|
+
if (exports.hasOwnProperty(key)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
`,nullishCoalesce:`
|
|
102
|
+
function nullishCoalesce(lhs, rhsFn) {
|
|
103
|
+
if (lhs != null) {
|
|
104
|
+
return lhs;
|
|
105
|
+
} else {
|
|
106
|
+
return rhsFn();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`,asyncNullishCoalesce:`
|
|
110
|
+
async function asyncNullishCoalesce(lhs, rhsFn) {
|
|
111
|
+
if (lhs != null) {
|
|
112
|
+
return lhs;
|
|
113
|
+
} else {
|
|
114
|
+
return await rhsFn();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,optionalChain:`
|
|
118
|
+
function optionalChain(ops) {
|
|
119
|
+
let lastAccessLHS = undefined;
|
|
120
|
+
let value = ops[0];
|
|
121
|
+
let i = 1;
|
|
122
|
+
while (i < ops.length) {
|
|
123
|
+
const op = ops[i];
|
|
124
|
+
const fn = ops[i + 1];
|
|
125
|
+
i += 2;
|
|
126
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
130
|
+
lastAccessLHS = value;
|
|
131
|
+
value = fn(value);
|
|
132
|
+
} else if (op === 'call' || op === 'optionalCall') {
|
|
133
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
134
|
+
lastAccessLHS = undefined;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
`,asyncOptionalChain:`
|
|
140
|
+
async function asyncOptionalChain(ops) {
|
|
141
|
+
let lastAccessLHS = undefined;
|
|
142
|
+
let value = ops[0];
|
|
143
|
+
let i = 1;
|
|
144
|
+
while (i < ops.length) {
|
|
145
|
+
const op = ops[i];
|
|
146
|
+
const fn = ops[i + 1];
|
|
147
|
+
i += 2;
|
|
148
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
152
|
+
lastAccessLHS = value;
|
|
153
|
+
value = await fn(value);
|
|
154
|
+
} else if (op === 'call' || op === 'optionalCall') {
|
|
155
|
+
value = await fn((...args) => value.call(lastAccessLHS, ...args));
|
|
156
|
+
lastAccessLHS = undefined;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
`,optionalChainDelete:`
|
|
162
|
+
function optionalChainDelete(ops) {
|
|
163
|
+
const result = OPTIONAL_CHAIN_NAME(ops);
|
|
164
|
+
return result == null ? true : result;
|
|
165
|
+
}
|
|
166
|
+
`,asyncOptionalChainDelete:`
|
|
167
|
+
async function asyncOptionalChainDelete(ops) {
|
|
168
|
+
const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
|
|
169
|
+
return result == null ? true : result;
|
|
170
|
+
}
|
|
171
|
+
`};class yn{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(t){this.nameManager=t,yn.prototype.__init.call(this),yn.prototype.__init2.call(this)}getHelperName(t){let r=this.helperNames[t];return r||(r=this.nameManager.claimFreeName(`_${t}`),this.helperNames[t]=r,r)}emitHelpers(){let t="";this.helperNames.optionalChainDelete&&this.getHelperName("optionalChain"),this.helperNames.asyncOptionalChainDelete&&this.getHelperName("asyncOptionalChain");for(const[r,s]of Object.entries(nc)){const i=this.helperNames[r];let a=s;r==="optionalChainDelete"?a=a.replace("OPTIONAL_CHAIN_NAME",this.helperNames.optionalChain):r==="asyncOptionalChainDelete"?a=a.replace("ASYNC_OPTIONAL_CHAIN_NAME",this.helperNames.asyncOptionalChain):r==="require"&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName("_createRequire")),a=a.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),i&&(t+=" ",t+=a.replace(r,i).replace(/\s+/g," ").trim())}return t}}function Cs(e,t,r){rc(e,r)&&sc(e,t,r)}function rc(e,t){for(const r of e.tokens)if(r.type===n.name&&!r.isType&&o1(r)&&t.has(e.identifierNameForToken(r)))return!0;return!1}function sc(e,t,r){const s=[];let i=t.length-1;for(let a=e.tokens.length-1;;a--){for(;s.length>0&&s[s.length-1].startTokenIndex===a+1;)s.pop();for(;i>=0&&t[i].endTokenIndex===a+1;)s.push(t[i]),i--;if(a<0)break;const u=e.tokens[a],d=e.identifierNameForToken(u);if(s.length>1&&!u.isType&&u.type===n.name&&r.has(d)){if(i1(u))Ns(s[s.length-1],e,d);else if(a1(u)){let h=s.length-1;for(;h>0&&!s[h].isFunctionScope;)h--;if(h<0)throw new Error("Did not find parent function scope.");Ns(s[h],e,d)}}}if(s.length>0)throw new Error("Expected empty scope stack after processing file.")}function Ns(e,t,r){for(let s=e.startTokenIndex;s<e.endTokenIndex;s++){const i=t.tokens[s];(i.type===n.name||i.type===n.jsxName)&&t.identifierNameForToken(i)===r&&(i.shadowsGlobal=!0)}}function oc(e,t){const r=[];for(const s of t)s.type===n.name&&r.push(e.slice(s.start,s.end));return r}class Fr{__init(){this.usedNames=new Set}constructor(t,r){Fr.prototype.__init.call(this),this.usedNames=new Set(oc(t,r))}claimFreeName(t){const r=this.findFreeName(t);return this.usedNames.add(r),r}findFreeName(t){if(!this.usedNames.has(t))return t;let r=2;for(;this.usedNames.has(t+String(r));)r++;return t+String(r)}}var ue={},Ir={},Xe={},ic=gt&>.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var a in i)i.hasOwnProperty(a)&&(s[a]=i[a])},e(t,r)};return function(t,r){e(t,r);function s(){this.constructor=t}t.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.DetailContext=Xe.NoopContext=Xe.VError=void 0;var Io=function(e){ic(t,e);function t(r,s){var i=e.call(this,s)||this;return i.path=r,Object.setPrototypeOf(i,t.prototype),i}return t}(Error);Xe.VError=Io;var ac=function(){function e(){}return e.prototype.fail=function(t,r,s){return!1},e.prototype.unionResolver=function(){return this},e.prototype.createContext=function(){return this},e.prototype.resolveUnion=function(t){},e}();Xe.NoopContext=ac;var So=function(){function e(){this._propNames=[""],this._messages=[null],this._score=0}return e.prototype.fail=function(t,r,s){return this._propNames.push(t),this._messages.push(r),this._score+=s,!1},e.prototype.unionResolver=function(){return new cc},e.prototype.resolveUnion=function(t){for(var r,s,i=t,a=null,u=0,d=i.contexts;u<d.length;u++){var h=d[u];(!a||h._score>=a._score)&&(a=h)}a&&a._score>0&&((r=this._propNames).push.apply(r,a._propNames),(s=this._messages).push.apply(s,a._messages))},e.prototype.getError=function(t){for(var r=[],s=this._propNames.length-1;s>=0;s--){var i=this._propNames[s];t+=typeof i=="number"?"["+i+"]":i?"."+i:"";var a=this._messages[s];a&&r.push(t+" "+a)}return new Io(t,r.join("; "))},e.prototype.getErrorDetail=function(t){for(var r=[],s=this._propNames.length-1;s>=0;s--){var i=this._propNames[s];t+=typeof i=="number"?"["+i+"]":i?"."+i:"";var a=this._messages[s];a&&r.push({path:t,message:a})}for(var u=null,s=r.length-1;s>=0;s--)u&&(r[s].nested=[u]),u=r[s];return u},e}();Xe.DetailContext=So;var cc=function(){function e(){this.contexts=[]}return e.prototype.createContext=function(){var t=new So;return this.contexts.push(t),t},e}();(function(e){var t=gt&>.__extends||function(){var g=function(y,_){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,E){T.__proto__=E}||function(T,E){for(var $ in E)E.hasOwnProperty($)&&(T[$]=E[$])},g(y,_)};return function(y,_){g(y,_);function T(){this.constructor=y}y.prototype=_===null?Object.create(_):(T.prototype=_.prototype,new T)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.basicTypes=e.BasicType=e.TParamList=e.TParam=e.param=e.TFunc=e.func=e.TProp=e.TOptional=e.opt=e.TIface=e.iface=e.TEnumLiteral=e.enumlit=e.TEnumType=e.enumtype=e.TIntersection=e.intersection=e.TUnion=e.union=e.TTuple=e.tuple=e.TArray=e.array=e.TLiteral=e.lit=e.TName=e.name=e.TType=void 0;var r=Xe,s=function(){function g(){}return g}();e.TType=s;function i(g){return typeof g=="string"?u(g):g}function a(g,y){var _=g[y];if(!_)throw new Error("Unknown type "+y);return _}function u(g){return new d(g)}e.name=u;var d=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.name=_,T._failMsg="is not a "+_,T}return y.prototype.getChecker=function(_,T,E){var $=this,B=a(_,this.name),se=B.getChecker(_,T,E);return B instanceof X||B instanceof y?se:function(de,le){return se(de,le)?!0:le.fail(null,$._failMsg,0)}},y}(s);e.TName=d;function h(g){return new f(g)}e.lit=h;var f=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.value=_,T.name=JSON.stringify(_),T._failMsg="is not "+T.name,T}return y.prototype.getChecker=function(_,T){var E=this;return function($,B){return $===E.value?!0:B.fail(null,E._failMsg,-1)}},y}(s);e.TLiteral=f;function k(g){return new w(i(g))}e.array=k;var w=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.ttype=_,T}return y.prototype.getChecker=function(_,T){var E=this.ttype.getChecker(_,T);return function($,B){if(!Array.isArray($))return B.fail(null,"is not an array",0);for(var se=0;se<$.length;se++){var de=E($[se],B);if(!de)return B.fail(se,null,1)}return!0}},y}(s);e.TArray=w;function C(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return new R(g.map(function(_){return i(_)}))}e.tuple=C;var R=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.ttypes=_,T}return y.prototype.getChecker=function(_,T){var E=this.ttypes.map(function(B){return B.getChecker(_,T)}),$=function(B,se){if(!Array.isArray(B))return se.fail(null,"is not an array",0);for(var de=0;de<E.length;de++){var le=E[de](B[de],se);if(!le)return se.fail(de,null,1)}return!0};return T?function(B,se){return $(B,se)?B.length<=E.length?!0:se.fail(E.length,"is extraneous",2):!1}:$},y}(s);e.TTuple=R;function q(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return new L(g.map(function(_){return i(_)}))}e.union=q;var L=function(g){t(y,g);function y(_){var T=g.call(this)||this;T.ttypes=_;var E=_.map(function(B){return B instanceof d||B instanceof f?B.name:null}).filter(function(B){return B}),$=_.length-E.length;return E.length?($>0&&E.push($+" more"),T._failMsg="is none of "+E.join(", ")):T._failMsg="is none of "+$+" types",T}return y.prototype.getChecker=function(_,T){var E=this,$=this.ttypes.map(function(B){return B.getChecker(_,T)});return function(B,se){for(var de=se.unionResolver(),le=0;le<$.length;le++){var Ie=$[le](B,de.createContext());if(Ie)return!0}return se.resolveUnion(de),se.fail(null,E._failMsg,0)}},y}(s);e.TUnion=L;function te(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return new Z(g.map(function(_){return i(_)}))}e.intersection=te;var Z=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.ttypes=_,T}return y.prototype.getChecker=function(_,T){var E=new Set,$=this.ttypes.map(function(B){return B.getChecker(_,T,E)});return function(B,se){var de=$.every(function(le){return le(B,se)});return de?!0:se.fail(null,null,0)}},y}(s);e.TIntersection=Z;function S(g){return new N(g)}e.enumtype=S;var N=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.members=_,T.validValues=new Set,T._failMsg="is not a valid enum value",T.validValues=new Set(Object.keys(_).map(function(E){return _[E]})),T}return y.prototype.getChecker=function(_,T){var E=this;return function($,B){return E.validValues.has($)?!0:B.fail(null,E._failMsg,0)}},y}(s);e.TEnumType=N;function v(g,y){return new O(g,y)}e.enumlit=v;var O=function(g){t(y,g);function y(_,T){var E=g.call(this)||this;return E.enumName=_,E.prop=T,E._failMsg="is not "+_+"."+T,E}return y.prototype.getChecker=function(_,T){var E=this,$=a(_,this.enumName);if(!($ instanceof N))throw new Error("Type "+this.enumName+" used in enumlit is not an enum type");var B=$.members[this.prop];if(!$.members.hasOwnProperty(this.prop))throw new Error("Unknown value "+this.enumName+"."+this.prop+" used in enumlit");return function(se,de){return se===B?!0:de.fail(null,E._failMsg,-1)}},y}(s);e.TEnumLiteral=O;function U(g){return Object.keys(g).map(function(y){return j(y,g[y])})}function j(g,y){return y instanceof pe?new we(g,y.ttype,!0):new we(g,i(y),!1)}function ce(g,y){return new V(g,U(y))}e.iface=ce;var V=function(g){t(y,g);function y(_,T){var E=g.call(this)||this;return E.bases=_,E.props=T,E.propSet=new Set(T.map(function($){return $.name})),E}return y.prototype.getChecker=function(_,T,E){var $=this,B=this.bases.map(function(oe){return a(_,oe).getChecker(_,T)}),se=this.props.map(function(oe){return oe.ttype.getChecker(_,T)}),de=new r.NoopContext,le=this.props.map(function(oe,Ee){return!oe.isOpt&&!se[Ee](void 0,de)}),Ie=function(oe,Ee){if(typeof oe!="object"||oe===null)return Ee.fail(null,"is not an object",0);for(var ve=0;ve<B.length;ve++)if(!B[ve](oe,Ee))return!1;for(var ve=0;ve<se.length;ve++){var Be=$.props[ve].name,tt=oe[Be];if(tt===void 0){if(le[ve])return Ee.fail(Be,"is missing",1)}else{var lt=se[ve](tt,Ee);if(!lt)return Ee.fail(Be,null,1)}}return!0};if(!T)return Ie;var Se=this.propSet;return E&&(this.propSet.forEach(function(oe){return E.add(oe)}),Se=E),function(oe,Ee){if(!Ie(oe,Ee))return!1;for(var ve in oe)if(!Se.has(ve))return Ee.fail(ve,"is extraneous",2);return!0}},y}(s);e.TIface=V;function H(g){return new pe(i(g))}e.opt=H;var pe=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.ttype=_,T}return y.prototype.getChecker=function(_,T){var E=this.ttype.getChecker(_,T);return function($,B){return $===void 0||E($,B)}},y}(s);e.TOptional=pe;var we=function(){function g(y,_,T){this.name=y,this.ttype=_,this.isOpt=T}return g}();e.TProp=we;function he(g){for(var y=[],_=1;_<arguments.length;_++)y[_-1]=arguments[_];return new be(new ge(y),i(g))}e.func=he;var be=function(g){t(y,g);function y(_,T){var E=g.call(this)||this;return E.paramList=_,E.result=T,E}return y.prototype.getChecker=function(_,T){return function(E,$){return typeof E=="function"?!0:$.fail(null,"is not a function",0)}},y}(s);e.TFunc=be;function M(g,y,_){return new ee(g,i(y),!!_)}e.param=M;var ee=function(){function g(y,_,T){this.name=y,this.ttype=_,this.isOpt=T}return g}();e.TParam=ee;var ge=function(g){t(y,g);function y(_){var T=g.call(this)||this;return T.params=_,T}return y.prototype.getChecker=function(_,T){var E=this,$=this.params.map(function(le){return le.ttype.getChecker(_,T)}),B=new r.NoopContext,se=this.params.map(function(le,Ie){return!le.isOpt&&!$[Ie](void 0,B)}),de=function(le,Ie){if(!Array.isArray(le))return Ie.fail(null,"is not an array",0);for(var Se=0;Se<$.length;Se++){var oe=E.params[Se];if(le[Se]===void 0){if(se[Se])return Ie.fail(oe.name,"is missing",1)}else{var Ee=$[Se](le[Se],Ie);if(!Ee)return Ie.fail(oe.name,null,1)}}return!0};return T?function(le,Ie){return de(le,Ie)?le.length<=$.length?!0:Ie.fail($.length,"is extraneous",2):!1}:de},y}(s);e.TParamList=ge;var X=function(g){t(y,g);function y(_,T){var E=g.call(this)||this;return E.validator=_,E.message=T,E}return y.prototype.getChecker=function(_,T){var E=this;return function($,B){return E.validator($)?!0:B.fail(null,E.message,0)}},y}(s);e.BasicType=X,e.basicTypes={any:new X(function(g){return!0},"is invalid"),number:new X(function(g){return typeof g=="number"},"is not a number"),object:new X(function(g){return typeof g=="object"&&g},"is not an object"),boolean:new X(function(g){return typeof g=="boolean"},"is not a boolean"),string:new X(function(g){return typeof g=="string"},"is not a string"),symbol:new X(function(g){return typeof g=="symbol"},"is not a symbol"),void:new X(function(g){return g==null},"is not void"),undefined:new X(function(g){return g===void 0},"is not undefined"),null:new X(function(g){return g===null},"is not null"),never:new X(function(g){return!1},"is unexpected"),Date:new X(Ae("[object Date]"),"is not a Date"),RegExp:new X(Ae("[object RegExp]"),"is not a RegExp")};var _e=Object.prototype.toString;function Ae(g){return function(y){return typeof y=="object"&&y&&_e.call(y)===g}}typeof Buffer<"u"&&(e.basicTypes.Buffer=new X(function(g){return Buffer.isBuffer(g)},"is not a Buffer"));for(var J=function(g){e.basicTypes[g.name]=new X(function(y){return y instanceof g},"is not a "+g.name)},ne=0,fe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];ne<fe.length;ne++){var Re=fe[ne];J(Re)}})(Ir);(function(e){var t=gt&>.__spreadArrays||function(){for(var h=0,f=0,k=arguments.length;f<k;f++)h+=arguments[f].length;for(var w=Array(h),C=0,f=0;f<k;f++)for(var R=arguments[f],q=0,L=R.length;q<L;q++,C++)w[C]=R[q];return w};Object.defineProperty(e,"__esModule",{value:!0}),e.Checker=e.createCheckers=void 0;var r=Ir,s=Xe,i=Ir;Object.defineProperty(e,"TArray",{enumerable:!0,get:function(){return i.TArray}}),Object.defineProperty(e,"TEnumType",{enumerable:!0,get:function(){return i.TEnumType}}),Object.defineProperty(e,"TEnumLiteral",{enumerable:!0,get:function(){return i.TEnumLiteral}}),Object.defineProperty(e,"TFunc",{enumerable:!0,get:function(){return i.TFunc}}),Object.defineProperty(e,"TIface",{enumerable:!0,get:function(){return i.TIface}}),Object.defineProperty(e,"TLiteral",{enumerable:!0,get:function(){return i.TLiteral}}),Object.defineProperty(e,"TName",{enumerable:!0,get:function(){return i.TName}}),Object.defineProperty(e,"TOptional",{enumerable:!0,get:function(){return i.TOptional}}),Object.defineProperty(e,"TParam",{enumerable:!0,get:function(){return i.TParam}}),Object.defineProperty(e,"TParamList",{enumerable:!0,get:function(){return i.TParamList}}),Object.defineProperty(e,"TProp",{enumerable:!0,get:function(){return i.TProp}}),Object.defineProperty(e,"TTuple",{enumerable:!0,get:function(){return i.TTuple}}),Object.defineProperty(e,"TType",{enumerable:!0,get:function(){return i.TType}}),Object.defineProperty(e,"TUnion",{enumerable:!0,get:function(){return i.TUnion}}),Object.defineProperty(e,"TIntersection",{enumerable:!0,get:function(){return i.TIntersection}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return i.array}}),Object.defineProperty(e,"enumlit",{enumerable:!0,get:function(){return i.enumlit}}),Object.defineProperty(e,"enumtype",{enumerable:!0,get:function(){return i.enumtype}}),Object.defineProperty(e,"func",{enumerable:!0,get:function(){return i.func}}),Object.defineProperty(e,"iface",{enumerable:!0,get:function(){return i.iface}}),Object.defineProperty(e,"lit",{enumerable:!0,get:function(){return i.lit}}),Object.defineProperty(e,"name",{enumerable:!0,get:function(){return i.name}}),Object.defineProperty(e,"opt",{enumerable:!0,get:function(){return i.opt}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return i.param}}),Object.defineProperty(e,"tuple",{enumerable:!0,get:function(){return i.tuple}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return i.union}}),Object.defineProperty(e,"intersection",{enumerable:!0,get:function(){return i.intersection}}),Object.defineProperty(e,"BasicType",{enumerable:!0,get:function(){return i.BasicType}});var a=Xe;Object.defineProperty(e,"VError",{enumerable:!0,get:function(){return a.VError}});function u(){for(var h=[],f=0;f<arguments.length;f++)h[f]=arguments[f];for(var k=Object.assign.apply(Object,t([{},r.basicTypes],h)),w={},C=0,R=h;C<R.length;C++)for(var q=R[C],L=0,te=Object.keys(q);L<te.length;L++){var Z=te[L];w[Z]=new d(k,q[Z])}return w}e.createCheckers=u;var d=function(){function h(f,k,w){if(w===void 0&&(w="value"),this.suite=f,this.ttype=k,this._path=w,this.props=new Map,k instanceof r.TIface)for(var C=0,R=k.props;C<R.length;C++){var q=R[C];this.props.set(q.name,q.ttype)}this.checkerPlain=this.ttype.getChecker(f,!1),this.checkerStrict=this.ttype.getChecker(f,!0)}return h.prototype.setReportedPath=function(f){this._path=f},h.prototype.check=function(f){return this._doCheck(this.checkerPlain,f)},h.prototype.test=function(f){return this.checkerPlain(f,new s.NoopContext)},h.prototype.validate=function(f){return this._doValidate(this.checkerPlain,f)},h.prototype.strictCheck=function(f){return this._doCheck(this.checkerStrict,f)},h.prototype.strictTest=function(f){return this.checkerStrict(f,new s.NoopContext)},h.prototype.strictValidate=function(f){return this._doValidate(this.checkerStrict,f)},h.prototype.getProp=function(f){var k=this.props.get(f);if(!k)throw new Error("Type has no property "+f);return new h(this.suite,k,this._path+"."+f)},h.prototype.methodArgs=function(f){var k=this._getMethod(f);return new h(this.suite,k.paramList)},h.prototype.methodResult=function(f){var k=this._getMethod(f);return new h(this.suite,k.result)},h.prototype.getArgs=function(){if(!(this.ttype instanceof r.TFunc))throw new Error("getArgs() applied to non-function");return new h(this.suite,this.ttype.paramList)},h.prototype.getResult=function(){if(!(this.ttype instanceof r.TFunc))throw new Error("getResult() applied to non-function");return new h(this.suite,this.ttype.result)},h.prototype.getType=function(){return this.ttype},h.prototype._doCheck=function(f,k){var w=new s.NoopContext;if(!f(k,w)){var C=new s.DetailContext;throw f(k,C),C.getError(this._path)}},h.prototype._doValidate=function(f,k){var w=new s.NoopContext;if(f(k,w))return null;var C=new s.DetailContext;return f(k,C),C.getErrorDetail(this._path)},h.prototype._getMethod=function(f){var k=this.props.get(f);if(!k)throw new Error("Type has no property "+f);if(!(k instanceof r.TFunc))throw new Error("Property "+f+" is not a method");return k},h}();e.Checker=d})(ue);const lc=ue.union(ue.lit("jsx"),ue.lit("typescript"),ue.lit("flow"),ue.lit("imports"),ue.lit("react-hot-loader"),ue.lit("jest")),uc=ue.iface([],{compiledFilename:"string"}),pc=ue.iface([],{transforms:ue.array("Transform"),disableESTransforms:ue.opt("boolean"),jsxRuntime:ue.opt(ue.union(ue.lit("classic"),ue.lit("automatic"),ue.lit("preserve"))),production:ue.opt("boolean"),jsxImportSource:ue.opt("string"),jsxPragma:ue.opt("string"),jsxFragmentPragma:ue.opt("string"),keepUnusedImports:ue.opt("boolean"),preserveDynamicImport:ue.opt("boolean"),injectCreateRequireForImportRequire:ue.opt("boolean"),enableLegacyTypeScriptModuleInterop:ue.opt("boolean"),enableLegacyBabel5ModuleInterop:ue.opt("boolean"),sourceMapOptions:ue.opt("SourceMapOptions"),filePath:ue.opt("string")}),dc={Transform:lc,SourceMapOptions:uc,Options:pc},{Options:fc}=ue.createCheckers(dc);function hc(e){fc.strictCheck(e)}function To(){b(),Pe(!1)}function Ao(e){b(),Rn(e)}function ct(e){z(),$r(e)}function vn(){z(),o.tokens[o.tokens.length-1].identifierRole=F.ImportDeclaration}function $r(e){let t;o.scopeDepth===0?t=F.TopLevelDeclaration:e?t=F.BlockScopedDeclaration:t=F.FunctionScopedDeclaration,o.tokens[o.tokens.length-1].identifierRole=t}function Rn(e){switch(o.type){case n._this:{const t=K(0);b(),Q(t);return}case n._yield:case n.name:{o.type=n.name,ct(e);return}case n.bracketL:{b(),Br(n.bracketR,e,!0);return}case n.braceL:Qr(!0,e);return;default:G()}}function Br(e,t,r=!1,s=!1,i=0){let a=!0,u=!1;const d=o.tokens.length;for(;!m(e)&&!o.error;)if(a?a=!1:(x(n.comma),o.tokens[o.tokens.length-1].contextId=i,!u&&o.tokens[d].isType&&(o.tokens[o.tokens.length-1].isType=!0,u=!0)),!(r&&c(n.comma))){if(m(e))break;if(c(n.ellipsis)){Ao(t),Eo(),m(n.comma),x(e);break}else mc(s,t)}}function mc(e,t){e&&zr([l._public,l._protected,l._private,l._readonly,l._override]),wn(t),Eo(),wn(t,!0)}function Eo(){ie?Du():re&&_l()}function wn(e,t=!1){if(t||Rn(e),!m(n.eq))return;const r=o.tokens.length-1;Pe(),o.tokens[r].rhsEndIndex=o.tokens.length}function Sr(){return c(n.name)}function gc(){return c(n.name)||!!(o.type&n.IS_KEYWORD)||c(n.string)||c(n.num)||c(n.bigint)||c(n.decimal)}function Co(){const e=o.snapshot();return b(),(c(n.bracketL)||c(n.braceL)||c(n.star)||c(n.ellipsis)||c(n.hash)||gc())&&!je()?!0:(o.restoreFromSnapshot(e),!1)}function zr(e){for(;No(e)!==null;);}function No(e){if(!c(n.name))return null;const t=o.contextualKeyword;if(e.indexOf(t)!==-1&&Co()){switch(t){case l._readonly:o.tokens[o.tokens.length-1].type=n._readonly;break;case l._abstract:o.tokens[o.tokens.length-1].type=n._abstract;break;case l._static:o.tokens[o.tokens.length-1].type=n._static;break;case l._public:o.tokens[o.tokens.length-1].type=n._public;break;case l._private:o.tokens[o.tokens.length-1].type=n._private;break;case l._protected:o.tokens[o.tokens.length-1].type=n._protected;break;case l._override:o.tokens[o.tokens.length-1].type=n._override;break;case l._declare:o.tokens[o.tokens.length-1].type=n._declare;break}return t}return null}function sn(){for(z();m(n.dot);)z()}function kc(){sn(),!je()&&c(n.lessThan)&&Rt()}function xc(){b(),on()}function bc(){b()}function yc(){x(n._typeof),c(n._import)?Po():sn(),!je()&&c(n.lessThan)&&Rt()}function Po(){x(n._import),x(n.parenL),x(n.string),x(n.parenR),m(n.dot)&&sn(),c(n.lessThan)&&Rt()}function vc(){m(n._const);const e=m(n._in),t=Te(l._out);m(n._const),(e||t)&&!c(n.name)?o.tokens[o.tokens.length-1].type=n.name:z(),m(n._extends)&&xe(),m(n.eq)&&xe()}function yt(){c(n.lessThan)&&Dn()}function Dn(){const e=K(0);for(c(n.lessThan)||c(n.typeParameterStart)?b():G();!m(n.greaterThan)&&!o.error;)vc(),m(n.comma);Q(e)}function qr(e){const t=e===n.arrow;yt(),x(n.parenL),o.scopeDepth++,wc(!1),o.scopeDepth--,(t||c(e))&&Qt(e)}function wc(e){Br(n.parenR,e)}function _n(){m(n.comma)||me()}function Ps(){qr(n.colon),_n()}function _c(){const e=o.snapshot();b();const t=m(n.name)&&c(n.colon);return o.restoreFromSnapshot(e),t}function Ro(){if(!(c(n.bracketL)&&_c()))return!1;const e=K(0);return x(n.bracketL),z(),on(),x(n.bracketR),Pt(),_n(),Q(e),!0}function Rs(e){m(n.question),!e&&(c(n.parenL)||c(n.lessThan))?(qr(n.colon),_n()):(Pt(),_n())}function Ic(){if(c(n.parenL)||c(n.lessThan)){Ps();return}if(c(n._new)){b(),c(n.parenL)||c(n.lessThan)?Ps():Rs(!1);return}const e=!!No([l._readonly]);Ro()||((D(l._get)||D(l._set))&&Co(),Kt(-1),Rs(e))}function Sc(){Do()}function Do(){for(x(n.braceL);!m(n.braceR)&&!o.error;)Ic()}function Tc(){const e=o.snapshot(),t=Ac();return o.restoreFromSnapshot(e),t}function Ac(){return b(),m(n.plus)||m(n.minus)?D(l._readonly):(D(l._readonly)&&b(),!c(n.bracketL)||(b(),!Sr())?!1:(b(),c(n._in)))}function Ec(){z(),x(n._in),xe()}function Cc(){x(n.braceL),c(n.plus)||c(n.minus)?(b(),ye(l._readonly)):Te(l._readonly),x(n.bracketL),Ec(),Te(l._as)&&xe(),x(n.bracketR),c(n.plus)||c(n.minus)?(b(),x(n.question)):m(n.question),Uc(),me(),x(n.braceR)}function Nc(){for(x(n.bracketL);!m(n.bracketR)&&!o.error;)Pc(),m(n.comma)}function Pc(){m(n.ellipsis)?xe():(xe(),m(n.question)),m(n.colon)&&xe()}function Rc(){x(n.parenL),xe(),x(n.parenR)}function Dc(){for(nt(),nt();!c(n.backQuote)&&!o.error;)x(n.dollarBraceL),xe(),nt(),nt();b()}var st;(function(e){e[e.TSFunctionType=0]="TSFunctionType";const r=1;e[e.TSConstructorType=r]="TSConstructorType";const s=r+1;e[e.TSAbstractConstructorType=s]="TSAbstractConstructorType"})(st||(st={}));function br(e){e===st.TSAbstractConstructorType&&ye(l._abstract),(e===st.TSConstructorType||e===st.TSAbstractConstructorType)&&x(n._new);const t=o.inDisallowConditionalTypesContext;o.inDisallowConditionalTypesContext=!1,qr(n.arrow),o.inDisallowConditionalTypesContext=t}function Lc(){switch(o.type){case n.name:kc();return;case n._void:case n._null:b();return;case n.string:case n.num:case n.bigint:case n.decimal:case n._true:case n._false:Nt();return;case n.minus:b(),Nt();return;case n._this:{bc(),D(l._is)&&!je()&&xc();return}case n._typeof:yc();return;case n._import:Po();return;case n.braceL:Tc()?Cc():Sc();return;case n.bracketL:Nc();return;case n.parenL:Rc();return;case n.backQuote:Dc();return;default:if(o.type&n.IS_KEYWORD){b(),o.tokens[o.tokens.length-1].type=n.name;return}break}G()}function jc(){for(Lc();!je()&&m(n.bracketL);)m(n.bracketR)||(xe(),x(n.bracketR))}function Oc(){if(ye(l._infer),z(),c(n._extends)){const e=o.snapshot();x(n._extends);const t=o.inDisallowConditionalTypesContext;o.inDisallowConditionalTypesContext=!0,xe(),o.inDisallowConditionalTypesContext=t,(o.error||!o.inDisallowConditionalTypesContext&&c(n.question))&&o.restoreFromSnapshot(e)}}function Tr(){if(D(l._keyof)||D(l._unique)||D(l._readonly))b(),Tr();else if(D(l._infer))Oc();else{const e=o.inDisallowConditionalTypesContext;o.inDisallowConditionalTypesContext=!1,jc(),o.inDisallowConditionalTypesContext=e}}function Ds(){if(m(n.bitwiseAND),Tr(),c(n.bitwiseAND))for(;m(n.bitwiseAND);)Tr()}function Mc(){if(m(n.bitwiseOR),Ds(),c(n.bitwiseOR))for(;m(n.bitwiseOR);)Ds()}function Fc(){return c(n.lessThan)?!0:c(n.parenL)&&Bc()}function $c(){if(c(n.name)||c(n._this))return b(),!0;if(c(n.braceL)||c(n.bracketL)){let e=1;for(b();e>0&&!o.error;)c(n.braceL)||c(n.bracketL)?e++:(c(n.braceR)||c(n.bracketR))&&e--,b();return!0}return!1}function Bc(){const e=o.snapshot(),t=zc();return o.restoreFromSnapshot(e),t}function zc(){return b(),!!(c(n.parenR)||c(n.ellipsis)||$c()&&(c(n.colon)||c(n.comma)||c(n.question)||c(n.eq)||c(n.parenR)&&(b(),c(n.arrow))))}function Qt(e){const t=K(0);x(e),Hc()||xe(),Q(t)}function qc(){c(n.colon)&&Qt(n.colon)}function Pt(){c(n.colon)&&on()}function Uc(){m(n.colon)&&xe()}function Hc(){const e=o.snapshot();return D(l._asserts)?(b(),Te(l._is)?(xe(),!0):Sr()||c(n._this)?(b(),Te(l._is)&&xe(),!0):(o.restoreFromSnapshot(e),!1)):Sr()||c(n._this)?(b(),D(l._is)&&!je()?(b(),xe(),!0):(o.restoreFromSnapshot(e),!1)):!1}function on(){const e=K(0);x(n.colon),xe(),Q(e)}function xe(){if(Ls(),o.inDisallowConditionalTypesContext||je()||!m(n._extends))return;const e=o.inDisallowConditionalTypesContext;o.inDisallowConditionalTypesContext=!0,Ls(),o.inDisallowConditionalTypesContext=e,x(n.question),xe(),x(n.colon),xe()}function Vc(){return D(l._abstract)&&ke()===n._new}function Ls(){if(Fc()){br(st.TSFunctionType);return}if(c(n._new)){br(st.TSConstructorType);return}else if(Vc()){br(st.TSAbstractConstructorType);return}Mc()}function Wc(){const e=K(1);xe(),x(n.greaterThan),Q(e),an()}function Gc(){if(m(n.jsxTagStart)){o.tokens[o.tokens.length-1].type=n.typeParameterStart;const e=K(1);for(;!c(n.greaterThan)&&!o.error;)xe(),m(n.comma);ze(),Q(e)}}function Lo(){for(;!c(n.braceL)&&!o.error;)Xc(),m(n.comma)}function Xc(){sn(),c(n.lessThan)&&Rt()}function Jc(){ct(!1),yt(),m(n._extends)&&Lo(),Do()}function Yc(){ct(!1),yt(),x(n.eq),xe(),me()}function Qc(){if(c(n.string)?Nt():z(),m(n.eq)){const e=o.tokens.length-1;Pe(),o.tokens[e].rhsEndIndex=o.tokens.length}}function Ur(){for(ct(!1),x(n.braceL);!m(n.braceR)&&!o.error;)Qc(),m(n.comma)}function Hr(){x(n.braceL),Mn(n.braceR)}function Ar(){ct(!1),m(n.dot)?Ar():Hr()}function jo(){D(l._global)?z():c(n.string)?et():G(),c(n.braceL)?Hr():me()}function Er(){vn(),x(n.eq),Zc(),me()}function Kc(){return D(l._require)&&ke()===n.parenL}function Zc(){Kc()?el():sn()}function el(){ye(l._require),x(n.parenL),c(n.string)||G(),Nt(),x(n.parenR)}function tl(){if(Ge())return!1;switch(o.type){case n._function:{const e=K(1);b();const t=o.start;return xt(t,!0),Q(e),!0}case n._class:{const e=K(1);return bt(!0,!1),Q(e),!0}case n._const:if(c(n._const)&&Or(l._enum)){const e=K(1);return x(n._const),ye(l._enum),o.tokens[o.tokens.length-1].type=n._enum,Ur(),Q(e),!0}case n._var:case n._let:{const e=K(1);return gn(o.type!==n._var),Q(e),!0}case n.name:{const e=K(1),t=o.contextualKeyword;let r=!1;return t===l._global?(jo(),r=!0):r=Ln(t,!0),Q(e),r}default:return!1}}function js(){return Ln(o.contextualKeyword,!0)}function nl(e){switch(e){case l._declare:{const t=o.tokens.length-1;if(tl())return o.tokens[t].type=n._declare,!0;break}case l._global:if(c(n.braceL))return Hr(),!0;break;default:return Ln(e,!1)}return!1}function Ln(e,t){switch(e){case l._abstract:if(At(t)&&c(n._class))return o.tokens[o.tokens.length-1].type=n._abstract,bt(!0,!1),!0;break;case l._enum:if(At(t)&&c(n.name))return o.tokens[o.tokens.length-1].type=n._enum,Ur(),!0;break;case l._interface:if(At(t)&&c(n.name)){const r=K(t?2:1);return Jc(),Q(r),!0}break;case l._module:if(At(t)){if(c(n.string)){const r=K(t?2:1);return jo(),Q(r),!0}else if(c(n.name)){const r=K(t?2:1);return Ar(),Q(r),!0}}break;case l._namespace:if(At(t)&&c(n.name)){const r=K(t?2:1);return Ar(),Q(r),!0}break;case l._type:if(At(t)&&c(n.name)){const r=K(t?2:1);return Yc(),Q(r),!0}break}return!1}function At(e){return e?(b(),!0):!Ge()}function rl(){const e=o.snapshot();return Dn(),Dt(),qc(),x(n.arrow),o.error?(o.restoreFromSnapshot(e),!1):(cn(!0),!0)}function Vr(){o.type===n.bitShiftL&&(o.pos-=1,W(n.lessThan)),Rt()}function Rt(){const e=K(0);for(x(n.lessThan);!c(n.greaterThan)&&!o.error;)xe(),m(n.comma);e?(x(n.greaterThan),Q(e)):(Q(e),mo(),x(n.greaterThan),o.tokens[o.tokens.length-1].isType=!0)}function Oo(){if(c(n.name))switch(o.contextualKeyword){case l._abstract:case l._declare:case l._enum:case l._interface:case l._module:case l._namespace:case l._type:return!0}return!1}function sl(e,t){if(c(n.colon)&&Qt(n.colon),!c(n.braceL)&&Ge()){let r=o.tokens.length-1;for(;r>=0&&(o.tokens[r].start>=e||o.tokens[r].type===n._default||o.tokens[r].type===n._export);)o.tokens[r].isType=!0,r--;return}cn(!1,t)}function ol(e,t,r){if(!je()&&m(n.bang)){o.tokens[o.tokens.length-1].type=n.nonNullAssertion;return}if(c(n.lessThan)||c(n.bitShiftL)){const s=o.snapshot();if(!t&&Ho()&&rl())return;if(Vr(),!t&&m(n.parenL)?(o.tokens[o.tokens.length-1].subscriptStartIndex=e,ot()):c(n.backQuote)?Yr():(o.type===n.greaterThan||o.type!==n.parenL&&o.type&n.IS_EXPRESSION_START&&!je())&&G(),o.error)o.restoreFromSnapshot(s);else return}else!t&&c(n.questionDot)&&ke()===n.lessThan&&(b(),o.tokens[e].isOptionalChainStart=!0,o.tokens[o.tokens.length-1].subscriptStartIndex=e,Rt(),x(n.parenL),ot());Gr(e,t,r)}function il(){if(m(n._import))return D(l._type)&&ke()!==n.eq&&ye(l._type),Er(),!0;if(m(n.eq))return Ne(),me(),!0;if(Te(l._as))return ye(l._namespace),z(),me(),!0;if(D(l._type)){const e=ke();(e===n.braceL||e===n.star)&&b()}return!1}function al(){if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-1].identifierRole=F.ImportDeclaration;return}if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-1].identifierRole=F.ImportDeclaration,o.tokens[o.tokens.length-2].isType=!0,o.tokens[o.tokens.length-1].isType=!0;return}if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-3].identifierRole=F.ImportAccess,o.tokens[o.tokens.length-1].identifierRole=F.ImportDeclaration;return}z(),o.tokens[o.tokens.length-3].identifierRole=F.ImportAccess,o.tokens[o.tokens.length-1].identifierRole=F.ImportDeclaration,o.tokens[o.tokens.length-4].isType=!0,o.tokens[o.tokens.length-3].isType=!0,o.tokens[o.tokens.length-2].isType=!0,o.tokens[o.tokens.length-1].isType=!0}function cl(){if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-1].identifierRole=F.ExportAccess;return}if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-1].identifierRole=F.ExportAccess,o.tokens[o.tokens.length-2].isType=!0,o.tokens[o.tokens.length-1].isType=!0;return}if(z(),c(n.comma)||c(n.braceR)){o.tokens[o.tokens.length-3].identifierRole=F.ExportAccess;return}z(),o.tokens[o.tokens.length-3].identifierRole=F.ExportAccess,o.tokens[o.tokens.length-4].isType=!0,o.tokens[o.tokens.length-3].isType=!0,o.tokens[o.tokens.length-2].isType=!0,o.tokens[o.tokens.length-1].isType=!0}function ll(){if(D(l._abstract)&&ke()===n._class)return o.type=n._abstract,b(),bt(!0,!0),!0;if(D(l._interface)){const e=K(2);return Ln(l._interface,!0),Q(e),!0}return!1}function ul(){if(o.type===n._const){const e=rn();if(e.type===n.name&&e.contextualKeyword===l._enum)return x(n._const),ye(l._enum),o.tokens[o.tokens.length-1].type=n._enum,Ur(),!0}return!1}function pl(e){const t=o.tokens.length;zr([l._abstract,l._readonly,l._declare,l._static,l._override]);const r=o.tokens.length;if(Ro()){const i=e?t-1:t;for(let a=i;a<r;a++)o.tokens[a].isType=!0;return!0}return!1}function dl(e){nl(e)||me()}function fl(){const e=Te(l._declare);e&&(o.tokens[o.tokens.length-1].type=n._declare);let t=!1;if(c(n.name))if(e){const r=K(2);t=js(),Q(r)}else t=js();if(!t)if(e){const r=K(2);$e(!0),Q(r)}else $e(!0)}function hl(e){if(e&&(c(n.lessThan)||c(n.bitShiftL))&&Vr(),Te(l._implements)){o.tokens[o.tokens.length-1].type=n._implements;const t=K(1);Lo(),Q(t)}}function ml(){yt()}function gl(){yt()}function kl(){const e=K(0);je()||m(n.bang),Pt(),Q(e)}function xl(){c(n.colon)&&on()}function bl(e,t){return Nn?yl(e,t):vl(e,t)}function yl(e,t){if(!c(n.lessThan))return Je(e,t);const r=o.snapshot();let s=Je(e,t);if(o.error)o.restoreFromSnapshot(r);else return s;return o.type=n.typeParameterStart,Dn(),s=Je(e,t),s||G(),s}function vl(e,t){if(!c(n.lessThan))return Je(e,t);const r=o.snapshot();Dn();const s=Je(e,t);if(s||G(),o.error)o.restoreFromSnapshot(r);else return s;return Je(e,t)}function wl(){if(c(n.colon)){const e=o.snapshot();Qt(n.colon),Fe()&&G(),c(n.arrow)||G(),o.error&&o.restoreFromSnapshot(e)}return m(n.arrow)}function _l(){const e=K(0);m(n.question),Pt(),Q(e)}function Il(){(c(n.lessThan)||c(n.bitShiftL))&&Vr(),ni()}function Sl(){let e=!1,t=!1;for(;;){if(o.pos>=A.length){G("Unterminated JSX contents");return}const r=A.charCodeAt(o.pos);if(r===p.lessThan||r===p.leftCurlyBrace){if(o.pos===o.start){if(r===p.lessThan){o.pos++,W(n.jsxTagStart);return}go(r);return}W(e&&!t?n.jsxEmptyText:n.jsxText);return}r===p.lineFeed?e=!0:r!==p.space&&r!==p.carriageReturn&&r!==p.tab&&(t=!0),o.pos++}}function Tl(e){for(o.pos++;;){if(o.pos>=A.length){G("Unterminated string constant");return}if(A.charCodeAt(o.pos)===e){o.pos++;break}o.pos++}W(n.string)}function Al(){let e;do{if(o.pos>A.length){G("Unexpectedly reached the end of input.");return}e=A.charCodeAt(++o.pos)}while(He[e]||e===p.dash);W(n.jsxName)}function Cr(){ze()}function Mo(e){if(Cr(),!m(n.colon)){o.tokens[o.tokens.length-1].identifierRole=e;return}Cr()}function Fo(){const e=o.tokens.length;Mo(F.Access);let t=!1;for(;c(n.dot);)t=!0,ze(),Cr();if(!t){const r=o.tokens[e],s=A.charCodeAt(r.start);s>=p.lowercaseA&&s<=p.lowercaseZ&&(r.identifierRole=null)}}function El(){switch(o.type){case n.braceL:b(),Ne(),ze();return;case n.jsxTagStart:Bo(),ze();return;case n.string:ze();return;default:G("JSX value should be either an expression or a quoted JSX text")}}function Cl(){x(n.ellipsis),Ne()}function Nl(e){if(c(n.jsxTagEnd))return!1;Fo(),re&&Gc();let t=!1;for(;!c(n.slash)&&!c(n.jsxTagEnd)&&!o.error;){if(m(n.braceL)){t=!0,x(n.ellipsis),Pe(),ze();continue}t&&o.end-o.start===3&&A.charCodeAt(o.start)===p.lowercaseK&&A.charCodeAt(o.start+1)===p.lowercaseE&&A.charCodeAt(o.start+2)===p.lowercaseY&&(o.tokens[e].jsxRole=Ue.KeyAfterPropSpread),Mo(F.ObjectKey),c(n.eq)&&(ze(),El())}const r=c(n.slash);return r&&ze(),r}function Pl(){c(n.jsxTagEnd)||Fo()}function $o(){const e=o.tokens.length-1;o.tokens[e].jsxRole=Ue.NoChildren;let t=0;if(!Nl(e))for(Et();;)switch(o.type){case n.jsxTagStart:if(ze(),c(n.slash)){ze(),Pl(),o.tokens[e].jsxRole!==Ue.KeyAfterPropSpread&&(t===1?o.tokens[e].jsxRole=Ue.OneChild:t>1&&(o.tokens[e].jsxRole=Ue.StaticChildren));return}t++,$o(),Et();break;case n.jsxText:t++,Et();break;case n.jsxEmptyText:Et();break;case n.braceL:b(),c(n.ellipsis)?(Cl(),Et(),t+=2):(c(n.braceR)||(t++,Ne()),Et());break;default:G();return}}function Bo(){ze(),$o()}function ze(){o.tokens.push(new Pn),fo(),o.start=o.pos;const e=A.charCodeAt(o.pos);if(nn[e])Al();else if(e===p.quotationMark||e===p.apostrophe)Tl(e);else switch(++o.pos,e){case p.greaterThan:W(n.jsxTagEnd);break;case p.lessThan:W(n.jsxTagStart);break;case p.slash:W(n.slash);break;case p.equalsTo:W(n.eq);break;case p.leftCurlyBrace:W(n.braceL);break;case p.dot:W(n.dot);break;case p.colon:W(n.colon);break;default:G()}}function Et(){o.tokens.push(new Pn),o.start=o.pos,Sl()}function Rl(e){if(c(n.question)){const t=ke();if(t===n.colon||t===n.comma||t===n.parenR)return}zo(e)}function Dl(){ao(n.question),c(n.colon)&&(re?on():ie&&vt())}class Ll{constructor(t){this.stop=t}}function Ne(e=!1){if(Pe(e),c(n.comma))for(;m(n.comma);)Pe(e)}function Pe(e=!1,t=!1){return re?bl(e,t):ie?$u(e,t):Je(e,t)}function Je(e,t){if(c(n._yield))return Yl(),!1;(c(n.parenL)||c(n.name)||c(n._yield))&&(o.potentialArrowAt=o.start);const r=jl(e);return t&&Jr(),o.type&n.IS_ASSIGN?(b(),Pe(e),!1):r}function jl(e){return Ml(e)?!0:(Ol(e),!1)}function Ol(e){re||ie?Rl(e):zo(e)}function zo(e){m(n.question)&&(Pe(),x(n.colon),Pe(e))}function Ml(e){const t=o.tokens.length;return an()?!0:(hn(t,-1,e),!1)}function hn(e,t,r){if(re&&(n._in&n.PRECEDENCE_MASK)>t&&!je()&&(Te(l._as)||Te(l._satisfies))){const i=K(1);xe(),Q(i),mo(),hn(e,t,r);return}const s=o.type&n.PRECEDENCE_MASK;if(s>0&&(!r||!c(n._in))&&s>t){const i=o.type;b(),i===n.nullishCoalescing&&(o.tokens[o.tokens.length-1].nullishStartIndex=e);const a=o.tokens.length;an(),hn(a,i&n.IS_RIGHT_ASSOCIATIVE?s-1:s,r),i===n.nullishCoalescing&&(o.tokens[e].numNullishCoalesceStarts++,o.tokens[o.tokens.length-1].numNullishCoalesceEnds++),hn(e,t,r)}}function an(){if(re&&!Nn&&m(n.lessThan))return Wc(),!1;if(D(l._module)&&lo()===p.leftCurlyBrace&&!no())return Ql(),!1;if(o.type&n.IS_PREFIX)return b(),an(),!1;if(qo())return!0;for(;o.type&n.IS_POSTFIX&&!Fe();)o.type===n.preIncDec&&(o.type=n.postIncDec),b();return!1}function qo(){const e=o.tokens.length;return et()?!0:(Wr(e),o.tokens.length>e&&o.tokens[e].isOptionalChainStart&&(o.tokens[o.tokens.length-1].isOptionalChainEnd=!0),!1)}function Wr(e,t=!1){ie?zu(e,t):Uo(e,t)}function Uo(e,t=!1){const r=new Ll(!1);do Fl(e,t,r);while(!r.stop&&!o.error)}function Fl(e,t,r){re?ol(e,t,r):ie?vu(e,t,r):Gr(e,t,r)}function Gr(e,t,r){if(!t&&m(n.doubleColon))Xr(),r.stop=!0,Wr(e,t);else if(c(n.questionDot)){if(o.tokens[e].isOptionalChainStart=!0,t&&ke()===n.parenL){r.stop=!0;return}b(),o.tokens[o.tokens.length-1].subscriptStartIndex=e,m(n.bracketL)?(Ne(),x(n.bracketR)):m(n.parenL)?ot():In()}else if(m(n.dot))o.tokens[o.tokens.length-1].subscriptStartIndex=e,In();else if(m(n.bracketL))o.tokens[o.tokens.length-1].subscriptStartIndex=e,Ne(),x(n.bracketR);else if(!t&&c(n.parenL))if(Ho()){const s=o.snapshot(),i=o.tokens.length;b(),o.tokens[o.tokens.length-1].subscriptStartIndex=e;const a=Jt();o.tokens[o.tokens.length-1].contextId=a,ot(),o.tokens[o.tokens.length-1].contextId=a,$l()&&(o.restoreFromSnapshot(s),r.stop=!0,o.scopeDepth++,Dt(),Bl(i))}else{b(),o.tokens[o.tokens.length-1].subscriptStartIndex=e;const s=Jt();o.tokens[o.tokens.length-1].contextId=s,ot(),o.tokens[o.tokens.length-1].contextId=s}else c(n.backQuote)?Yr():r.stop=!0}function Ho(){return o.tokens[o.tokens.length-1].contextualKeyword===l._async&&!Fe()}function ot(){let e=!0;for(;!m(n.parenR)&&!o.error;){if(e)e=!1;else if(x(n.comma),m(n.parenR))break;Xo(!1)}}function $l(){return c(n.colon)||c(n.arrow)}function Bl(e){re?xl():ie&&Fu(),x(n.arrow),Zt(e)}function Xr(){const e=o.tokens.length;et(),Wr(e,!0)}function et(){if(m(n.modulo))return z(),!1;if(c(n.jsxText)||c(n.jsxEmptyText))return Nt(),!1;if(c(n.lessThan)&&Nn)return o.type=n.jsxTagStart,Bo(),b(),!1;const e=o.potentialArrowAt===o.start;switch(o.type){case n.slash:case n.assign:l1();case n._super:case n._this:case n.regexp:case n.num:case n.bigint:case n.decimal:case n.string:case n._null:case n._true:case n._false:return b(),!1;case n._import:return b(),c(n.dot)&&(o.tokens[o.tokens.length-1].type=n.name,b(),z()),!1;case n.name:{const t=o.tokens.length,r=o.start,s=o.contextualKeyword;return z(),s===l._await?(Jl(),!1):s===l._async&&c(n._function)&&!Fe()?(b(),xt(r,!1),!1):e&&s===l._async&&!Fe()&&c(n.name)?(o.scopeDepth++,ct(!1),x(n.arrow),Zt(t),!0):c(n._do)&&!Fe()?(b(),it(),!1):e&&!Fe()&&c(n.arrow)?(o.scopeDepth++,$r(!1),x(n.arrow),Zt(t),!0):(o.tokens[o.tokens.length-1].identifierRole=F.Access,!1)}case n._do:return b(),it(),!1;case n.parenL:return Vo(e);case n.bracketL:return b(),Go(n.bracketR,!0),!1;case n.braceL:return Qr(!1,!1),!1;case n._function:return zl(),!1;case n.at:is();case n._class:return bt(!1),!1;case n._new:return Ul(),!1;case n.backQuote:return Yr(),!1;case n.doubleColon:return b(),Xr(),!1;case n.hash:{const t=lo();return nn[t]||t===p.backslash?In():b(),!1}default:return G(),!1}}function In(){m(n.hash),z()}function zl(){const e=o.start;z(),m(n.dot)&&z(),xt(e,!1)}function Nt(){b()}function jn(){x(n.parenL),Ne(),x(n.parenR)}function Vo(e){const t=o.snapshot(),r=o.tokens.length;x(n.parenL);let s=!0;for(;!c(n.parenR)&&!o.error;){if(s)s=!1;else if(x(n.comma),c(n.parenR))break;if(c(n.ellipsis)){Ao(!1),Jr();break}else Pe(!1,!0)}return x(n.parenR),e&&ql()&&Nr()?(o.restoreFromSnapshot(t),o.scopeDepth++,Dt(),Nr(),Zt(r),o.error?(o.restoreFromSnapshot(t),Vo(!1),!1):!0):!1}function ql(){return c(n.colon)||!Fe()}function Nr(){return re?wl():ie?Bu():m(n.arrow)}function Jr(){(re||ie)&&Dl()}function Ul(){if(x(n._new),m(n.dot)){z();return}Hl(),ie&&wu(),m(n.parenL)&&Go(n.parenR)}function Hl(){Xr(),m(n.questionDot)}function Yr(){for(nt(),nt();!c(n.backQuote)&&!o.error;)x(n.dollarBraceL),Ne(),nt(),nt();b()}function Qr(e,t){const r=Jt();let s=!0;for(b(),o.tokens[o.tokens.length-1].contextId=r;!m(n.braceR)&&!o.error;){if(s)s=!1;else if(x(n.comma),m(n.braceR))break;let i=!1;if(c(n.ellipsis)){const a=o.tokens.length;if(To(),e&&(o.tokens.length===a+2&&$r(t),m(n.braceR)))break;continue}e||(i=m(n.star)),!e&&D(l._async)?(i&&G(),z(),c(n.colon)||c(n.parenL)||c(n.braceR)||c(n.eq)||c(n.comma)||(c(n.star)&&(b(),i=!0),Kt(r))):Kt(r),Xl(e,t,r)}o.tokens[o.tokens.length-1].contextId=r}function Vl(e){return!e&&(c(n.string)||c(n.num)||c(n.bracketL)||c(n.name)||!!(o.type&n.IS_KEYWORD))}function Wl(e,t){const r=o.start;return c(n.parenL)?(e&&G(),Pr(r,!1),!0):Vl(e)?(Kt(t),Pr(r,!1),!0):!1}function Gl(e,t){if(m(n.colon)){e?wn(t):Pe(!1);return}let r;e?o.scopeDepth===0?r=F.ObjectShorthandTopLevelDeclaration:t?r=F.ObjectShorthandBlockScopedDeclaration:r=F.ObjectShorthandFunctionScopedDeclaration:r=F.ObjectShorthand,o.tokens[o.tokens.length-1].identifierRole=r,wn(t,!0)}function Xl(e,t,r){re?ml():ie&&Ru(),Wl(e,r)||Gl(e,t)}function Kt(e){ie&&os(),m(n.bracketL)?(o.tokens[o.tokens.length-1].contextId=e,Pe(),x(n.bracketR),o.tokens[o.tokens.length-1].contextId=e):(c(n.num)||c(n.string)||c(n.bigint)||c(n.decimal)?et():In(),o.tokens[o.tokens.length-1].identifierRole=F.ObjectKey,o.tokens[o.tokens.length-1].contextId=e)}function Pr(e,t){const r=Jt();o.scopeDepth++;const s=o.tokens.length;Dt(t,r),Wo(e,r);const a=o.tokens.length;o.scopes.push(new Ye(s,a,!0)),o.scopeDepth--}function Zt(e){cn(!0);const t=o.tokens.length;o.scopes.push(new Ye(e,t,!0)),o.scopeDepth--}function Wo(e,t=0){re?sl(e,t):ie?yu(t):cn(!1,t)}function cn(e,t=0){e&&!c(n.braceL)?Pe():it(!0,t)}function Go(e,t=!1){let r=!0;for(;!m(e)&&!o.error;){if(r)r=!1;else if(x(n.comma),m(e))break;Xo(t)}}function Xo(e){e&&c(n.comma)||(c(n.ellipsis)?(To(),Jr()):c(n.question)?b():Pe(!1,!0))}function z(){b(),o.tokens[o.tokens.length-1].type=n.name}function Jl(){an()}function Yl(){b(),!c(n.semi)&&!Fe()&&(m(n.star),Pe())}function Ql(){ye(l._module),x(n.braceL),Mn(n.braceR)}function Kl(e){return(e.type===n.name||!!(e.type&n.IS_KEYWORD))&&e.contextualKeyword!==l._from}function Qe(e){const t=K(0);x(e||n.colon),Oe(),Q(t)}function Os(){x(n.modulo),ye(l._checks),m(n.parenL)&&(Ne(),x(n.parenR))}function Kr(){const e=K(0);x(n.colon),c(n.modulo)?Os():(Oe(),c(n.modulo)&&Os()),Q(e)}function Zl(){b(),Zr(!0)}function eu(){b(),z(),c(n.lessThan)&&We(),x(n.parenL),Dr(),x(n.parenR),Kr(),me()}function Rr(){c(n._class)?Zl():c(n._function)?eu():c(n._var)?tu():Te(l._module)?m(n.dot)?su():nu():D(l._type)?ou():D(l._opaque)?iu():D(l._interface)?au():c(n._export)?ru():G()}function tu(){b(),Ko(),me()}function nu(){for(c(n.string)?et():z(),x(n.braceL);!c(n.braceR)&&!o.error;)c(n._import)?(b(),ci()):G();x(n.braceR)}function ru(){x(n._export),m(n._default)?c(n._function)||c(n._class)?Rr():(Oe(),me()):c(n._var)||c(n._function)||c(n._class)||D(l._opaque)?Rr():c(n.star)||c(n.braceL)||D(l._interface)||D(l._type)||D(l._opaque)?ii():G()}function su(){ye(l._exports),vt(),me()}function ou(){b(),ts()}function iu(){b(),ns(!0)}function au(){b(),Zr()}function Zr(e=!1){if(On(),c(n.lessThan)&&We(),m(n._extends))do mn();while(!e&&m(n.comma));if(D(l._mixins)){b();do mn();while(m(n.comma))}if(D(l._implements)){b();do mn();while(m(n.comma))}Sn(e,!1,e)}function mn(){Jo(!1),c(n.lessThan)&&kt()}function es(){Zr()}function On(){z()}function ts(){On(),c(n.lessThan)&&We(),Qe(n.eq),me()}function ns(e){ye(l._type),On(),c(n.lessThan)&&We(),c(n.colon)&&Qe(n.colon),e||Qe(n.eq),me()}function cu(){os(),Ko(),m(n.eq)&&Oe()}function We(){const e=K(0);c(n.lessThan)||c(n.typeParameterStart)?b():G();do cu(),c(n.greaterThan)||x(n.comma);while(!c(n.greaterThan)&&!o.error);x(n.greaterThan),Q(e)}function kt(){const e=K(0);for(x(n.lessThan);!c(n.greaterThan)&&!o.error;)Oe(),c(n.greaterThan)||x(n.comma);x(n.greaterThan),Q(e)}function lu(){if(ye(l._interface),m(n._extends))do mn();while(m(n.comma));Sn(!1,!1,!1)}function rs(){c(n.num)||c(n.string)?et():z()}function uu(){ke()===n.colon?(rs(),Qe()):Oe(),x(n.bracketR),Qe()}function pu(){rs(),x(n.bracketR),x(n.bracketR),c(n.lessThan)||c(n.parenL)?ss():(m(n.question),Qe())}function ss(){for(c(n.lessThan)&&We(),x(n.parenL);!c(n.parenR)&&!c(n.ellipsis)&&!o.error;)Tn(),c(n.parenR)||x(n.comma);m(n.ellipsis)&&Tn(),x(n.parenR),Qe()}function du(){ss()}function Sn(e,t,r){let s;for(t&&c(n.braceBarL)?(x(n.braceBarL),s=n.braceBarR):(x(n.braceL),s=n.braceR);!c(s)&&!o.error;){if(r&&D(l._proto)){const i=ke();i!==n.colon&&i!==n.question&&(b(),e=!1)}if(e&&D(l._static)){const i=ke();i!==n.colon&&i!==n.question&&b()}if(os(),m(n.bracketL))m(n.bracketL)?pu():uu();else if(c(n.parenL)||c(n.lessThan))du();else{if(D(l._get)||D(l._set)){const i=ke();(i===n.name||i===n.string||i===n.num)&&b()}fu()}hu()}x(s)}function fu(){if(c(n.ellipsis)){if(x(n.ellipsis),m(n.comma)||m(n.semi),c(n.braceR))return;Oe()}else rs(),c(n.lessThan)||c(n.parenL)?ss():(m(n.question),Qe())}function hu(){!m(n.semi)&&!m(n.comma)&&!c(n.braceR)&&!c(n.braceBarR)&&G()}function Jo(e){for(e||z();m(n.dot);)z()}function mu(){Jo(!0),c(n.lessThan)&&kt()}function gu(){x(n._typeof),Yo()}function ku(){for(x(n.bracketL);o.pos<A.length&&!c(n.bracketR)&&(Oe(),!c(n.bracketR));)x(n.comma);x(n.bracketR)}function Tn(){const e=ke();e===n.colon||e===n.question?(z(),m(n.question),Qe()):Oe()}function Dr(){for(;!c(n.parenR)&&!c(n.ellipsis)&&!o.error;)Tn(),c(n.parenR)||x(n.comma);m(n.ellipsis)&&Tn()}function Yo(){let e=!1;const t=o.noAnonFunctionType;switch(o.type){case n.name:{if(D(l._interface)){lu();return}z(),mu();return}case n.braceL:Sn(!1,!1,!1);return;case n.braceBarL:Sn(!1,!0,!1);return;case n.bracketL:ku();return;case n.lessThan:We(),x(n.parenL),Dr(),x(n.parenR),x(n.arrow),Oe();return;case n.parenL:if(b(),!c(n.parenR)&&!c(n.ellipsis))if(c(n.name)){const r=ke();e=r!==n.question&&r!==n.colon}else e=!0;if(e)if(o.noAnonFunctionType=!1,Oe(),o.noAnonFunctionType=t,o.noAnonFunctionType||!(c(n.comma)||c(n.parenR)&&ke()===n.arrow)){x(n.parenR);return}else m(n.comma);Dr(),x(n.parenR),x(n.arrow),Oe();return;case n.minus:b(),Nt();return;case n.string:case n.num:case n._true:case n._false:case n._null:case n._this:case n._void:case n.star:b();return;default:if(o.type===n._typeof){gu();return}else if(o.type&n.IS_KEYWORD){b(),o.tokens[o.tokens.length-1].type=n.name;return}}G()}function xu(){for(Yo();!Fe()&&(c(n.bracketL)||c(n.questionDot));)m(n.questionDot),x(n.bracketL),m(n.bracketR)||(Oe(),x(n.bracketR))}function Qo(){m(n.question)?Qo():xu()}function Ms(){Qo(),!o.noAnonFunctionType&&m(n.arrow)&&Oe()}function Fs(){for(m(n.bitwiseAND),Ms();m(n.bitwiseAND);)Ms()}function bu(){for(m(n.bitwiseOR),Fs();m(n.bitwiseOR);)Fs()}function Oe(){bu()}function vt(){Qe()}function Ko(){z(),c(n.colon)&&vt()}function os(){(c(n.plus)||c(n.minus))&&(b(),o.tokens[o.tokens.length-1].isType=!0)}function yu(e){c(n.colon)&&Kr(),cn(!1,e)}function vu(e,t,r){if(c(n.questionDot)&&ke()===n.lessThan){if(t){r.stop=!0;return}b(),kt(),x(n.parenL),ot();return}else if(!t&&c(n.lessThan)){const s=o.snapshot();if(kt(),x(n.parenL),ot(),o.error)o.restoreFromSnapshot(s);else return}Gr(e,t,r)}function wu(){if(c(n.lessThan)){const e=o.snapshot();kt(),o.error&&o.restoreFromSnapshot(e)}}function _u(){if(c(n.name)&&o.contextualKeyword===l._interface){const e=K(0);return b(),es(),Q(e),!0}else if(D(l._enum))return Zo(),!0;return!1}function Iu(){return D(l._enum)?(Zo(),!0):!1}function Su(e){if(e===l._declare){if(c(n._class)||c(n.name)||c(n._function)||c(n._var)||c(n._export)){const t=K(1);Rr(),Q(t)}}else if(c(n.name)){if(e===l._interface){const t=K(1);es(),Q(t)}else if(e===l._type){const t=K(1);ts(),Q(t)}else if(e===l._opaque){const t=K(1);ns(!1),Q(t)}}me()}function Tu(){return D(l._type)||D(l._interface)||D(l._opaque)||D(l._enum)}function Au(){return c(n.name)&&(o.contextualKeyword===l._type||o.contextualKeyword===l._interface||o.contextualKeyword===l._opaque||o.contextualKeyword===l._enum)}function Eu(){if(D(l._type)){const e=K(1);b(),c(n.braceL)?(as(),en()):ts(),Q(e)}else if(D(l._opaque)){const e=K(1);b(),ns(!1),Q(e)}else if(D(l._interface)){const e=K(1);b(),es(),Q(e)}else $e(!0)}function Cu(){return c(n.star)||D(l._type)&&ke()===n.star}function Nu(){if(Te(l._type)){const e=K(2);Lr(),Q(e)}else Lr()}function Pu(e){if(e&&c(n.lessThan)&&kt(),D(l._implements)){const t=K(0);b(),o.tokens[o.tokens.length-1].type=n._implements;do On(),c(n.lessThan)&&kt();while(m(n.comma));Q(t)}}function Ru(){c(n.lessThan)&&(We(),c(n.parenL)||G())}function Du(){const e=K(0);m(n.question),c(n.colon)&&vt(),Q(e)}function Lu(){if(c(n._typeof)||D(l._type)){const e=rn();(Kl(e)||e.type===n.braceL||e.type===n.star)&&b()}}function ju(){const e=o.contextualKeyword===l._type||o.type===n._typeof;e?b():z(),D(l._as)&&!Or(l._as)?(z(),e&&!c(n.name)&&!(o.type&n.IS_KEYWORD)||z()):(e&&(c(n.name)||o.type&n.IS_KEYWORD)&&z(),Te(l._as)&&z())}function Ou(){if(c(n.lessThan)){const e=K(0);We(),Q(e)}}function Mu(){c(n.colon)&&vt()}function Fu(){if(c(n.colon)){const e=o.noAnonFunctionType;o.noAnonFunctionType=!0,vt(),o.noAnonFunctionType=e}}function $u(e,t){if(c(n.lessThan)){const r=o.snapshot();let s=Je(e,t);if(o.error)o.restoreFromSnapshot(r),o.type=n.typeParameterStart;else return s;const i=K(0);if(We(),Q(i),s=Je(e,t),s)return!0;G()}return Je(e,t)}function Bu(){if(c(n.colon)){const e=K(0),t=o.snapshot(),r=o.noAnonFunctionType;o.noAnonFunctionType=!0,Kr(),o.noAnonFunctionType=r,Fe()&&G(),c(n.arrow)||G(),o.error&&o.restoreFromSnapshot(t),Q(e)}return m(n.arrow)}function zu(e,t=!1){if(o.tokens[o.tokens.length-1].contextualKeyword===l._async&&c(n.lessThan)){const r=o.snapshot();if(qu()&&!o.error)return;o.restoreFromSnapshot(r)}Uo(e,t)}function qu(){o.scopeDepth++;const e=o.tokens.length;return Dt(),Nr()?(Zt(e),!0):!1}function Zo(){ye(l._enum),o.tokens[o.tokens.length-1].type=n._enum,z(),Uu()}function Uu(){Te(l._of)&&b(),x(n.braceL),Hu(),x(n.braceR)}function Hu(){for(;!c(n.braceR)&&!o.error&&!m(n.ellipsis);)Vu(),c(n.braceR)||x(n.comma)}function Vu(){z(),m(n.eq)&&b()}function Wu(){if(Mn(n.eof),o.scopes.push(new Ye(0,o.tokens.length,!0)),o.scopeDepth!==0)throw new Error(`Invalid scope depth at end of file: ${o.scopeDepth}`);return new Rp(o.tokens,o.scopes)}function $e(e){ie&&_u()||(c(n.at)&&is(),Gu(e))}function Gu(e){if(re&&ul())return;const t=o.type;switch(t){case n._break:case n._continue:Ju();return;case n._debugger:Yu();return;case n._do:Qu();return;case n._for:Ku();return;case n._function:if(ke()===n.dot)break;e||G(),tp();return;case n._class:e||G(),bt(!0);return;case n._if:np();return;case n._return:rp();return;case n._switch:sp();return;case n._throw:op();return;case n._try:ap();return;case n._let:case n._const:e||G();case n._var:gn(t!==n._var);return;case n._while:cp();return;case n.braceL:it();return;case n.semi:lp();return;case n._export:case n._import:{const i=ke();if(i===n.parenL||i===n.dot)break;b(),t===n._import?ci():ii();return}case n.name:if(o.contextualKeyword===l._async){const i=o.start,a=o.snapshot();if(b(),c(n._function)&&!Fe()){x(n._function),xt(i,!0);return}else o.restoreFromSnapshot(a)}else if(o.contextualKeyword===l._using&&!no()&&ke()===n.name){gn(!0);return}else if(ei()){ye(l._await),gn(!0);return}}const r=o.tokens.length;Ne();let s=null;if(o.tokens.length===r+1){const i=o.tokens[o.tokens.length-1];i.type===n.name&&(s=i.contextualKeyword)}if(s==null){me();return}m(n.colon)?up():pp(s)}function ei(){if(!D(l._await))return!1;const e=o.snapshot();return b(),!D(l._using)||je()||(b(),!c(n.name)||je())?(o.restoreFromSnapshot(e),!1):(o.restoreFromSnapshot(e),!0)}function is(){for(;c(n.at);)ti()}function ti(){if(b(),m(n.parenL))Ne(),x(n.parenR);else{for(z();m(n.dot);)z();Xu()}}function Xu(){re?Il():ni()}function ni(){m(n.parenL)&&ot()}function Ju(){b(),Ge()||(z(),me())}function Yu(){b(),me()}function Qu(){b(),$e(!1),x(n._while),jn(),m(n.semi)}function Ku(){o.scopeDepth++;const e=o.tokens.length;ep();const t=o.tokens.length;o.scopes.push(new Ye(e,t,!1)),o.scopeDepth--}function Zu(){return!(!D(l._using)||Or(l._of))}function ep(){b();let e=!1;if(D(l._await)&&(e=!0,b()),x(n.parenL),c(n.semi)){e&&G(),yr();return}const t=ei();if(t||c(n._var)||c(n._let)||c(n._const)||Zu()){if(t&&ye(l._await),b(),ri(!0,o.type!==n._var),c(n._in)||D(l._of)){$s(e);return}yr();return}if(Ne(!0),c(n._in)||D(l._of)){$s(e);return}e&&G(),yr()}function tp(){const e=o.start;b(),xt(e,!0)}function np(){b(),jn(),$e(!1),m(n._else)&&$e(!1)}function rp(){b(),Ge()||(Ne(),me())}function sp(){b(),jn(),o.scopeDepth++;const e=o.tokens.length;for(x(n.braceL);!c(n.braceR)&&!o.error;)if(c(n._case)||c(n._default)){const r=c(n._case);b(),r&&Ne(),x(n.colon)}else $e(!0);b();const t=o.tokens.length;o.scopes.push(new Ye(e,t,!1)),o.scopeDepth--}function op(){b(),Ne(),me()}function ip(){Rn(!0),re&&Pt()}function ap(){if(b(),it(),c(n._catch)){b();let e=null;if(c(n.parenL)&&(o.scopeDepth++,e=o.tokens.length,x(n.parenL),ip(),x(n.parenR)),it(),e!=null){const t=o.tokens.length;o.scopes.push(new Ye(e,t,!1)),o.scopeDepth--}}m(n._finally)&&it()}function gn(e){b(),ri(!1,e),me()}function cp(){b(),jn(),$e(!1)}function lp(){b()}function up(){$e(!0)}function pp(e){re?dl(e):ie?Su(e):me()}function it(e=!1,t=0){const r=o.tokens.length;o.scopeDepth++,x(n.braceL),t&&(o.tokens[o.tokens.length-1].contextId=t),Mn(n.braceR),t&&(o.tokens[o.tokens.length-1].contextId=t);const s=o.tokens.length;o.scopes.push(new Ye(r,s,e)),o.scopeDepth--}function Mn(e){for(;!m(e)&&!o.error;)$e(!0)}function yr(){x(n.semi),c(n.semi)||Ne(),x(n.semi),c(n.parenR)||Ne(),x(n.parenR),$e(!1)}function $s(e){e?Te(l._of):b(),Ne(),x(n.parenR),$e(!1)}function ri(e,t){for(;;){if(dp(t),m(n.eq)){const r=o.tokens.length-1;Pe(e),o.tokens[r].rhsEndIndex=o.tokens.length}if(!m(n.comma))break}}function dp(e){Rn(e),re?kl():ie&&Mu()}function xt(e,t,r=!1){c(n.star)&&b(),t&&!r&&!c(n.name)&&!c(n._yield)&&G();let s=null;c(n.name)&&(t||(s=o.tokens.length,o.scopeDepth++),ct(!1));const i=o.tokens.length;o.scopeDepth++,Dt(),Wo(e);const a=o.tokens.length;o.scopes.push(new Ye(i,a,!0)),o.scopeDepth--,s!==null&&(o.scopes.push(new Ye(s,a,!0)),o.scopeDepth--)}function Dt(e=!1,t=0){re?gl():ie&&Ou(),x(n.parenL),t&&(o.tokens[o.tokens.length-1].contextId=t),Br(n.parenR,!1,!1,e,t),t&&(o.tokens[o.tokens.length-1].contextId=t)}function bt(e,t=!1){const r=Jt();b(),o.tokens[o.tokens.length-1].contextId=r,o.tokens[o.tokens.length-1].isExpression=!e;let s=null;e||(s=o.tokens.length,o.scopeDepth++),gp(e,t),kp();const i=o.tokens.length;if(fp(r),!o.error&&(o.tokens[i].contextId=r,o.tokens[o.tokens.length-1].contextId=r,s!==null)){const a=o.tokens.length;o.scopes.push(new Ye(s,a,!1)),o.scopeDepth--}}function si(){return c(n.eq)||c(n.semi)||c(n.braceR)||c(n.bang)||c(n.colon)}function oi(){return c(n.parenL)||c(n.lessThan)}function fp(e){for(x(n.braceL);!m(n.braceR)&&!o.error;){if(m(n.semi))continue;if(c(n.at)){ti();continue}const t=o.start;hp(t,e)}}function hp(e,t){re&&zr([l._declare,l._public,l._protected,l._private,l._override]);let r=!1;if(c(n.name)&&o.contextualKeyword===l._static){if(z(),oi()){Ht(e,!1);return}else if(si()){kn();return}if(o.tokens[o.tokens.length-1].type=n._static,r=!0,c(n.braceL)){o.tokens[o.tokens.length-1].contextId=t,it();return}}mp(e,r,t)}function mp(e,t,r){if(re&&pl(t))return;if(m(n.star)){qt(r),Ht(e,!1);return}qt(r);let s=!1;const i=o.tokens[o.tokens.length-1];i.contextualKeyword===l._constructor&&(s=!0),Bs(),oi()?Ht(e,s):si()?kn():i.contextualKeyword===l._async&&!Ge()?(o.tokens[o.tokens.length-1].type=n._async,c(n.star)&&b(),qt(r),Bs(),Ht(e,!1)):(i.contextualKeyword===l._get||i.contextualKeyword===l._set)&&!(Ge()&&c(n.star))?(i.contextualKeyword===l._get?o.tokens[o.tokens.length-1].type=n._get:o.tokens[o.tokens.length-1].type=n._set,qt(r),Ht(e,!1)):i.contextualKeyword===l._accessor&&!Ge()?(qt(r),kn()):Ge()?kn():G()}function Ht(e,t){re?yt():ie&&c(n.lessThan)&&We(),Pr(e,t)}function qt(e){Kt(e)}function Bs(){if(re){const e=K(0);m(n.question),Q(e)}}function kn(){if(re?(ao(n.bang),Pt()):ie&&c(n.colon)&&vt(),c(n.eq)){const e=o.tokens.length;b(),Pe(),o.tokens[e].rhsEndIndex=o.tokens.length}me()}function gp(e,t=!1){re&&(!e||t)&&D(l._implements)||(c(n.name)&&ct(!0),re?yt():ie&&c(n.lessThan)&&We())}function kp(){let e=!1;m(n._extends)?(qo(),e=!0):e=!1,re?hl(e):ie&&Pu(e)}function ii(){const e=o.tokens.length-1;re&&il()||(vp()?wp():yp()?(z(),c(n.comma)&&ke()===n.star?(x(n.comma),x(n.star),ye(l._as),z()):ai(),en()):m(n._default)?xp():Ip()?bp():(as(),en()),o.tokens[e].rhsEndIndex=o.tokens.length)}function xp(){if(re&&ll()||ie&&Iu())return;const e=o.start;m(n._function)?xt(e,!0,!0):D(l._async)&&ke()===n._function?(Te(l._async),m(n._function),xt(e,!0,!0)):c(n._class)?bt(!0,!0):c(n.at)?(is(),bt(!0,!0)):(Pe(),me())}function bp(){re?fl():ie?Eu():$e(!0)}function yp(){if(re&&Oo())return!1;if(ie&&Au())return!1;if(c(n.name))return o.contextualKeyword!==l._async;if(!c(n._default))return!1;const e=Mr(),t=rn(),r=t.type===n.name&&t.contextualKeyword===l._from;if(t.type===n.comma)return!0;if(r){const s=A.charCodeAt(co(e+4));return s===p.quotationMark||s===p.apostrophe}return!1}function ai(){m(n.comma)&&as()}function en(){Te(l._from)&&(et(),li()),me()}function vp(){return ie?Cu():c(n.star)}function wp(){ie?Nu():Lr()}function Lr(){x(n.star),D(l._as)?_p():en()}function _p(){b(),o.tokens[o.tokens.length-1].type=n._as,z(),ai(),en()}function Ip(){return re&&Oo()||ie&&Tu()||o.type===n._var||o.type===n._const||o.type===n._let||o.type===n._function||o.type===n._class||D(l._async)||c(n.at)}function as(){let e=!0;for(x(n.braceL);!m(n.braceR)&&!o.error;){if(e)e=!1;else if(x(n.comma),m(n.braceR))break;Sp()}}function Sp(){if(re){cl();return}z(),o.tokens[o.tokens.length-1].identifierRole=F.ExportAccess,Te(l._as)&&z()}function Tp(){const e=o.snapshot();return ye(l._module),Te(l._from)?D(l._from)?(o.restoreFromSnapshot(e),!0):(o.restoreFromSnapshot(e),!1):c(n.comma)?(o.restoreFromSnapshot(e),!1):(o.restoreFromSnapshot(e),!0)}function Ap(){D(l._module)&&Tp()&&b()}function ci(){if(re&&c(n.name)&&ke()===n.eq){Er();return}if(re&&D(l._type)){const e=rn();if(e.type===n.name&&e.contextualKeyword!==l._from){if(ye(l._type),ke()===n.eq){Er();return}}else(e.type===n.star||e.type===n.braceL)&&ye(l._type)}c(n.string)||(Ap(),Cp(),ye(l._from)),et(),li(),me()}function Ep(){return c(n.name)}function zs(){vn()}function Cp(){ie&&Lu();let e=!0;if(!(Ep()&&(zs(),!m(n.comma)))){if(c(n.star)){b(),ye(l._as),zs();return}for(x(n.braceL);!m(n.braceR)&&!o.error;){if(e)e=!1;else if(m(n.colon)&&G("ES2015 named imports do not destructure. Use another statement for destructuring after the import."),x(n.comma),m(n.braceR))break;Np()}}}function Np(){if(re){al();return}if(ie){ju();return}vn(),D(l._as)&&(o.tokens[o.tokens.length-1].identifierRole=F.ImportAccess,b(),vn())}function li(){(c(n._with)||D(l._assert)&&!je())&&(b(),Qr(!1,!1))}function Pp(){return o.pos===0&&A.charCodeAt(0)===p.numberSign&&A.charCodeAt(1)===p.exclamationMark&&po(2),uo(),Wu()}class Rp{constructor(t,r){this.tokens=t,this.scopes=r}}function Dp(e,t,r,s){if(s&&r)throw new Error("Cannot combine flow and typescript plugins.");n1(e,t,r,s);const i=Pp();if(o.error)throw Za(o.error);return i}function Lp(e){let t=e.currentIndex(),r=0;const s=e.currentToken();do{const i=e.tokens[t];if(i.isOptionalChainStart&&r++,i.isOptionalChainEnd&&r--,r+=i.numNullishCoalesceStarts,r-=i.numNullishCoalesceEnds,i.contextualKeyword===l._await&&i.identifierRole==null&&i.scopeDepth===s.scopeDepth)return!0;t+=1}while(r>0&&t<e.tokens.length);return!1}class Wt{__init(){this.resultCode=""}__init2(){this.resultMappings=new Array(this.tokens.length)}__init3(){this.tokenIndex=0}constructor(t,r,s,i,a){this.code=t,this.tokens=r,this.isFlowEnabled=s,this.disableESTransforms=i,this.helperManager=a,Wt.prototype.__init.call(this),Wt.prototype.__init2.call(this),Wt.prototype.__init3.call(this)}snapshot(){return{resultCode:this.resultCode,tokenIndex:this.tokenIndex}}restoreToSnapshot(t){this.resultCode=t.resultCode,this.tokenIndex=t.tokenIndex}dangerouslyGetAndRemoveCodeSinceSnapshot(t){const r=this.resultCode.slice(t.resultCode.length);return this.resultCode=t.resultCode,r}reset(){this.resultCode="",this.resultMappings=new Array(this.tokens.length),this.tokenIndex=0}matchesContextualAtIndex(t,r){return this.matches1AtIndex(t,n.name)&&this.tokens[t].contextualKeyword===r}identifierNameAtIndex(t){return this.identifierNameForToken(this.tokens[t])}identifierNameAtRelativeIndex(t){return this.identifierNameForToken(this.tokenAtRelativeIndex(t))}identifierName(){return this.identifierNameForToken(this.currentToken())}identifierNameForToken(t){return this.code.slice(t.start,t.end)}rawCodeForToken(t){return this.code.slice(t.start,t.end)}stringValueAtIndex(t){return this.stringValueForToken(this.tokens[t])}stringValue(){return this.stringValueForToken(this.currentToken())}stringValueForToken(t){return this.code.slice(t.start+1,t.end-1)}matches1AtIndex(t,r){return this.tokens[t].type===r}matches2AtIndex(t,r,s){return this.tokens[t].type===r&&this.tokens[t+1].type===s}matches3AtIndex(t,r,s,i){return this.tokens[t].type===r&&this.tokens[t+1].type===s&&this.tokens[t+2].type===i}matches1(t){return this.tokens[this.tokenIndex].type===t}matches2(t,r){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===r}matches3(t,r,s){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===r&&this.tokens[this.tokenIndex+2].type===s}matches4(t,r,s,i){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===r&&this.tokens[this.tokenIndex+2].type===s&&this.tokens[this.tokenIndex+3].type===i}matches5(t,r,s,i,a){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===r&&this.tokens[this.tokenIndex+2].type===s&&this.tokens[this.tokenIndex+3].type===i&&this.tokens[this.tokenIndex+4].type===a}matchesContextual(t){return this.matchesContextualAtIndex(this.tokenIndex,t)}matchesContextIdAndLabel(t,r){return this.matches1(t)&&this.currentToken().contextId===r}previousWhitespaceAndComments(){let t=this.code.slice(this.tokenIndex>0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex<this.tokens.length?this.tokens[this.tokenIndex].start:this.code.length);return this.isFlowEnabled&&(t=t.replace(/@flow/g,"")),t}replaceToken(t){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=t,this.appendTokenSuffix(),this.tokenIndex++}replaceTokenTrimmingLeftWhitespace(t){this.resultCode+=this.previousWhitespaceAndComments().replace(/[^\r\n]/g,""),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=t,this.appendTokenSuffix(),this.tokenIndex++}removeInitialToken(){this.replaceToken("")}removeToken(){this.replaceTokenTrimmingLeftWhitespace("")}removeBalancedCode(){let t=0;for(;!this.isAtEnd();){if(this.matches1(n.braceL))t++;else if(this.matches1(n.braceR)){if(t===0)return;t--}this.removeToken()}}copyExpectedToken(t){if(this.tokens[this.tokenIndex].type!==t)throw new Error(`Expected token ${t}`);this.copyToken()}copyToken(){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}copyTokenWithPrefix(t){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultCode+=t,this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}appendTokenPrefix(){const t=this.currentToken();if((t.numNullishCoalesceStarts||t.isOptionalChainStart)&&(t.isAsyncOperation=Lp(this)),!this.disableESTransforms){if(t.numNullishCoalesceStarts)for(let r=0;r<t.numNullishCoalesceStarts;r++)t.isAsyncOperation?(this.resultCode+="await ",this.resultCode+=this.helperManager.getHelperName("asyncNullishCoalesce")):this.resultCode+=this.helperManager.getHelperName("nullishCoalesce"),this.resultCode+="(";t.isOptionalChainStart&&(t.isAsyncOperation&&(this.resultCode+="await "),this.tokenIndex>0&&this.tokenAtRelativeIndex(-1).type===n._delete?t.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChainDelete"):this.resultCode+=this.helperManager.getHelperName("optionalChainDelete"):t.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChain"):this.resultCode+=this.helperManager.getHelperName("optionalChain"),this.resultCode+="([")}}appendTokenSuffix(){const t=this.currentToken();if(t.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+="])"),t.numNullishCoalesceEnds&&!this.disableESTransforms)for(let r=0;r<t.numNullishCoalesceEnds;r++)this.resultCode+="))"}appendCode(t){this.resultCode+=t}currentToken(){return this.tokens[this.tokenIndex]}currentTokenCode(){const t=this.currentToken();return this.code.slice(t.start,t.end)}tokenAtRelativeIndex(t){return this.tokens[this.tokenIndex+t]}currentIndex(){return this.tokenIndex}nextToken(){if(this.tokenIndex===this.tokens.length)throw new Error("Unexpectedly reached end of input.");this.tokenIndex++}previousToken(){this.tokenIndex--}finish(){if(this.tokenIndex!==this.tokens.length)throw new Error("Tried to finish processing tokens before reaching the end.");return this.resultCode+=this.previousWhitespaceAndComments(),{code:this.resultCode,mappings:this.resultMappings}}isAtEnd(){return this.tokenIndex===this.tokens.length}}function jp(e,t,r,s){const i=t.snapshot(),a=Op(t);let u=[];const d=[],h=[];let f=null;const k=[],w=[],C=t.currentToken().contextId;if(C==null)throw new Error("Expected non-null class context ID on class open-brace.");for(t.nextToken();!t.matchesContextIdAndLabel(n.braceR,C);)if(t.matchesContextual(l._constructor)&&!t.currentToken().isType)({constructorInitializerStatements:u,constructorInsertPos:f}=qs(t));else if(t.matches1(n.semi))s||w.push({start:t.currentIndex(),end:t.currentIndex()+1}),t.nextToken();else if(t.currentToken().isType)t.nextToken();else{const R=t.currentIndex();let q=!1,L=!1,te=!1;for(;An(t.currentToken());)t.matches1(n._static)&&(q=!0),t.matches1(n.hash)&&(L=!0),(t.matches1(n._declare)||t.matches1(n._abstract))&&(te=!0),t.nextToken();if(q&&t.matches1(n.braceL)){vr(t,C);continue}if(L){vr(t,C);continue}if(t.matchesContextual(l._constructor)&&!t.currentToken().isType){({constructorInitializerStatements:u,constructorInsertPos:f}=qs(t));continue}const Z=t.currentIndex();if(Mp(t),t.matches1(n.lessThan)||t.matches1(n.parenL)){vr(t,C);continue}for(;t.currentToken().isType;)t.nextToken();if(t.matches1(n.eq)){const S=t.currentIndex(),N=t.currentToken().rhsEndIndex;if(N==null)throw new Error("Expected rhsEndIndex on class field assignment.");for(t.nextToken();t.currentIndex()<N;)e.processToken();let v;q?(v=r.claimFreeName("__initStatic"),h.push(v)):(v=r.claimFreeName("__init"),d.push(v)),k.push({initializerName:v,equalsIndex:S,start:Z,end:t.currentIndex()})}else(!s||te)&&w.push({start:R,end:t.currentIndex()})}return t.restoreToSnapshot(i),s?{headerInfo:a,constructorInitializerStatements:u,instanceInitializerNames:[],staticInitializerNames:[],constructorInsertPos:f,fields:[],rangesToRemove:w}:{headerInfo:a,constructorInitializerStatements:u,instanceInitializerNames:d,staticInitializerNames:h,constructorInsertPos:f,fields:k,rangesToRemove:w}}function vr(e,t){for(e.nextToken();e.currentToken().contextId!==t;)e.nextToken();for(;An(e.tokenAtRelativeIndex(-1));)e.previousToken()}function Op(e){const t=e.currentToken(),r=t.contextId;if(r==null)throw new Error("Expected context ID on class token.");const s=t.isExpression;if(s==null)throw new Error("Expected isExpression on class token.");let i=null,a=!1;for(e.nextToken(),e.matches1(n.name)&&(i=e.identifierName());!e.matchesContextIdAndLabel(n.braceL,r);)e.matches1(n._extends)&&!e.currentToken().isType&&(a=!0),e.nextToken();return{isExpression:s,className:i,hasSuperclass:a}}function qs(e){const t=[];e.nextToken();const r=e.currentToken().contextId;if(r==null)throw new Error("Expected context ID on open-paren starting constructor params.");for(;!e.matchesContextIdAndLabel(n.parenR,r);)if(e.currentToken().contextId===r){if(e.nextToken(),An(e.currentToken())){for(e.nextToken();An(e.currentToken());)e.nextToken();const a=e.currentToken();if(a.type!==n.name)throw new Error("Expected identifier after access modifiers in constructor arg.");const u=e.identifierNameForToken(a);t.push(`this.${u} = ${u}`)}}else e.nextToken();for(e.nextToken();e.currentToken().isType;)e.nextToken();let s=e.currentIndex(),i=!1;for(;!e.matchesContextIdAndLabel(n.braceR,r);){if(!i&&e.matches2(n._super,n.parenL)){e.nextToken();const a=e.currentToken().contextId;if(a==null)throw new Error("Expected a context ID on the super call");for(;!e.matchesContextIdAndLabel(n.parenR,a);)e.nextToken();s=e.currentIndex(),i=!0}e.nextToken()}return e.nextToken(),{constructorInitializerStatements:t,constructorInsertPos:s}}function An(e){return[n._async,n._get,n._set,n.plus,n.minus,n._readonly,n._static,n._public,n._private,n._protected,n._override,n._abstract,n.star,n._declare,n.hash].includes(e.type)}function Mp(e){if(e.matches1(n.bracketL)){const r=e.currentToken().contextId;if(r==null)throw new Error("Expected class context ID on computed name open bracket.");for(;!e.matchesContextIdAndLabel(n.bracketR,r);)e.nextToken();e.nextToken()}else e.nextToken()}function ui(e){if(e.removeInitialToken(),e.removeToken(),e.removeToken(),e.removeToken(),e.matches1(n.parenL))e.removeToken(),e.removeToken(),e.removeToken();else for(;e.matches1(n.dot);)e.removeToken(),e.removeToken()}const pi={typeDeclarations:new Set,valueDeclarations:new Set};function di(e){const t=new Set,r=new Set;for(let s=0;s<e.tokens.length;s++){const i=e.tokens[s];i.type===n.name&&io(i)&&(i.isType?t.add(e.identifierNameForToken(i)):r.add(e.identifierNameForToken(i)))}return{typeDeclarations:t,valueDeclarations:r}}function fi(e){let t=e.currentIndex();for(;!e.matches1AtIndex(t,n.braceR);)t++;return e.matchesContextualAtIndex(t+1,l._from)&&e.matches1AtIndex(t+2,n.string)}function mt(e){(e.matches2(n._with,n.braceL)||e.matches2(n.name,n.braceL)&&e.matchesContextual(l._assert))&&(e.removeToken(),e.removeToken(),e.removeBalancedCode(),e.removeToken())}function hi(e,t,r,s){if(!e||t)return!1;const i=r.currentToken();if(i.rhsEndIndex==null)throw new Error("Expected non-null rhsEndIndex on export token.");const a=i.rhsEndIndex-r.currentIndex();if(a!==3&&!(a===4&&r.matches1AtIndex(i.rhsEndIndex-1,n.semi)))return!1;const u=r.tokenAtRelativeIndex(2);if(u.type!==n.name)return!1;const d=r.identifierNameForToken(u);return s.typeDeclarations.has(d)&&!s.valueDeclarations.has(d)}class Gt extends Ve{__init(){this.hadExport=!1}__init2(){this.hadNamedExport=!1}__init3(){this.hadDefaultExport=!1}constructor(t,r,s,i,a,u,d,h,f,k,w,C){super(),this.rootTransformer=t,this.tokens=r,this.importProcessor=s,this.nameManager=i,this.helperManager=a,this.reactHotLoaderTransformer=u,this.enableLegacyBabel5ModuleInterop=d,this.enableLegacyTypeScriptModuleInterop=h,this.isTypeScriptTransformEnabled=f,this.isFlowTransformEnabled=k,this.preserveDynamicImport=w,this.keepUnusedImports=C,Gt.prototype.__init.call(this),Gt.prototype.__init2.call(this),Gt.prototype.__init3.call(this),this.declarationInfo=f?di(r):pi}getPrefixCode(){let t="";return this.hadExport&&(t+='Object.defineProperty(exports, "__esModule", {value: true});'),t}getSuffixCode(){return this.enableLegacyBabel5ModuleInterop&&this.hadDefaultExport&&!this.hadNamedExport?`
|
|
172
|
+
module.exports = exports.default;
|
|
173
|
+
`:""}process(){return this.tokens.matches3(n._import,n.name,n.eq)?this.processImportEquals():this.tokens.matches1(n._import)?(this.processImport(),!0):this.tokens.matches2(n._export,n.eq)?(this.tokens.replaceToken("module.exports"),!0):this.tokens.matches1(n._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(n.name,n.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(n.name)||this.tokens.matches1(n.jsxName)?this.processIdentifier():this.tokens.matches1(n.eq)?this.processAssignment():this.tokens.matches1(n.assign)?this.processComplexAssignment():this.tokens.matches1(n.preIncDec)?this.processPreIncDec():!1}processImportEquals(){const t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.shouldAutomaticallyElideImportedName(t)?ui(this.tokens):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(n._import,n.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}const r=this.enableLegacyTypeScriptModuleInterop?"":`${this.helperManager.getHelperName("interopRequireWildcard")}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${r}require`);const s=this.tokens.currentToken().contextId;if(s==null)throw new Error("Expected context ID on dynamic import invocation.");for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(n.parenR,s);)this.rootTransformer.processToken();this.tokens.replaceToken(r?")))":"))");return}if(this.removeImportAndDetectIfShouldElide())this.tokens.removeToken();else{const r=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(r)),this.tokens.appendCode(this.importProcessor.claimImportCode(r))}mt(this.tokens),this.tokens.matches1(n.semi)&&this.tokens.removeToken()}removeImportAndDetectIfShouldElide(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,n.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(n.name)||this.tokens.matches1(n.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(n.string))return!1;let t=!1,r=!1;for(;!this.tokens.matches1(n.string);)(!t&&this.tokens.matches1(n.braceL)||this.tokens.matches1(n.comma))&&(this.tokens.removeToken(),this.tokens.matches1(n.braceR)||(r=!0),(this.tokens.matches2(n.name,n.comma)||this.tokens.matches2(n.name,n.braceR)||this.tokens.matches4(n.name,n.name,n.name,n.comma)||this.tokens.matches4(n.name,n.name,n.name,n.braceR))&&(t=!0)),this.tokens.removeToken();return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!t:this.isFlowTransformEnabled?r&&!t:!1}removeRemainingImport(){for(;!this.tokens.matches1(n.string);)this.tokens.removeToken()}processIdentifier(){const t=this.tokens.currentToken();if(t.shadowsGlobal)return!1;if(t.identifierRole===F.ObjectShorthand)return this.processObjectShorthand();if(t.identifierRole!==F.Access)return!1;const r=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(t));if(!r)return!1;let s=this.tokens.currentIndex()+1;for(;s<this.tokens.tokens.length&&this.tokens.tokens[s].type===n.parenR;)s++;return this.tokens.tokens[s].type===n.parenL?this.tokens.tokenAtRelativeIndex(1).type===n.parenL&&this.tokens.tokenAtRelativeIndex(-1).type!==n._new?(this.tokens.replaceToken(`${r}.call(void 0, `),this.tokens.removeToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR)):this.tokens.replaceToken(`(0, ${r})`):this.tokens.replaceToken(r),!0}processObjectShorthand(){const t=this.tokens.identifierName(),r=this.importProcessor.getIdentifierReplacement(t);return r?(this.tokens.replaceToken(`${t}: ${r}`),!0):!1}processExport(){if(this.tokens.matches2(n._export,n._enum)||this.tokens.matches3(n._export,n._const,n._enum))return this.hadNamedExport=!0,!1;if(this.tokens.matches2(n._export,n._default))return this.tokens.matches3(n._export,n._default,n._enum)?(this.hadDefaultExport=!0,!1):(this.processExportDefault(),!0);if(this.tokens.matches2(n._export,n.braceL))return this.processExportBindings(),!0;if(this.tokens.matches2(n._export,n.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(n.braceL)){for(;!this.tokens.matches1(n.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(n._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,n.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),mt(this.tokens)),!0}if(this.hadNamedExport=!0,this.tokens.matches2(n._export,n._var)||this.tokens.matches2(n._export,n._let)||this.tokens.matches2(n._export,n._const))return this.processExportVar(),!0;if(this.tokens.matches2(n._export,n._function)||this.tokens.matches3(n._export,n.name,n._function))return this.processExportFunction(),!0;if(this.tokens.matches2(n._export,n._class)||this.tokens.matches3(n._export,n._abstract,n._class)||this.tokens.matches2(n._export,n.at))return this.processExportClass(),!0;if(this.tokens.matches2(n._export,n.star))return this.processExportStar(),!0;throw new Error("Unrecognized export syntax.")}processAssignment(){const t=this.tokens.currentIndex(),r=this.tokens.tokens[t-1];if(r.isType||r.type!==n.name||r.shadowsGlobal||t>=2&&this.tokens.matches1AtIndex(t-2,n.dot)||t>=2&&[n._var,n._let,n._const].includes(this.tokens.tokens[t-2].type))return!1;const s=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(r));return s?(this.tokens.copyToken(),this.tokens.appendCode(` ${s} =`),!0):!1}processComplexAssignment(){const t=this.tokens.currentIndex(),r=this.tokens.tokens[t-1];if(r.type!==n.name||r.shadowsGlobal||t>=2&&this.tokens.matches1AtIndex(t-2,n.dot))return!1;const s=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(r));return s?(this.tokens.appendCode(` = ${s}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){const t=this.tokens.currentIndex(),r=this.tokens.tokens[t+1];if(r.type!==n.name||r.shadowsGlobal||t+2<this.tokens.tokens.length&&(this.tokens.matches1AtIndex(t+2,n.dot)||this.tokens.matches1AtIndex(t+2,n.bracketL)||this.tokens.matches1AtIndex(t+2,n.parenL)))return!1;const s=this.tokens.identifierNameForToken(r),i=this.importProcessor.resolveExportBinding(s);return i?(this.tokens.appendCode(`${i} = `),this.tokens.copyToken(),!0):!1}processPostIncDec(){const t=this.tokens.currentIndex(),r=this.tokens.tokens[t],s=this.tokens.tokens[t+1];if(r.type!==n.name||r.shadowsGlobal||t>=1&&this.tokens.matches1AtIndex(t-1,n.dot))return!1;const i=this.tokens.identifierNameForToken(r),a=this.importProcessor.resolveExportBinding(i);if(!a)return!1;const u=this.tokens.rawCodeForToken(s),d=this.importProcessor.getIdentifierReplacement(i)||i;if(u==="++")this.tokens.replaceToken(`(${d} = ${a} = ${d} + 1, ${d} - 1)`);else if(u==="--")this.tokens.replaceToken(`(${d} = ${a} = ${d} - 1, ${d} + 1)`);else throw new Error(`Unexpected operator: ${u}`);return this.tokens.removeToken(),!0}processExportDefault(){let t=!0;if(this.tokens.matches4(n._export,n._default,n._function,n.name)||this.tokens.matches5(n._export,n._default,n.name,n._function,n.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();const r=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${r};`)}else if(this.tokens.matches4(n._export,n._default,n._class,n.name)||this.tokens.matches5(n._export,n._default,n._abstract,n._class,n.name)||this.tokens.matches3(n._export,n._default,n.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(n._abstract)&&this.tokens.removeToken();const r=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${r};`)}else if(hi(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))t=!1,this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){const r=this.nameManager.claimFreeName("_default");this.tokens.replaceToken(`let ${r}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${r} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(r)}else this.tokens.replaceToken("exports."),this.tokens.copyToken(),this.tokens.appendCode(" =");t&&(this.hadDefaultExport=!0)}copyDecorators(){for(;this.tokens.matches1(n.at);)if(this.tokens.copyToken(),this.tokens.matches1(n.parenL))this.tokens.copyExpectedToken(n.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR);else{for(this.tokens.copyExpectedToken(n.name);this.tokens.matches1(n.dot);)this.tokens.copyExpectedToken(n.dot),this.tokens.copyExpectedToken(n.name);this.tokens.matches1(n.parenL)&&(this.tokens.copyExpectedToken(n.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let t=this.tokens.currentIndex();if(t++,t++,!this.tokens.matches1AtIndex(t,n.name))return!1;for(t++;t<this.tokens.tokens.length&&this.tokens.tokens[t].isType;)t++;return!!this.tokens.matches1AtIndex(t,n.eq)}processSimpleExportVar(){this.tokens.removeInitialToken(),this.tokens.copyToken();const t=this.tokens.identifierName();for(;!this.tokens.matches1(n.eq);)this.rootTransformer.processToken();const r=this.tokens.currentToken().rhsEndIndex;if(r==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<r;)this.rootTransformer.processToken();this.tokens.appendCode(`; exports.${t} = ${t}`)}processComplexExportVar(){this.tokens.removeInitialToken(),this.tokens.removeToken();const t=this.tokens.matches1(n.braceL);t&&this.tokens.appendCode("(");let r=0;for(;;)if(this.tokens.matches1(n.braceL)||this.tokens.matches1(n.dollarBraceL)||this.tokens.matches1(n.bracketL))r++,this.tokens.copyToken();else if(this.tokens.matches1(n.braceR)||this.tokens.matches1(n.bracketR))r--,this.tokens.copyToken();else{if(r===0&&!this.tokens.matches1(n.name)&&!this.tokens.currentToken().isType)break;if(this.tokens.matches1(n.eq)){const s=this.tokens.currentToken().rhsEndIndex;if(s==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<s;)this.rootTransformer.processToken()}else{const s=this.tokens.currentToken();if(oo(s)){const i=this.tokens.identifierName();let a=this.importProcessor.getIdentifierReplacement(i);if(a===null)throw new Error(`Expected a replacement for ${i} in \`export var\` syntax.`);c1(s)&&(a=`${i}: ${a}`),this.tokens.replaceToken(a)}else this.rootTransformer.processToken()}}if(t){const s=this.tokens.currentToken().rhsEndIndex;if(s==null)throw new Error("Expected = token with an end index.");for(;this.tokens.currentIndex()<s;)this.rootTransformer.processToken();this.tokens.appendCode(")")}}processExportFunction(){this.tokens.replaceToken("");const t=this.processNamedFunction();this.tokens.appendCode(` exports.${t} = ${t};`)}processNamedFunction(){if(this.tokens.matches1(n._function))this.tokens.copyToken();else if(this.tokens.matches2(n.name,n._function)){if(!this.tokens.matchesContextual(l._async))throw new Error("Expected async keyword in function export.");this.tokens.copyToken(),this.tokens.copyToken()}if(this.tokens.matches1(n.star)&&this.tokens.copyToken(),!this.tokens.matches1(n.name))throw new Error("Expected identifier for exported function name.");const t=this.tokens.identifierName();if(this.tokens.copyToken(),this.tokens.currentToken().isType)for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return this.tokens.copyExpectedToken(n.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR),this.rootTransformer.processPossibleTypeRange(),this.tokens.copyExpectedToken(n.braceL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.braceR),t}processExportClass(){this.tokens.removeInitialToken(),this.copyDecorators(),this.tokens.matches1(n._abstract)&&this.tokens.removeToken();const t=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.${t} = ${t};`)}processExportBindings(){this.tokens.removeInitialToken(),this.tokens.removeToken();const t=fi(this.tokens),r=[];for(;;){if(this.tokens.matches1(n.braceR)){this.tokens.removeToken();break}const s=Yt(this.tokens);for(;this.tokens.currentIndex()<s.endIndex;)this.tokens.removeToken();if(!(s.isType||!t&&this.shouldElideExportedIdentifier(s.leftName))){const a=s.rightName;a==="default"?this.hadDefaultExport=!0:this.hadNamedExport=!0;const u=s.leftName,d=this.importProcessor.getIdentifierReplacement(u);r.push(`exports.${a} = ${d||u};`)}if(this.tokens.matches1(n.braceR)){this.tokens.removeToken();break}if(this.tokens.matches2(n.comma,n.braceR)){this.tokens.removeToken(),this.tokens.removeToken();break}else if(this.tokens.matches1(n.comma))this.tokens.removeToken();else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`)}if(this.tokens.matchesContextual(l._from)){this.tokens.removeToken();const s=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(s)),mt(this.tokens)}else this.tokens.appendCode(r.join(" "));this.tokens.matches1(n.semi)&&this.tokens.removeToken()}processExportStar(){for(this.tokens.removeInitialToken();!this.tokens.matches1(n.string);)this.tokens.removeToken();const t=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(t)),mt(this.tokens),this.tokens.matches1(n.semi)&&this.tokens.removeToken()}shouldElideExportedIdentifier(t){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.declarationInfo.valueDeclarations.has(t)}}class Fp extends Ve{constructor(t,r,s,i,a,u,d,h){super(),this.tokens=t,this.nameManager=r,this.helperManager=s,this.reactHotLoaderTransformer=i,this.isTypeScriptTransformEnabled=a,this.isFlowTransformEnabled=u,this.keepUnusedImports=d,this.nonTypeIdentifiers=a&&!d?vo(t,h):new Set,this.declarationInfo=a&&!d?di(t):pi,this.injectCreateRequireForImportRequire=!!h.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(n._import,n.name,n.eq))return this.processImportEquals();if(this.tokens.matches4(n._import,n.name,n.name,n.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){this.tokens.removeInitialToken();for(let t=0;t<7;t++)this.tokens.removeToken();return!0}if(this.tokens.matches2(n._export,n.eq))return this.tokens.replaceToken("module.exports"),!0;if(this.tokens.matches5(n._export,n._import,n.name,n.name,n.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._type)){this.tokens.removeInitialToken();for(let t=0;t<8;t++)this.tokens.removeToken();return!0}if(this.tokens.matches1(n._import))return this.processImport();if(this.tokens.matches2(n._export,n._default))return this.processExportDefault();if(this.tokens.matches2(n._export,n.braceL))return this.processNamedExports();if(this.tokens.matches2(n._export,n.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(n.braceL)){for(;!this.tokens.matches1(n.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(n._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(l._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,n.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),mt(this.tokens)),!0}return!1}processImportEquals(){const t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.shouldAutomaticallyElideImportedName(t)?ui(this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken("const"),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName("require"))):this.tokens.replaceToken("const"),!0}processImport(){if(this.tokens.matches2(n._import,n.parenL))return!1;const t=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(t);!this.tokens.matches1(n.string);)this.tokens.removeToken();this.tokens.removeToken(),mt(this.tokens),this.tokens.matches1(n.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(n._import),this.tokens.matchesContextual(l._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,n.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,l._from))return!0;if(this.tokens.matches1(n.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(l._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._from)&&this.tokens.copyToken();let t=!1,r=!1,s=!1;if(this.tokens.matches1(n.name)&&(this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(n.comma)&&this.tokens.removeToken()):(t=!0,this.tokens.copyToken(),this.tokens.matches1(n.comma)&&(s=!0,this.tokens.removeToken()))),this.tokens.matches1(n.star))this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(s&&this.tokens.appendCode(","),t=!0,this.tokens.copyExpectedToken(n.star),this.tokens.copyExpectedToken(n.name),this.tokens.copyExpectedToken(n.name));else if(this.tokens.matches1(n.braceL)){for(s&&this.tokens.appendCode(","),this.tokens.copyToken();!this.tokens.matches1(n.braceR);){r=!0;const i=Yt(this.tokens);if(i.isType||this.shouldAutomaticallyElideImportedName(i.rightName)){for(;this.tokens.currentIndex()<i.endIndex;)this.tokens.removeToken();this.tokens.matches1(n.comma)&&this.tokens.removeToken()}else{for(t=!0;this.tokens.currentIndex()<i.endIndex;)this.tokens.copyToken();this.tokens.matches1(n.comma)&&this.tokens.copyToken()}}this.tokens.copyExpectedToken(n.braceR)}return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!t:this.isFlowTransformEnabled?r&&!t:!1}shouldAutomaticallyElideImportedName(t){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(t)}processExportDefault(){if(hi(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))return this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken(),!0;if(!(this.tokens.matches4(n._export,n._default,n._function,n.name)||this.tokens.matches5(n._export,n._default,n.name,n._function,n.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,l._async)||this.tokens.matches4(n._export,n._default,n._class,n.name)||this.tokens.matches5(n._export,n._default,n._abstract,n._class,n.name))&&this.reactHotLoaderTransformer){const r=this.nameManager.claimFreeName("_default");return this.tokens.replaceToken(`let ${r}; export`),this.tokens.copyToken(),this.tokens.appendCode(` ${r} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(r),!0}return!1}processNamedExports(){if(!this.isTypeScriptTransformEnabled)return!1;this.tokens.copyExpectedToken(n._export),this.tokens.copyExpectedToken(n.braceL);const t=fi(this.tokens);let r=!1;for(;!this.tokens.matches1(n.braceR);){const s=Yt(this.tokens);if(s.isType||!t&&this.shouldElideExportedName(s.leftName)){for(;this.tokens.currentIndex()<s.endIndex;)this.tokens.removeToken();this.tokens.matches1(n.comma)&&this.tokens.removeToken()}else{for(r=!0;this.tokens.currentIndex()<s.endIndex;)this.tokens.copyToken();this.tokens.matches1(n.comma)&&this.tokens.copyToken()}}return this.tokens.copyExpectedToken(n.braceR),!this.keepUnusedImports&&t&&!r&&(this.tokens.removeToken(),this.tokens.removeToken(),mt(this.tokens)),!0}shouldElideExportedName(t){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&this.declarationInfo.typeDeclarations.has(t)&&!this.declarationInfo.valueDeclarations.has(t)}}class $p extends Ve{constructor(t,r,s){super(),this.rootTransformer=t,this.tokens=r,this.isImportsTransformEnabled=s}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(n._enum)?(this.processEnum(),!0):this.tokens.matches2(n._export,n._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(n._export,n._default,n._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();const t=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${t} = ${t};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();const t=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${t};`):this.tokens.appendCode(` export default ${t};`)}processEnum(){this.tokens.replaceToken("const"),this.tokens.copyExpectedToken(n.name);let t=!1;this.tokens.matchesContextual(l._of)&&(this.tokens.removeToken(),t=this.tokens.matchesContextual(l._symbol),this.tokens.removeToken());const r=this.tokens.matches3(n.braceL,n.name,n.eq);this.tokens.appendCode(' = require("flow-enums-runtime")');const s=!t&&!r;for(this.tokens.replaceTokenTrimmingLeftWhitespace(s?".Mirrored([":"({");!this.tokens.matches1(n.braceR);){if(this.tokens.matches1(n.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(t,r),this.tokens.matches1(n.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(s?"]);":"});")}processEnumElement(t,r){if(t){const s=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol("${s}")`)}else r?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(":"),this.tokens.copyToken()):this.tokens.replaceToken(`"${this.tokens.identifierName()}"`)}}function Bp(e){let t,r=e[0],s=1;for(;s<e.length;){const i=e[s],a=e[s+1];if(s+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(t=r,r=a(r)):(i==="call"||i==="optionalCall")&&(r=a((...u)=>r.call(t,...u)),t=void 0)}return r}const fn="jest",zp=["mock","unmock","enableAutomock","disableAutomock"];class cs extends Ve{__init(){this.hoistedFunctionNames=[]}constructor(t,r,s,i){super(),this.rootTransformer=t,this.tokens=r,this.nameManager=s,this.importProcessor=i,cs.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(n.name,n.dot,n.name,n.parenL)&&this.tokens.identifierName()===fn?Bp([this,"access",t=>t.importProcessor,"optionalAccess",t=>t.getGlobalNames,"call",t=>t(),"optionalAccess",t=>t.has,"call",t=>t(fn)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(t=>`${t}();`).join(""):""}extractHoistedCalls(){this.tokens.removeToken();let t=!1;for(;this.tokens.matches3(n.dot,n.name,n.parenL);){const r=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(zp.includes(r)){const i=this.nameManager.claimFreeName("__jestHoist");this.hoistedFunctionNames.push(i),this.tokens.replaceToken(`function ${i}(){${fn}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR),this.tokens.appendCode(";}"),t=!1}else t?this.tokens.copyToken():this.tokens.replaceToken(`${fn}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.parenR),t=!0}return!0}}class qp extends Ve{constructor(t){super(),this.tokens=t}process(){if(this.tokens.matches1(n.num)){const t=this.tokens.currentTokenCode();if(t.includes("_"))return this.tokens.replaceToken(t.replace(/_/g,"")),!0}return!1}}class Up extends Ve{constructor(t,r){super(),this.tokens=t,this.nameManager=r}process(){return this.tokens.matches2(n._catch,n.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`),!0):!1}}class Hp extends Ve{constructor(t,r){super(),this.tokens=t,this.nameManager=r}process(){if(this.tokens.matches1(n.nullishCoalescing)){const s=this.tokens.currentToken();return this.tokens.tokens[s.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("):this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("),!0}if(this.tokens.matches1(n._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;const r=this.tokens.currentToken().subscriptStartIndex;if(r!=null&&this.tokens.tokens[r].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==n._super){const s=this.nameManager.claimFreeName("_");let i;if(r>0&&this.tokens.matches1AtIndex(r-1,n._delete)&&this.isLastSubscriptInChain()?i=`${s} => delete ${s}`:i=`${s} => ${s}`,this.tokens.tokens[r].isAsyncOperation&&(i=`async ${i}`),this.tokens.matches2(n.questionDot,n.parenL)||this.tokens.matches2(n.questionDot,n.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${i}`);else if(this.tokens.matches2(n.questionDot,n.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}`);else if(this.tokens.matches1(n.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${i}.`);else if(this.tokens.matches1(n.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}.`);else if(this.tokens.matches1(n.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${i}[`);else if(this.tokens.matches1(n.parenL))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${i}(`);else throw new Error("Unexpected subscript operator in optional chain.");return!0}return!1}isLastSubscriptInChain(){let t=0;for(let r=this.tokens.currentIndex()+1;;r++){if(r>=this.tokens.tokens.length)throw new Error("Reached the end of the code while finding the end of the access chain.");if(this.tokens.tokens[r].isOptionalChainStart?t++:this.tokens.tokens[r].isOptionalChainEnd&&t--,t<0)return!0;if(t===0&&this.tokens.tokens[r].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let t=0,r=this.tokens.currentIndex()-1;for(;;){if(r<0)throw new Error("Reached the start of the code while finding the start of the access chain.");if(this.tokens.tokens[r].isOptionalChainStart?t--:this.tokens.tokens[r].isOptionalChainEnd&&t++,t<0)return!1;if(t===0&&this.tokens.tokens[r].subscriptStartIndex!=null)return this.tokens.tokens[r-1].type===n._super;r--}}}class Vp extends Ve{constructor(t,r,s,i){super(),this.rootTransformer=t,this.tokens=r,this.importProcessor=s,this.options=i}process(){const t=this.tokens.currentIndex();if(this.tokens.identifierName()==="createReactClass"){const r=this.importProcessor&&this.importProcessor.getIdentifierReplacement("createReactClass");return r?this.tokens.replaceToken(`(0, ${r})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(t),!0}if(this.tokens.matches3(n.name,n.dot,n.name)&&this.tokens.identifierName()==="React"&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)==="createClass"){const r=this.importProcessor&&this.importProcessor.getIdentifierReplacement("React")||"React";return this.tokens.replaceToken(r),this.tokens.copyToken(),this.tokens.copyToken(),this.tryProcessCreateClassCall(t),!0}return!1}tryProcessCreateClassCall(t){const r=this.findDisplayName(t);r&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(n.parenL),this.tokens.copyExpectedToken(n.braceL),this.tokens.appendCode(`displayName: '${r}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(n.braceR),this.tokens.copyExpectedToken(n.parenR))}findDisplayName(t){return t<2?null:this.tokens.matches2AtIndex(t-2,n.name,n.eq)?this.tokens.identifierNameAtIndex(t-2):t>=2&&this.tokens.tokens[t-2].identifierRole===F.ObjectKey?this.tokens.identifierNameAtIndex(t-2):this.tokens.matches2AtIndex(t-2,n._export,n._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){const r=(this.options.filePath||"unknown").split("/"),s=r[r.length-1],i=s.lastIndexOf("."),a=i===-1?s:s.slice(0,i);return a==="index"&&r[r.length-2]?r[r.length-2]:a}classNeedsDisplayName(){let t=this.tokens.currentIndex();if(!this.tokens.matches2(n.parenL,n.braceL))return!1;const r=t+1,s=this.tokens.tokens[r].contextId;if(s==null)throw new Error("Expected non-null context ID on object open-brace.");for(;t<this.tokens.tokens.length;t++){const i=this.tokens.tokens[t];if(i.type===n.braceR&&i.contextId===s){t++;break}if(this.tokens.identifierNameAtIndex(t)==="displayName"&&this.tokens.tokens[t].identifierRole===F.ObjectKey&&i.contextId===s)return!1}if(t===this.tokens.tokens.length)throw new Error("Unexpected end of input when processing React class.");return this.tokens.matches1AtIndex(t,n.parenR)||this.tokens.matches2AtIndex(t,n.comma,n.parenR)}}class ls extends Ve{__init(){this.extractedDefaultExportName=null}constructor(t,r){super(),this.tokens=t,this.filePath=r,ls.prototype.__init.call(this)}setExtractedDefaultExportName(t){this.extractedDefaultExportName=t}getPrefixCode(){return`
|
|
174
|
+
(function () {
|
|
175
|
+
var enterModule = require('react-hot-loader').enterModule;
|
|
176
|
+
enterModule && enterModule(module);
|
|
177
|
+
})();`.replace(/\s+/g," ").trim()}getSuffixCode(){const t=new Set;for(const s of this.tokens.tokens)!s.isType&&io(s)&&s.identifierRole!==F.ImportDeclaration&&t.add(this.tokens.identifierNameForToken(s));const r=Array.from(t).map(s=>({variableName:s,uniqueLocalName:s}));return this.extractedDefaultExportName&&r.push({variableName:this.extractedDefaultExportName,uniqueLocalName:"default"}),`
|
|
178
|
+
;(function () {
|
|
179
|
+
var reactHotLoader = require('react-hot-loader').default;
|
|
180
|
+
var leaveModule = require('react-hot-loader').leaveModule;
|
|
181
|
+
if (!reactHotLoader) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
${r.map(({variableName:s,uniqueLocalName:i})=>` reactHotLoader.register(${s}, "${i}", ${JSON.stringify(this.filePath||"")});`).join(`
|
|
185
|
+
`)}
|
|
186
|
+
leaveModule(module);
|
|
187
|
+
})();`}process(){return!1}}const Wp=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","implements","interface","let","package","private","protected","public","static","await","false","null","true"]);function Us(e){if(e.length===0||!nn[e.charCodeAt(0)])return!1;for(let t=1;t<e.length;t++)if(!He[e.charCodeAt(t)])return!1;return!Wp.has(e)}class Gp extends Ve{constructor(t,r,s){super(),this.rootTransformer=t,this.tokens=r,this.isImportsTransformEnabled=s}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(n._public)||this.tokens.matches1(n._protected)||this.tokens.matches1(n._private)||this.tokens.matches1(n._abstract)||this.tokens.matches1(n._readonly)||this.tokens.matches1(n._override)||this.tokens.matches1(n.nonNullAssertion)?(this.tokens.removeInitialToken(),!0):this.tokens.matches1(n._enum)||this.tokens.matches2(n._const,n._enum)?(this.processEnum(),!0):this.tokens.matches2(n._export,n._enum)||this.tokens.matches3(n._export,n._const,n._enum)?(this.processEnum(!0),!0):!1}processEnum(t=!1){for(this.tokens.removeInitialToken();this.tokens.matches1(n._const)||this.tokens.matches1(n._enum);)this.tokens.removeToken();const r=this.tokens.identifierName();this.tokens.removeToken(),t&&!this.isImportsTransformEnabled&&this.tokens.appendCode("export "),this.tokens.appendCode(`var ${r}; (function (${r})`),this.tokens.copyExpectedToken(n.braceL),this.processEnumBody(r),this.tokens.copyExpectedToken(n.braceR),t&&this.isImportsTransformEnabled?this.tokens.appendCode(`)(${r} || (exports.${r} = ${r} = {}));`):this.tokens.appendCode(`)(${r} || (${r} = {}));`)}processEnumBody(t){let r=null;for(;!this.tokens.matches1(n.braceR);){const{nameStringCode:s,variableName:i}=this.extractEnumKeyInfo(this.tokens.currentToken());this.tokens.removeInitialToken(),this.tokens.matches3(n.eq,n.string,n.comma)||this.tokens.matches3(n.eq,n.string,n.braceR)?this.processStringLiteralEnumMember(t,s,i):this.tokens.matches1(n.eq)?this.processExplicitValueEnumMember(t,s,i):this.processImplicitValueEnumMember(t,s,i,r),this.tokens.matches1(n.comma)&&this.tokens.removeToken(),i!=null?r=i:r=`${t}[${s}]`}}extractEnumKeyInfo(t){if(t.type===n.name){const r=this.tokens.identifierNameForToken(t);return{nameStringCode:`"${r}"`,variableName:Us(r)?r:null}}else if(t.type===n.string){const r=this.tokens.stringValueForToken(t);return{nameStringCode:this.tokens.code.slice(t.start,t.end),variableName:Us(r)?r:null}}else throw new Error("Expected name or string at beginning of enum element.")}processStringLiteralEnumMember(t,r,s){s!=null?(this.tokens.appendCode(`const ${s}`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(`; ${t}[${r}] = ${s};`)):(this.tokens.appendCode(`${t}[${r}]`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(";"))}processExplicitValueEnumMember(t,r,s){const i=this.tokens.currentToken().rhsEndIndex;if(i==null)throw new Error("Expected rhsEndIndex on enum assign.");if(s!=null){for(this.tokens.appendCode(`const ${s}`),this.tokens.copyToken();this.tokens.currentIndex()<i;)this.rootTransformer.processToken();this.tokens.appendCode(`; ${t}[${t}[${r}] = ${s}] = ${r};`)}else{for(this.tokens.appendCode(`${t}[${t}[${r}]`),this.tokens.copyToken();this.tokens.currentIndex()<i;)this.rootTransformer.processToken();this.tokens.appendCode(`] = ${r};`)}}processImplicitValueEnumMember(t,r,s,i){let a=i!=null?`${i} + 1`:"0";s!=null&&(this.tokens.appendCode(`const ${s} = ${a}; `),a=s),this.tokens.appendCode(`${t}[${t}[${r}] = ${a}] = ${r};`)}}class En{__init(){this.transformers=[]}__init2(){this.generatedVariables=[]}constructor(t,r,s,i){En.prototype.__init.call(this),En.prototype.__init2.call(this),this.nameManager=t.nameManager,this.helperManager=t.helperManager;const{tokenProcessor:a,importProcessor:u}=t;this.tokens=a,this.isImportsTransformEnabled=r.includes("imports"),this.isReactHotLoaderTransformEnabled=r.includes("react-hot-loader"),this.disableESTransforms=!!i.disableESTransforms,i.disableESTransforms||(this.transformers.push(new Hp(a,this.nameManager)),this.transformers.push(new qp(a)),this.transformers.push(new Up(a,this.nameManager))),r.includes("jsx")&&(i.jsxRuntime!=="preserve"&&this.transformers.push(new ft(this,a,u,this.nameManager,i)),this.transformers.push(new Vp(this,a,u,i)));let d=null;if(r.includes("react-hot-loader")){if(!i.filePath)throw new Error("filePath is required when using the react-hot-loader transform.");d=new ls(a,i.filePath),this.transformers.push(d)}if(r.includes("imports")){if(u===null)throw new Error("Expected non-null importProcessor with imports transform enabled.");this.transformers.push(new Gt(this,a,u,this.nameManager,this.helperManager,d,s,!!i.enableLegacyTypeScriptModuleInterop,r.includes("typescript"),r.includes("flow"),!!i.preserveDynamicImport,!!i.keepUnusedImports))}else this.transformers.push(new Fp(a,this.nameManager,this.helperManager,d,r.includes("typescript"),r.includes("flow"),!!i.keepUnusedImports,i));r.includes("flow")&&this.transformers.push(new $p(this,a,r.includes("imports"))),r.includes("typescript")&&this.transformers.push(new Gp(this,a,r.includes("imports"))),r.includes("jest")&&this.transformers.push(new cs(this,a,this.nameManager,u))}transform(){this.tokens.reset(),this.processBalancedCode();let r=this.isImportsTransformEnabled?'"use strict";':"";for(const u of this.transformers)r+=u.getPrefixCode();r+=this.helperManager.emitHelpers(),r+=this.generatedVariables.map(u=>` var ${u};`).join("");for(const u of this.transformers)r+=u.getHoistedCode();let s="";for(const u of this.transformers)s+=u.getSuffixCode();const i=this.tokens.finish();let{code:a}=i;if(a.startsWith("#!")){let u=a.indexOf(`
|
|
188
|
+
`);return u===-1&&(u=a.length,a+=`
|
|
189
|
+
`),{code:a.slice(0,u+1)+r+a.slice(u+1)+s,mappings:this.shiftMappings(i.mappings,r.length)}}else return{code:r+a+s,mappings:this.shiftMappings(i.mappings,r.length)}}processBalancedCode(){let t=0,r=0;for(;!this.tokens.isAtEnd();){if(this.tokens.matches1(n.braceL)||this.tokens.matches1(n.dollarBraceL))t++;else if(this.tokens.matches1(n.braceR)){if(t===0)return;t--}if(this.tokens.matches1(n.parenL))r++;else if(this.tokens.matches1(n.parenR)){if(r===0)return;r--}this.processToken()}}processToken(){if(this.tokens.matches1(n._class)){this.processClass();return}for(const t of this.transformers)if(t.process())return;this.tokens.copyToken()}processNamedClass(){if(!this.tokens.matches2(n._class,n.name))throw new Error("Expected identifier for exported class name.");const t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.processClass(),t}processClass(){const t=jp(this,this.tokens,this.nameManager,this.disableESTransforms),r=(t.headerInfo.isExpression||!t.headerInfo.className)&&t.staticInitializerNames.length+t.instanceInitializerNames.length>0;let s=t.headerInfo.className;r&&(s=this.nameManager.claimFreeName("_class"),this.generatedVariables.push(s),this.tokens.appendCode(` (${s} =`));const a=this.tokens.currentToken().contextId;if(a==null)throw new Error("Expected class to have a context ID.");for(this.tokens.copyExpectedToken(n._class);!this.tokens.matchesContextIdAndLabel(n.braceL,a);)this.processToken();this.processClassBody(t,s);const u=t.staticInitializerNames.map(d=>`${s}.${d}()`);r?this.tokens.appendCode(`, ${u.map(d=>`${d}, `).join("")}${s})`):t.staticInitializerNames.length>0&&this.tokens.appendCode(` ${u.map(d=>`${d};`).join(" ")}`)}processClassBody(t,r){const{headerInfo:s,constructorInsertPos:i,constructorInitializerStatements:a,fields:u,instanceInitializerNames:d,rangesToRemove:h}=t;let f=0,k=0;const w=this.tokens.currentToken().contextId;if(w==null)throw new Error("Expected non-null context ID on class.");this.tokens.copyExpectedToken(n.braceL),this.isReactHotLoaderTransformEnabled&&this.tokens.appendCode("__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}");const C=a.length+d.length>0;if(i===null&&C){const R=this.makeConstructorInitCode(a,d,r);if(s.hasSuperclass){const q=this.nameManager.claimFreeName("args");this.tokens.appendCode(`constructor(...${q}) { super(...${q}); ${R}; }`)}else this.tokens.appendCode(`constructor() { ${R}; }`)}for(;!this.tokens.matchesContextIdAndLabel(n.braceR,w);)if(f<u.length&&this.tokens.currentIndex()===u[f].start){let R=!1;for(this.tokens.matches1(n.bracketL)?this.tokens.copyTokenWithPrefix(`${u[f].initializerName}() {this`):this.tokens.matches1(n.string)||this.tokens.matches1(n.num)?(this.tokens.copyTokenWithPrefix(`${u[f].initializerName}() {this[`),R=!0):this.tokens.copyTokenWithPrefix(`${u[f].initializerName}() {this.`);this.tokens.currentIndex()<u[f].end;)R&&this.tokens.currentIndex()===u[f].equalsIndex&&this.tokens.appendCode("]"),this.processToken();this.tokens.appendCode("}"),f++}else if(k<h.length&&this.tokens.currentIndex()>=h[k].start){for(this.tokens.currentIndex()<h[k].end&&this.tokens.removeInitialToken();this.tokens.currentIndex()<h[k].end;)this.tokens.removeToken();k++}else this.tokens.currentIndex()===i?(this.tokens.copyToken(),C&&this.tokens.appendCode(`;${this.makeConstructorInitCode(a,d,r)};`),this.processToken()):this.processToken();this.tokens.copyExpectedToken(n.braceR)}makeConstructorInitCode(t,r,s){return[...t,...r.map(i=>`${s}.prototype.${i}.call(this)`)].join(";")}processPossibleArrowParamEnd(){if(this.tokens.matches2(n.parenR,n.colon)&&this.tokens.tokenAtRelativeIndex(1).isType){let t=this.tokens.currentIndex()+1;for(;this.tokens.tokens[t].isType;)t++;if(this.tokens.matches1AtIndex(t,n.arrow)){for(this.tokens.removeInitialToken();this.tokens.currentIndex()<t;)this.tokens.removeToken();return this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"),!0}}return!1}processPossibleAsyncArrowWithTypeParams(){if(!this.tokens.matchesContextual(l._async)&&!this.tokens.matches1(n._async))return!1;const t=this.tokens.tokenAtRelativeIndex(1);if(t.type!==n.lessThan||!t.isType)return!1;let r=this.tokens.currentIndex()+1;for(;this.tokens.tokens[r].isType;)r++;if(this.tokens.matches1AtIndex(r,n.parenL)){for(this.tokens.replaceToken("async ("),this.tokens.removeInitialToken();this.tokens.currentIndex()<r;)this.tokens.removeToken();return this.tokens.removeToken(),this.processBalancedCode(),this.processToken(),!0}return!1}processPossibleTypeRange(){if(this.tokens.currentToken().isType){for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return!0}return!1}shiftMappings(t,r){for(let s=0;s<t.length;s++){const i=t[s];i!==void 0&&(t[s]=i+r)}return t}}var Xp={};(function(e){e.__esModule=!0,e.LinesAndColumns=void 0;var t=`
|
|
190
|
+
`,r="\r",s=function(){function i(a){this.string=a;for(var u=[0],d=0;d<a.length;)switch(a[d]){case t:d+=t.length,u.push(d);break;case r:d+=r.length,a[d]===t&&(d+=t.length),u.push(d);break;default:d++;break}this.offsets=u}return i.prototype.locationForIndex=function(a){if(a<0||a>this.string.length)return null;for(var u=0,d=this.offsets;d[u+1]<=a;)u++;var h=a-d[u];return{line:u,column:h}},i.prototype.indexForLocation=function(a){var u=a.line,d=a.column;return u<0||u>=this.offsets.length||d<0||d>this.lengthOfLine(u)?null:this.offsets[u]+d},i.prototype.lengthOfLine=function(a){var u=this.offsets[a],d=a===this.offsets.length-1?this.string.length:this.offsets[a+1];return d-u},i}();e.LinesAndColumns=s,e.default=s})(Xp);function Jp(e){const t=new Set;for(let r=0;r<e.tokens.length;r++)e.matches1AtIndex(r,n._import)&&!e.matches3AtIndex(r,n._import,n.name,n.eq)&&Yp(e,r,t);return t}function Yp(e,t,r){t++,!e.matches1AtIndex(t,n.parenL)&&(e.matches1AtIndex(t,n.name)&&(r.add(e.identifierNameAtIndex(t)),t++,e.matches1AtIndex(t,n.comma)&&t++),e.matches1AtIndex(t,n.star)&&(t+=2,r.add(e.identifierNameAtIndex(t)),t++),e.matches1AtIndex(t,n.braceL)&&(t++,Qp(e,t,r)))}function Qp(e,t,r){for(;;){if(e.matches1AtIndex(t,n.braceR))return;const s=Yt(e,t);if(t=s.endIndex,s.isType||r.add(s.rightName),e.matches2AtIndex(t,n.comma,n.braceR))return;if(e.matches1AtIndex(t,n.braceR))return;if(e.matches1AtIndex(t,n.comma))t++;else throw new Error(`Unexpected token: ${JSON.stringify(e.tokens[t])}`)}}function Kp(e,t){hc(t);try{const r=Zp(e,t),i=new En(r,t.transforms,!!t.enableLegacyBabel5ModuleInterop,t).transform();let a={code:i.code};if(t.sourceMapOptions){if(!t.filePath)throw new Error("filePath must be specified when generating a source map.");a={...a,sourceMap:ec(i,t.filePath,t.sourceMapOptions,e,r.tokenProcessor.tokens)}}return a}catch(r){throw t.filePath&&(r.message=`Error transforming ${t.filePath}: ${r.message}`),r}}function Zp(e,t){const r=t.transforms.includes("jsx"),s=t.transforms.includes("typescript"),i=t.transforms.includes("flow"),a=t.disableESTransforms===!0,u=Dp(e,r,s,i),d=u.tokens,h=u.scopes,f=new Fr(e,d),k=new yn(f),w=new Wt(e,d,i,a,k),C=!!t.enableLegacyTypeScriptModuleInterop;let R=null;return t.transforms.includes("imports")?(R=new ht(f,w,C,t,t.transforms.includes("typescript"),!!t.keepUnusedImports,k),R.preprocessTokens(),Cs(w,h,R.getGlobalNames()),t.transforms.includes("typescript")&&!t.keepUnusedImports&&R.pruneTypeOnlyImports()):t.transforms.includes("typescript")&&!t.keepUnusedImports&&Cs(w,h,Jp(w)),{tokenProcessor:w,scopes:h,nameManager:f,importProcessor:R,helperManager:k}}let ed=0;function Fn(e,t={}){var d;const{filename:r="App.tsx",isTypeScript:s,isJSX:i}=t,a=((d=r.split(".").pop())==null?void 0:d.toLowerCase())??"",u=[];(s??(a==="tsx"||a==="ts"))&&u.push("typescript"),(i??(a==="tsx"||a==="jsx"))&&u.push("jsx");try{return{code:Kp(e,{transforms:u,jsxRuntime:"automatic",production:!1,filePath:r}).code,error:null}}catch(h){return{code:"",error:td(h,e)}}}function td(e,t){var d;const r=e.message||"Transpilation failed";let s,i;const a=r.match(/\((\d+):(\d+)\)/);if(a&&(s=parseInt(a[1],10),i=parseInt(a[2],10)),!s&&typeof e.pos=="number"){const h=t.substring(0,e.pos).split(`
|
|
191
|
+
`);s=h.length,i=(((d=h[h.length-1])==null?void 0:d.length)??0)+1}let u;if(s){const h=t.split(`
|
|
192
|
+
`),f=Math.max(0,s-6),k=Math.min(h.length,s+5);u=h.slice(f,k).map((w,C)=>`${f+C+1}: ${w}`).join(`
|
|
193
|
+
`)}return{id:`transpile-${++ed}`,category:"transpilation",severity:"error",message:nd(r),line:s,column:i,sourceContext:u,timestamp:new Date().toISOString()}}function nd(e){return e.replace(/^\/[^:]+:\s*/,"").replace(/^Error:\s*/,"")}function rd(e){const t={};for(const[r,s]of Object.entries(e))t[r]=Fn(s,{filename:r});return t}const sd="https://esm.sh";function us(e={}){var d,h;const t=e.cdnBase||sd,r="18.2.0",s="?external=react,react-dom",i={react:`${t}/react@${r}`,"react/":`${t}/react@${r}/`,"react-dom":`${t}/react-dom@${r}`,"react-dom/":`${t}/react-dom@${r}/`,"react/jsx-runtime":`${t}/react@${r}/jsx-runtime`,"react/jsx-dev-runtime":`${t}/react@${r}/jsx-dev-runtime`,"class-variance-authority":`${t}/class-variance-authority@0.7.1`,clsx:`${t}/clsx@2.1.1`,"tailwind-merge":`${t}/tailwind-merge@2.6.0`,"lucide-react":`${t}/lucide-react@0.468.0${s}`,"react-icons/":`${t}/react-icons@5.4.0/`,"date-fns":`${t}/date-fns@4.1.0`,"date-fns/":`${t}/date-fns@4.1.0/`,"chart.js":`${t}/chart.js@4.4.8/auto`,"chart.js/auto":`${t}/chart.js@4.4.8/auto`,"chart.js/":`${t}/chart.js@4.4.8/`,"react-chartjs-2":`${t}/react-chartjs-2@5.3.0${s}`,recharts:`${t}/recharts@2.15.0${s}`,"recharts/":`${t}/recharts@2.15.0&external=react,react-dom/`,"framer-motion":`${t}/framer-motion@11.18.0${s}`,"framer-motion/":`${t}/framer-motion@11.18.0&external=react,react-dom/`,"react-hook-form":`${t}/react-hook-form@7.54.2${s}`,zod:`${t}/zod@3.24.1`,"@hookform/resolvers":`${t}/@hookform/resolvers@3.9.1${s}`,"@hookform/resolvers/":`${t}/@hookform/resolvers@3.9.1&external=react,react-dom/`,"@tanstack/react-table":`${t}/@tanstack/react-table@8.21.2${s}`,zustand:`${t}/zustand@5.0.3${s}`,"zustand/":`${t}/zustand@5.0.3&external=react,react-dom/`,"react-router-dom":`${t}/react-router-dom@6.28.2${s}`,"react-router-dom/":`${t}/react-router-dom@6.28.2&external=react,react-dom/`,sonner:`${t}/sonner@1.7.3${s}`,cmdk:`${t}/cmdk@1.0.4${s}`,"@dnd-kit/core":`${t}/@dnd-kit/core@6.3.1${s}`,"@dnd-kit/sortable":`${t}/@dnd-kit/sortable@10.0.0${s}`,"@dnd-kit/utilities":`${t}/@dnd-kit/utilities@3.2.2`,axios:`${t}/axios@1.7.9`,"axios/":`${t}/axios@1.7.9/`,"lodash-es":`${t}/lodash-es@4.17.21`,"lodash-es/":`${t}/lodash-es@4.17.21/`,nanoid:`${t}/nanoid@5.0.9`,uuid:`${t}/uuid@11.0.5`,"react-markdown":`${t}/react-markdown@9.0.3${s}`,"remark-gfm":`${t}/remark-gfm@4.0.0`,"react-syntax-highlighter":`${t}/react-syntax-highlighter@15.6.1${s}`,"react-syntax-highlighter/":`${t}/react-syntax-highlighter@15.6.1&external=react,react-dom/`,"react-leaflet":`${t}/react-leaflet@4.2.1${s}`,"react-leaflet/":`${t}/react-leaflet@4.2.1&external=react,react-dom/`,leaflet:`${t}/leaflet@1.9.4`,"leaflet/":`${t}/leaflet@1.9.4/`,"react-player":`${t}/react-player@2.16.0${s}`,"react-player/":`${t}/react-player@2.16.0&external=react,react-dom/`,"usehooks-ts":`${t}/usehooks-ts@3.1.0${s}`,"react-colorful":`${t}/react-colorful@5.6.1${s}`,"@radix-ui/react-slot":`${t}/@radix-ui/react-slot@1.1.1${s}`,"@radix-ui/react-accordion":`${t}/@radix-ui/react-accordion@1.2.2${s}`,"@radix-ui/react-alert-dialog":`${t}/@radix-ui/react-alert-dialog@1.1.4${s}`,"@radix-ui/react-aspect-ratio":`${t}/@radix-ui/react-aspect-ratio@1.1.1${s}`,"@radix-ui/react-avatar":`${t}/@radix-ui/react-avatar@1.1.2${s}`,"@radix-ui/react-checkbox":`${t}/@radix-ui/react-checkbox@1.1.3${s}`,"@radix-ui/react-collapsible":`${t}/@radix-ui/react-collapsible@1.1.2${s}`,"@radix-ui/react-context-menu":`${t}/@radix-ui/react-context-menu@2.2.4${s}`,"@radix-ui/react-dialog":`${t}/@radix-ui/react-dialog@1.1.4${s}`,"@radix-ui/react-dropdown-menu":`${t}/@radix-ui/react-dropdown-menu@2.1.4${s}`,"@radix-ui/react-hover-card":`${t}/@radix-ui/react-hover-card@1.1.4${s}`,"@radix-ui/react-label":`${t}/@radix-ui/react-label@2.1.1${s}`,"@radix-ui/react-menubar":`${t}/@radix-ui/react-menubar@1.1.4${s}`,"@radix-ui/react-navigation-menu":`${t}/@radix-ui/react-navigation-menu@1.2.3${s}`,"@radix-ui/react-popover":`${t}/@radix-ui/react-popover@1.1.4${s}`,"@radix-ui/react-progress":`${t}/@radix-ui/react-progress@1.1.1${s}`,"@radix-ui/react-radio-group":`${t}/@radix-ui/react-radio-group@1.2.2${s}`,"@radix-ui/react-scroll-area":`${t}/@radix-ui/react-scroll-area@1.2.2${s}`,"@radix-ui/react-select":`${t}/@radix-ui/react-select@2.1.4${s}`,"@radix-ui/react-separator":`${t}/@radix-ui/react-separator@1.1.1${s}`,"@radix-ui/react-slider":`${t}/@radix-ui/react-slider@1.2.2${s}`,"@radix-ui/react-switch":`${t}/@radix-ui/react-switch@1.1.2${s}`,"@radix-ui/react-tabs":`${t}/@radix-ui/react-tabs@1.1.2${s}`,"@radix-ui/react-toast":`${t}/@radix-ui/react-toast@1.2.4${s}`,"@radix-ui/react-toggle":`${t}/@radix-ui/react-toggle@1.1.1${s}`,"@radix-ui/react-toggle-group":`${t}/@radix-ui/react-toggle-group@1.1.1${s}`,"@radix-ui/react-tooltip":`${t}/@radix-ui/react-tooltip@1.1.6${s}`,"@radix-ui/react-portal":`${t}/@radix-ui/react-portal@1.1.3${s}`,"@radix-ui/react-visually-hidden":`${t}/@radix-ui/react-visually-hidden@1.1.1${s}`,"@radix-ui/react-collection":`${t}/@radix-ui/react-collection@1.1.1${s}`,"@radix-ui/react-context":`${t}/@radix-ui/react-context@1.1.1${s}`,"embla-carousel-react":`${t}/embla-carousel-react@8.5.1${s}`,"embla-carousel-autoplay":`${t}/embla-carousel-autoplay@8.5.1`,vaul:`${t}/vaul@1.1.2${s}`,"resize-observer-polyfill":`${t}/resize-observer-polyfill@1.5.1`,"react-resizable-panels":`${t}/react-resizable-panels@2.1.7${s}`,"react-day-picker":`${t}/react-day-picker@9.4.4${s}`,"input-otp":`${t}/input-otp@1.4.1${s}`,"react-dropzone":`${t}/react-dropzone@14.3.5${s}`,"qrcode.react":`${t}/qrcode.react@4.2.0${s}`};if(e.dependencies)for(const[f,k]of Object.entries(e.dependencies))k.startsWith("http")?i[f]=k:i[f]=`${t}/${f}@${k}${s}`;const a={...i,...((d=e.overrides)==null?void 0:d.imports)||{}},u={react:`${t}/react@${r}`,"react/":`${t}/react@${r}/`,"react-dom":`${t}/react-dom@${r}`,"react-dom/":`${t}/react-dom@${r}/`,"react/jsx-runtime":`${t}/react@${r}/jsx-runtime`,"react/jsx-dev-runtime":`${t}/react@${r}/jsx-dev-runtime`};return{imports:a,scopes:{[`${t}/`]:u,...((h=e.overrides)==null?void 0:h.scopes)||{}}}}function ps(e){return`<script type="importmap">${JSON.stringify(e,null,2)}<\/script>`}function mi(){return`Available packages (just import, no install needed):
|
|
194
|
+
|
|
195
|
+
STYLING: clsx, class-variance-authority, tailwind-merge
|
|
196
|
+
ICONS: lucide-react (1400+ icons), react-icons/* (40k+ icons from fa/md/hi/etc)
|
|
197
|
+
DATES: date-fns (format, parseISO, differenceInDays, etc)
|
|
198
|
+
CHARTS: recharts (LineChart, BarChart, PieChart, AreaChart), chart.js + react-chartjs-2
|
|
199
|
+
ANIMATION: framer-motion (motion, AnimatePresence, useSpring)
|
|
200
|
+
FORMS: react-hook-form (useForm) + zod (z.object) + @hookform/resolvers
|
|
201
|
+
TABLES: @tanstack/react-table (useReactTable, getCoreRowModel, getSortedRowModel)
|
|
202
|
+
STATE: zustand (create)
|
|
203
|
+
ROUTING: react-router-dom (BrowserRouter, Route, useNavigate)
|
|
204
|
+
TOASTS: sonner (toast, Toaster)
|
|
205
|
+
COMMAND: cmdk (Command, Command.Input, Command.List)
|
|
206
|
+
DND: @dnd-kit/core, @dnd-kit/sortable
|
|
207
|
+
HTTP: axios
|
|
208
|
+
UTILS: lodash-es (debounce, groupBy, etc), nanoid, uuid
|
|
209
|
+
MARKDOWN: react-markdown + remark-gfm
|
|
210
|
+
CODE: react-syntax-highlighter
|
|
211
|
+
MAPS: react-leaflet + leaflet
|
|
212
|
+
MEDIA: react-player
|
|
213
|
+
HOOKS: usehooks-ts (useCopyToClipboard, useLocalStorage, etc)
|
|
214
|
+
COLOR: react-colorful
|
|
215
|
+
MISC: react-resizable-panels, react-day-picker, input-otp, react-dropzone, qrcode.react
|
|
216
|
+
|
|
217
|
+
UI PRIMITIVES (Radix): accordion, alert-dialog, aspect-ratio, avatar, checkbox,
|
|
218
|
+
collapsible, context-menu, dialog, dropdown-menu, hover-card, label, menubar,
|
|
219
|
+
navigation-menu, popover, progress, radio-group, scroll-area, select, separator,
|
|
220
|
+
slider, switch, tabs, toast, toggle, toggle-group, tooltip, portal, visually-hidden
|
|
221
|
+
|
|
222
|
+
All packages use Tailwind CSS (available via CDN). Use Tailwind classes for all styling.`}const od="https://cdn.tailwindcss.com/3.4.16?plugins=forms,typography";function xn(e){const{transpiledCode:t,template:r,importMap:s,tailwindCdn:i=od,externalResources:a=[]}=e;return r==="html"?id(t,{tailwindCdn:i,externalResources:a}):r==="markdown"?cd(t,{tailwindCdn:i,externalResources:a}):r==="mermaid"?ld(t):r==="svg"?ud(t):r==="csv"?pd(t):r==="json"?dd(t):fd(t,{importMap:s,tailwindCdn:i,externalResources:a})}function id(e,t){const{tailwindCdn:r,externalResources:s=[]}=t;if(e.includes("<html")||e.includes("<!DOCTYPE"))return e;const i=s.map(u=>u.endsWith(".css")?`<link rel="stylesheet" href="${u}">`:`<script src="${u}"><\/script>`).join(`
|
|
223
|
+
`);return`<!DOCTYPE html>
|
|
224
|
+
<html lang="en">
|
|
225
|
+
<head>
|
|
226
|
+
<meta charset="UTF-8">
|
|
227
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
228
|
+
${r?`<script src="${r}"><\/script>`:""}
|
|
229
|
+
${i}
|
|
230
|
+
${wt()}
|
|
231
|
+
<style>
|
|
232
|
+
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; }
|
|
233
|
+
</style>
|
|
234
|
+
</head>
|
|
235
|
+
<body>
|
|
236
|
+
${e}
|
|
237
|
+
<script>
|
|
238
|
+
// Notify parent that HTML content is ready
|
|
239
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
240
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
241
|
+
});
|
|
242
|
+
// Fallback if DOMContentLoaded already fired
|
|
243
|
+
if (document.readyState !== 'loading') {
|
|
244
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
245
|
+
}
|
|
246
|
+
<\/script>
|
|
247
|
+
</body>
|
|
248
|
+
</html>`}function ds(){return`
|
|
249
|
+
.mermaid-viewer {
|
|
250
|
+
position: relative;
|
|
251
|
+
border: 1px solid #30363d;
|
|
252
|
+
border-radius: 8px;
|
|
253
|
+
overflow: hidden;
|
|
254
|
+
margin: 16px 0;
|
|
255
|
+
background: #161b22;
|
|
256
|
+
}
|
|
257
|
+
.mermaid-viewport {
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
cursor: grab;
|
|
260
|
+
min-height: 200px;
|
|
261
|
+
position: relative;
|
|
262
|
+
}
|
|
263
|
+
.mermaid-viewport.grabbing { cursor: grabbing; }
|
|
264
|
+
.mermaid-viewport .mermaid-inner {
|
|
265
|
+
transform-origin: 0 0;
|
|
266
|
+
transition: transform 0.1s ease-out;
|
|
267
|
+
display: inline-block;
|
|
268
|
+
}
|
|
269
|
+
.mermaid-controls {
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: 8px;
|
|
272
|
+
right: 8px;
|
|
273
|
+
display: flex;
|
|
274
|
+
gap: 4px;
|
|
275
|
+
z-index: 10;
|
|
276
|
+
}
|
|
277
|
+
.mermaid-controls button {
|
|
278
|
+
width: 28px; height: 28px;
|
|
279
|
+
border-radius: 6px;
|
|
280
|
+
border: 1px solid #30363d;
|
|
281
|
+
background: #0d1117;
|
|
282
|
+
color: #8b949e;
|
|
283
|
+
font-size: 14px;
|
|
284
|
+
font-weight: 600;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: center;
|
|
289
|
+
transition: all 0.15s;
|
|
290
|
+
padding: 0;
|
|
291
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
292
|
+
}
|
|
293
|
+
.mermaid-controls button:hover {
|
|
294
|
+
background: #21262d;
|
|
295
|
+
color: #e6edf3;
|
|
296
|
+
border-color: #484f58;
|
|
297
|
+
}
|
|
298
|
+
.mermaid-zoom-label {
|
|
299
|
+
font-size: 10px;
|
|
300
|
+
color: #484f58;
|
|
301
|
+
padding: 0 6px;
|
|
302
|
+
display: flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
user-select: none;
|
|
305
|
+
}
|
|
306
|
+
`}function fs(){return`
|
|
307
|
+
function initZoomPan(viewer) {
|
|
308
|
+
const viewport = viewer.querySelector('.mermaid-viewport');
|
|
309
|
+
const inner = viewer.querySelector('.mermaid-inner');
|
|
310
|
+
const zoomLabel = viewer.querySelector('.mermaid-zoom-label');
|
|
311
|
+
const btnIn = viewer.querySelector('[data-action="zoom-in"]');
|
|
312
|
+
const btnOut = viewer.querySelector('[data-action="zoom-out"]');
|
|
313
|
+
const btnFit = viewer.querySelector('[data-action="fit"]');
|
|
314
|
+
const btnReset = viewer.querySelector('[data-action="reset"]');
|
|
315
|
+
|
|
316
|
+
let scale = 1, panX = 0, panY = 0, dragging = false, startX = 0, startY = 0;
|
|
317
|
+
|
|
318
|
+
function apply() {
|
|
319
|
+
inner.style.transform = 'translate(' + panX + 'px,' + panY + 'px) scale(' + scale + ')';
|
|
320
|
+
if (zoomLabel) zoomLabel.textContent = Math.round(scale * 100) + '%';
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function fitToContainer() {
|
|
324
|
+
const svg = inner.querySelector('svg');
|
|
325
|
+
if (!svg) return;
|
|
326
|
+
// Reset transform to measure natural SVG size
|
|
327
|
+
inner.style.transform = 'none';
|
|
328
|
+
const svgRect = svg.getBoundingClientRect();
|
|
329
|
+
const naturalW = svgRect.width;
|
|
330
|
+
const naturalH = svgRect.height;
|
|
331
|
+
if (naturalW === 0 || naturalH === 0) return;
|
|
332
|
+
|
|
333
|
+
const vw = viewport.clientWidth;
|
|
334
|
+
const vh = viewport.clientHeight;
|
|
335
|
+
// Scale to fit with some padding (90% of viewport)
|
|
336
|
+
scale = Math.min((vw * 0.9) / naturalW, (vh * 0.9) / naturalH, 2);
|
|
337
|
+
scale = Math.max(scale, 0.1);
|
|
338
|
+
// Center: translate so scaled content is in the middle
|
|
339
|
+
panX = (vw - naturalW * scale) / 2;
|
|
340
|
+
panY = (vh - naturalH * scale) / 2;
|
|
341
|
+
apply();
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (btnIn) btnIn.onclick = () => { scale = Math.min(scale * 1.25, 5); apply(); };
|
|
345
|
+
if (btnOut) btnOut.onclick = () => { scale = Math.max(scale / 1.25, 0.1); apply(); };
|
|
346
|
+
if (btnReset) btnReset.onclick = () => { scale = 1; panX = 0; panY = 0; apply(); };
|
|
347
|
+
if (btnFit) btnFit.onclick = () => fitToContainer();
|
|
348
|
+
|
|
349
|
+
// Mouse wheel zoom
|
|
350
|
+
viewport.addEventListener('wheel', (e) => {
|
|
351
|
+
e.preventDefault();
|
|
352
|
+
const factor = e.deltaY < 0 ? 1.1 : 0.9;
|
|
353
|
+
scale = Math.min(Math.max(scale * factor, 0.1), 5);
|
|
354
|
+
apply();
|
|
355
|
+
}, { passive: false });
|
|
356
|
+
|
|
357
|
+
// Pan via drag
|
|
358
|
+
viewport.addEventListener('mousedown', (e) => {
|
|
359
|
+
dragging = true; startX = e.clientX - panX; startY = e.clientY - panY;
|
|
360
|
+
viewport.classList.add('grabbing');
|
|
361
|
+
});
|
|
362
|
+
window.addEventListener('mousemove', (e) => {
|
|
363
|
+
if (!dragging) return;
|
|
364
|
+
panX = e.clientX - startX; panY = e.clientY - startY;
|
|
365
|
+
inner.style.transition = 'none';
|
|
366
|
+
apply();
|
|
367
|
+
});
|
|
368
|
+
window.addEventListener('mouseup', () => {
|
|
369
|
+
dragging = false;
|
|
370
|
+
viewport.classList.remove('grabbing');
|
|
371
|
+
inner.style.transition = 'transform 0.1s ease-out';
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// Auto-fit on first load
|
|
375
|
+
requestAnimationFrame(() => fitToContainer());
|
|
376
|
+
}
|
|
377
|
+
`}function ad(e){return`<div class="mermaid-viewer">
|
|
378
|
+
<div class="mermaid-controls">
|
|
379
|
+
<button data-action="zoom-in" title="Zoom in">+</button>
|
|
380
|
+
<button data-action="zoom-out" title="Zoom out">−</button>
|
|
381
|
+
<span class="mermaid-zoom-label">100%</span>
|
|
382
|
+
<button data-action="fit" title="Fit to view">
|
|
383
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="12" height="12" rx="2"/><polyline points="6 2 6 6 2 6"/><polyline points="10 14 10 10 14 10"/></svg>
|
|
384
|
+
</button>
|
|
385
|
+
<button data-action="reset" title="Reset zoom">1:1</button>
|
|
386
|
+
</div>
|
|
387
|
+
<div class="mermaid-viewport">
|
|
388
|
+
<div class="mermaid-inner">
|
|
389
|
+
<div class="mermaid">${e}</div>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>`}function cd(e,t){const{tailwindCdn:r,externalResources:s=[]}=t,i=s.map(d=>d.endsWith(".css")?`<link rel="stylesheet" href="${d}">`:`<script src="${d}"><\/script>`).join(`
|
|
393
|
+
`),a=r?`<script src="${r}"><\/script>`:"",u=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${");return`<!DOCTYPE html>
|
|
394
|
+
<html lang="en">
|
|
395
|
+
<head>
|
|
396
|
+
<meta charset="UTF-8">
|
|
397
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
398
|
+
${a}
|
|
399
|
+
${i}
|
|
400
|
+
<script src="https://cdn.jsdelivr.net/npm/marked@14/marked.min.js"><\/script>
|
|
401
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"><\/script>
|
|
402
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5/github-markdown-dark.min.css">
|
|
403
|
+
${wt()}
|
|
404
|
+
<style>
|
|
405
|
+
body { margin: 0; padding: 0; background: #0d1117; }
|
|
406
|
+
.markdown-body {
|
|
407
|
+
box-sizing: border-box;
|
|
408
|
+
min-width: 200px;
|
|
409
|
+
max-width: 980px;
|
|
410
|
+
margin: 0 auto;
|
|
411
|
+
padding: 32px 24px;
|
|
412
|
+
}
|
|
413
|
+
pre code { border-radius: 6px; }
|
|
414
|
+
${ds()}
|
|
415
|
+
</style>
|
|
416
|
+
</head>
|
|
417
|
+
<body>
|
|
418
|
+
<article id="content" class="markdown-body"></article>
|
|
419
|
+
<script>
|
|
420
|
+
${fs()}
|
|
421
|
+
|
|
422
|
+
mermaid.initialize({
|
|
423
|
+
startOnLoad: false,
|
|
424
|
+
theme: 'dark',
|
|
425
|
+
securityLevel: 'loose',
|
|
426
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
const renderer = new marked.Renderer();
|
|
430
|
+
const origCode = renderer.code.bind(renderer);
|
|
431
|
+
renderer.code = function({ text, lang }) {
|
|
432
|
+
if (lang === 'mermaid') {
|
|
433
|
+
return ${JSON.stringify(ad("__MERMAID__"))}.replace('__MERMAID__', text);
|
|
434
|
+
}
|
|
435
|
+
return origCode({ text, lang });
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
marked.setOptions({ renderer, gfm: true, breaks: true });
|
|
439
|
+
|
|
440
|
+
const md = \`${u}\`;
|
|
441
|
+
document.getElementById('content').innerHTML = marked.parse(md);
|
|
442
|
+
|
|
443
|
+
mermaid.run({ nodes: document.querySelectorAll('.mermaid') }).then(() => {
|
|
444
|
+
document.querySelectorAll('.mermaid-viewer').forEach(initZoomPan);
|
|
445
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
446
|
+
}).catch((err) => {
|
|
447
|
+
console.error('Mermaid error:', err);
|
|
448
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
449
|
+
});
|
|
450
|
+
<\/script>
|
|
451
|
+
</body>
|
|
452
|
+
</html>`}function ld(e){const t=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${");return`<!DOCTYPE html>
|
|
453
|
+
<html lang="en">
|
|
454
|
+
<head>
|
|
455
|
+
<meta charset="UTF-8">
|
|
456
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
457
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"><\/script>
|
|
458
|
+
${wt()}
|
|
459
|
+
<style>
|
|
460
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
461
|
+
body { background: #0d1117; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
|
|
462
|
+
${ds()}
|
|
463
|
+
.mermaid-viewer {
|
|
464
|
+
position: fixed;
|
|
465
|
+
inset: 0;
|
|
466
|
+
border: none;
|
|
467
|
+
border-radius: 0;
|
|
468
|
+
margin: 0;
|
|
469
|
+
}
|
|
470
|
+
.mermaid-viewport {
|
|
471
|
+
width: 100vw;
|
|
472
|
+
height: 100vh;
|
|
473
|
+
}
|
|
474
|
+
</style>
|
|
475
|
+
</head>
|
|
476
|
+
<body>
|
|
477
|
+
<div class="mermaid-viewer">
|
|
478
|
+
<div class="mermaid-controls">
|
|
479
|
+
<button data-action="zoom-in" title="Zoom in">+</button>
|
|
480
|
+
<button data-action="zoom-out" title="Zoom out">−</button>
|
|
481
|
+
<span class="mermaid-zoom-label">100%</span>
|
|
482
|
+
<button data-action="fit" title="Fit to view">
|
|
483
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="12" height="12" rx="2"/><polyline points="6 2 6 6 2 6"/><polyline points="10 14 10 10 14 10"/></svg>
|
|
484
|
+
</button>
|
|
485
|
+
<button data-action="reset" title="Reset zoom">1:1</button>
|
|
486
|
+
</div>
|
|
487
|
+
<div class="mermaid-viewport">
|
|
488
|
+
<div class="mermaid-inner">
|
|
489
|
+
<div class="mermaid" id="diagram"></div>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
492
|
+
</div>
|
|
493
|
+
|
|
494
|
+
<script>
|
|
495
|
+
${fs()}
|
|
496
|
+
|
|
497
|
+
mermaid.initialize({
|
|
498
|
+
startOnLoad: false,
|
|
499
|
+
theme: 'dark',
|
|
500
|
+
securityLevel: 'loose',
|
|
501
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
const code = \`${t}\`;
|
|
505
|
+
document.getElementById('diagram').textContent = code;
|
|
506
|
+
|
|
507
|
+
mermaid.run({ nodes: [document.getElementById('diagram')] }).then(() => {
|
|
508
|
+
initZoomPan(document.querySelector('.mermaid-viewer'));
|
|
509
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
510
|
+
}).catch((err) => {
|
|
511
|
+
console.error('Mermaid error:', err);
|
|
512
|
+
document.getElementById('diagram').innerHTML =
|
|
513
|
+
'<div style="padding:24px;color:#f85149;font-family:monospace;font-size:13px;white-space:pre-wrap;">'
|
|
514
|
+
+ 'Mermaid Error\\n' + (err.message || err) + '</div>';
|
|
515
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
516
|
+
});
|
|
517
|
+
<\/script>
|
|
518
|
+
</body>
|
|
519
|
+
</html>`}function ud(e){return`<!DOCTYPE html>
|
|
520
|
+
<html lang="en">
|
|
521
|
+
<head>
|
|
522
|
+
<meta charset="UTF-8">
|
|
523
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
524
|
+
${wt()}
|
|
525
|
+
<style>
|
|
526
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
527
|
+
body { background: #0d1117; }
|
|
528
|
+
${ds()}
|
|
529
|
+
.mermaid-viewer { position: fixed; inset: 0; border: none; border-radius: 0; margin: 0; }
|
|
530
|
+
.mermaid-viewport { width: 100vw; height: 100vh; }
|
|
531
|
+
/* Ensure SVG is visible even without explicit width/height */
|
|
532
|
+
#svg-container svg {
|
|
533
|
+
display: block;
|
|
534
|
+
width: auto;
|
|
535
|
+
height: auto;
|
|
536
|
+
min-width: 100px;
|
|
537
|
+
min-height: 100px;
|
|
538
|
+
max-width: none;
|
|
539
|
+
max-height: none;
|
|
540
|
+
}
|
|
541
|
+
</style>
|
|
542
|
+
</head>
|
|
543
|
+
<body>
|
|
544
|
+
<div class="mermaid-viewer">
|
|
545
|
+
<div class="mermaid-controls">
|
|
546
|
+
<button data-action="zoom-in" title="Zoom in">+</button>
|
|
547
|
+
<button data-action="zoom-out" title="Zoom out">−</button>
|
|
548
|
+
<span class="mermaid-zoom-label">100%</span>
|
|
549
|
+
<button data-action="fit" title="Fit to view">
|
|
550
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="12" height="12" rx="2"/><polyline points="6 2 6 6 2 6"/><polyline points="10 14 10 10 14 10"/></svg>
|
|
551
|
+
</button>
|
|
552
|
+
<button data-action="reset" title="Reset zoom">1:1</button>
|
|
553
|
+
</div>
|
|
554
|
+
<div class="mermaid-viewport">
|
|
555
|
+
<div class="mermaid-inner" id="svg-container">
|
|
556
|
+
${e}
|
|
557
|
+
</div>
|
|
558
|
+
</div>
|
|
559
|
+
</div>
|
|
560
|
+
<script>
|
|
561
|
+
${fs()}
|
|
562
|
+
|
|
563
|
+
// If SVG has viewBox but no width/height, set explicit dimensions from viewBox
|
|
564
|
+
const svg = document.querySelector('#svg-container > svg');
|
|
565
|
+
if (svg) {
|
|
566
|
+
const vb = svg.getAttribute('viewBox');
|
|
567
|
+
if (vb && !svg.getAttribute('width')) {
|
|
568
|
+
const parts = vb.split(/[\\s,]+/);
|
|
569
|
+
if (parts.length === 4) {
|
|
570
|
+
svg.setAttribute('width', parts[2]);
|
|
571
|
+
svg.setAttribute('height', parts[3]);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
initZoomPan(document.querySelector('.mermaid-viewer'));
|
|
577
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
578
|
+
<\/script>
|
|
579
|
+
</body>
|
|
580
|
+
</html>`}function pd(e){const t=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${");return`<!DOCTYPE html>
|
|
581
|
+
<html lang="en">
|
|
582
|
+
<head>
|
|
583
|
+
<meta charset="UTF-8">
|
|
584
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
585
|
+
${wt()}
|
|
586
|
+
<style>
|
|
587
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
588
|
+
body { background: #0d1117; color: #e6edf3; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; padding: 16px; }
|
|
589
|
+
.csv-info { font-size: 11px; color: #484f58; margin-bottom: 12px; }
|
|
590
|
+
.csv-info span { color: #8b949e; }
|
|
591
|
+
table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
592
|
+
thead { position: sticky; top: 0; z-index: 1; }
|
|
593
|
+
th {
|
|
594
|
+
background: #161b22; color: #8b949e; font-weight: 600; text-align: left;
|
|
595
|
+
padding: 8px 12px; border-bottom: 2px solid #30363d; cursor: pointer;
|
|
596
|
+
user-select: none; white-space: nowrap;
|
|
597
|
+
}
|
|
598
|
+
th:hover { color: #e6edf3; }
|
|
599
|
+
th .sort-arrow { margin-left: 4px; font-size: 10px; opacity: 0.5; }
|
|
600
|
+
th .sort-arrow.active { opacity: 1; color: #58a6ff; }
|
|
601
|
+
td {
|
|
602
|
+
padding: 6px 12px; border-bottom: 1px solid #21262d;
|
|
603
|
+
max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
604
|
+
}
|
|
605
|
+
tr:hover td { background: rgba(136,198,255,0.04); }
|
|
606
|
+
tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
|
|
607
|
+
tr:nth-child(even):hover td { background: rgba(136,198,255,0.04); }
|
|
608
|
+
.num { text-align: right; font-variant-numeric: tabular-nums; color: #79c0ff; }
|
|
609
|
+
</style>
|
|
610
|
+
</head>
|
|
611
|
+
<body>
|
|
612
|
+
<div class="csv-info" id="info"></div>
|
|
613
|
+
<div style="overflow:auto;max-height:calc(100vh - 48px);">
|
|
614
|
+
<table id="table"></table>
|
|
615
|
+
</div>
|
|
616
|
+
<script>
|
|
617
|
+
const csv = \`${t}\`;
|
|
618
|
+
|
|
619
|
+
function parseCSV(text) {
|
|
620
|
+
const lines = text.trim().split('\\n');
|
|
621
|
+
return lines.map(line => {
|
|
622
|
+
const row = []; let cell = ''; let inQuotes = false;
|
|
623
|
+
for (let i = 0; i < line.length; i++) {
|
|
624
|
+
const c = line[i];
|
|
625
|
+
if (inQuotes) {
|
|
626
|
+
if (c === '"' && line[i+1] === '"') { cell += '"'; i++; }
|
|
627
|
+
else if (c === '"') { inQuotes = false; }
|
|
628
|
+
else { cell += c; }
|
|
629
|
+
} else {
|
|
630
|
+
if (c === '"') { inQuotes = true; }
|
|
631
|
+
else if (c === ',') { row.push(cell.trim()); cell = ''; }
|
|
632
|
+
else { cell += c; }
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
row.push(cell.trim());
|
|
636
|
+
return row;
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function isNumeric(v) { return v !== '' && !isNaN(Number(v)); }
|
|
641
|
+
|
|
642
|
+
const rows = parseCSV(csv);
|
|
643
|
+
if (rows.length === 0) { document.body.textContent = 'Empty CSV'; }
|
|
644
|
+
const headers = rows[0] || [];
|
|
645
|
+
const data = rows.slice(1);
|
|
646
|
+
|
|
647
|
+
document.getElementById('info').innerHTML =
|
|
648
|
+
'<span>' + data.length + '</span> rows · <span>' + headers.length + '</span> columns';
|
|
649
|
+
|
|
650
|
+
let sortCol = -1, sortAsc = true;
|
|
651
|
+
|
|
652
|
+
function render(d) {
|
|
653
|
+
const table = document.getElementById('table');
|
|
654
|
+
let html = '<thead><tr>';
|
|
655
|
+
headers.forEach((h, i) => {
|
|
656
|
+
const active = sortCol === i;
|
|
657
|
+
const arrow = active ? (sortAsc ? '▲' : '▼') : '▲';
|
|
658
|
+
html += '<th data-col="' + i + '">' + esc(h) +
|
|
659
|
+
'<span class="sort-arrow' + (active ? ' active' : '') + '">' + arrow + '</span></th>';
|
|
660
|
+
});
|
|
661
|
+
html += '</tr></thead><tbody>';
|
|
662
|
+
d.forEach(row => {
|
|
663
|
+
html += '<tr>';
|
|
664
|
+
row.forEach((cell, i) => {
|
|
665
|
+
html += '<td' + (isNumeric(cell) ? ' class="num"' : '') + '>' + esc(cell) + '</td>';
|
|
666
|
+
});
|
|
667
|
+
html += '</tr>';
|
|
668
|
+
});
|
|
669
|
+
html += '</tbody>';
|
|
670
|
+
table.innerHTML = html;
|
|
671
|
+
|
|
672
|
+
table.querySelectorAll('th').forEach(th => {
|
|
673
|
+
th.onclick = () => {
|
|
674
|
+
const col = +th.dataset.col;
|
|
675
|
+
if (sortCol === col) sortAsc = !sortAsc; else { sortCol = col; sortAsc = true; }
|
|
676
|
+
const sorted = [...data].sort((a, b) => {
|
|
677
|
+
const va = a[col] || '', vb = b[col] || '';
|
|
678
|
+
if (isNumeric(va) && isNumeric(vb)) return sortAsc ? Number(va) - Number(vb) : Number(vb) - Number(va);
|
|
679
|
+
return sortAsc ? va.localeCompare(vb) : vb.localeCompare(va);
|
|
680
|
+
});
|
|
681
|
+
render(sorted);
|
|
682
|
+
};
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function esc(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
|
687
|
+
|
|
688
|
+
render(data);
|
|
689
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
690
|
+
<\/script>
|
|
691
|
+
</body>
|
|
692
|
+
</html>`}function dd(e){const t=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${");return`<!DOCTYPE html>
|
|
693
|
+
<html lang="en">
|
|
694
|
+
<head>
|
|
695
|
+
<meta charset="UTF-8">
|
|
696
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
697
|
+
${wt()}
|
|
698
|
+
<style>
|
|
699
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
700
|
+
body { background: #0d1117; color: #e6edf3; font-family: 'SF Mono', Menlo, monospace; font-size: 13px; padding: 16px; line-height: 1.5; }
|
|
701
|
+
.json-info { font-size: 11px; color: #484f58; margin-bottom: 12px; font-family: -apple-system, sans-serif; }
|
|
702
|
+
.json-info span { color: #8b949e; }
|
|
703
|
+
.tree { padding: 0; }
|
|
704
|
+
.node { padding-left: 20px; }
|
|
705
|
+
.toggle {
|
|
706
|
+
cursor: pointer; user-select: none; display: inline-block; width: 14px;
|
|
707
|
+
color: #484f58; font-size: 10px; text-align: center; vertical-align: middle;
|
|
708
|
+
}
|
|
709
|
+
.toggle:hover { color: #8b949e; }
|
|
710
|
+
.key { color: #79c0ff; }
|
|
711
|
+
.str { color: #a5d6ff; }
|
|
712
|
+
.num { color: #d2a8ff; }
|
|
713
|
+
.bool { color: #ff7b72; }
|
|
714
|
+
.null { color: #484f58; font-style: italic; }
|
|
715
|
+
.bracket { color: #8b949e; }
|
|
716
|
+
.comma { color: #484f58; }
|
|
717
|
+
.collapsed-preview { color: #484f58; font-style: italic; font-size: 11px; }
|
|
718
|
+
.hidden { display: none; }
|
|
719
|
+
.copy-path {
|
|
720
|
+
opacity: 0; margin-left: 6px; font-size: 10px; color: #484f58; cursor: pointer;
|
|
721
|
+
font-family: -apple-system, sans-serif; border: none; background: none; padding: 0;
|
|
722
|
+
}
|
|
723
|
+
.node:hover > .line > .copy-path { opacity: 0.7; }
|
|
724
|
+
.copy-path:hover { opacity: 1 !important; color: #58a6ff; }
|
|
725
|
+
</style>
|
|
726
|
+
</head>
|
|
727
|
+
<body>
|
|
728
|
+
<div class="json-info" id="info"></div>
|
|
729
|
+
<div id="tree" class="tree"></div>
|
|
730
|
+
<script>
|
|
731
|
+
const raw = \`${t}\`;
|
|
732
|
+
let parsed;
|
|
733
|
+
try { parsed = JSON.parse(raw); } catch(e) {
|
|
734
|
+
document.getElementById('tree').innerHTML =
|
|
735
|
+
'<div style="color:#f85149;padding:16px;">Invalid JSON: ' + e.message + '</div>';
|
|
736
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
737
|
+
throw e;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function typeLabel(v) {
|
|
741
|
+
if (v === null) return 'null';
|
|
742
|
+
if (Array.isArray(v)) return 'array[' + v.length + ']';
|
|
743
|
+
if (typeof v === 'object') return 'object{' + Object.keys(v).length + '}';
|
|
744
|
+
return typeof v;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
document.getElementById('info').innerHTML = '<span>' + typeLabel(parsed) + '</span> · ' +
|
|
748
|
+
'<span>' + new Blob([raw]).size + '</span> bytes';
|
|
749
|
+
|
|
750
|
+
function esc(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
|
751
|
+
|
|
752
|
+
function renderValue(val, path) {
|
|
753
|
+
if (val === null) return '<span class="null">null</span>';
|
|
754
|
+
if (typeof val === 'string') return '<span class="str">"' + esc(val) + '"</span>';
|
|
755
|
+
if (typeof val === 'number') return '<span class="num">' + val + '</span>';
|
|
756
|
+
if (typeof val === 'boolean') return '<span class="bool">' + val + '</span>';
|
|
757
|
+
return '';
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
let nodeId = 0;
|
|
761
|
+
function renderNode(key, val, path, isLast) {
|
|
762
|
+
const id = 'n' + (nodeId++);
|
|
763
|
+
const comma = isLast ? '' : '<span class="comma">,</span>';
|
|
764
|
+
const keyHtml = key !== null ? '<span class="key">"' + esc(String(key)) + '"</span>: ' : '';
|
|
765
|
+
const copyBtn = '<button class="copy-path" title="Copy path" onclick="copyPath(\\''+esc(path)+'\\')">path</button>';
|
|
766
|
+
|
|
767
|
+
if (val === null || typeof val !== 'object') {
|
|
768
|
+
return '<div class="line">' + keyHtml + renderValue(val, path) + comma + copyBtn + '</div>';
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
const isArr = Array.isArray(val);
|
|
772
|
+
const entries = isArr ? val.map((v,i) => [i, v]) : Object.entries(val);
|
|
773
|
+
const open = isArr ? '[' : '{';
|
|
774
|
+
const close = isArr ? ']' : '}';
|
|
775
|
+
const preview = isArr ? entries.length + ' items' : Object.keys(val).join(', ').substring(0,40);
|
|
776
|
+
|
|
777
|
+
let html = '<div class="line">';
|
|
778
|
+
html += '<span class="toggle" data-target="' + id + '">▼</span>';
|
|
779
|
+
html += keyHtml + '<span class="bracket">' + open + '</span>';
|
|
780
|
+
html += '<span class="collapsed-preview hidden" id="' + id + '-p"> ' + esc(preview) + ' </span>';
|
|
781
|
+
html += copyBtn;
|
|
782
|
+
html += '</div>';
|
|
783
|
+
html += '<div class="node" id="' + id + '">';
|
|
784
|
+
entries.forEach(([k, v], i) => {
|
|
785
|
+
const childPath = isArr ? path + '[' + k + ']' : path + '.' + k;
|
|
786
|
+
html += renderNode(isArr ? null : k, v, childPath, i === entries.length - 1);
|
|
787
|
+
});
|
|
788
|
+
html += '</div>';
|
|
789
|
+
html += '<div class="line"><span class="bracket">' + close + '</span>' + comma + '</div>';
|
|
790
|
+
return html;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
document.getElementById('tree').innerHTML = renderNode(null, parsed, '$', true);
|
|
794
|
+
|
|
795
|
+
// Toggle collapse
|
|
796
|
+
document.addEventListener('click', (e) => {
|
|
797
|
+
const toggle = e.target.closest('.toggle');
|
|
798
|
+
if (!toggle) return;
|
|
799
|
+
const target = document.getElementById(toggle.dataset.target);
|
|
800
|
+
const preview = document.getElementById(toggle.dataset.target + '-p');
|
|
801
|
+
if (!target) return;
|
|
802
|
+
const collapsed = target.classList.toggle('hidden');
|
|
803
|
+
if (preview) preview.classList.toggle('hidden');
|
|
804
|
+
toggle.innerHTML = collapsed ? '▶' : '▼';
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
window.copyPath = (p) => {
|
|
808
|
+
navigator.clipboard.writeText(p).catch(() => {});
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
812
|
+
<\/script>
|
|
813
|
+
</body>
|
|
814
|
+
</html>`}function fd(e,t){const{importMap:r,tailwindCdn:s,externalResources:i=[]}=t,a=i.map(d=>d.endsWith(".css")?`<link rel="stylesheet" href="${d}">`:`<script src="${d}"><\/script>`).join(`
|
|
815
|
+
`),u=s?`<script src="${s}"><\/script>`:"";return`<!DOCTYPE html>
|
|
816
|
+
<html lang="en">
|
|
817
|
+
<head>
|
|
818
|
+
<meta charset="UTF-8">
|
|
819
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
820
|
+
${ps(r)}
|
|
821
|
+
${u}
|
|
822
|
+
${a}
|
|
823
|
+
${wt()}
|
|
824
|
+
<style>
|
|
825
|
+
* { box-sizing: border-box; }
|
|
826
|
+
body {
|
|
827
|
+
margin: 0;
|
|
828
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
829
|
+
-webkit-font-smoothing: antialiased;
|
|
830
|
+
}
|
|
831
|
+
#root { min-height: 100vh; }
|
|
832
|
+
</style>
|
|
833
|
+
</head>
|
|
834
|
+
<body>
|
|
835
|
+
<div id="root"></div>
|
|
836
|
+
<script type="module">
|
|
837
|
+
${hd(e)}
|
|
838
|
+
<\/script>
|
|
839
|
+
</body>
|
|
840
|
+
</html>`}function hd(e){return`
|
|
841
|
+
import React from 'react';
|
|
842
|
+
import { createRoot } from 'react-dom/client';
|
|
843
|
+
|
|
844
|
+
// Wait for Tailwind to be ready
|
|
845
|
+
function waitForTailwind(timeout = 3000) {
|
|
846
|
+
return new Promise((resolve) => {
|
|
847
|
+
if (typeof window.tailwind !== 'undefined') {
|
|
848
|
+
resolve();
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const start = Date.now();
|
|
852
|
+
const check = () => {
|
|
853
|
+
if (typeof window.tailwind !== 'undefined' || Date.now() - start > timeout) {
|
|
854
|
+
resolve();
|
|
855
|
+
} else {
|
|
856
|
+
requestAnimationFrame(check);
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
check();
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
async function main() {
|
|
864
|
+
try {
|
|
865
|
+
await waitForTailwind();
|
|
866
|
+
|
|
867
|
+
// Create a blob URL module from the transpiled code
|
|
868
|
+
const code = \`${e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}\`;
|
|
869
|
+
const blob = new Blob([code], { type: 'text/javascript' });
|
|
870
|
+
const url = URL.createObjectURL(blob);
|
|
871
|
+
|
|
872
|
+
const mod = await import(/* @vite-ignore */ url);
|
|
873
|
+
URL.revokeObjectURL(url);
|
|
874
|
+
|
|
875
|
+
const App = mod.default || mod.App;
|
|
876
|
+
if (!App) {
|
|
877
|
+
throw new Error('No default export found. Your component must use "export default".');
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
const root = createRoot(document.getElementById('root'));
|
|
881
|
+
root.render(React.createElement(App));
|
|
882
|
+
|
|
883
|
+
// Notify parent we're ready
|
|
884
|
+
window.parent.postMessage({ type: 'codeviz', action: 'ready' }, '*');
|
|
885
|
+
} catch (err) {
|
|
886
|
+
console.error(err);
|
|
887
|
+
// Show error in the preview
|
|
888
|
+
document.getElementById('root').innerHTML =
|
|
889
|
+
'<div style="padding:16px;color:#ef4444;font-family:monospace;white-space:pre-wrap;font-size:13px;">'
|
|
890
|
+
+ '<strong>Error</strong>\\n' + (err.message || err) + '</div>';
|
|
891
|
+
window.parent.postMessage({
|
|
892
|
+
type: 'codeviz',
|
|
893
|
+
action: 'error',
|
|
894
|
+
payload: { message: err.message || String(err), stack: err.stack }
|
|
895
|
+
}, '*');
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
main();
|
|
900
|
+
`}function wt(){return`<script>
|
|
901
|
+
// Capture unhandled errors
|
|
902
|
+
window.addEventListener('error', (e) => {
|
|
903
|
+
window.parent.postMessage({
|
|
904
|
+
type: 'codeviz',
|
|
905
|
+
action: 'error',
|
|
906
|
+
payload: { message: e.message, stack: e.error?.stack }
|
|
907
|
+
}, '*');
|
|
908
|
+
});
|
|
909
|
+
// Capture unhandled promise rejections
|
|
910
|
+
window.addEventListener('unhandledrejection', (e) => {
|
|
911
|
+
const msg = e.reason?.message || String(e.reason);
|
|
912
|
+
window.parent.postMessage({
|
|
913
|
+
type: 'codeviz',
|
|
914
|
+
action: 'error',
|
|
915
|
+
payload: { message: msg, stack: e.reason?.stack }
|
|
916
|
+
}, '*');
|
|
917
|
+
});
|
|
918
|
+
// Override console.error to capture runtime errors
|
|
919
|
+
const _origError = console.error;
|
|
920
|
+
console.error = function(...args) {
|
|
921
|
+
_origError.apply(console, args);
|
|
922
|
+
const msg = args.map(a => typeof a === 'string' ? a : JSON.stringify(a)).join(' ');
|
|
923
|
+
window.parent.postMessage({
|
|
924
|
+
type: 'codeviz',
|
|
925
|
+
action: 'console',
|
|
926
|
+
payload: { message: msg, level: 'error' }
|
|
927
|
+
}, '*');
|
|
928
|
+
};
|
|
929
|
+
<\/script>`}let md=0;function Hs(e,t,r){return{id:`preview-${++md}`,category:e,severity:"error",message:t,timestamp:new Date().toISOString(),...r}}const gi=I.memo(function({code:t,template:r,importMap:s,dependencies:i,cdnBase:a,tailwindCdn:u,externalResources:d,files:h,onError:f,onLoad:k,theme:w="dark",showLoader:C=!0,loader:R}){const q=I.useRef(null),[L,te]=I.useState(!0),Z=I.useRef(f),S=I.useRef(k);I.useEffect(()=>{Z.current=f,S.current=k},[f,k]);const N=I.useMemo(()=>us({cdnBase:a,dependencies:i,overrides:s}),[a,i,s]);I.useEffect(()=>{const j=ce=>{var H,pe,we,he,be,M,ee,ge;const V=ce.data;if((V==null?void 0:V.type)==="codeviz"){if(V.action==="ready")te(!1),(H=S.current)==null||H.call(S);else if(V.action==="error"){const X=((pe=V.payload)==null?void 0:pe.message)||"Unknown error";te(!1);const _e=X.includes("Failed to resolve")||X.includes("does not provide an export")?"import":"runtime";(M=Z.current)==null||M.call(Z,Hs(_e,X,{stack:(we=V.payload)==null?void 0:we.stack,line:(he=V.payload)==null?void 0:he.line,column:(be=V.payload)==null?void 0:be.column}))}else if(V.action==="console"&&((ee=V.payload)==null?void 0:ee.level)==="error"){const X=V.payload.message||"";!X.includes("Warning:")&&!X.includes("ReactDOM.render")&&((ge=Z.current)==null||ge.call(Z,Hs("console-error",X)))}}};return window.addEventListener("message",j),()=>window.removeEventListener("message",j)},[]);const v=I.useMemo(()=>{var ce;if(r==="html"||r==="markdown"||r==="mermaid"||r==="svg"||r==="csv"||r==="json")return xn({transpiledCode:t,template:r,importMap:N,tailwindCdn:u,externalResources:d});const j=Fn(t,{filename:r==="react"?"App.jsx":"App.tsx"});return j.error?((ce=Z.current)==null||ce.call(Z,j.error),xn({transpiledCode:gd(j.error),template:"html",importMap:N,tailwindCdn:!1})):xn({transpiledCode:j.code,template:r,importMap:N,tailwindCdn:u,externalResources:d})},[t,r,N,u,d]),O=I.useRef(v);I.useEffect(()=>{v!==O.current&&(te(!0),O.current=v)},[v]),I.useEffect(()=>{if(!L)return;const j=setTimeout(()=>te(!1),8e3);return()=>clearTimeout(j)},[L,v]);const U=w==="dark"?"#09090b":"#ffffff";return P.jsxs("div",{style:{..._r.container,backgroundColor:U},children:[C&&L&&P.jsx("div",{style:{..._r.overlay,backgroundColor:U},children:R||P.jsx(jr,{size:"lg",label:"Building preview..."})}),P.jsx("iframe",{ref:q,srcDoc:v,sandbox:"allow-scripts allow-modals allow-popups allow-same-origin",style:_r.iframe,title:"Preview"})]})});function gd(e){const t=[`<div style="padding:20px;color:#fca5a5;font-family:'SF Mono',Menlo,monospace;font-size:13px;line-height:1.6;background:#18181b;min-height:100vh;">`,'<div style="color:#ef4444;font-weight:600;font-size:14px;margin-bottom:8px;">Transpilation Error</div>',`<div style="color:#fca5a5;margin-bottom:12px;">${wr(e.message)}</div>`];if(e.line&&t.push(`<div style="color:#71717a;font-size:11px;margin-bottom:8px;">Line ${e.line}${e.column?`:${e.column}`:""}</div>`),e.sourceContext){t.push('<pre style="background:#0f0f0f;border-radius:8px;padding:12px;overflow-x:auto;font-size:12px;border:1px solid #27272a;">');for(const r of e.sourceContext.split(`
|
|
930
|
+
`)){const i=parseInt(r)===e.line;t.push(i?`<span style="color:#ef4444;background:rgba(239,68,68,0.1);display:block;padding:0 4px;">${wr(r)}</span>`:`<span style="color:#52525b;">${wr(r)}</span>`)}t.push("</pre>")}return t.push("</div>"),t.join(`
|
|
931
|
+
`)}function wr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const _r={container:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},overlay:{position:"absolute",inset:0,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},iframe:{width:"100%",height:"100%",border:"none",display:"block"}},Vs=768,ki=I.memo(function({view:t,onViewChange:r,onRefresh:s,errorCount:i,isLoading:a,theme:u,isFullscreen:d=!1,onFullscreenToggle:h,onDownload:f,onClose:k}){const w=u==="dark",[C,R]=I.useState(()=>typeof window<"u"?window.innerWidth>=Vs:!1);I.useEffect(()=>{const v=window.matchMedia(`(min-width: ${Vs}px)`),O=U=>R(U.matches);return O(v),v.addEventListener("change",O),()=>v.removeEventListener("change",O)},[]);const q=C||d;I.useEffect(()=>{t==="split"&&!q&&r("code")},[q,t,r]);const L=q?["code","split","preview"]:["code","preview"],te=I.useCallback(v=>{switch(v){case"code":return"⟨⟩ Code";case"split":return"⫿ Split";case"preview":return"▸ Preview"}},[]),Z={display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:5,border:"none",cursor:"pointer",backgroundColor:"transparent",color:w?"#71717a":"#a1a1aa",transition:"all 0.15s",padding:0},S=(v,O)=>{v.currentTarget.style.backgroundColor=O?w?"#27272a":"#e4e4e7":"transparent",v.currentTarget.style.color=O?w?"#d4d4d8":"#52525b":w?"#71717a":"#a1a1aa"},N=(v,O)=>{v.currentTarget.style.backgroundColor=O?"rgba(239,68,68,0.15)":"transparent",v.currentTarget.style.color=O?"#ef4444":w?"#71717a":"#a1a1aa"};return P.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",height:38,padding:"0 8px 0 12px",backgroundColor:w?"#18181b":"#fafafa",borderBottom:`1px solid ${w?"#27272a":"#e4e4e7"}`,flexShrink:0,userSelect:"none"},children:[P.jsx("div",{style:{display:"flex",alignItems:"center",gap:2,padding:2,borderRadius:6,backgroundColor:w?"#27272a":"#e4e4e7"},children:L.map(v=>P.jsx("button",{onClick:()=>r(v),style:{padding:"3px 10px",borderRadius:4,border:"none",cursor:"pointer",fontSize:11,fontWeight:500,fontFamily:"inherit",letterSpacing:.3,backgroundColor:t===v?w?"#3f3f46":"#ffffff":"transparent",color:t===v?w?"#fafafa":"#18181b":w?"#71717a":"#a1a1aa",boxShadow:t===v?"0 1px 2px rgba(0,0,0,0.1)":"none",transition:"all 0.15s"},children:te(v)},v))}),P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a&&P.jsx("div",{style:{width:6,height:6,borderRadius:"50%",backgroundColor:"#f59e0b",animation:"codevizPulse 1s infinite"}}),i>0&&P.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:10,backgroundColor:w?"rgba(239,68,68,0.15)":"rgba(239,68,68,0.1)",color:"#ef4444",fontSize:11,fontWeight:600},children:[P.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[P.jsx("circle",{cx:"6",cy:"6",r:"5",stroke:"currentColor",strokeWidth:"1.5"}),P.jsx("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),P.jsx("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})]}),i]})]}),P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[P.jsx("button",{onClick:s,title:"Refresh preview",style:Z,onMouseEnter:v=>S(v,!0),onMouseLeave:v=>S(v,!1),children:P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[P.jsx("path",{d:"M2 8a6 6 0 0 1 10.3-4.2M14 2v4h-4"}),P.jsx("path",{d:"M14 8a6 6 0 0 1-10.3 4.2M2 14v-4h4"})]})}),f&&P.jsx("button",{onClick:f,title:"Download",style:Z,onMouseEnter:v=>S(v,!0),onMouseLeave:v=>S(v,!1),children:P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("path",{d:"M8 2v8m0 0l-3-3m3 3l3-3"}),P.jsx("path",{d:"M2 12v1.5a.5.5 0 00.5.5h11a.5.5 0 00.5-.5V12"})]})}),h&&P.jsx("button",{onClick:h,title:d?"Exit fullscreen":"Fullscreen",style:Z,onMouseEnter:v=>S(v,!0),onMouseLeave:v=>S(v,!1),children:d?P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("polyline",{points:"4 14 4 10 0 10"}),P.jsx("polyline",{points:"12 2 12 6 16 6"}),P.jsx("line",{x1:"0",y1:"16",x2:"4",y2:"10"}),P.jsx("line",{x1:"16",y1:"0",x2:"12",y2:"6"})]}):P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("polyline",{points:"10 2 14 2 14 6"}),P.jsx("polyline",{points:"6 14 2 14 2 10"}),P.jsx("line",{x1:"14",y1:"2",x2:"10",y2:"6"}),P.jsx("line",{x1:"2",y1:"14",x2:"6",y2:"10"})]})}),k&&P.jsxs(P.Fragment,{children:[P.jsx("div",{style:{width:1,height:16,backgroundColor:w?"#27272a":"#e4e4e7",margin:"0 2px"}}),P.jsx("button",{onClick:k,title:"Close preview",style:Z,onMouseEnter:v=>N(v,!0),onMouseLeave:v=>N(v,!1),children:P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[P.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),P.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})})]})]})]})}),xi=I.memo(function({errors:t,isLoading:r,isStreaming:s,language:i,theme:a}){const u=a==="dark",d=t.filter(w=>w.severity==="error").length,h=t.filter(w=>w.severity==="warning").length;let f="Ready",k=u?"#71717a":"#a1a1aa";return s?(f="⟳ Streaming...",k="#818cf8"):r?(f="◌ Building...",k="#f59e0b"):d>0&&(f=`✕ ${d} error${d>1?"s":""}`,k="#ef4444"),P.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",height:24,padding:"0 10px",backgroundColor:u?"#18181b":"#f4f4f5",borderTop:`1px solid ${u?"#27272a":"#e4e4e7"}`,fontSize:11,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace',flexShrink:0,userSelect:"none"},children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[P.jsx("span",{style:{color:k,fontWeight:500},children:f}),h>0&&P.jsxs("span",{style:{color:"#f59e0b"},children:["⚠ ",h]})]}),P.jsx("div",{style:{display:"flex",alignItems:"center",gap:10},children:P.jsx("span",{style:{color:u?"#52525b":"#a1a1aa"},children:i.toUpperCase()})})]})}),pt=`// ── Available Dependencies (use any, unused ones are not loaded) ──
|
|
932
|
+
import { useState, useEffect, useRef, useMemo, useCallback, createContext, useContext } from 'react';
|
|
933
|
+
|
|
934
|
+
// Icons (1400+ available: Heart, Star, Settings, ChevronDown, etc.)
|
|
935
|
+
import { LayoutDashboard, Users, Settings, BarChart3, FileText, Bell, Search, ChevronDown, ChevronRight, ChevronLeft, LogOut, Menu, X, Plus, TrendingUp, TrendingDown, ArrowRight, ArrowUpRight, MoreHorizontal, Calendar, Check, AlertCircle, Star, Heart, Zap, Shield, Globe, Copy, Download, Upload, Trash2, Edit3, Eye, EyeOff, Filter, RefreshCw, ExternalLink, Mail, Phone, MapPin, Clock, Tag, Bookmark, Share2, MessageSquare, ThumbsUp, Flag, Archive, Inbox, Send, Paperclip, Image, Video, Mic, Camera, Wifi, Battery, Volume2, Sun, Moon, CloudRain, Thermometer, Activity, Coffee, Gift, ShoppingCart, CreditCard, DollarSign, Percent, PieChart, Target, Award, Briefcase, Home, Key, Lock, Unlock, User, UserPlus, UserCheck, UserX, AlertTriangle, Info, HelpCircle, CheckCircle, XCircle, Loader2, RotateCw, Maximize2, Minimize2, Columns, Grid, List, LayoutGrid, Layers, Box, Database, Server, Code, Terminal, GitBranch, Github } from 'lucide-react';
|
|
936
|
+
|
|
937
|
+
// Charts
|
|
938
|
+
import { LineChart, Line, BarChart, Bar, PieChart, Pie, Cell, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip as ChartTooltip, ResponsiveContainer, Legend } from 'recharts';
|
|
939
|
+
|
|
940
|
+
// Animation
|
|
941
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
942
|
+
|
|
943
|
+
// Dates
|
|
944
|
+
import { format, formatDistanceToNow, parseISO, differenceInDays, addDays, subDays, isAfter, isBefore, startOfWeek, endOfWeek, eachDayOfInterval } from 'date-fns';
|
|
945
|
+
|
|
946
|
+
// Forms + Validation
|
|
947
|
+
import { useForm } from 'react-hook-form';
|
|
948
|
+
import { z } from 'zod';
|
|
949
|
+
|
|
950
|
+
// Utilities
|
|
951
|
+
import { clsx } from 'clsx';
|
|
952
|
+
`,dt=`
|
|
953
|
+
// ── Shared UI utilities ──────────────────────────────────────────
|
|
954
|
+
function cn(...classes: (string | undefined | false)[]) {
|
|
955
|
+
return classes.filter(Boolean).join(' ');
|
|
956
|
+
}
|
|
957
|
+
`,at={blank:{id:"blank",name:"Blank",description:"Empty React component with all dependencies available",keywords:["blank","empty","simple","hello","basic","start"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
958
|
+
export default function App() {
|
|
959
|
+
return (
|
|
960
|
+
<div className="min-h-screen bg-white dark:bg-zinc-950 p-8">
|
|
961
|
+
<h1 className="text-2xl font-bold text-zinc-900">Hello World</h1>
|
|
962
|
+
<p className="text-zinc-500 mt-2">Start building — all dependencies are available.</p>
|
|
963
|
+
</div>
|
|
964
|
+
);
|
|
965
|
+
}`},dashboard:{id:"dashboard",name:"Dashboard",description:"Stats cards, charts (recharts), and activity feed",keywords:["dashboard","analytics","stats","metrics","chart","graph","kpi","overview","admin"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
966
|
+
const barData = [
|
|
967
|
+
{ name: 'Jan', value: 4000 }, { name: 'Feb', value: 3000 },
|
|
968
|
+
{ name: 'Mar', value: 5000 }, { name: 'Apr', value: 4500 },
|
|
969
|
+
{ name: 'May', value: 6000 }, { name: 'Jun', value: 5500 },
|
|
970
|
+
];
|
|
971
|
+
|
|
972
|
+
const lineData = [
|
|
973
|
+
{ name: 'Mon', value: 24 }, { name: 'Tue', value: 35 },
|
|
974
|
+
{ name: 'Wed', value: 28 }, { name: 'Thu', value: 42 },
|
|
975
|
+
{ name: 'Fri', value: 38 }, { name: 'Sat', value: 50 },
|
|
976
|
+
{ name: 'Sun', value: 45 },
|
|
977
|
+
];
|
|
978
|
+
|
|
979
|
+
function StatCard({ title, value, change, icon: Icon, positive }: any) {
|
|
980
|
+
return (
|
|
981
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-6">
|
|
982
|
+
<div className="flex items-center justify-between mb-4">
|
|
983
|
+
<span className="text-sm font-medium text-zinc-500">{title}</span>
|
|
984
|
+
<div className="p-2 bg-indigo-50 rounded-lg">
|
|
985
|
+
<Icon size={18} className="text-indigo-600" />
|
|
986
|
+
</div>
|
|
987
|
+
</div>
|
|
988
|
+
<div className="text-2xl font-bold text-zinc-900 mb-1">{value}</div>
|
|
989
|
+
<div className={cn('flex items-center gap-1 text-sm', positive ? 'text-emerald-600' : 'text-red-500')}>
|
|
990
|
+
{positive ? <TrendingUp size={14} /> : <TrendingDown size={14} />}
|
|
991
|
+
<span>{change}</span>
|
|
992
|
+
</div>
|
|
993
|
+
</div>
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
export default function App() {
|
|
998
|
+
return (
|
|
999
|
+
<div className="min-h-screen bg-zinc-50 p-6">
|
|
1000
|
+
<div className="max-w-7xl mx-auto space-y-6">
|
|
1001
|
+
<h1 className="text-2xl font-bold text-zinc-900">Dashboard</h1>
|
|
1002
|
+
|
|
1003
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
1004
|
+
<StatCard title="Revenue" value="$45,231" change="+12.5%" icon={DollarSign} positive />
|
|
1005
|
+
<StatCard title="Users" value="2,350" change="+8.2%" icon={Users} positive />
|
|
1006
|
+
<StatCard title="Orders" value="1,247" change="-3.1%" icon={ShoppingCart} positive={false} />
|
|
1007
|
+
<StatCard title="Conversion" value="3.24%" change="+0.4%" icon={Activity} positive />
|
|
1008
|
+
</div>
|
|
1009
|
+
|
|
1010
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
1011
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-6">
|
|
1012
|
+
<h2 className="text-lg font-semibold text-zinc-900 mb-4">Revenue</h2>
|
|
1013
|
+
<ResponsiveContainer width="100%" height={250}>
|
|
1014
|
+
<BarChart data={barData}>
|
|
1015
|
+
<CartesianGrid strokeDasharray="3 3" stroke="#f1f5f9" />
|
|
1016
|
+
<XAxis dataKey="name" tick={{ fill: '#64748b', fontSize: 12 }} />
|
|
1017
|
+
<YAxis tick={{ fill: '#64748b', fontSize: 12 }} />
|
|
1018
|
+
<ChartTooltip />
|
|
1019
|
+
<Bar dataKey="value" fill="#6366f1" radius={[6, 6, 0, 0]} />
|
|
1020
|
+
</BarChart>
|
|
1021
|
+
</ResponsiveContainer>
|
|
1022
|
+
</div>
|
|
1023
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-6">
|
|
1024
|
+
<h2 className="text-lg font-semibold text-zinc-900 mb-4">Weekly Traffic</h2>
|
|
1025
|
+
<ResponsiveContainer width="100%" height={250}>
|
|
1026
|
+
<LineChart data={lineData}>
|
|
1027
|
+
<CartesianGrid strokeDasharray="3 3" stroke="#f1f5f9" />
|
|
1028
|
+
<XAxis dataKey="name" tick={{ fill: '#64748b', fontSize: 12 }} />
|
|
1029
|
+
<YAxis tick={{ fill: '#64748b', fontSize: 12 }} />
|
|
1030
|
+
<ChartTooltip />
|
|
1031
|
+
<Line type="monotone" dataKey="value" stroke="#6366f1" strokeWidth={2} dot={{ r: 4 }} />
|
|
1032
|
+
</LineChart>
|
|
1033
|
+
</ResponsiveContainer>
|
|
1034
|
+
</div>
|
|
1035
|
+
</div>
|
|
1036
|
+
</div>
|
|
1037
|
+
</div>
|
|
1038
|
+
);
|
|
1039
|
+
}`},form:{id:"form",name:"Form",description:"Form with react-hook-form + zod validation, all input types",keywords:["form","input","validation","register","signup","login","contact","survey","questionnaire"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
1040
|
+
const schema = z.object({
|
|
1041
|
+
name: z.string().min(2, 'Name must be at least 2 characters'),
|
|
1042
|
+
email: z.string().email('Invalid email address'),
|
|
1043
|
+
role: z.enum(['developer', 'designer', 'manager', 'other']),
|
|
1044
|
+
bio: z.string().max(500).optional(),
|
|
1045
|
+
newsletter: z.boolean(),
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
type FormData = z.infer<typeof schema>;
|
|
1049
|
+
|
|
1050
|
+
function Field({ label, error, children }: { label: string; error?: string; children: React.ReactNode }) {
|
|
1051
|
+
return (
|
|
1052
|
+
<div>
|
|
1053
|
+
<label className="block text-sm font-medium text-zinc-700 mb-1">{label}</label>
|
|
1054
|
+
{children}
|
|
1055
|
+
{error && <p className="mt-1 text-sm text-red-500 flex items-center gap-1"><AlertCircle size={14} /> {error}</p>}
|
|
1056
|
+
</div>
|
|
1057
|
+
);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
export default function App() {
|
|
1061
|
+
const [submitted, setSubmitted] = useState<FormData | null>(null);
|
|
1062
|
+
const { register, handleSubmit, formState: { errors, isSubmitting } } = useForm<FormData>({
|
|
1063
|
+
defaultValues: { role: 'developer', newsletter: false },
|
|
1064
|
+
});
|
|
1065
|
+
|
|
1066
|
+
const onSubmit = async (data: FormData) => {
|
|
1067
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1068
|
+
setSubmitted(data);
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
if (submitted) {
|
|
1072
|
+
return (
|
|
1073
|
+
<div className="min-h-screen bg-zinc-50 flex items-center justify-center p-6">
|
|
1074
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-8 max-w-md w-full text-center">
|
|
1075
|
+
<div className="w-12 h-12 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
1076
|
+
<Check className="text-emerald-600" size={24} />
|
|
1077
|
+
</div>
|
|
1078
|
+
<h2 className="text-xl font-bold text-zinc-900 mb-2">Submitted!</h2>
|
|
1079
|
+
<pre className="text-left text-sm bg-zinc-50 rounded-lg p-4 mt-4 overflow-auto">{JSON.stringify(submitted, null, 2)}</pre>
|
|
1080
|
+
<button onClick={() => setSubmitted(null)} className="mt-4 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition">Reset</button>
|
|
1081
|
+
</div>
|
|
1082
|
+
</div>
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
return (
|
|
1087
|
+
<div className="min-h-screen bg-zinc-50 flex items-center justify-center p-6">
|
|
1088
|
+
<form onSubmit={handleSubmit(onSubmit)} className="bg-white rounded-xl border border-zinc-200 p-8 max-w-lg w-full space-y-5">
|
|
1089
|
+
<h2 className="text-xl font-bold text-zinc-900">Registration</h2>
|
|
1090
|
+
<Field label="Name" error={errors.name?.message}><input {...register('name')} className="w-full px-3 py-2 border border-zinc-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="John Doe" /></Field>
|
|
1091
|
+
<Field label="Email" error={errors.email?.message}><input {...register('email')} type="email" className="w-full px-3 py-2 border border-zinc-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="john@example.com" /></Field>
|
|
1092
|
+
<Field label="Role" error={errors.role?.message}>
|
|
1093
|
+
<select {...register('role')} className="w-full px-3 py-2 border border-zinc-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
|
1094
|
+
<option value="developer">Developer</option><option value="designer">Designer</option><option value="manager">Manager</option><option value="other">Other</option>
|
|
1095
|
+
</select>
|
|
1096
|
+
</Field>
|
|
1097
|
+
<Field label="Bio (optional)" error={errors.bio?.message}><textarea {...register('bio')} className="w-full px-3 py-2 border border-zinc-200 rounded-lg text-sm min-h-[80px] focus:outline-none focus:ring-2 focus:ring-indigo-500" /></Field>
|
|
1098
|
+
<label className="flex items-center gap-2 cursor-pointer"><input {...register('newsletter')} type="checkbox" className="w-4 h-4 rounded" /><span className="text-sm text-zinc-600">Subscribe to newsletter</span></label>
|
|
1099
|
+
<button type="submit" disabled={isSubmitting} className="w-full py-2.5 bg-indigo-600 text-white rounded-lg font-medium hover:bg-indigo-500 disabled:opacity-50 transition">{isSubmitting ? 'Submitting...' : 'Submit'}</button>
|
|
1100
|
+
</form>
|
|
1101
|
+
</div>
|
|
1102
|
+
);
|
|
1103
|
+
}`},table:{id:"table",name:"Data Table",description:"Sortable, filterable data table with search",keywords:["table","data","list","grid","sort","filter","search","rows","columns","spreadsheet"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
1104
|
+
type User = { id: number; name: string; email: string; role: string; status: 'active' | 'inactive'; joined: string };
|
|
1105
|
+
|
|
1106
|
+
const data: User[] = [
|
|
1107
|
+
{ id: 1, name: 'Alice Johnson', email: 'alice@example.com', role: 'Admin', status: 'active', joined: '2024-01-15' },
|
|
1108
|
+
{ id: 2, name: 'Bob Smith', email: 'bob@example.com', role: 'Editor', status: 'active', joined: '2024-02-20' },
|
|
1109
|
+
{ id: 3, name: 'Carol White', email: 'carol@example.com', role: 'Viewer', status: 'inactive', joined: '2024-03-10' },
|
|
1110
|
+
{ id: 4, name: 'Dave Brown', email: 'dave@example.com', role: 'Editor', status: 'active', joined: '2024-04-05' },
|
|
1111
|
+
{ id: 5, name: 'Eve Davis', email: 'eve@example.com', role: 'Admin', status: 'active', joined: '2024-05-12' },
|
|
1112
|
+
{ id: 6, name: 'Frank Miller', email: 'frank@example.com', role: 'Viewer', status: 'inactive', joined: '2024-06-18' },
|
|
1113
|
+
];
|
|
1114
|
+
|
|
1115
|
+
export default function App() {
|
|
1116
|
+
const [search, setSearch] = useState('');
|
|
1117
|
+
const [sortKey, setSortKey] = useState<keyof User>('name');
|
|
1118
|
+
const [sortAsc, setSortAsc] = useState(true);
|
|
1119
|
+
|
|
1120
|
+
const filtered = data
|
|
1121
|
+
.filter(u => u.name.toLowerCase().includes(search.toLowerCase()) || u.email.toLowerCase().includes(search.toLowerCase()))
|
|
1122
|
+
.sort((a, b) => {
|
|
1123
|
+
const av = a[sortKey], bv = b[sortKey];
|
|
1124
|
+
return sortAsc ? String(av).localeCompare(String(bv)) : String(bv).localeCompare(String(av));
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
const toggleSort = (key: keyof User) => {
|
|
1128
|
+
if (sortKey === key) setSortAsc(!sortAsc);
|
|
1129
|
+
else { setSortKey(key); setSortAsc(true); }
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
return (
|
|
1133
|
+
<div className="min-h-screen bg-zinc-50 p-6">
|
|
1134
|
+
<div className="max-w-5xl mx-auto">
|
|
1135
|
+
<div className="flex items-center justify-between mb-4">
|
|
1136
|
+
<h1 className="text-xl font-bold text-zinc-900">Users</h1>
|
|
1137
|
+
<div className="relative">
|
|
1138
|
+
<Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-zinc-400" />
|
|
1139
|
+
<input value={search} onChange={e => setSearch(e.target.value)} placeholder="Search..." className="pl-9 pr-4 py-2 border border-zinc-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" />
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
<div className="bg-white rounded-xl border border-zinc-200 overflow-hidden">
|
|
1143
|
+
<table className="w-full text-sm">
|
|
1144
|
+
<thead className="bg-zinc-50 border-b border-zinc-200">
|
|
1145
|
+
<tr>
|
|
1146
|
+
{(['name', 'email', 'role', 'status', 'joined'] as (keyof User)[]).map(k => (
|
|
1147
|
+
<th key={k} className="px-4 py-3 text-left font-medium text-zinc-500 cursor-pointer hover:text-zinc-900" onClick={() => toggleSort(k)}>
|
|
1148
|
+
<div className="flex items-center gap-1">{k.charAt(0).toUpperCase() + k.slice(1)} {sortKey === k && (sortAsc ? '↑' : '↓')}</div>
|
|
1149
|
+
</th>
|
|
1150
|
+
))}
|
|
1151
|
+
</tr>
|
|
1152
|
+
</thead>
|
|
1153
|
+
<tbody>
|
|
1154
|
+
{filtered.map(u => (
|
|
1155
|
+
<tr key={u.id} className="border-b border-zinc-50 hover:bg-zinc-50">
|
|
1156
|
+
<td className="px-4 py-3 font-medium text-zinc-900">{u.name}</td>
|
|
1157
|
+
<td className="px-4 py-3 text-zinc-600">{u.email}</td>
|
|
1158
|
+
<td className="px-4 py-3 text-zinc-600">{u.role}</td>
|
|
1159
|
+
<td className="px-4 py-3"><span className={cn('px-2 py-0.5 rounded-full text-xs font-medium', u.status === 'active' ? 'bg-emerald-100 text-emerald-700' : 'bg-zinc-100 text-zinc-500')}>{u.status}</span></td>
|
|
1160
|
+
<td className="px-4 py-3 text-zinc-500">{u.joined}</td>
|
|
1161
|
+
</tr>
|
|
1162
|
+
))}
|
|
1163
|
+
</tbody>
|
|
1164
|
+
</table>
|
|
1165
|
+
</div>
|
|
1166
|
+
</div>
|
|
1167
|
+
</div>
|
|
1168
|
+
);
|
|
1169
|
+
}`},app:{id:"app",name:"Multi-Page App",description:"Sidebar navigation, route switching, header, multiple pages",keywords:["app","application","multipage","sidebar","navigation","layout","shell","admin","panel","portal","crm","erp"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
1170
|
+
const pages: Record<string, { label: string; icon: any; component: () => JSX.Element }> = {
|
|
1171
|
+
dashboard: { label: 'Dashboard', icon: LayoutDashboard, component: DashboardPage },
|
|
1172
|
+
users: { label: 'Users', icon: Users, component: UsersPage },
|
|
1173
|
+
analytics: { label: 'Analytics', icon: BarChart3, component: AnalyticsPage },
|
|
1174
|
+
documents: { label: 'Documents', icon: FileText, component: DocumentsPage },
|
|
1175
|
+
settings: { label: 'Settings', icon: Settings, component: SettingsPage },
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
export default function App() {
|
|
1179
|
+
const [activePage, setActivePage] = useState('dashboard');
|
|
1180
|
+
const [sidebarOpen, setSidebarOpen] = useState(true);
|
|
1181
|
+
const ActivePage = pages[activePage]?.component ?? DashboardPage;
|
|
1182
|
+
|
|
1183
|
+
return (
|
|
1184
|
+
<div className="flex h-screen bg-zinc-50 overflow-hidden">
|
|
1185
|
+
{/* Sidebar */}
|
|
1186
|
+
<aside className={cn('flex flex-col bg-white border-r border-zinc-200 transition-all duration-200', sidebarOpen ? 'w-60' : 'w-16')}>
|
|
1187
|
+
<div className={cn('flex items-center h-14 px-4 border-b border-zinc-100', sidebarOpen ? 'justify-between' : 'justify-center')}>
|
|
1188
|
+
{sidebarOpen && <span className="text-base font-bold text-zinc-900">Acme Inc</span>}
|
|
1189
|
+
<button onClick={() => setSidebarOpen(!sidebarOpen)} className="p-1.5 rounded-lg hover:bg-zinc-100 text-zinc-500"><Menu size={16} /></button>
|
|
1190
|
+
</div>
|
|
1191
|
+
<nav className="flex-1 py-3 px-2 space-y-0.5 overflow-y-auto">
|
|
1192
|
+
{Object.entries(pages).map(([key, { label, icon: Icon }]) => {
|
|
1193
|
+
const active = activePage === key;
|
|
1194
|
+
return (
|
|
1195
|
+
<button key={key} onClick={() => setActivePage(key)} title={!sidebarOpen ? label : undefined}
|
|
1196
|
+
className={cn('w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm font-medium transition',
|
|
1197
|
+
active ? 'bg-indigo-50 text-indigo-700' : 'text-zinc-600 hover:bg-zinc-100',
|
|
1198
|
+
!sidebarOpen && 'justify-center')}>
|
|
1199
|
+
<Icon size={17} className={active ? 'text-indigo-600' : 'text-zinc-400'} />
|
|
1200
|
+
{sidebarOpen && <span>{label}</span>}
|
|
1201
|
+
</button>
|
|
1202
|
+
);
|
|
1203
|
+
})}
|
|
1204
|
+
</nav>
|
|
1205
|
+
{sidebarOpen && (
|
|
1206
|
+
<div className="p-2 border-t border-zinc-100">
|
|
1207
|
+
<div className="flex items-center gap-2.5 px-3 py-2 rounded-lg hover:bg-zinc-50 cursor-pointer">
|
|
1208
|
+
<div className="w-7 h-7 rounded-full bg-indigo-100 flex items-center justify-center text-xs font-bold text-indigo-600">JD</div>
|
|
1209
|
+
<div className="flex-1 min-w-0"><div className="text-sm font-medium text-zinc-900 truncate">John Doe</div><div className="text-xs text-zinc-400 truncate">john@acme.com</div></div>
|
|
1210
|
+
</div>
|
|
1211
|
+
</div>
|
|
1212
|
+
)}
|
|
1213
|
+
</aside>
|
|
1214
|
+
|
|
1215
|
+
{/* Main */}
|
|
1216
|
+
<div className="flex-1 flex flex-col min-w-0">
|
|
1217
|
+
<header className="h-14 bg-white border-b border-zinc-200 flex items-center justify-between px-6 flex-shrink-0">
|
|
1218
|
+
<h1 className="text-base font-semibold text-zinc-900">{pages[activePage]?.label}</h1>
|
|
1219
|
+
<div className="flex items-center gap-3">
|
|
1220
|
+
<div className="relative hidden sm:block"><Search size={15} className="absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400" /><input placeholder="Search..." className="pl-8 pr-3 py-1.5 bg-zinc-100 rounded-lg text-sm border-none focus:outline-none focus:ring-2 focus:ring-indigo-500 w-44" /></div>
|
|
1221
|
+
<button className="relative p-1.5 rounded-lg hover:bg-zinc-100"><Bell size={17} className="text-zinc-500" /><span className="absolute top-1 right-1 w-1.5 h-1.5 bg-red-500 rounded-full" /></button>
|
|
1222
|
+
</div>
|
|
1223
|
+
</header>
|
|
1224
|
+
<main className="flex-1 overflow-y-auto p-6"><ActivePage /></main>
|
|
1225
|
+
</div>
|
|
1226
|
+
</div>
|
|
1227
|
+
);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
function DashboardPage() {
|
|
1231
|
+
const stats = [
|
|
1232
|
+
{ label: 'Revenue', value: '$45,231', change: '+12.5%', icon: DollarSign, positive: true },
|
|
1233
|
+
{ label: 'Users', value: '2,350', change: '+8.2%', icon: Users, positive: true },
|
|
1234
|
+
{ label: 'Orders', value: '47', change: '-3.1%', icon: ShoppingCart, positive: false },
|
|
1235
|
+
{ label: 'Conversion', value: '3.24%', change: '+0.4%', icon: Activity, positive: true },
|
|
1236
|
+
];
|
|
1237
|
+
return (
|
|
1238
|
+
<div className="space-y-6 max-w-6xl">
|
|
1239
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
1240
|
+
{stats.map(s => (
|
|
1241
|
+
<div key={s.label} className="bg-white rounded-xl border border-zinc-200 p-5">
|
|
1242
|
+
<div className="flex items-center justify-between mb-3"><span className="text-sm text-zinc-500">{s.label}</span><div className="p-1.5 bg-indigo-50 rounded-lg"><s.icon size={16} className="text-indigo-600" /></div></div>
|
|
1243
|
+
<div className="text-2xl font-bold text-zinc-900">{s.value}</div>
|
|
1244
|
+
<div className={cn('text-sm mt-1 flex items-center gap-1', s.positive ? 'text-emerald-600' : 'text-red-500')}><TrendingUp size={13} /> {s.change}</div>
|
|
1245
|
+
</div>
|
|
1246
|
+
))}
|
|
1247
|
+
</div>
|
|
1248
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-6">
|
|
1249
|
+
<h3 className="font-semibold text-zinc-900 mb-4">Quick Actions</h3>
|
|
1250
|
+
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
|
1251
|
+
{['New Project', 'Add User', 'Create Report', 'View Logs'].map(a => (
|
|
1252
|
+
<button key={a} className="flex flex-col items-center gap-2 p-4 rounded-xl border border-zinc-100 hover:border-indigo-200 hover:bg-indigo-50/50 transition text-sm text-zinc-700"><Plus size={18} className="text-indigo-500" />{a}</button>
|
|
1253
|
+
))}
|
|
1254
|
+
</div>
|
|
1255
|
+
</div>
|
|
1256
|
+
</div>
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
function UsersPage() {
|
|
1261
|
+
const users = [
|
|
1262
|
+
{ name: 'Alice Johnson', email: 'alice@acme.com', role: 'Admin', status: 'Active', avatar: 'AJ' },
|
|
1263
|
+
{ name: 'Bob Smith', email: 'bob@acme.com', role: 'Editor', status: 'Active', avatar: 'BS' },
|
|
1264
|
+
{ name: 'Carol White', email: 'carol@acme.com', role: 'Viewer', status: 'Inactive', avatar: 'CW' },
|
|
1265
|
+
];
|
|
1266
|
+
return (
|
|
1267
|
+
<div className="max-w-4xl space-y-4">
|
|
1268
|
+
<div className="bg-white rounded-xl border border-zinc-200 overflow-hidden">
|
|
1269
|
+
<table className="w-full text-sm">
|
|
1270
|
+
<thead className="bg-zinc-50 border-b border-zinc-200"><tr><th className="px-4 py-3 text-left font-medium text-zinc-500">User</th><th className="px-4 py-3 text-left font-medium text-zinc-500">Role</th><th className="px-4 py-3 text-left font-medium text-zinc-500">Status</th></tr></thead>
|
|
1271
|
+
<tbody>{users.map(u => (
|
|
1272
|
+
<tr key={u.email} className="border-b border-zinc-50 hover:bg-zinc-50">
|
|
1273
|
+
<td className="px-4 py-3"><div className="flex items-center gap-3"><div className="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-xs font-bold text-indigo-600">{u.avatar}</div><div><div className="font-medium text-zinc-900">{u.name}</div><div className="text-zinc-500 text-xs">{u.email}</div></div></div></td>
|
|
1274
|
+
<td className="px-4 py-3 text-zinc-600">{u.role}</td>
|
|
1275
|
+
<td className="px-4 py-3"><span className={cn('px-2 py-0.5 rounded-full text-xs font-medium', u.status === 'Active' ? 'bg-emerald-100 text-emerald-700' : 'bg-zinc-100 text-zinc-500')}>{u.status}</span></td>
|
|
1276
|
+
</tr>
|
|
1277
|
+
))}</tbody>
|
|
1278
|
+
</table>
|
|
1279
|
+
</div>
|
|
1280
|
+
</div>
|
|
1281
|
+
);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
function AnalyticsPage() {
|
|
1285
|
+
return (
|
|
1286
|
+
<div className="max-w-4xl space-y-6">
|
|
1287
|
+
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
1288
|
+
{[{ label: 'Page Views', value: '124,892', change: '+14%' }, { label: 'Bounce Rate', value: '32.1%', change: '-2.3%' }, { label: 'Avg. Session', value: '4m 23s', change: '+18%' }].map(s => (
|
|
1289
|
+
<div key={s.label} className="bg-white rounded-xl border border-zinc-200 p-5">
|
|
1290
|
+
<div className="text-sm text-zinc-500">{s.label}</div>
|
|
1291
|
+
<div className="text-2xl font-bold text-zinc-900 mt-1">{s.value}</div>
|
|
1292
|
+
<div className="text-sm text-emerald-600 mt-1 flex items-center gap-1"><ArrowUpRight size={14} /> {s.change}</div>
|
|
1293
|
+
</div>
|
|
1294
|
+
))}
|
|
1295
|
+
</div>
|
|
1296
|
+
</div>
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
function DocumentsPage() {
|
|
1301
|
+
const docs = [
|
|
1302
|
+
{ name: 'Q4 Report.pdf', size: '2.4 MB', date: 'Dec 15', type: 'PDF' },
|
|
1303
|
+
{ name: 'Design System.fig', size: '18.1 MB', date: 'Dec 12', type: 'Figma' },
|
|
1304
|
+
{ name: 'API Docs.md', size: '340 KB', date: 'Dec 10', type: 'Markdown' },
|
|
1305
|
+
];
|
|
1306
|
+
return (
|
|
1307
|
+
<div className="max-w-4xl space-y-2">
|
|
1308
|
+
{docs.map(d => (
|
|
1309
|
+
<div key={d.name} className="bg-white rounded-xl border border-zinc-200 p-4 flex items-center justify-between hover:border-indigo-200 transition cursor-pointer">
|
|
1310
|
+
<div className="flex items-center gap-3"><div className="w-10 h-10 rounded-lg bg-indigo-50 flex items-center justify-center"><FileText size={18} className="text-indigo-500" /></div><div><div className="font-medium text-zinc-900 text-sm">{d.name}</div><div className="text-xs text-zinc-400">{d.size}</div></div></div>
|
|
1311
|
+
<div className="flex items-center gap-4"><span className="text-xs text-zinc-400">{d.date}</span><span className="px-2 py-0.5 rounded text-xs bg-zinc-100 text-zinc-500">{d.type}</span></div>
|
|
1312
|
+
</div>
|
|
1313
|
+
))}
|
|
1314
|
+
</div>
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
function SettingsPage() {
|
|
1319
|
+
return (
|
|
1320
|
+
<div className="max-w-2xl space-y-6">
|
|
1321
|
+
<div className="bg-white rounded-xl border border-zinc-200 p-6">
|
|
1322
|
+
<h3 className="font-semibold text-zinc-900 mb-4">Profile</h3>
|
|
1323
|
+
<div className="space-y-4">
|
|
1324
|
+
{[{ label: 'Name', value: 'John Doe' }, { label: 'Email', value: 'john@acme.com' }].map(f => (
|
|
1325
|
+
<div key={f.label}><label className="block text-sm font-medium text-zinc-600 mb-1">{f.label}</label><input defaultValue={f.value} className="w-full px-3 py-2 border border-zinc-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" /></div>
|
|
1326
|
+
))}
|
|
1327
|
+
</div>
|
|
1328
|
+
</div>
|
|
1329
|
+
<button className="px-6 py-2.5 bg-indigo-600 text-white text-sm font-medium rounded-lg hover:bg-indigo-500">Save Changes</button>
|
|
1330
|
+
</div>
|
|
1331
|
+
);
|
|
1332
|
+
}`},landing:{id:"landing",name:"Landing Page",description:"Marketing page with hero, features, pricing, CTA sections",keywords:["landing","marketing","website","hero","features","pricing","saas","product","homepage"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
1333
|
+
const features = [
|
|
1334
|
+
{ icon: Zap, title: 'Lightning Fast', desc: 'Sub-second load times with edge computing.' },
|
|
1335
|
+
{ icon: Shield, title: 'Enterprise Security', desc: 'SOC2 compliant with E2E encryption.' },
|
|
1336
|
+
{ icon: Globe, title: 'Global Scale', desc: 'Deploy to 30+ regions automatically.' },
|
|
1337
|
+
];
|
|
1338
|
+
|
|
1339
|
+
const plans = [
|
|
1340
|
+
{ name: 'Starter', price: '$0', features: ['5 projects', '1GB storage', 'Community support'], popular: false },
|
|
1341
|
+
{ name: 'Pro', price: '$29', features: ['Unlimited projects', '100GB storage', 'Priority support', 'Custom domains'], popular: true },
|
|
1342
|
+
{ name: 'Enterprise', price: 'Custom', features: ['Everything in Pro', 'SSO/SAML', 'Dedicated support', 'SLA guarantee'], popular: false },
|
|
1343
|
+
];
|
|
1344
|
+
|
|
1345
|
+
export default function App() {
|
|
1346
|
+
return (
|
|
1347
|
+
<div className="min-h-screen bg-white">
|
|
1348
|
+
{/* Hero */}
|
|
1349
|
+
<section className="bg-gradient-to-br from-indigo-600 via-purple-600 to-indigo-800 text-white">
|
|
1350
|
+
<div className="max-w-5xl mx-auto px-6 py-24 text-center">
|
|
1351
|
+
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-sm mb-6"><Star size={14} className="text-yellow-400 fill-yellow-400" /> Now in Public Beta</div>
|
|
1352
|
+
<h1 className="text-5xl font-extrabold tracking-tight mb-4">Build faster,<br/>ship with confidence</h1>
|
|
1353
|
+
<p className="text-lg text-indigo-100 max-w-2xl mx-auto mb-8">The modern platform for teams who want to move fast without breaking things.</p>
|
|
1354
|
+
<div className="flex gap-3 justify-center">
|
|
1355
|
+
<button className="px-6 py-3 bg-white text-indigo-700 font-semibold rounded-lg hover:bg-indigo-50 transition flex items-center gap-2">Get Started <ArrowRight size={18} /></button>
|
|
1356
|
+
<button className="px-6 py-3 border border-white/30 text-white font-medium rounded-lg hover:bg-white/10 transition">View Demo</button>
|
|
1357
|
+
</div>
|
|
1358
|
+
</div>
|
|
1359
|
+
</section>
|
|
1360
|
+
|
|
1361
|
+
{/* Features */}
|
|
1362
|
+
<section className="max-w-5xl mx-auto px-6 py-20">
|
|
1363
|
+
<h2 className="text-3xl font-bold text-center text-zinc-900 mb-12">Why teams choose us</h2>
|
|
1364
|
+
<div className="grid md:grid-cols-3 gap-8">
|
|
1365
|
+
{features.map(f => (
|
|
1366
|
+
<div key={f.title} className="text-center p-6">
|
|
1367
|
+
<div className="w-12 h-12 bg-indigo-100 rounded-xl flex items-center justify-center mx-auto mb-4"><f.icon size={24} className="text-indigo-600" /></div>
|
|
1368
|
+
<h3 className="text-lg font-semibold text-zinc-900 mb-2">{f.title}</h3>
|
|
1369
|
+
<p className="text-zinc-500 text-sm">{f.desc}</p>
|
|
1370
|
+
</div>
|
|
1371
|
+
))}
|
|
1372
|
+
</div>
|
|
1373
|
+
</section>
|
|
1374
|
+
|
|
1375
|
+
{/* Pricing */}
|
|
1376
|
+
<section className="bg-zinc-50 py-20">
|
|
1377
|
+
<div className="max-w-5xl mx-auto px-6">
|
|
1378
|
+
<h2 className="text-3xl font-bold text-center text-zinc-900 mb-12">Simple pricing</h2>
|
|
1379
|
+
<div className="grid md:grid-cols-3 gap-6">
|
|
1380
|
+
{plans.map(p => (
|
|
1381
|
+
<div key={p.name} className={cn('bg-white rounded-xl border p-6', p.popular ? 'border-indigo-600 ring-2 ring-indigo-600' : 'border-zinc-200')}>
|
|
1382
|
+
{p.popular && <span className="text-xs font-semibold text-indigo-600 uppercase">Most Popular</span>}
|
|
1383
|
+
<h3 className="text-lg font-semibold text-zinc-900 mt-2">{p.name}</h3>
|
|
1384
|
+
<div className="mt-2 mb-6"><span className="text-3xl font-bold text-zinc-900">{p.price}</span>{p.price !== 'Custom' && <span className="text-zinc-500 text-sm">/mo</span>}</div>
|
|
1385
|
+
<ul className="space-y-2 mb-6">{p.features.map(f => <li key={f} className="flex items-center gap-2 text-sm text-zinc-600"><CheckCircle size={16} className="text-emerald-500 flex-shrink-0" /> {f}</li>)}</ul>
|
|
1386
|
+
<button className={cn('w-full py-2.5 rounded-lg font-medium transition', p.popular ? 'bg-indigo-600 text-white hover:bg-indigo-500' : 'border border-zinc-200 text-zinc-700 hover:bg-zinc-50')}>{p.popular ? 'Start Free Trial' : 'Get Started'}</button>
|
|
1387
|
+
</div>
|
|
1388
|
+
))}
|
|
1389
|
+
</div>
|
|
1390
|
+
</div>
|
|
1391
|
+
</section>
|
|
1392
|
+
</div>
|
|
1393
|
+
);
|
|
1394
|
+
}`},kanban:{id:"kanban",name:"Kanban Board",description:"Drag-and-drop kanban board with columns and cards",keywords:["kanban","board","trello","task","project","sprint","agile","todo","drag","drop"],language:"tsx",type:"react-ts",code:`${pt}${dt}
|
|
1395
|
+
type Card = { id: string; title: string; tag: string; tagColor: string; assignee: string };
|
|
1396
|
+
type Column = { id: string; title: string; color: string; cards: Card[] };
|
|
1397
|
+
|
|
1398
|
+
const initialColumns: Column[] = [
|
|
1399
|
+
{ id: 'todo', title: 'To Do', color: '#64748b', cards: [
|
|
1400
|
+
{ id: '1', title: 'Design new landing page', tag: 'Design', tagColor: '#8b5cf6', assignee: 'AJ' },
|
|
1401
|
+
{ id: '2', title: 'Set up CI/CD pipeline', tag: 'DevOps', tagColor: '#f59e0b', assignee: 'BS' },
|
|
1402
|
+
]},
|
|
1403
|
+
{ id: 'progress', title: 'In Progress', color: '#3b82f6', cards: [
|
|
1404
|
+
{ id: '3', title: 'Implement auth flow', tag: 'Backend', tagColor: '#10b981', assignee: 'CW' },
|
|
1405
|
+
]},
|
|
1406
|
+
{ id: 'review', title: 'Review', color: '#f59e0b', cards: [
|
|
1407
|
+
{ id: '5', title: 'API rate limiting', tag: 'Backend', tagColor: '#10b981', assignee: 'DB' },
|
|
1408
|
+
]},
|
|
1409
|
+
{ id: 'done', title: 'Done', color: '#10b981', cards: [
|
|
1410
|
+
{ id: '6', title: 'User onboarding flow', tag: 'Design', tagColor: '#8b5cf6', assignee: 'CW' },
|
|
1411
|
+
]},
|
|
1412
|
+
];
|
|
1413
|
+
|
|
1414
|
+
export default function App() {
|
|
1415
|
+
const [columns, setColumns] = useState(initialColumns);
|
|
1416
|
+
const [dragging, setDragging] = useState<{ cardId: string; fromCol: string } | null>(null);
|
|
1417
|
+
|
|
1418
|
+
const handleDrop = (toCol: string) => {
|
|
1419
|
+
if (!dragging || dragging.fromCol === toCol) { setDragging(null); return; }
|
|
1420
|
+
setColumns(cols => {
|
|
1421
|
+
const from = cols.findIndex(c => c.id === dragging.fromCol);
|
|
1422
|
+
const to = cols.findIndex(c => c.id === toCol);
|
|
1423
|
+
const card = cols[from].cards.find(c => c.id === dragging.cardId);
|
|
1424
|
+
if (!card) return cols;
|
|
1425
|
+
const next = [...cols];
|
|
1426
|
+
next[from] = { ...next[from], cards: next[from].cards.filter(c => c.id !== dragging.cardId) };
|
|
1427
|
+
next[to] = { ...next[to], cards: [...next[to].cards, card] };
|
|
1428
|
+
return next;
|
|
1429
|
+
});
|
|
1430
|
+
setDragging(null);
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
return (
|
|
1434
|
+
<div className="min-h-screen bg-zinc-100 p-6">
|
|
1435
|
+
<h1 className="text-xl font-bold text-zinc-900 mb-6">Project Board</h1>
|
|
1436
|
+
<div className="flex gap-4 overflow-x-auto pb-4">
|
|
1437
|
+
{columns.map(col => (
|
|
1438
|
+
<div key={col.id} className="bg-zinc-200/50 rounded-xl p-3 min-w-[270px] w-[270px] flex-shrink-0" onDragOver={e => e.preventDefault()} onDrop={() => handleDrop(col.id)}>
|
|
1439
|
+
<div className="flex items-center gap-2 mb-3 px-1">
|
|
1440
|
+
<div className="w-2.5 h-2.5 rounded-full" style={{ backgroundColor: col.color }} />
|
|
1441
|
+
<span className="font-semibold text-sm text-zinc-700">{col.title}</span>
|
|
1442
|
+
<span className="text-xs text-zinc-400 bg-zinc-200 px-1.5 rounded">{col.cards.length}</span>
|
|
1443
|
+
</div>
|
|
1444
|
+
<div className="space-y-2">
|
|
1445
|
+
{col.cards.map(card => (
|
|
1446
|
+
<div key={card.id} draggable onDragStart={() => setDragging({ cardId: card.id, fromCol: col.id })}
|
|
1447
|
+
className="bg-white rounded-lg p-3 shadow-sm border border-zinc-100 cursor-grab active:cursor-grabbing hover:shadow-md transition">
|
|
1448
|
+
<span className="text-xs px-2 py-0.5 rounded-full text-white font-medium" style={{ backgroundColor: card.tagColor }}>{card.tag}</span>
|
|
1449
|
+
<h3 className="text-sm font-medium text-zinc-900 mt-2 mb-3">{card.title}</h3>
|
|
1450
|
+
<div className="w-6 h-6 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center text-[10px] font-bold">{card.assignee}</div>
|
|
1451
|
+
</div>
|
|
1452
|
+
))}
|
|
1453
|
+
</div>
|
|
1454
|
+
</div>
|
|
1455
|
+
))}
|
|
1456
|
+
</div>
|
|
1457
|
+
</div>
|
|
1458
|
+
);
|
|
1459
|
+
}`},html:{id:"html",name:"Static HTML",description:"Plain HTML + Tailwind CSS, no React",keywords:["html","static","plain","simple","css","tailwind","no-react"],language:"html",type:"html",code:`<div class="min-h-screen bg-zinc-50 flex items-center justify-center p-6">
|
|
1460
|
+
<div class="bg-white rounded-2xl shadow-lg p-8 max-w-md w-full text-center">
|
|
1461
|
+
<h1 class="text-3xl font-bold text-zinc-900 mb-2">Static HTML</h1>
|
|
1462
|
+
<p class="text-zinc-500 mb-6">Pure HTML + Tailwind CSS — no framework needed</p>
|
|
1463
|
+
<button onclick="this.textContent = 'Clicked!'; this.classList.add('bg-emerald-500')"
|
|
1464
|
+
class="px-6 py-2.5 bg-indigo-600 text-white rounded-lg font-medium hover:bg-indigo-500 transition">
|
|
1465
|
+
Click Me
|
|
1466
|
+
</button>
|
|
1467
|
+
</div>
|
|
1468
|
+
</div>`},markdown:{id:"markdown",name:"Markdown",description:"GitHub-flavored Markdown with Mermaid diagram support",keywords:["markdown","md","document","documentation","mermaid","diagram","flowchart","sequence","gantt","readme","notes","report","writeup"],language:"md",type:"markdown",code:`# Project Overview
|
|
1469
|
+
|
|
1470
|
+
## Architecture
|
|
1471
|
+
|
|
1472
|
+
\`\`\`mermaid
|
|
1473
|
+
graph TD
|
|
1474
|
+
A[Client] -->|HTTP| B[API Gateway]
|
|
1475
|
+
B --> C[Auth Service]
|
|
1476
|
+
B --> D[App Service]
|
|
1477
|
+
D --> E[(Database)]
|
|
1478
|
+
D --> F[Cache]
|
|
1479
|
+
C --> E
|
|
1480
|
+
\`\`\`
|
|
1481
|
+
|
|
1482
|
+
## Features
|
|
1483
|
+
|
|
1484
|
+
- **Real-time updates** — WebSocket-based live data
|
|
1485
|
+
- **Authentication** — JWT with refresh tokens
|
|
1486
|
+
- **Caching** — Redis for frequently accessed data
|
|
1487
|
+
|
|
1488
|
+
## API Endpoints
|
|
1489
|
+
|
|
1490
|
+
| Method | Endpoint | Description |
|
|
1491
|
+
|--------|----------|-------------|
|
|
1492
|
+
| GET | \`/api/users\` | List all users |
|
|
1493
|
+
| POST | \`/api/users\` | Create a user |
|
|
1494
|
+
| GET | \`/api/users/:id\` | Get user by ID |
|
|
1495
|
+
|
|
1496
|
+
## Sequence Diagram
|
|
1497
|
+
|
|
1498
|
+
\`\`\`mermaid
|
|
1499
|
+
sequenceDiagram
|
|
1500
|
+
participant U as User
|
|
1501
|
+
participant A as API
|
|
1502
|
+
participant DB as Database
|
|
1503
|
+
U->>A: POST /login
|
|
1504
|
+
A->>DB: Validate credentials
|
|
1505
|
+
DB-->>A: User record
|
|
1506
|
+
A-->>U: JWT token
|
|
1507
|
+
U->>A: GET /data (with JWT)
|
|
1508
|
+
A->>DB: Query data
|
|
1509
|
+
DB-->>A: Results
|
|
1510
|
+
A-->>U: JSON response
|
|
1511
|
+
\`\`\`
|
|
1512
|
+
|
|
1513
|
+
## Getting Started
|
|
1514
|
+
|
|
1515
|
+
\`\`\`bash
|
|
1516
|
+
npm install
|
|
1517
|
+
npm run dev
|
|
1518
|
+
\`\`\`
|
|
1519
|
+
|
|
1520
|
+
> **Note:** Make sure to set up your \`.env\` file before running.
|
|
1521
|
+
`},mermaid:{id:"mermaid",name:"Mermaid Diagram",description:"Standalone Mermaid diagram with zoom/pan (flowchart, sequence, class, gantt, etc.)",keywords:["mermaid","diagram","flowchart","sequence","class-diagram","gantt","er","state","pie","graph","architecture","flow","uml"],language:"mermaid",type:"mermaid",code:`graph TD
|
|
1522
|
+
A[User Request] -->|HTTP| B(API Gateway)
|
|
1523
|
+
B --> C{Auth Valid?}
|
|
1524
|
+
C -->|Yes| D[Route to Service]
|
|
1525
|
+
C -->|No| E[401 Unauthorized]
|
|
1526
|
+
D --> F[User Service]
|
|
1527
|
+
D --> G[Order Service]
|
|
1528
|
+
D --> H[Payment Service]
|
|
1529
|
+
F --> I[(Users DB)]
|
|
1530
|
+
G --> J[(Orders DB)]
|
|
1531
|
+
H --> K[Stripe API]
|
|
1532
|
+
G -->|Events| L[Message Queue]
|
|
1533
|
+
L --> M[Notification Service]
|
|
1534
|
+
M --> N[Email / Push]
|
|
1535
|
+
|
|
1536
|
+
style A fill:#818cf8,stroke:#6366f1,color:#fff
|
|
1537
|
+
style B fill:#34d399,stroke:#10b981,color:#fff
|
|
1538
|
+
style C fill:#fbbf24,stroke:#f59e0b,color:#000
|
|
1539
|
+
style E fill:#f87171,stroke:#ef4444,color:#fff
|
|
1540
|
+
`},svg:{id:"svg",name:"SVG Image",description:"SVG vector graphic with zoom/pan viewer",keywords:["svg","vector","image","icon","illustration","graphic","logo","drawing"],language:"svg",type:"svg",code:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300">
|
|
1541
|
+
<defs>
|
|
1542
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
1543
|
+
<stop offset="0%" style="stop-color:#818cf8"/>
|
|
1544
|
+
<stop offset="100%" style="stop-color:#6366f1"/>
|
|
1545
|
+
</linearGradient>
|
|
1546
|
+
<linearGradient id="accent" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
1547
|
+
<stop offset="0%" style="stop-color:#34d399"/>
|
|
1548
|
+
<stop offset="100%" style="stop-color:#10b981"/>
|
|
1549
|
+
</linearGradient>
|
|
1550
|
+
</defs>
|
|
1551
|
+
<rect width="400" height="300" rx="16" fill="url(#bg)"/>
|
|
1552
|
+
<circle cx="200" cy="130" r="50" fill="url(#accent)" opacity="0.9"/>
|
|
1553
|
+
<circle cx="140" cy="180" r="30" fill="#fbbf24" opacity="0.7"/>
|
|
1554
|
+
<circle cx="260" cy="180" r="30" fill="#f87171" opacity="0.7"/>
|
|
1555
|
+
<text x="200" y="260" text-anchor="middle" fill="white" font-family="sans-serif" font-size="18" font-weight="bold">SVG Preview</text>
|
|
1556
|
+
</svg>`},csv:{id:"csv",name:"CSV Table",description:"CSV data rendered as a styled, sortable table",keywords:["csv","table","data","spreadsheet","tabular","rows","columns","dataset"],language:"csv",type:"csv",code:`Name,Department,Role,Salary,Start Date,Status
|
|
1557
|
+
Alice Johnson,Engineering,Senior Engineer,145000,2021-03-15,Active
|
|
1558
|
+
Bob Smith,Design,Lead Designer,125000,2020-07-01,Active
|
|
1559
|
+
Carol Williams,Engineering,Staff Engineer,165000,2019-11-20,Active
|
|
1560
|
+
David Brown,Marketing,Marketing Manager,110000,2022-01-10,Active
|
|
1561
|
+
Eve Davis,Engineering,Junior Engineer,95000,2023-06-01,Active
|
|
1562
|
+
Frank Miller,Sales,Account Executive,105000,2021-09-15,On Leave
|
|
1563
|
+
Grace Wilson,Design,UX Researcher,115000,2022-04-20,Active
|
|
1564
|
+
Henry Taylor,Engineering,DevOps Engineer,140000,2020-02-28,Active
|
|
1565
|
+
Iris Anderson,Product,Product Manager,135000,2021-08-05,Active
|
|
1566
|
+
Jack Thomas,Engineering,Frontend Engineer,130000,2022-11-01,Active`},json:{id:"json",name:"JSON Viewer",description:"JSON data with collapsible tree view and syntax highlighting",keywords:["json","api","response","config","configuration","data","object","tree"],language:"json",type:"json",code:`{
|
|
1567
|
+
"project": "Ranger",
|
|
1568
|
+
"version": "2.0.0",
|
|
1569
|
+
"services": [
|
|
1570
|
+
{
|
|
1571
|
+
"name": "api-gateway",
|
|
1572
|
+
"port": 3080,
|
|
1573
|
+
"status": "healthy",
|
|
1574
|
+
"uptime": "14d 6h 32m",
|
|
1575
|
+
"metrics": {
|
|
1576
|
+
"requests_per_sec": 1250,
|
|
1577
|
+
"avg_latency_ms": 45,
|
|
1578
|
+
"error_rate": 0.002
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"name": "rag-api",
|
|
1583
|
+
"port": 8000,
|
|
1584
|
+
"status": "healthy",
|
|
1585
|
+
"uptime": "14d 6h 30m",
|
|
1586
|
+
"metrics": {
|
|
1587
|
+
"embeddings_per_sec": 85,
|
|
1588
|
+
"avg_latency_ms": 120,
|
|
1589
|
+
"error_rate": 0.001
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
"name": "code-executor",
|
|
1594
|
+
"port": 8088,
|
|
1595
|
+
"status": "degraded",
|
|
1596
|
+
"uptime": "2d 1h 15m",
|
|
1597
|
+
"metrics": {
|
|
1598
|
+
"executions_per_min": 30,
|
|
1599
|
+
"avg_latency_ms": 2500,
|
|
1600
|
+
"error_rate": 0.05
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
],
|
|
1604
|
+
"database": {
|
|
1605
|
+
"type": "MongoDB",
|
|
1606
|
+
"connections": 42,
|
|
1607
|
+
"collections": ["users", "conversations", "messages", "agents", "templates"]
|
|
1608
|
+
},
|
|
1609
|
+
"features": {
|
|
1610
|
+
"streaming": true,
|
|
1611
|
+
"multiModal": true,
|
|
1612
|
+
"codeExecution": true,
|
|
1613
|
+
"ragEnabled": true
|
|
1614
|
+
}
|
|
1615
|
+
}`}};function kd(e){return at[e]}function xd(){return Object.keys(at)}function bi(){return Object.values(at).map(e=>`- **${e.id}**: ${e.description} [keywords: ${e.keywords.join(", ")}]`).join(`
|
|
1616
|
+
`)}function bd(e){const t=e.toLowerCase();let r="blank",s=0;for(const[i,a]of Object.entries(at)){let u=0;for(const d of a.keywords)t.includes(d)&&(u+=d.length);u>s&&(s=u,r=i)}return r}const yd=`export default function App() {
|
|
1617
|
+
return (
|
|
1618
|
+
<div className="flex items-center justify-center min-h-screen bg-gradient-to-br from-indigo-500 to-purple-600">
|
|
1619
|
+
<div className="bg-white rounded-2xl shadow-xl p-8 max-w-md text-center">
|
|
1620
|
+
<h1 className="text-3xl font-bold text-gray-900 mb-2">Hello World</h1>
|
|
1621
|
+
<p className="text-gray-500">Edit the code to see live changes</p>
|
|
1622
|
+
</div>
|
|
1623
|
+
</div>
|
|
1624
|
+
);
|
|
1625
|
+
}`,vd=I.memo(I.forwardRef(function({code:t,language:r="tsx",template:s="react-ts",templateId:i,importMap:a,dependencies:u,cdnBase:d,externalResources:h,tailwindCdn:f,onChange:k,onError:w,onLoad:C,onClose:R,onFullscreenChange:q,showEditor:L=!0,showPreview:te=!0,defaultView:Z="split",editorOptions:S,className:N,height:v="100%",width:O="100%",theme:U="dark",readOnly:j=!1,showLoader:ce=!0,loader:V,showToolbar:H=!0,showStatusBar:pe=!0},we){const he=i?at[i]:null,be=(he==null?void 0:he.code)??t??yd,M=(he==null?void 0:he.language)??r,ee=(he==null?void 0:he.type)??s??_d(M),[ge,X]=I.useState(be),[_e,Ae]=I.useState([]),[J,ne]=I.useState(L?te?Z:"code":"preview"),[fe,Re]=I.useState(!0),[g,y]=I.useState(!1),[_,T]=I.useState(!1),E=I.useRef(null),$=I.useRef(null),B=I.useRef(0),[se,de]=I.useState(0),le=I.useRef(),[Ie,Se]=I.useState(be),oe=I.useRef(be),[Ee,ve]=I.useState(null),Be=I.useRef(null);I.useEffect(()=>{const Y=()=>{const Ce=document.fullscreenElement===$.current;T(Ce),q==null||q(Ce),Ce?ne(De=>(Be.current=De,te?"split":"code")):Be.current!=null&&(ne(Be.current),Be.current=null)};return document.addEventListener("fullscreenchange",Y),()=>document.removeEventListener("fullscreenchange",Y)},[q,te]);const tt=I.useCallback(()=>{const Y=$.current;Y&&(document.fullscreenElement===Y?document.exitFullscreen():Y.requestFullscreen())},[]),lt=I.useCallback(()=>{const Y=oe.current,{filename:Ce,content:De,mime:Ke}=wd(Y,ee,M),qe=new Blob([De],{type:Ke}),Tt=URL.createObjectURL(qe),Ze=document.createElement("a");Ze.href=Tt,Ze.download=Ce,document.body.appendChild(Ze),Ze.click(),document.body.removeChild(Ze),URL.revokeObjectURL(Tt)},[ee,M]),Lt=I.useCallback(Y=>{X(Y),oe.current=Y,k==null||k(Y),clearTimeout(le.current),le.current=setTimeout(()=>{Se(Y)},400)},[k]),jt=I.useCallback(Y=>{Ae(Ce=>Ce.some(De=>De.message===Y.message)?Ce:[...Ce.slice(-9),Y]),w==null||w(Y)},[w]),Ot=I.useCallback(()=>{Re(!1),Ae([]),C==null||C()},[C]);I.useImperativeHandle(we,()=>({getCode:()=>oe.current,setCode:Y=>{ve(ge),X(Y),Se(Y),oe.current=Y,Ae([]),E.current&&E.current.setValue(Y)},streamCode:Y=>{if(g||(ve(oe.current),y(!0)),oe.current=Y,X(Y),E.current){const Ce=E.current.getModel();Ce&&Ce.getValue()!==Y&&E.current.setValue(Y)}},commitCode:()=>{y(!1);const Y=oe.current;X(Y),Se(Y),Ae([])},editCode:(Y,Ce)=>{const De=oe.current,Ke=De.indexOf(Y);if(Ke===-1)return!1;Ee==null&&ve(De);const qe=De.slice(0,Ke)+Ce+De.slice(Ke+Y.length);return X(qe),Se(qe),oe.current=qe,E.current&&E.current.setValue(qe),k==null||k(qe),!0},refresh:()=>{B.current+=1,de(B.current),Ae([])},setView:Y=>ne(Y),getErrors:()=>_e,clearErrors:()=>Ae([]),isLoading:()=>fe})),I.useEffect(()=>{if(i&&at[i]){const Y=at[i];X(Y.code),Se(Y.code),oe.current=Y.code,ve(null)}},[i]);const ut=U==="dark",_t=J==="split"||J==="code",It=J==="split"||J==="preview",Mt={display:"flex",flexDirection:"column",width:_?"100vw":typeof O=="number"?`${O}px`:O,height:_?"100vh":typeof v=="number"?`${v}px`:v,overflow:"hidden",borderRadius:_?0:10,border:_?"none":`1px solid ${ut?"#27272a":"#e4e4e7"}`,backgroundColor:ut?"#09090b":"#ffffff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},Ft={display:"flex",flexDirection:"row",flex:1,minHeight:0,overflow:"hidden"},St={flex:1,minWidth:0,minHeight:0,overflow:"hidden"},$t={flexShrink:0,width:1,backgroundColor:ut?"#27272a":"#e4e4e7"},Bt=ee==="react-ts"?"react-ts":ee;return P.jsxs("div",{ref:$,className:N,style:Mt,children:[H&&P.jsx(ki,{view:J,onViewChange:ne,onRefresh:()=>{B.current+=1,de(B.current),Ae([])},errorCount:_e.filter(Y=>Y.severity==="error").length,isLoading:fe,theme:U,isFullscreen:_,onFullscreenToggle:tt,onDownload:lt,onClose:R}),P.jsxs("div",{style:Ft,children:[_t&&P.jsx("div",{style:St,children:P.jsx(eo,{code:ge,language:M,onChange:Lt,theme:U,readOnly:j||g,options:S,editorRef:E,baseCode:Ee})}),_t&&It&&P.jsx("div",{style:$t}),It&&P.jsx("div",{style:St,children:P.jsx(gi,{code:Ie,template:Bt,importMap:a,dependencies:u,cdnBase:d,tailwindCdn:f,externalResources:h,files:void 0,onError:jt,onLoad:Ot,theme:U,showLoader:ce,loader:V})},se)]}),pe&&P.jsx(xi,{errors:_e,isLoading:fe,isStreaming:g,language:M,theme:U})]})}));function wd(e,t,r){switch(t){case"html":return{filename:"preview.html",content:e,mime:"text/html"};case"markdown":return{filename:"document.md",content:e,mime:"text/markdown"};case"mermaid":return{filename:"diagram.mermaid",content:e,mime:"text/plain"};case"svg":return{filename:"image.svg",content:e,mime:"image/svg+xml"};case"csv":return{filename:"data.csv",content:e,mime:"text/csv"};case"json":return{filename:"data.json",content:e,mime:"application/json"};case"react":case"react-ts":{const s=Fn(e,{filename:t==="react"?"App.jsx":"App.tsx"});if(s.error)return{filename:`component.${r==="jsx"||r==="js"?"jsx":"tsx"}`,content:e,mime:"text/plain"};const i=us({}),a=s.code.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${");return{filename:"preview.html",content:`<!DOCTYPE html>
|
|
1626
|
+
<html lang="en">
|
|
1627
|
+
<head>
|
|
1628
|
+
<meta charset="UTF-8">
|
|
1629
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1630
|
+
<title>CodeViz Export</title>
|
|
1631
|
+
${ps(i)}
|
|
1632
|
+
<script src="https://cdn.tailwindcss.com/3.4.16?plugins=forms,typography"><\/script>
|
|
1633
|
+
<style>
|
|
1634
|
+
* { box-sizing: border-box; }
|
|
1635
|
+
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; }
|
|
1636
|
+
#root { min-height: 100vh; }
|
|
1637
|
+
</style>
|
|
1638
|
+
</head>
|
|
1639
|
+
<body>
|
|
1640
|
+
<div id="root"></div>
|
|
1641
|
+
<script type="module">
|
|
1642
|
+
import React from 'react';
|
|
1643
|
+
import { createRoot } from 'react-dom/client';
|
|
1644
|
+
const code = \`${a}\`;
|
|
1645
|
+
const blob = new Blob([code], { type: 'text/javascript' });
|
|
1646
|
+
const url = URL.createObjectURL(blob);
|
|
1647
|
+
const mod = await import(url);
|
|
1648
|
+
URL.revokeObjectURL(url);
|
|
1649
|
+
const App = mod.default || mod.App;
|
|
1650
|
+
createRoot(document.getElementById('root')).render(React.createElement(App));
|
|
1651
|
+
<\/script>
|
|
1652
|
+
</body>
|
|
1653
|
+
</html>`,mime:"text/html"}}default:return{filename:"file.txt",content:e,mime:"text/plain"}}}function _d(e){switch(e.toLowerCase().replace(/^\./,"")){case"html":case"htm":return"html";case"md":case"markdown":case"mdx":return"markdown";case"mermaid":case"mmd":return"mermaid";case"svg":return"svg";case"csv":case"tsv":return"csv";case"json":case"jsonl":return"json";case"jsx":case"js":case"javascript":return"react";case"tsx":case"ts":case"typescript":default:return"react-ts"}}const yi={"application/vnd.react":{description:"React TSX component (single file, default export)",extension:".tsx",template:"react-ts",example:"export default function App() { return <h1>Hello</h1>; }"},"text/html":{description:"Static HTML (rendered directly, Tailwind CSS available)",extension:".html",template:"html",example:'<div class="p-4"><h1 class="text-2xl font-bold">Hello</h1></div>'},"text/markdown":{description:"Markdown with Mermaid diagram support (GFM, rendered with github-markdown-css)",extension:".md",template:"markdown",example:`# Hello
|
|
1654
|
+
|
|
1655
|
+
Some text
|
|
1656
|
+
|
|
1657
|
+
\`\`\`mermaid
|
|
1658
|
+
graph TD
|
|
1659
|
+
A-->B
|
|
1660
|
+
\`\`\``},"application/vnd.mermaid":{description:"Standalone Mermaid diagram with zoom/pan viewer (flowchart, sequence, gantt, etc.)",extension:".mermaid",template:"mermaid",example:`graph TD
|
|
1661
|
+
A[Start] --> B{Decision}
|
|
1662
|
+
B -->|Yes| C[OK]
|
|
1663
|
+
B -->|No| D[End]`},"image/svg+xml":{description:"SVG image with zoom/pan viewer",extension:".svg",template:"svg",example:'<svg viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="#818cf8"/></svg>'},"text/csv":{description:"CSV data rendered as a styled, sortable table",extension:".csv",template:"csv",example:`Name,Age,City
|
|
1664
|
+
Alice,30,NYC
|
|
1665
|
+
Bob,25,LA`},"application/json":{description:"JSON data with collapsible tree view and syntax highlighting",extension:".json",template:"json",example:'{"users": [{"name": "Alice", "role": "admin"}]}'}};function Id(){return yi}function Sd(){return`## Artifact Preview (CodeViz)
|
|
1666
|
+
|
|
1667
|
+
You can create interactive React or HTML artifacts that render in a live preview.
|
|
1668
|
+
|
|
1669
|
+
### Renderable Types
|
|
1670
|
+
- **application/vnd.react** — Single-file React TSX component. Must have a default export.
|
|
1671
|
+
- **text/html** — Static HTML with Tailwind CSS. No React needed.
|
|
1672
|
+
- **text/markdown** — Markdown (GFM) with Mermaid diagram support. Use \`\`\`mermaid code blocks for diagrams.
|
|
1673
|
+
- **application/vnd.mermaid** — Standalone Mermaid diagram with zoom/pan controls. Raw mermaid syntax, no markdown wrapping.
|
|
1674
|
+
- **image/svg+xml** — SVG image with zoom/pan viewer.
|
|
1675
|
+
- **text/csv** — CSV data, rendered as styled sortable table.
|
|
1676
|
+
- **application/json** — JSON data with collapsible tree view.
|
|
1677
|
+
|
|
1678
|
+
### Rules
|
|
1679
|
+
1. **Always use a default export**: \`export default function App() { ... }\`
|
|
1680
|
+
2. **Single file only**: Everything goes in one file — components, types, data, styles.
|
|
1681
|
+
3. **Tailwind CSS**: Available via CDN. Use Tailwind classes for ALL styling. No CSS imports.
|
|
1682
|
+
4. **No local imports**: You cannot import from relative paths. All imports must be from packages listed below.
|
|
1683
|
+
5. **Pick a template**: Start from the closest matching template to save tokens. Edit the template body — don't rewrite imports.
|
|
1684
|
+
|
|
1685
|
+
### Available Templates
|
|
1686
|
+
${bi()}
|
|
1687
|
+
|
|
1688
|
+
### Template Selection
|
|
1689
|
+
Pick the template whose keywords best match the user's request. If unsure, use **blank**.
|
|
1690
|
+
|
|
1691
|
+
${mi()}
|
|
1692
|
+
|
|
1693
|
+
### Error Handling
|
|
1694
|
+
If you receive an error from the preview, fix it by:
|
|
1695
|
+
1. Check the line number in the error
|
|
1696
|
+
2. Look at the source context provided
|
|
1697
|
+
3. Fix the specific issue (missing closing tag, typo, wrong import, etc.)
|
|
1698
|
+
4. Do NOT regenerate the entire artifact — make a targeted edit`}exports.CodeViz=vd;exports.EditorPane=eo;exports.Loader=jr;exports.PreviewPane=gi;exports.RENDERABLE_TYPES=yi;exports.StatusBar=xi;exports.Toolbar=ki;exports.buildImportMap=us;exports.buildPreviewHtml=xn;exports.getAgentSystemPrompt=Sd;exports.getAvailablePackages=mi;exports.getRenderableTypes=Id;exports.getTemplate=kd;exports.getTemplateIds=xd;exports.getTemplateSummary=bi;exports.importMapToScript=ps;exports.pickTemplate=bd;exports.templates=at;exports.transpile=Fn;exports.transpileFiles=rd;
|
|
1699
|
+
//# sourceMappingURL=index.cjs.map
|