react-code-locator 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ Defaulting to 2020, but this will stop working in the future.`)),a.ecmaVersion=1
8
8
  `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},xe.readEscapedChar=function(t){var a=this.input.charCodeAt(++this.pos);switch(++this.pos,a){case 110:return`
9
9
  `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return o(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var c=this.pos-1;this.invalidStringToken(c,"Invalid escape sequence in template string")}default:if(a>=48&&a<=55){var p=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],v=parseInt(p,8);return v>255&&(p=p.slice(0,-1),v=parseInt(p,8)),this.pos+=p.length-1,a=this.input.charCodeAt(this.pos),(p!=="0"||a===56||a===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-p.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(v)}return ne(a)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(a)}},xe.readHexChar=function(t){var a=this.pos,c=this.readInt(16,t);return c===null&&this.invalidStringToken(a,"Bad character escape sequence"),c},xe.readWord1=function(){this.containsEsc=!1;for(var t="",a=!0,c=this.pos,p=this.options.ecmaVersion>=6;this.pos<this.input.length;){var v=this.fullCharCodeAtPos();if(_(v,p))this.pos+=v<=65535?1:2;else if(v===92){this.containsEsc=!0,t+=this.input.slice(c,this.pos);var T=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var O=this.readCodePoint();(a?F:_)(O,p)||this.invalidStringToken(T,"Invalid Unicode escape"),t+=o(O),c=this.pos}else break;a=!1}return t+this.input.slice(c,this.pos)},xe.readWord=function(){var t=this.readWord1(),a=d.name;return this.keywords.test(t)&&(a=z[t]),this.finishToken(a,t)};var fr="8.16.0";be.acorn={Parser:be,version:fr,defaultOptions:w,Position:y,SourceLocation:C,getLineInfo:A,Node:Ht,TokenType:k,tokTypes:d,keywordTypes:z,TokContext:We,tokContexts:Se,isIdentifierChar:_,isIdentifierStart:F,Token:mi,isNewLine:ne,lineBreak:re,lineBreakG:X,nonASCIIwhitespace:Z};function Po(t,a){return be.parse(t,a)}function Io(t,a,c){return be.parseExpressionAt(t,a,c)}function No(t,a){return be.tokenizer(t,a)}e.Node=Ht,e.Parser=be,e.Position=y,e.SourceLocation=C,e.TokContext=We,e.Token=mi,e.TokenType=k,e.defaultOptions=w,e.getLineInfo=A,e.isIdentifierChar=_,e.isIdentifierStart=F,e.isNewLine=ne,e.keywordTypes=z,e.lineBreak=re,e.lineBreakG=X,e.nonASCIIwhitespace=Z,e.parse=Po,e.parseExpressionAt=Io,e.tokContexts=Se,e.tokTypes=d,e.tokenizer=No,e.version=fr}))});var jn=rt((Wp,Rs)=>{"use strict";var hl=Vn(),ll=/^[\da-fA-F]+$/,pl=/^\d+$/,Fn=new WeakMap;function Bn(e){e=e.Parser.acorn||e;let i=Fn.get(e);if(!i){let s=e.tokTypes,n=e.TokContext,u=e.TokenType,l=new n("<tag",!1),m=new n("</tag",!1),g=new n("<tag>...</tag>",!0,!0),S={tc_oTag:l,tc_cTag:m,tc_expr:g},h={jsxName:new u("jsxName"),jsxText:new u("jsxText",{beforeExpr:!0}),jsxTagStart:new u("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new u("jsxTagEnd")};h.jsxTagStart.updateContext=function(){this.context.push(g),this.context.push(l),this.exprAllowed=!1},h.jsxTagEnd.updateContext=function(P){let E=this.context.pop();E===l&&P===s.slash||E===m?(this.context.pop(),this.exprAllowed=this.curContext()===g):this.exprAllowed=!0},i={tokContexts:S,tokTypes:h},Fn.set(e,i)}return i}function ri(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ri(e.object)+"."+ri(e.property)}Rs.exports=function(e){return e=e||{},function(i){return fl({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},i)}};Object.defineProperty(Rs.exports,"tokTypes",{get:function(){return Bn(Ls()).tokTypes},configurable:!0,enumerable:!0});function fl(e,i){let s=i.acorn||Ls(),n=Bn(s),u=s.tokTypes,l=n.tokTypes,m=s.tokContexts,g=n.tokContexts.tc_oTag,S=n.tokContexts.tc_cTag,h=n.tokContexts.tc_expr,P=s.isNewLine,E=s.isIdentifierStart,F=s.isIdentifierChar;return class extends i{static get acornJsx(){return n}jsx_readToken(){let _="",k=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let D=this.input.charCodeAt(this.pos);switch(D){case 60:case 123:return this.pos===this.start?D===60&&this.exprAllowed?(++this.pos,this.finishToken(l.jsxTagStart)):this.getTokenFromCode(D):(_+=this.input.slice(k,this.pos),this.finishToken(l.jsxText,_));case 38:_+=this.input.slice(k,this.pos),_+=this.jsx_readEntity(),k=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(D===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:P(D)?(_+=this.input.slice(k,this.pos),_+=this.jsx_readNewLine(!0),k=this.pos):++this.pos}}}jsx_readNewLine(_){let k=this.input.charCodeAt(this.pos),D;return++this.pos,k===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,D=_?`
10
10
  `:`\r
11
- `):D=String.fromCharCode(k),this.options.locations&&(++this.curLine,this.lineStart=this.pos),D}jsx_readString(_){let k="",D=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let R=this.input.charCodeAt(this.pos);if(R===_)break;R===38?(k+=this.input.slice(D,this.pos),k+=this.jsx_readEntity(),D=this.pos):P(R)?(k+=this.input.slice(D,this.pos),k+=this.jsx_readNewLine(!1),D=this.pos):++this.pos}return k+=this.input.slice(D,this.pos++),this.finishToken(u.string,k)}jsx_readEntity(){let _="",k=0,D,R=this.input[this.pos];R!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let H=++this.pos;for(;this.pos<this.input.length&&k++<10;){if(R=this.input[this.pos++],R===";"){_[0]==="#"?_[1]==="x"?(_=_.substr(2),ll.test(_)&&(D=String.fromCharCode(parseInt(_,16)))):(_=_.substr(1),pl.test(_)&&(D=String.fromCharCode(parseInt(_,10)))):D=hl[_];break}_+=R}return D||(this.pos=H,"&")}jsx_readWord(){let _,k=this.pos;do _=this.input.charCodeAt(++this.pos);while(F(_)||_===45);return this.finishToken(l.jsxName,this.input.slice(k,this.pos))}jsx_parseIdentifier(){let _=this.startNode();return this.type===l.jsxName?_.name=this.value:this.type.keyword?_.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(_,"JSXIdentifier")}jsx_parseNamespacedName(){let _=this.start,k=this.startLoc,D=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(u.colon))return D;var R=this.startNodeAt(_,k);return R.namespace=D,R.name=this.jsx_parseIdentifier(),this.finishNode(R,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===l.jsxTagEnd)return"";let _=this.start,k=this.startLoc,D=this.jsx_parseNamespacedName();for(this.type===u.dot&&D.type==="JSXNamespacedName"&&!e.allowNamespacedObjects&&this.unexpected();this.eat(u.dot);){let R=this.startNodeAt(_,k);R.object=D,R.property=this.jsx_parseIdentifier(),D=this.finishNode(R,"JSXMemberExpression")}return D}jsx_parseAttributeValue(){switch(this.type){case u.braceL:let _=this.jsx_parseExpressionContainer();return _.expression.type==="JSXEmptyExpression"&&this.raise(_.start,"JSX attributes must only be assigned a non-empty expression"),_;case l.jsxTagStart:case u.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let _=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(_,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let _=this.startNode();return this.next(),_.expression=this.type===u.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(u.braceR),this.finishNode(_,"JSXExpressionContainer")}jsx_parseAttribute(){let _=this.startNode();return this.eat(u.braceL)?(this.expect(u.ellipsis),_.argument=this.parseMaybeAssign(),this.expect(u.braceR),this.finishNode(_,"JSXSpreadAttribute")):(_.name=this.jsx_parseNamespacedName(),_.value=this.eat(u.eq)?this.jsx_parseAttributeValue():null,this.finishNode(_,"JSXAttribute"))}jsx_parseOpeningElementAt(_,k){let D=this.startNodeAt(_,k);D.attributes=[];let R=this.jsx_parseElementName();for(R&&(D.name=R);this.type!==u.slash&&this.type!==l.jsxTagEnd;)D.attributes.push(this.jsx_parseAttribute());return D.selfClosing=this.eat(u.slash),this.expect(l.jsxTagEnd),this.finishNode(D,R?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(_,k){let D=this.startNodeAt(_,k),R=this.jsx_parseElementName();return R&&(D.name=R),this.expect(l.jsxTagEnd),this.finishNode(D,R?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(_,k){let D=this.startNodeAt(_,k),R=[],H=this.jsx_parseOpeningElementAt(_,k),z=null;if(!H.selfClosing){e:for(;;)switch(this.type){case l.jsxTagStart:if(_=this.start,k=this.startLoc,this.next(),this.eat(u.slash)){z=this.jsx_parseClosingElementAt(_,k);break e}R.push(this.jsx_parseElementAt(_,k));break;case l.jsxText:R.push(this.parseExprAtom());break;case u.braceL:R.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}ri(z.name)!==ri(H.name)&&this.raise(z.start,"Expected corresponding JSX closing tag for <"+ri(H.name)+">")}let G=H.name?"Element":"Fragment";return D["opening"+G]=H,D["closing"+G]=z,D.children=R,this.type===u.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(D,"JSX"+G)}jsx_parseText(){let _=this.parseLiteral(this.value);return _.type="JSXText",_}jsx_parseElement(){let _=this.start,k=this.startLoc;return this.next(),this.jsx_parseElementAt(_,k)}parseExprAtom(_){return this.type===l.jsxText?this.jsx_parseText():this.type===l.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(_)}readToken(_){let k=this.curContext();if(k===h)return this.jsx_readToken();if(k===g||k===S){if(E(_))return this.jsx_readWord();if(_==62)return++this.pos,this.finishToken(l.jsxTagEnd);if((_===34||_===39)&&k==g)return this.jsx_readString(_)}return _===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(l.jsxTagStart)):super.readToken(_)}updateContext(_){if(this.type==u.braceL){var k=this.curContext();k==g?this.context.push(m.b_expr):k==h?this.context.push(m.b_tmpl):super.updateContext(_),this.exprAllowed=!0}else if(this.type===u.slash&&_===l.jsxTagStart)this.context.length-=2,this.context.push(S),this.exprAllowed=!1;else return super.updateContext(_)}}}});var ft="__componentSourceLoc",$t="$componentSourceLoc",mr="react-code-locator.jsxSourceRegistry";function Ji(e){return e.replace(/\\/g,"/")}function Bo(e){return e.replace(/\/+$/,"")}function xr(e){return Ji(e).split("/").filter(Boolean)}function jo(e,i){let s=xr(e),n=xr(i),u=0;for(;u<s.length&&u<n.length&&s[u]===n[u];)u+=1;let l=new Array(Math.max(0,s.length-u)).fill(".."),m=n.slice(u),g=[...l,...m];return g.length>0?g.join("/"):"."}function Uo(e){return e?Bo(Ji(e)):""}function yi(e){return e?e.match(/^(.*):\d+:\d+$/)?.[1]??null:null}function Ho(e,i){if(!e)return!1;let s=Uo(i),n=Ji(e);return s?n.startsWith(`${s}/`)||n===s?!0:!jo(s,n).startsWith("../"):!n.startsWith("../")&&!n.startsWith("/")&&!/^[A-Za-z]:\//.test(n)}function It(e,i){let s=yi(e);return Ho(s??void 0,i)}function qo(e,i){return i==="none"?!0:i==="alt"?e.altKey:i==="meta"?e.metaKey:i==="ctrl"?e.ctrlKey:e.shiftKey}function Wo(e){return Object.keys(e).find(i=>i.startsWith("__reactFiber$")||i.startsWith("__reactInternalInstance$"))}function $o(e){let i=e;for(;i;){let s=Wo(i);if(s)return i[s];i=i.parentElement}return null}function gi(e){if(!e)return null;if(typeof e=="function"){let n=e[ft];return typeof n=="string"?n:null}if(typeof e!="object")return null;let i=e,s=i[ft]??i.type?.[ft]??i.render?.[ft];return typeof s=="string"?s:null}function yr(e){if(e&&typeof e=="object"){let s=globalThis[Symbol.for(mr)];if(s instanceof WeakMap){let n=s.get(e);if(typeof n=="string")return n}}let i=e?.[$t];return typeof i=="string"?i:null}function Go(e){let i=e;for(;i;){let s=gi(i.type)??gi(i.elementType);if(s)return s;i=i.return??null}return null}function Ko(e){let i=e?._debugSource;return i?.fileName&&typeof i.lineNumber=="number"?`${i.fileName.replace(/\\/g,"/")}:${i.lineNumber}:${i.columnNumber??1}`:null}function gr(e,i){if(!i||!e)return e;let s=e.match(/^(.*):(\d+):(\d+)$/);if(!s)return e;let[,n,u,l]=s,m=n.replace(/\\/g,"/"),g=i.replace(/\\/g,"/").replace(/\/$/,"");return m.startsWith(g+"/")?`${m.slice(g.length+1)}:${u}:${l}`:e}function zo(e,i){let s=e,n=[],u=[];for(;s;){let F=yr(s.pendingProps)??yr(s.memoizedProps)??Ko(s),_=gr(F??"",i)||F;if(_){let R=yi(_);R&&!n.some(H=>H.source===_)&&n.push({source:_,file:R})}let k=gi(s.type)??gi(s.elementType),D=gr(k??"",i)||k;if(D){let R=yi(D);R&&!u.some(H=>H.source===D)&&u.push({source:D,file:R})}s=s.return??null}let l=n[0]?.source??null,m=u.find(F=>It(F.source))?.file,g=null;if(m){let F=n.find(_=>_.file===m);if(F)g=F.source;else{let _=u.find(k=>k.file===m);_&&(g=_.source)}}let S=u.find(F=>!It(F.source))?.source??null,h=n.find(F=>!It(F.source))?.source??null,P=n.find(F=>It(F.source))?.source??null,E=g??P??u.find(F=>It(F.source))?.source??null;return{direct:l??E,screen:E,implementation:S??h??E}}function Xo(e){return e==="direct"?"Direct JSX":e==="screen"?"Screen source":"Implementation source"}function Jo(e){if(typeof document>"u")return null;let i=document.createElement("div"),s=null,n="screen",u=null;i.setAttribute("data-react-code-locator","true"),Object.assign(i.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"2147483647",padding:"8px 10px",borderRadius:"8px",background:"rgba(17, 24, 39, 0.92)",color:"#fff",fontSize:"12px",lineHeight:"1.4",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",boxShadow:"0 8px 30px rgba(0, 0, 0, 0.25)",pointerEvents:"auto",cursor:"pointer",maxWidth:"min(70vw, 720px)",wordBreak:"break-all",opacity:"0",transition:"opacity 120ms ease"});let l=(g,S)=>{i.textContent=g,i.style.background=S==="success"?"rgba(6, 95, 70, 0.92)":S==="error"?"rgba(153, 27, 27, 0.94)":"rgba(17, 24, 39, 0.92)",i.style.opacity="1",i.style.pointerEvents="auto",u&&clearTimeout(u),u=setTimeout(()=>{i.style.opacity="0",i.style.pointerEvents="none"},2e3)};i.addEventListener("click",async()=>{if(s)try{await navigator.clipboard.writeText(s),l("[react-code-locator] copied","success")}catch{l("[react-code-locator] copy failed","error")}}),l(`[react-code-locator] enabled (${e}+click, alt+1/2/3 to switch mode)`,"idle");let m=()=>{!i.isConnected&&document.body&&document.body.appendChild(i)};return document.body?m():document.addEventListener("DOMContentLoaded",m,{once:!0}),{setStatus(g,S="idle"){l(g,S)},setCopyValue(g){s=g},setMode(g){n=g,l(`[react-code-locator] ${Xo(g)}`,"idle")},remove(){u&&clearTimeout(u),i.remove()}}}function vr(e,i="screen",s){let n=e instanceof Element?e:e instanceof Node?e.parentElement:null,u=$o(n);if(!u)return null;let l=zo(u,s),m=l[i]??l.screen??l.direct??l.implementation;if(m)return{source:m,mode:i};let g=Go(u);return g?{source:g,mode:i}:null}function Qo(e={}){if(process.env.NODE_ENV!=="development")return;let i=Jo(e.triggerKey??"shift"),s="screen",{triggerKey:n="shift",projectRoot:u,onLocate:l=h=>{console.log(`[react-code-locator] ${h.source}`),i?.setCopyValue(h.source),i?.setStatus(`[react-code-locator] ${h.source}`,"success")},onError:m=h=>{console.error("[react-code-locator]",h);let P=h instanceof Error?h.message:String(h);i?.setCopyValue(null),i?.setStatus(`[react-code-locator] ${P}`,"error")}}=e;console.log("[react-code-locator] enabled",{triggerKey:n});let g=h=>{if(h.altKey){if(h.code==="Digit1"){s="direct",i?.setMode(s),h.preventDefault();return}if(h.code==="Digit2"){s="screen",i?.setMode(s),h.preventDefault();return}h.code==="Digit3"&&(s="implementation",i?.setMode(s),h.preventDefault())}},S=h=>{if(console.log("[react-code-locator] click",{triggerKey:n,shiftKey:h.shiftKey,altKey:h.altKey,ctrlKey:h.ctrlKey,metaKey:h.metaKey,target:h.target}),!qo(h,n))return;let P=vr(h.target,s,u);if(!P){m(new Error("No React component source metadata found for clicked element."));return}h.preventDefault(),h.stopPropagation(),l(P)};return document.addEventListener("click",S,!0),document.addEventListener("keydown",g,!0),()=>{document.removeEventListener("click",S,!0),document.removeEventListener("keydown",g,!0),i?.remove()}}var Gr=dr(Hr(),1);import{resolve as wu}from"path";function Ge(e){return e=e||[],Array.isArray(e)?e:[e]}var Tu=/\\/g;function Si(e){return e.replace(Tu,"/")}var Pu=/^(?:\/|(?:[A-Z]:)?[/\\|])/i;function Iu(e){return Pu.test(e)}function Nu(e,i){return e.startsWith("**")||Iu(e)?Si(e):Si(wu(i,e))}function qr(e){if(e instanceof RegExp)return s=>{let n=Si(s),u=e.test(n);return e.lastIndex=0,u};let i=(0,Gr.default)(Nu(e,process.cwd()),{dot:!0});return s=>i(Si(s))}function Wr(e){return e instanceof RegExp?i=>{let s=e.test(i);return e.lastIndex=0,s}:i=>i.includes(e)}function Kr(e,i){if(!(!e&&!i))return s=>e?.some(n=>n(s))?!1:i?.some(n=>n(s))?!0:!(i&&i.length>0)}function zr(e){return typeof e=="string"||e instanceof RegExp?{include:[e]}:Array.isArray(e)?{include:e}:{exclude:e.exclude?Ge(e.exclude):void 0,include:e.include?Ge(e.include):void 0}}function Xr(e){if(!e)return;let{exclude:i,include:s}=zr(e),n=i?.map(qr),u=s?.map(qr);return Kr(n,u)}function Lu(e){if(!e)return;let{exclude:i,include:s}=zr(e),n=i?.map(Wr),u=s?.map(Wr);return Kr(n,u)}function Ru(e){let i=Xr(e);return i?s=>!!i(s):void 0}function Ou(e,i){if(!e&&!i)return;let s=Xr(e),n=Lu(i);return(u,l)=>{let m=!0;return s&&(m&&=s(u)),m?(n&&(m&&=n(l)),m):!1}}function we(e,i){let s,n;if(typeof i=="function")s=i;else{s=i.handler;let u=i.filter;e==="resolveId"||e==="load"?n=Ru(u?.id):n=Ou(u?.id,u?.code)}return{handler:s,filter:n||(()=>!0)}}var $r;function dt(e,i={}){if(!$r)throw new Error("Parse implementation is not set. Please call setParseImpl first.");return $r(e,i)}import{isAbsolute as Mu,normalize as Vu}from"path";function ns(e,i,s){if(e.resource==null)return[];let n=Lt(e.resource+(e.resourceQuery||""));if(i.transformInclude&&!i.transformInclude(n))return[];let{filter:u}=we("load",i.transform);return u(n)?[{loader:s,options:{plugin:i},ident:i.name}]:[]}function Lt(e){return Mu(e)?Vu(e):e}import{resolve as Du}from"path";import{Buffer as Fu}from"buffer";function Ci(e,i,s,n){return{getNativeBuildContext(){return{framework:"rspack",compiler:e,compilation:i,loaderContext:s,inputSourceMap:n}},addWatchFile(u){let l=Du(process.cwd(),u);i.fileDependencies.add(l),s?.addDependency(l)},getWatchFiles(){return Array.from(i.fileDependencies)},parse:dt,emitFile(u){let l=u.fileName||u.name;if(u.source&&l){let{sources:m}=i.compiler.webpack;i.emitAsset(l,new m.RawSource(typeof u.source=="string"?u.source:Fu.from(u.source)))}}}}function Jr(e){let i=new Error(typeof e=="string"?e:e.message);return typeof e=="object"&&(i.stack=e.stack,i.cause=e.meta),i}import{basename as Bu,dirname as ju,resolve as Uu}from"path";import Xt from"fs";function Qr(e,i){return Uu(i.__virtualModulePrefix,encodeURIComponent(e))}function Yr(e,i){return decodeURIComponent(Bu(e))}function os(e,i){return ju(e)===i.__virtualModulePrefix}var Zr=class at{name="FakeVirtualModulesPlugin";static counters=new Map;static initCleanup=!1;constructor(i){this.plugin=i,at.initCleanup||(at.initCleanup=!0,process.once("exit",()=>{at.counters.forEach((s,n)=>{Xt.rmSync(n,{recursive:!0,force:!0})})}))}apply(i){let s=this.plugin.__virtualModulePrefix;Xt.existsSync(s)||Xt.mkdirSync(s,{recursive:!0});let n=at.counters.get(s)??0;at.counters.set(s,n+1),i.hooks.shutdown.tap(this.name,()=>{let u=(at.counters.get(s)??1)-1;u===0?(at.counters.delete(s),Xt.rmSync(s,{recursive:!0,force:!0})):at.counters.set(s,u)})}async writeModule(i){return Xt.promises.writeFile(i,"")}};import{createRequire as Hu}from"module";import{resolve as qu}from"path";import{Buffer as Wu}from"buffer";import $u from"process";function us(e){return{addWatchFile(i){(e.fileDependencies??e.compilationDependencies).add(i)},getWatchFiles(){return Array.from(e.fileDependencies??e.compilationDependencies)}}}var Gu=Hu(import.meta.url);function Ku(e){return new(Gu("webpack")).sources.RawSource(typeof e=="string"?e:Wu.from(e.buffer))}function _i(e,i,s,n,u){return{parse:dt,addWatchFile(l){e.addWatchFile(qu($u.cwd(),l))},emitFile(l){let m=l.fileName||l.name;if(l.source&&m){if(!s)throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");s.emitAsset(m,Ku(l.source))}},getWatchFiles(){return e.getWatchFiles()},getNativeBuildContext(){return{framework:"webpack",compiler:i,compilation:s,loaderContext:n,inputSourceMap:u}}}}function ea(e){let i=new Error(typeof e=="string"?e:e.message);return typeof e=="object"&&(i.stack=e.stack,i.cause=e.meta),i}import{createRequire as jc}from"module";import Be,{extname as Uc,isAbsolute as La,resolve as Ot}from"path";import nt from"fs";import{Buffer as qa}from"buffer";var aa=44,zu=59,ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",na=new Uint8Array(64),oa=new Uint8Array(128);for(let e=0;e<ta.length;e++){let i=ta.charCodeAt(e);na[e]=i,oa[i]=e}function Jt(e,i){let s=0,n=0,u=0;do{let m=e.next();u=oa[m],s|=(u&31)<<n,n+=5}while(u&32);let l=s&1;return s>>>=1,l&&(s=-2147483648|-s),i+s}function Qt(e,i,s){let n=i-s;n=n<0?-n<<1|1:n<<1;do{let u=n&31;n>>>=5,n>0&&(u|=32),e.write(na[u])}while(n>0);return i}function ia(e,i){return e.pos>=i?!1:e.peek()!==aa}var sa=1024*16,ra=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let i="";for(let s=0;s<e.length;s++)i+=String.fromCharCode(e[s]);return i}},Xu=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(sa)}write(e){let{buffer:i}=this;i[this.pos++]=e,this.pos===sa&&(this.out+=ra.decode(i),this.pos=0)}flush(){let{buffer:e,out:i,pos:s}=this;return s>0?i+ra.decode(e.subarray(0,s)):i}},Ju=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:i,pos:s}=this,n=i.indexOf(e,s);return n===-1?i.length:n}};function ua(e){let{length:i}=e,s=new Ju(e),n=[],u=0,l=0,m=0,g=0,S=0;do{let h=s.indexOf(";"),P=[],E=!0,F=0;for(u=0;s.pos<h;){let _;u=Jt(s,u),u<F&&(E=!1),F=u,ia(s,h)?(l=Jt(s,l),m=Jt(s,m),g=Jt(s,g),ia(s,h)?(S=Jt(s,S),_=[u,l,m,g,S]):_=[u,l,m,g]):_=[u],P.push(_),s.pos++}E||Qu(P),n.push(P),s.pos=h+1}while(s.pos<=i);return n}function Qu(e){e.sort(Yu)}function Yu(e,i){return e[0]-i[0]}function cs(e){let i=new Xu,s=0,n=0,u=0,l=0;for(let m=0;m<e.length;m++){let g=e[m];if(m>0&&i.write(zu),g.length===0)continue;let S=0;for(let h=0;h<g.length;h++){let P=g[h];h>0&&i.write(aa),S=Qt(i,P[0],S),P.length!==1&&(s=Qt(i,P[1],s),n=Qt(i,P[2],n),u=Qt(i,P[3],u),P.length!==4&&(l=Qt(i,P[4],l)))}}return i.flush()}var Zu=/^[\w+.-]+:\/\//,ec=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,tc=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function ic(e){return Zu.test(e)}function sc(e){return e.startsWith("//")}function la(e){return e.startsWith("/")}function rc(e){return e.startsWith("file:")}function ca(e){return/^[.?#]/.test(e)}function Ai(e){let i=ec.exec(e);return pa(i[1],i[2]||"",i[3],i[4]||"",i[5]||"/",i[6]||"",i[7]||"")}function ac(e){let i=tc.exec(e),s=i[2];return pa("file:","",i[1]||"","",la(s)?s:"/"+s,i[3]||"",i[4]||"")}function pa(e,i,s,n,u,l,m){return{scheme:e,user:i,host:s,port:n,path:u,query:l,hash:m,type:7}}function ha(e){if(sc(e)){let s=Ai("http:"+e);return s.scheme="",s.type=6,s}if(la(e)){let s=Ai("http://foo.com"+e);return s.scheme="",s.host="",s.type=5,s}if(rc(e))return ac(e);if(ic(e))return Ai(e);let i=Ai("http://foo.com/"+e);return i.scheme="",i.host="",i.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,i}function nc(e){if(e.endsWith("/.."))return e;let i=e.lastIndexOf("/");return e.slice(0,i+1)}function oc(e,i){fa(i,i.type),e.path==="/"?e.path=i.path:e.path=nc(i.path)+e.path}function fa(e,i){let s=i<=4,n=e.path.split("/"),u=1,l=0,m=!1;for(let S=1;S<n.length;S++){let h=n[S];if(!h){m=!0;continue}if(m=!1,h!=="."){if(h===".."){l?(m=!0,l--,u--):s&&(n[u++]=h);continue}n[u++]=h,l++}}let g="";for(let S=1;S<u;S++)g+="/"+n[S];(!g||m&&!g.endsWith("/.."))&&(g+="/"),e.path=g}function da(e,i){if(!e&&!i)return"";let s=ha(e),n=s.type;if(i&&n!==7){let l=ha(i),m=l.type;switch(n){case 1:s.hash=l.hash;case 2:s.query=l.query;case 3:case 4:oc(s,l);case 5:s.user=l.user,s.host=l.host,s.port=l.port;case 6:s.scheme=l.scheme}m>n&&(n=m)}fa(s,n);let u=s.query+s.hash;switch(n){case 2:case 3:return u;case 4:{let l=s.path.slice(1);return l?ca(i||e)&&!ca(l)?"./"+l+u:l+u:u||"."}case 5:return s.path+u;default:return s.scheme+"//"+s.user+s.host+s.port+s.path+u}}function uc(e){if(!e)return"";let i=e.lastIndexOf("/");return e.slice(0,i+1)}function cc(e,i){let s=uc(e),n=i?i+"/":"";return u=>da(n+(u||""),s)}var mt=0;function hc(e,i){let s=ma(e,0);if(s===e.length)return e;i||(e=e.slice());for(let n=s;n<e.length;n=ma(e,n+1))e[n]=pc(e[n],i);return e}function ma(e,i){for(let s=i;s<e.length;s++)if(!lc(e[s]))return s;return e.length}function lc(e){for(let i=1;i<e.length;i++)if(e[i][mt]<e[i-1][mt])return!1;return!0}function pc(e,i){return i||(e=e.slice()),e.sort(fc)}function fc(e,i){return e[mt]-i[mt]}var ki=!1;function dc(e,i,s,n){for(;s<=n;){let u=s+(n-s>>1),l=e[u][mt]-i;if(l===0)return ki=!0,u;l<0?s=u+1:n=u-1}return ki=!1,s-1}function mc(e,i,s){for(let n=s+1;n<e.length&&e[n][mt]===i;s=n++);return s}function xc(e,i,s){for(let n=s-1;n>=0&&e[n][mt]===i;s=n--);return s}function yc(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function gc(e,i,s,n){let{lastKey:u,lastNeedle:l,lastIndex:m}=s,g=0,S=e.length-1;if(n===u){if(i===l)return ki=m!==-1&&e[m][mt]===i,m;i>=l?g=m===-1?0:m:S=m}return s.lastKey=n,s.lastNeedle=i,s.lastIndex=dc(e,i,g,S)}function vc(e){return typeof e=="string"?JSON.parse(e):e}var xa=-1,bc=1,Ei=class{constructor(e,i){let s=typeof e=="string";if(!s&&e._decodedMemo)return e;let n=vc(e),{version:u,file:l,names:m,sourceRoot:g,sources:S,sourcesContent:h}=n;this.version=u,this.file=l,this.names=m||[],this.sourceRoot=g,this.sources=S,this.sourcesContent=h,this.ignoreList=n.ignoreList||n.x_google_ignoreList||void 0;let P=cc(i,g);this.resolvedSources=S.map(P);let{mappings:E}=n;if(typeof E=="string")this._encoded=E,this._decoded=void 0;else if(Array.isArray(E))this._encoded=void 0,this._decoded=hc(E,s);else throw n.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(n)}`);this._decodedMemo=yc(),this._bySources=void 0,this._bySourceMemos=void 0}};function wi(e){var i;return(i=e)._decoded||(i._decoded=ua(e._encoded))}function ya(e,i,s){let n=wi(e);if(i>=n.length)return null;let u=n[i],l=Sc(u,e._decodedMemo,i,s,bc);return l===-1?null:u[l]}function Sc(e,i,s,n,u){let l=gc(e,n,i,s);return ki?l=(u===xa?mc:xc)(e,n,l):u===xa&&l++,l===-1||l===e.length?-1:l}var hs=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function va(e,i){return e._indexes[i]}function Yt(e,i){let s=va(e,i);if(s!==void 0)return s;let{array:n,_indexes:u}=e,l=n.push(i);return u[i]=l-1}function Cc(e,i){let s=va(e,i);if(s===void 0)return;let{array:n,_indexes:u}=e;for(let l=s+1;l<n.length;l++){let m=n[l];n[l-1]=m,u[m]--}u[i]=void 0,n.pop()}var _c=0,Ac=1,kc=2,Ec=3,wc=4,ba=-1,Sa=class{constructor({file:e,sourceRoot:i}={}){this._names=new hs,this._sources=new hs,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=i,this._ignoreList=new hs}};var Ca=(e,i,s,n,u,l,m,g)=>Tc(!0,e,i,s,n,u,l,m,g);function _a(e,i,s){let{_sources:n,_sourcesContent:u}=e,l=Yt(n,i);u[l]=s}function Aa(e,i,s=!0){let{_sources:n,_sourcesContent:u,_ignoreList:l}=e,m=Yt(n,i);m===u.length&&(u[m]=null),s?Yt(l,m):Cc(l,m)}function ls(e){let{_mappings:i,_sources:s,_sourcesContent:n,_names:u,_ignoreList:l}=e;return Nc(i),{version:3,file:e.file||void 0,names:u.array,sourceRoot:e.sourceRoot||void 0,sources:s.array,sourcesContent:n,mappings:i,ignoreList:l.array}}function ka(e){let i=ls(e);return Object.assign({},i,{mappings:cs(i.mappings)})}function Tc(e,i,s,n,u,l,m,g,S){let{_mappings:h,_sources:P,_sourcesContent:E,_names:F}=i,_=Pc(h,s),k=Ic(_,n);if(!u)return e&&Lc(_,k)?void 0:ga(_,k,[n]);let D=Yt(P,u),R=g?Yt(F,g):ba;if(D===E.length&&(E[D]=S??null),!(e&&Rc(_,k,D,l,m,R)))return ga(_,k,g?[n,D,l,m,R]:[n,D,l,m])}function Pc(e,i){for(let s=e.length;s<=i;s++)e[s]=[];return e[i]}function Ic(e,i){let s=e.length;for(let n=s-1;n>=0;s=n--){let u=e[n];if(i>=u[_c])break}return s}function ga(e,i,s){for(let n=e.length;n>i;n--)e[n]=e[n-1];e[i]=s}function Nc(e){let{length:i}=e,s=i;for(let n=s-1;n>=0&&!(e[n].length>0);s=n,n--);s<i&&(e.length=s)}function Lc(e,i){return i===0?!0:e[i-1].length===1}function Rc(e,i,s,n,u,l){if(i===0)return!1;let m=e[i-1];return m.length===1?!1:s===m[Ac]&&n===m[kc]&&u===m[Ec]&&l===(m.length===5?m[wc]:ba)}var Ea=wa("",-1,-1,"",null,!1),Oc=[];function wa(e,i,s,n,u,l){return{source:e,line:i,column:s,name:n,content:u,ignore:l}}function Ta(e,i,s,n,u){return{map:e,sources:i,source:s,content:n,ignore:u}}function Pa(e,i){return Ta(e,i,"",null,!1)}function Mc(e,i,s){return Ta(null,Oc,e,i,s)}function Vc(e){let i=new Sa({file:e.map.file}),{sources:s,map:n}=e,u=n.names,l=wi(n);for(let m=0;m<l.length;m++){let g=l[m];for(let S=0;S<g.length;S++){let h=g[S],P=h[0],E=Ea;if(h.length!==1){let z=s[h[1]];if(E=Ia(z,h[2],h[3],h.length===5?u[h[4]]:""),E==null)continue}let{column:F,line:_,name:k,content:D,source:R,ignore:H}=E;Ca(i,m,P,R,_,F,k),R&&D!=null&&_a(i,R,D),H&&Aa(i,R,!0)}}return i}function Ia(e,i,s,n){if(!e.map)return wa(e.source,i,s,n,e.content,e.ignore);let u=ya(e.map,i,s);return u==null?null:u.length===1?Ea:Ia(e.sources[u[1]],u[2],u[3],u.length===5?e.map.names[u[4]]:n)}function Dc(e){return Array.isArray(e)?e:[e]}function Fc(e,i){let s=Dc(e).map(l=>new Ei(l,"")),n=s.pop();for(let l=0;l<s.length;l++)if(s[l].sources.length>1)throw new Error(`Transformation map ${l} must have exactly one source file.
11
+ `):D=String.fromCharCode(k),this.options.locations&&(++this.curLine,this.lineStart=this.pos),D}jsx_readString(_){let k="",D=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let R=this.input.charCodeAt(this.pos);if(R===_)break;R===38?(k+=this.input.slice(D,this.pos),k+=this.jsx_readEntity(),D=this.pos):P(R)?(k+=this.input.slice(D,this.pos),k+=this.jsx_readNewLine(!1),D=this.pos):++this.pos}return k+=this.input.slice(D,this.pos++),this.finishToken(u.string,k)}jsx_readEntity(){let _="",k=0,D,R=this.input[this.pos];R!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let H=++this.pos;for(;this.pos<this.input.length&&k++<10;){if(R=this.input[this.pos++],R===";"){_[0]==="#"?_[1]==="x"?(_=_.substr(2),ll.test(_)&&(D=String.fromCharCode(parseInt(_,16)))):(_=_.substr(1),pl.test(_)&&(D=String.fromCharCode(parseInt(_,10)))):D=hl[_];break}_+=R}return D||(this.pos=H,"&")}jsx_readWord(){let _,k=this.pos;do _=this.input.charCodeAt(++this.pos);while(F(_)||_===45);return this.finishToken(l.jsxName,this.input.slice(k,this.pos))}jsx_parseIdentifier(){let _=this.startNode();return this.type===l.jsxName?_.name=this.value:this.type.keyword?_.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(_,"JSXIdentifier")}jsx_parseNamespacedName(){let _=this.start,k=this.startLoc,D=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(u.colon))return D;var R=this.startNodeAt(_,k);return R.namespace=D,R.name=this.jsx_parseIdentifier(),this.finishNode(R,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===l.jsxTagEnd)return"";let _=this.start,k=this.startLoc,D=this.jsx_parseNamespacedName();for(this.type===u.dot&&D.type==="JSXNamespacedName"&&!e.allowNamespacedObjects&&this.unexpected();this.eat(u.dot);){let R=this.startNodeAt(_,k);R.object=D,R.property=this.jsx_parseIdentifier(),D=this.finishNode(R,"JSXMemberExpression")}return D}jsx_parseAttributeValue(){switch(this.type){case u.braceL:let _=this.jsx_parseExpressionContainer();return _.expression.type==="JSXEmptyExpression"&&this.raise(_.start,"JSX attributes must only be assigned a non-empty expression"),_;case l.jsxTagStart:case u.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let _=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(_,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let _=this.startNode();return this.next(),_.expression=this.type===u.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(u.braceR),this.finishNode(_,"JSXExpressionContainer")}jsx_parseAttribute(){let _=this.startNode();return this.eat(u.braceL)?(this.expect(u.ellipsis),_.argument=this.parseMaybeAssign(),this.expect(u.braceR),this.finishNode(_,"JSXSpreadAttribute")):(_.name=this.jsx_parseNamespacedName(),_.value=this.eat(u.eq)?this.jsx_parseAttributeValue():null,this.finishNode(_,"JSXAttribute"))}jsx_parseOpeningElementAt(_,k){let D=this.startNodeAt(_,k);D.attributes=[];let R=this.jsx_parseElementName();for(R&&(D.name=R);this.type!==u.slash&&this.type!==l.jsxTagEnd;)D.attributes.push(this.jsx_parseAttribute());return D.selfClosing=this.eat(u.slash),this.expect(l.jsxTagEnd),this.finishNode(D,R?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(_,k){let D=this.startNodeAt(_,k),R=this.jsx_parseElementName();return R&&(D.name=R),this.expect(l.jsxTagEnd),this.finishNode(D,R?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(_,k){let D=this.startNodeAt(_,k),R=[],H=this.jsx_parseOpeningElementAt(_,k),z=null;if(!H.selfClosing){e:for(;;)switch(this.type){case l.jsxTagStart:if(_=this.start,k=this.startLoc,this.next(),this.eat(u.slash)){z=this.jsx_parseClosingElementAt(_,k);break e}R.push(this.jsx_parseElementAt(_,k));break;case l.jsxText:R.push(this.parseExprAtom());break;case u.braceL:R.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}ri(z.name)!==ri(H.name)&&this.raise(z.start,"Expected corresponding JSX closing tag for <"+ri(H.name)+">")}let G=H.name?"Element":"Fragment";return D["opening"+G]=H,D["closing"+G]=z,D.children=R,this.type===u.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(D,"JSX"+G)}jsx_parseText(){let _=this.parseLiteral(this.value);return _.type="JSXText",_}jsx_parseElement(){let _=this.start,k=this.startLoc;return this.next(),this.jsx_parseElementAt(_,k)}parseExprAtom(_){return this.type===l.jsxText?this.jsx_parseText():this.type===l.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(_)}readToken(_){let k=this.curContext();if(k===h)return this.jsx_readToken();if(k===g||k===S){if(E(_))return this.jsx_readWord();if(_==62)return++this.pos,this.finishToken(l.jsxTagEnd);if((_===34||_===39)&&k==g)return this.jsx_readString(_)}return _===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(l.jsxTagStart)):super.readToken(_)}updateContext(_){if(this.type==u.braceL){var k=this.curContext();k==g?this.context.push(m.b_expr):k==h?this.context.push(m.b_tmpl):super.updateContext(_),this.exprAllowed=!0}else if(this.type===u.slash&&_===l.jsxTagStart)this.context.length-=2,this.context.push(S),this.exprAllowed=!1;else return super.updateContext(_)}}}});var ft="__componentSourceLoc",$t="$componentSourceLoc",mr="react-code-locator.jsxSourceRegistry";function Ji(e){return e.replace(/\\/g,"/")}function Bo(e){return e.replace(/\/+$/,"")}function xr(e){return Ji(e).split("/").filter(Boolean)}function jo(e,i){let s=xr(e),n=xr(i),u=0;for(;u<s.length&&u<n.length&&s[u]===n[u];)u+=1;let l=new Array(Math.max(0,s.length-u)).fill(".."),m=n.slice(u),g=[...l,...m];return g.length>0?g.join("/"):"."}function Uo(e){return e?Bo(Ji(e)):""}function yi(e){return e?e.match(/^(.*):\d+:\d+$/)?.[1]??null:null}function Ho(e,i){if(!e)return!1;let s=Uo(i),n=Ji(e);return s?n.startsWith(`${s}/`)||n===s?!0:!jo(s,n).startsWith("../"):!n.startsWith("../")&&!n.startsWith("/")&&!/^[A-Za-z]:\//.test(n)}function It(e,i){let s=yi(e);return Ho(s??void 0,i)}function qo(e,i){return i==="none"?!0:i==="alt"?e.altKey:i==="meta"?e.metaKey:i==="ctrl"?e.ctrlKey:e.shiftKey}function Wo(e){return Object.keys(e).find(i=>i.startsWith("__reactFiber$")||i.startsWith("__reactInternalInstance$"))}function $o(e){let i=e;for(;i;){let s=Wo(i);if(s)return i[s];i=i.parentElement}return null}function gi(e){if(!e)return null;if(typeof e=="function"){let n=e[ft];return typeof n=="string"?n:null}if(typeof e!="object")return null;let i=e,s=i[ft]??i.type?.[ft]??i.render?.[ft];return typeof s=="string"?s:null}function yr(e){if(e&&typeof e=="object"){let s=globalThis[Symbol.for(mr)];if(s instanceof WeakMap){let n=s.get(e);if(typeof n=="string")return n}}let i=e?.[$t];return typeof i=="string"?i:null}function Go(e){let i=e;for(;i;){let s=gi(i.type)??gi(i.elementType);if(s)return s;i=i.return??null}return null}function Ko(e){let i=e?._debugSource;return i?.fileName&&typeof i.lineNumber=="number"?`${i.fileName.replace(/\\/g,"/")}:${i.lineNumber}:${i.columnNumber??1}`:null}function gr(e,i){if(!i||!e)return e;let s=e.match(/^(.*):(\d+):(\d+)$/);if(!s)return e;let[,n,u,l]=s,m=n.replace(/\\/g,"/"),g=i.replace(/\\/g,"/").replace(/\/$/,"");return m.startsWith(g+"/")?`${m.slice(g.length+1)}:${u}:${l}`:e}function zo(e,i){let s=e,n=[],u=[];for(;s;){let F=yr(s.pendingProps)??yr(s.memoizedProps)??Ko(s),_=gr(F??"",i)||F;if(_){let R=yi(_);R&&!n.some(H=>H.source===_)&&n.push({source:_,file:R})}let k=gi(s.type)??gi(s.elementType),D=gr(k??"",i)||k;if(D){let R=yi(D);R&&!u.some(H=>H.source===D)&&u.push({source:D,file:R})}s=s.return??null}console.log("[react-code-locator] DEBUG candidates",{jsxCandidates:n,componentCandidates:u,projectRoot:i});let l=n[0]?.source??null,m=u.find(F=>It(F.source))?.file,g=null;if(m){let F=n.find(_=>_.file===m);if(F)g=F.source;else{let _=u.find(k=>k.file===m);_&&(g=_.source)}}let S=u.find(F=>!It(F.source))?.source??null,h=n.find(F=>!It(F.source))?.source??null,P=n.find(F=>It(F.source))?.source??null,E=g??P??u.find(F=>It(F.source))?.source??null;return{direct:l??E,screen:E,implementation:S??h??E}}function Xo(e){return e==="direct"?"Direct JSX":e==="screen"?"Screen source":"Implementation source"}function Jo(e){if(typeof document>"u")return null;let i=document.createElement("div"),s=null,n="screen",u=null;i.setAttribute("data-react-code-locator","true"),Object.assign(i.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"2147483647",padding:"8px 10px",borderRadius:"8px",background:"rgba(17, 24, 39, 0.92)",color:"#fff",fontSize:"12px",lineHeight:"1.4",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",boxShadow:"0 8px 30px rgba(0, 0, 0, 0.25)",pointerEvents:"auto",cursor:"pointer",maxWidth:"min(70vw, 720px)",wordBreak:"break-all",opacity:"0",transition:"opacity 120ms ease"});let l=(g,S)=>{i.textContent=g,i.style.background=S==="success"?"rgba(6, 95, 70, 0.92)":S==="error"?"rgba(153, 27, 27, 0.94)":"rgba(17, 24, 39, 0.92)",i.style.opacity="1",i.style.pointerEvents="auto",u&&clearTimeout(u),u=setTimeout(()=>{i.style.opacity="0",i.style.pointerEvents="none"},2e3)};i.addEventListener("click",async()=>{if(s)try{await navigator.clipboard.writeText(s),l("[react-code-locator] copied","success")}catch{l("[react-code-locator] copy failed","error")}}),l(`[react-code-locator] enabled (${e}+click, alt+1/2/3 to switch mode)`,"idle");let m=()=>{!i.isConnected&&document.body&&document.body.appendChild(i)};return document.body?m():document.addEventListener("DOMContentLoaded",m,{once:!0}),{setStatus(g,S="idle"){l(g,S)},setCopyValue(g){s=g},setMode(g){n=g,l(`[react-code-locator] ${Xo(g)}`,"idle")},remove(){u&&clearTimeout(u),i.remove()}}}function vr(e,i="screen",s){let n=e instanceof Element?e:e instanceof Node?e.parentElement:null,u=$o(n);if(!u)return null;let l=zo(u,s),m=l[i]??l.screen??l.direct??l.implementation;if(m)return{source:m,mode:i};let g=Go(u);return g?{source:g,mode:i}:null}function Qo(e={}){if(process.env.NODE_ENV!=="development")return;let i=Jo(e.triggerKey??"shift"),s="screen",{triggerKey:n="shift",projectRoot:u,onLocate:l=h=>{console.log(`[react-code-locator] ${h.source}`),i?.setCopyValue(h.source),i?.setStatus(`[react-code-locator] ${h.source}`,"success")},onError:m=h=>{console.error("[react-code-locator]",h);let P=h instanceof Error?h.message:String(h);i?.setCopyValue(null),i?.setStatus(`[react-code-locator] ${P}`,"error")}}=e;console.log("[react-code-locator] enabled",{triggerKey:n});let g=h=>{if(h.altKey){if(h.code==="Digit1"){s="direct",i?.setMode(s),h.preventDefault();return}if(h.code==="Digit2"){s="screen",i?.setMode(s),h.preventDefault();return}h.code==="Digit3"&&(s="implementation",i?.setMode(s),h.preventDefault())}},S=h=>{if(console.log("[react-code-locator] click",{triggerKey:n,shiftKey:h.shiftKey,altKey:h.altKey,ctrlKey:h.ctrlKey,metaKey:h.metaKey,target:h.target}),!qo(h,n))return;let P=vr(h.target,s,u);if(!P){m(new Error("No React component source metadata found for clicked element."));return}h.preventDefault(),h.stopPropagation(),l(P)};return document.addEventListener("click",S,!0),document.addEventListener("keydown",g,!0),()=>{document.removeEventListener("click",S,!0),document.removeEventListener("keydown",g,!0),i?.remove()}}var Gr=dr(Hr(),1);import{resolve as wu}from"path";function Ge(e){return e=e||[],Array.isArray(e)?e:[e]}var Tu=/\\/g;function Si(e){return e.replace(Tu,"/")}var Pu=/^(?:\/|(?:[A-Z]:)?[/\\|])/i;function Iu(e){return Pu.test(e)}function Nu(e,i){return e.startsWith("**")||Iu(e)?Si(e):Si(wu(i,e))}function qr(e){if(e instanceof RegExp)return s=>{let n=Si(s),u=e.test(n);return e.lastIndex=0,u};let i=(0,Gr.default)(Nu(e,process.cwd()),{dot:!0});return s=>i(Si(s))}function Wr(e){return e instanceof RegExp?i=>{let s=e.test(i);return e.lastIndex=0,s}:i=>i.includes(e)}function Kr(e,i){if(!(!e&&!i))return s=>e?.some(n=>n(s))?!1:i?.some(n=>n(s))?!0:!(i&&i.length>0)}function zr(e){return typeof e=="string"||e instanceof RegExp?{include:[e]}:Array.isArray(e)?{include:e}:{exclude:e.exclude?Ge(e.exclude):void 0,include:e.include?Ge(e.include):void 0}}function Xr(e){if(!e)return;let{exclude:i,include:s}=zr(e),n=i?.map(qr),u=s?.map(qr);return Kr(n,u)}function Lu(e){if(!e)return;let{exclude:i,include:s}=zr(e),n=i?.map(Wr),u=s?.map(Wr);return Kr(n,u)}function Ru(e){let i=Xr(e);return i?s=>!!i(s):void 0}function Ou(e,i){if(!e&&!i)return;let s=Xr(e),n=Lu(i);return(u,l)=>{let m=!0;return s&&(m&&=s(u)),m?(n&&(m&&=n(l)),m):!1}}function we(e,i){let s,n;if(typeof i=="function")s=i;else{s=i.handler;let u=i.filter;e==="resolveId"||e==="load"?n=Ru(u?.id):n=Ou(u?.id,u?.code)}return{handler:s,filter:n||(()=>!0)}}var $r;function dt(e,i={}){if(!$r)throw new Error("Parse implementation is not set. Please call setParseImpl first.");return $r(e,i)}import{isAbsolute as Mu,normalize as Vu}from"path";function ns(e,i,s){if(e.resource==null)return[];let n=Lt(e.resource+(e.resourceQuery||""));if(i.transformInclude&&!i.transformInclude(n))return[];let{filter:u}=we("load",i.transform);return u(n)?[{loader:s,options:{plugin:i},ident:i.name}]:[]}function Lt(e){return Mu(e)?Vu(e):e}import{resolve as Du}from"path";import{Buffer as Fu}from"buffer";function Ci(e,i,s,n){return{getNativeBuildContext(){return{framework:"rspack",compiler:e,compilation:i,loaderContext:s,inputSourceMap:n}},addWatchFile(u){let l=Du(process.cwd(),u);i.fileDependencies.add(l),s?.addDependency(l)},getWatchFiles(){return Array.from(i.fileDependencies)},parse:dt,emitFile(u){let l=u.fileName||u.name;if(u.source&&l){let{sources:m}=i.compiler.webpack;i.emitAsset(l,new m.RawSource(typeof u.source=="string"?u.source:Fu.from(u.source)))}}}}function Jr(e){let i=new Error(typeof e=="string"?e:e.message);return typeof e=="object"&&(i.stack=e.stack,i.cause=e.meta),i}import{basename as Bu,dirname as ju,resolve as Uu}from"path";import Xt from"fs";function Qr(e,i){return Uu(i.__virtualModulePrefix,encodeURIComponent(e))}function Yr(e,i){return decodeURIComponent(Bu(e))}function os(e,i){return ju(e)===i.__virtualModulePrefix}var Zr=class at{name="FakeVirtualModulesPlugin";static counters=new Map;static initCleanup=!1;constructor(i){this.plugin=i,at.initCleanup||(at.initCleanup=!0,process.once("exit",()=>{at.counters.forEach((s,n)=>{Xt.rmSync(n,{recursive:!0,force:!0})})}))}apply(i){let s=this.plugin.__virtualModulePrefix;Xt.existsSync(s)||Xt.mkdirSync(s,{recursive:!0});let n=at.counters.get(s)??0;at.counters.set(s,n+1),i.hooks.shutdown.tap(this.name,()=>{let u=(at.counters.get(s)??1)-1;u===0?(at.counters.delete(s),Xt.rmSync(s,{recursive:!0,force:!0})):at.counters.set(s,u)})}async writeModule(i){return Xt.promises.writeFile(i,"")}};import{createRequire as Hu}from"module";import{resolve as qu}from"path";import{Buffer as Wu}from"buffer";import $u from"process";function us(e){return{addWatchFile(i){(e.fileDependencies??e.compilationDependencies).add(i)},getWatchFiles(){return Array.from(e.fileDependencies??e.compilationDependencies)}}}var Gu=Hu(import.meta.url);function Ku(e){return new(Gu("webpack")).sources.RawSource(typeof e=="string"?e:Wu.from(e.buffer))}function _i(e,i,s,n,u){return{parse:dt,addWatchFile(l){e.addWatchFile(qu($u.cwd(),l))},emitFile(l){let m=l.fileName||l.name;if(l.source&&m){if(!s)throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");s.emitAsset(m,Ku(l.source))}},getWatchFiles(){return e.getWatchFiles()},getNativeBuildContext(){return{framework:"webpack",compiler:i,compilation:s,loaderContext:n,inputSourceMap:u}}}}function ea(e){let i=new Error(typeof e=="string"?e:e.message);return typeof e=="object"&&(i.stack=e.stack,i.cause=e.meta),i}import{createRequire as jc}from"module";import Be,{extname as Uc,isAbsolute as La,resolve as Ot}from"path";import nt from"fs";import{Buffer as qa}from"buffer";var aa=44,zu=59,ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",na=new Uint8Array(64),oa=new Uint8Array(128);for(let e=0;e<ta.length;e++){let i=ta.charCodeAt(e);na[e]=i,oa[i]=e}function Jt(e,i){let s=0,n=0,u=0;do{let m=e.next();u=oa[m],s|=(u&31)<<n,n+=5}while(u&32);let l=s&1;return s>>>=1,l&&(s=-2147483648|-s),i+s}function Qt(e,i,s){let n=i-s;n=n<0?-n<<1|1:n<<1;do{let u=n&31;n>>>=5,n>0&&(u|=32),e.write(na[u])}while(n>0);return i}function ia(e,i){return e.pos>=i?!1:e.peek()!==aa}var sa=1024*16,ra=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let i="";for(let s=0;s<e.length;s++)i+=String.fromCharCode(e[s]);return i}},Xu=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(sa)}write(e){let{buffer:i}=this;i[this.pos++]=e,this.pos===sa&&(this.out+=ra.decode(i),this.pos=0)}flush(){let{buffer:e,out:i,pos:s}=this;return s>0?i+ra.decode(e.subarray(0,s)):i}},Ju=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:i,pos:s}=this,n=i.indexOf(e,s);return n===-1?i.length:n}};function ua(e){let{length:i}=e,s=new Ju(e),n=[],u=0,l=0,m=0,g=0,S=0;do{let h=s.indexOf(";"),P=[],E=!0,F=0;for(u=0;s.pos<h;){let _;u=Jt(s,u),u<F&&(E=!1),F=u,ia(s,h)?(l=Jt(s,l),m=Jt(s,m),g=Jt(s,g),ia(s,h)?(S=Jt(s,S),_=[u,l,m,g,S]):_=[u,l,m,g]):_=[u],P.push(_),s.pos++}E||Qu(P),n.push(P),s.pos=h+1}while(s.pos<=i);return n}function Qu(e){e.sort(Yu)}function Yu(e,i){return e[0]-i[0]}function cs(e){let i=new Xu,s=0,n=0,u=0,l=0;for(let m=0;m<e.length;m++){let g=e[m];if(m>0&&i.write(zu),g.length===0)continue;let S=0;for(let h=0;h<g.length;h++){let P=g[h];h>0&&i.write(aa),S=Qt(i,P[0],S),P.length!==1&&(s=Qt(i,P[1],s),n=Qt(i,P[2],n),u=Qt(i,P[3],u),P.length!==4&&(l=Qt(i,P[4],l)))}}return i.flush()}var Zu=/^[\w+.-]+:\/\//,ec=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,tc=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function ic(e){return Zu.test(e)}function sc(e){return e.startsWith("//")}function la(e){return e.startsWith("/")}function rc(e){return e.startsWith("file:")}function ca(e){return/^[.?#]/.test(e)}function Ai(e){let i=ec.exec(e);return pa(i[1],i[2]||"",i[3],i[4]||"",i[5]||"/",i[6]||"",i[7]||"")}function ac(e){let i=tc.exec(e),s=i[2];return pa("file:","",i[1]||"","",la(s)?s:"/"+s,i[3]||"",i[4]||"")}function pa(e,i,s,n,u,l,m){return{scheme:e,user:i,host:s,port:n,path:u,query:l,hash:m,type:7}}function ha(e){if(sc(e)){let s=Ai("http:"+e);return s.scheme="",s.type=6,s}if(la(e)){let s=Ai("http://foo.com"+e);return s.scheme="",s.host="",s.type=5,s}if(rc(e))return ac(e);if(ic(e))return Ai(e);let i=Ai("http://foo.com/"+e);return i.scheme="",i.host="",i.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,i}function nc(e){if(e.endsWith("/.."))return e;let i=e.lastIndexOf("/");return e.slice(0,i+1)}function oc(e,i){fa(i,i.type),e.path==="/"?e.path=i.path:e.path=nc(i.path)+e.path}function fa(e,i){let s=i<=4,n=e.path.split("/"),u=1,l=0,m=!1;for(let S=1;S<n.length;S++){let h=n[S];if(!h){m=!0;continue}if(m=!1,h!=="."){if(h===".."){l?(m=!0,l--,u--):s&&(n[u++]=h);continue}n[u++]=h,l++}}let g="";for(let S=1;S<u;S++)g+="/"+n[S];(!g||m&&!g.endsWith("/.."))&&(g+="/"),e.path=g}function da(e,i){if(!e&&!i)return"";let s=ha(e),n=s.type;if(i&&n!==7){let l=ha(i),m=l.type;switch(n){case 1:s.hash=l.hash;case 2:s.query=l.query;case 3:case 4:oc(s,l);case 5:s.user=l.user,s.host=l.host,s.port=l.port;case 6:s.scheme=l.scheme}m>n&&(n=m)}fa(s,n);let u=s.query+s.hash;switch(n){case 2:case 3:return u;case 4:{let l=s.path.slice(1);return l?ca(i||e)&&!ca(l)?"./"+l+u:l+u:u||"."}case 5:return s.path+u;default:return s.scheme+"//"+s.user+s.host+s.port+s.path+u}}function uc(e){if(!e)return"";let i=e.lastIndexOf("/");return e.slice(0,i+1)}function cc(e,i){let s=uc(e),n=i?i+"/":"";return u=>da(n+(u||""),s)}var mt=0;function hc(e,i){let s=ma(e,0);if(s===e.length)return e;i||(e=e.slice());for(let n=s;n<e.length;n=ma(e,n+1))e[n]=pc(e[n],i);return e}function ma(e,i){for(let s=i;s<e.length;s++)if(!lc(e[s]))return s;return e.length}function lc(e){for(let i=1;i<e.length;i++)if(e[i][mt]<e[i-1][mt])return!1;return!0}function pc(e,i){return i||(e=e.slice()),e.sort(fc)}function fc(e,i){return e[mt]-i[mt]}var ki=!1;function dc(e,i,s,n){for(;s<=n;){let u=s+(n-s>>1),l=e[u][mt]-i;if(l===0)return ki=!0,u;l<0?s=u+1:n=u-1}return ki=!1,s-1}function mc(e,i,s){for(let n=s+1;n<e.length&&e[n][mt]===i;s=n++);return s}function xc(e,i,s){for(let n=s-1;n>=0&&e[n][mt]===i;s=n--);return s}function yc(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function gc(e,i,s,n){let{lastKey:u,lastNeedle:l,lastIndex:m}=s,g=0,S=e.length-1;if(n===u){if(i===l)return ki=m!==-1&&e[m][mt]===i,m;i>=l?g=m===-1?0:m:S=m}return s.lastKey=n,s.lastNeedle=i,s.lastIndex=dc(e,i,g,S)}function vc(e){return typeof e=="string"?JSON.parse(e):e}var xa=-1,bc=1,Ei=class{constructor(e,i){let s=typeof e=="string";if(!s&&e._decodedMemo)return e;let n=vc(e),{version:u,file:l,names:m,sourceRoot:g,sources:S,sourcesContent:h}=n;this.version=u,this.file=l,this.names=m||[],this.sourceRoot=g,this.sources=S,this.sourcesContent=h,this.ignoreList=n.ignoreList||n.x_google_ignoreList||void 0;let P=cc(i,g);this.resolvedSources=S.map(P);let{mappings:E}=n;if(typeof E=="string")this._encoded=E,this._decoded=void 0;else if(Array.isArray(E))this._encoded=void 0,this._decoded=hc(E,s);else throw n.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(n)}`);this._decodedMemo=yc(),this._bySources=void 0,this._bySourceMemos=void 0}};function wi(e){var i;return(i=e)._decoded||(i._decoded=ua(e._encoded))}function ya(e,i,s){let n=wi(e);if(i>=n.length)return null;let u=n[i],l=Sc(u,e._decodedMemo,i,s,bc);return l===-1?null:u[l]}function Sc(e,i,s,n,u){let l=gc(e,n,i,s);return ki?l=(u===xa?mc:xc)(e,n,l):u===xa&&l++,l===-1||l===e.length?-1:l}var hs=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function va(e,i){return e._indexes[i]}function Yt(e,i){let s=va(e,i);if(s!==void 0)return s;let{array:n,_indexes:u}=e,l=n.push(i);return u[i]=l-1}function Cc(e,i){let s=va(e,i);if(s===void 0)return;let{array:n,_indexes:u}=e;for(let l=s+1;l<n.length;l++){let m=n[l];n[l-1]=m,u[m]--}u[i]=void 0,n.pop()}var _c=0,Ac=1,kc=2,Ec=3,wc=4,ba=-1,Sa=class{constructor({file:e,sourceRoot:i}={}){this._names=new hs,this._sources=new hs,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=i,this._ignoreList=new hs}};var Ca=(e,i,s,n,u,l,m,g)=>Tc(!0,e,i,s,n,u,l,m,g);function _a(e,i,s){let{_sources:n,_sourcesContent:u}=e,l=Yt(n,i);u[l]=s}function Aa(e,i,s=!0){let{_sources:n,_sourcesContent:u,_ignoreList:l}=e,m=Yt(n,i);m===u.length&&(u[m]=null),s?Yt(l,m):Cc(l,m)}function ls(e){let{_mappings:i,_sources:s,_sourcesContent:n,_names:u,_ignoreList:l}=e;return Nc(i),{version:3,file:e.file||void 0,names:u.array,sourceRoot:e.sourceRoot||void 0,sources:s.array,sourcesContent:n,mappings:i,ignoreList:l.array}}function ka(e){let i=ls(e);return Object.assign({},i,{mappings:cs(i.mappings)})}function Tc(e,i,s,n,u,l,m,g,S){let{_mappings:h,_sources:P,_sourcesContent:E,_names:F}=i,_=Pc(h,s),k=Ic(_,n);if(!u)return e&&Lc(_,k)?void 0:ga(_,k,[n]);let D=Yt(P,u),R=g?Yt(F,g):ba;if(D===E.length&&(E[D]=S??null),!(e&&Rc(_,k,D,l,m,R)))return ga(_,k,g?[n,D,l,m,R]:[n,D,l,m])}function Pc(e,i){for(let s=e.length;s<=i;s++)e[s]=[];return e[i]}function Ic(e,i){let s=e.length;for(let n=s-1;n>=0;s=n--){let u=e[n];if(i>=u[_c])break}return s}function ga(e,i,s){for(let n=e.length;n>i;n--)e[n]=e[n-1];e[i]=s}function Nc(e){let{length:i}=e,s=i;for(let n=s-1;n>=0&&!(e[n].length>0);s=n,n--);s<i&&(e.length=s)}function Lc(e,i){return i===0?!0:e[i-1].length===1}function Rc(e,i,s,n,u,l){if(i===0)return!1;let m=e[i-1];return m.length===1?!1:s===m[Ac]&&n===m[kc]&&u===m[Ec]&&l===(m.length===5?m[wc]:ba)}var Ea=wa("",-1,-1,"",null,!1),Oc=[];function wa(e,i,s,n,u,l){return{source:e,line:i,column:s,name:n,content:u,ignore:l}}function Ta(e,i,s,n,u){return{map:e,sources:i,source:s,content:n,ignore:u}}function Pa(e,i){return Ta(e,i,"",null,!1)}function Mc(e,i,s){return Ta(null,Oc,e,i,s)}function Vc(e){let i=new Sa({file:e.map.file}),{sources:s,map:n}=e,u=n.names,l=wi(n);for(let m=0;m<l.length;m++){let g=l[m];for(let S=0;S<g.length;S++){let h=g[S],P=h[0],E=Ea;if(h.length!==1){let z=s[h[1]];if(E=Ia(z,h[2],h[3],h.length===5?u[h[4]]:""),E==null)continue}let{column:F,line:_,name:k,content:D,source:R,ignore:H}=E;Ca(i,m,P,R,_,F,k),R&&D!=null&&_a(i,R,D),H&&Aa(i,R,!0)}}return i}function Ia(e,i,s,n){if(!e.map)return wa(e.source,i,s,n,e.content,e.ignore);let u=ya(e.map,i,s);return u==null?null:u.length===1?Ea:Ia(e.sources[u[1]],u[2],u[3],u.length===5?e.map.names[u[4]]:n)}function Dc(e){return Array.isArray(e)?e:[e]}function Fc(e,i){let s=Dc(e).map(l=>new Ei(l,"")),n=s.pop();for(let l=0;l<s.length;l++)if(s[l].sources.length>1)throw new Error(`Transformation map ${l} must have exactly one source file.
12
12
  Did you specify these with the most recent transformation maps first?`);let u=Na(n,i,"",0);for(let l=s.length-1;l>=0;l--)u=Pa(s[l],[u]);return u}function Na(e,i,s,n){let{resolvedSources:u,sourcesContent:l,ignoreList:m}=e,g=n+1,S=u.map((h,P)=>{let E={importer:s,depth:g,source:h||"",content:void 0,ignore:void 0},F=i(E.source,E),{source:_,content:k,ignore:D}=E;if(F)return Na(new Ei(F,_),i,_,g);let R=k!==void 0?k:l?l[P]:null,H=D!==void 0?D:m?m.includes(P):!1;return Mc(_,R,H)});return Pa(e,S)}var Bc=class{constructor(e,i){let s=i.decodedMappings?ls(e):ka(e);this.version=s.version,this.file=s.file,this.mappings=s.mappings,this.names=s.names,this.ignoreList=s.ignoreList,this.sourceRoot=s.sourceRoot,this.sources=s.sources,i.excludeContent||(this.sourcesContent=s.sourcesContent)}toString(){return JSON.stringify(this)}};function ps(e,i,s){let n=typeof s=="object"?s:{excludeContent:!!s,decodedMappings:!1},u=Fc(e,i);return new Bc(Vc(u),n)}import*as Wa from"querystring";import Hc from"process";var qc=jc(import.meta.url),Wc={".js":"js",".mjs":"js",".cjs":"js",".jsx":"jsx",".ts":"ts",".cts":"ts",".mts":"ts",".tsx":"tsx",".css":"css",".less":"css",".stylus":"css",".scss":"css",".sass":"css",".json":"json",".txt":"text"};function $c(e){return Wc[Be.extname(e).toLowerCase()]||"js"}function Gc(e){let i=[];return{addWatchFile(s){i.push(s)},getWatchFiles(){return i},emitFile(s){let n=s.fileName||s.name,u=e?.config?.outdir;if(u&&s.source&&n){let l=Be.resolve(u,n),m=Be.dirname(l);nt.existsSync(m)||nt.mkdirSync(m,{recursive:!0}),nt.writeFileSync(l,s.source)}},parse:dt,getNativeBuildContext(){return{framework:"bun",build:e}}}}function fs(e){let i=[],s=[];return{errors:i,warnings:s,mixedContext:{...e,error(n){i.push(n)},warn(n){s.push(n)}}}}function Kc(e){return i=>{if(typeof Bun>"u")throw new ReferenceError("Bun is not supported in this environment");if(!Bun.semver.satisfies(Bun.version,">=1.2.22"))throw new Error("Bun 1.2.22 or higher is required, please upgrade Bun");let s={framework:"bun"},n=Ge(e(i,s));return{name:(n.length===1?n[0].name:s.bunHostName)??`unplugin-host:${n.map(u=>u.name).join(":")}`,async setup(u){let l=Gc(u);n.some(E=>E.buildStart)&&u.onStart(async()=>{for(let E of n)E.buildStart&&await E.buildStart.call(l)});let m=n.filter(E=>E.resolveId).map(E=>({plugin:E,...we("resolveId",E.resolveId)})),g=n.filter(E=>E.load).map(E=>({plugin:E,...we("load",E.load)})),S=n.filter(E=>E.transform||E.transformInclude).map(E=>({plugin:E,...we("transform",E.transform)})),h=new Set;for(let E of n)E.resolveId&&E.load&&h.add(E.name);m.length&&u.onResolve({filter:/.*/},async E=>{if(!u.config?.external?.includes(E.path))for(let{plugin:F,handler:_,filter:k}of m){if(!k(E.path))continue;let{mixedContext:D,errors:R,warnings:H}=fs(l),z=E.kind==="entry-point-run"||E.kind==="entry-point-build",G=await _.call(D,E.path,z?void 0:E.importer,{isEntry:z});for(let d of H)console.warn("[unplugin]",typeof d=="string"?d:d.message);if(R.length>0){let d=R.map(re=>typeof re=="string"?re:re.message).join(`
13
13
  `);throw new Error(`[unplugin] ${F.name}: ${d}`)}if(typeof G=="string")return La(G)?{path:G}:{path:G,namespace:F.name};if(typeof G=="object"&&G!==null)return La(G.id)?{path:G.id,external:G.external}:{path:G.id,external:G.external,namespace:F.name}}});async function P(E,F,_){let k,D=!1,R=F==="file"?g:g.filter(H=>H.plugin.name===F);for(let{plugin:H,handler:z,filter:G}of R){if(H.loadInclude&&!H.loadInclude(E)||!G(E))continue;let{mixedContext:d,errors:re,warnings:X}=fs(l),ne=await z.call(d,E);for(let J of X)console.warn("[unplugin]",typeof J=="string"?J:J.message);if(re.length>0){let J=re.map(Z=>typeof Z=="string"?Z:Z.message).join(`
14
14
  `);throw new Error(`[unplugin] ${H.name}: ${J}`)}if(typeof ne=="string"){k=ne,D=!0;break}else if(typeof ne=="object"&&ne!==null){k=ne.code,D=!0;break}}if(!D&&F==="file"&&S.length>0&&(k=await Bun.file(E).text()),k!==void 0){let H=F==="file"?S:S.filter(z=>z.plugin.name===F);for(let{plugin:z,handler:G,filter:d}of H){if(z.transformInclude&&!z.transformInclude(E)||!d(E,k))continue;let{mixedContext:re,errors:X,warnings:ne}=fs(l),J=await G.call(re,k,E);for(let Z of ne)console.warn("[unplugin]",typeof Z=="string"?Z:Z.message);if(X.length>0){let Z=X.map(V=>typeof V=="string"?V:V.message).join(`