react-grab 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3211 +1,73 @@
1
- var ReactGrab = (function (exports) {
2
- 'use strict';
1
+ var ReactGrab=(function(exports){'use strict';/**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ var ce={name:"cursor",open:t=>{if(!t)return;let e=new URL("cursor://anysphere.cursor-deeplink/prompt");e.searchParams.set("text",t),window.open(e.toString(),"_blank");}};var Et=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Tt=t=>!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-"),Lt=t=>Array.isArray(t),Rt=(t,e=false)=>{let{composed:n,target:r}=t,c,s;if(r instanceof HTMLElement&&Tt(r)&&n){let a=t.composedPath()[0];a instanceof HTMLElement&&(c=a.tagName,s=a.role);}else r instanceof HTMLElement&&(c=r.tagName,s=r.role);return Lt(e)?!!(c&&e&&e.some(o=>typeof c=="string"&&o.toLowerCase()===c.toLowerCase()||o===s)):!!(c&&e&&e)},Mt=t=>Rt(t,Et),Pe=()=>{let t=c=>{Mt(c)||c.code!==void 0&&I.setState(s=>{let o=new Map(s.keyPressTimestamps);return s.pressedKeys.has(c.key)||o.set(c.key,Date.now()),{...s,keyPressTimestamps:o,pressedKeys:new Set([c.key,...s.pressedKeys])}});},e=c=>{c.code!==void 0&&I.setState(s=>{let o=new Map(s.keyPressTimestamps);return o.delete(c.key),{...s,keyPressTimestamps:o,pressedKeys:new Set([...s.pressedKeys].filter(a=>a!==c.key))}});},n=()=>{I.setState(c=>({...c,keyPressTimestamps:new Map,pressedKeys:new Set}));},r=()=>{I.setState(c=>({...c,keyPressTimestamps:new Map,pressedKeys:new Set}));};return document.addEventListener("keydown",t),document.addEventListener("keyup",e),window.addEventListener("blur",n),window.addEventListener("contextmenu",r),()=>{document.removeEventListener("keydown",t),document.removeEventListener("keyup",e),window.removeEventListener("blur",n),window.removeEventListener("contextmenu",r);}},ue=t=>{let{pressedKeys:e}=I.getState();return t.length===1?e.has(t.toLowerCase())||e.has(t.toUpperCase()):e.has(t)},De=(t,e,n)=>{let r=null,c=null,s=Date.now(),o=()=>{r!==null&&(clearTimeout(r),r=null),c!==null&&(c(),c=null);},a=(y,g)=>y.length===1?g.has(y.toLowerCase())||g.has(y.toUpperCase()):g.has(y),u=y=>Array.isArray(t)?t.every(g=>a(g,y)):a(t,y),l=()=>{let y=I.getState(),{pressedKeys:g}=y;if(!u(g)){r!==null&&(clearTimeout(r),r=null);return}let p=Date.now()-s,i=e-p;if(i<=0){n(),o();return}r!==null&&clearTimeout(r),r=setTimeout(()=>{n(),o();},i);};return c=I.subscribe(()=>{l();},y=>y.pressedKeys),l(),o};var $e="0.3.31",re=`bippy-${$e}`,He=Object.defineProperty,At=Object.prototype.hasOwnProperty,Y=()=>{},Ge=t=>{try{Function.prototype.toString.call(t).indexOf("^_^")>-1&&setTimeout(()=>{throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},Ue=(t=z())=>"getFiberRoots"in t,Ve=false,je,de=(t=z())=>Ve?true:(typeof t.inject=="function"&&(je=t.inject.toString()),!!je?.includes("(injected)")),te=new Set,q=new Set,Be=t=>{let e=new Map,n=0,r={checkDCE:Ge,supportsFiber:true,supportsFlight:true,hasUnsupportedRendererAttached:false,renderers:e,onCommitFiberRoot:Y,onCommitFiberUnmount:Y,onPostCommitFiberRoot:Y,on:Y,inject(c){let s=++n;return e.set(s,c),q.add(c),r._instrumentationIsActive||(r._instrumentationIsActive=true,te.forEach(o=>o())),s},_instrumentationSource:re,_instrumentationIsActive:false};try{He(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{get(){return r},set(o){if(o&&typeof o=="object"){let a=r.renderers;r=o,a.size>0&&(a.forEach((u,l)=>{q.add(u),o.renderers.set(l,u);}),ne(t));}},configurable:!0,enumerable:!0});let c=window.hasOwnProperty,s=!1;He(window,"hasOwnProperty",{value:function(){try{if(!s&&arguments[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,s=!0,-0}catch{}return c.apply(this,arguments)},configurable:!0,writable:!0});}catch{ne(t);}return r},ne=t=>{t&&te.add(t);try{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e)return;if(!e._instrumentationSource){if(e.checkDCE=Ge,e.supportsFiber=!0,e.supportsFlight=!0,e.hasUnsupportedRendererAttached=!1,e._instrumentationSource=re,e._instrumentationIsActive=!1,e.on=Y,e.renderers.size){e._instrumentationIsActive=!0,te.forEach(r=>r());return}let n=e.inject;de(e)&&!Ue()&&(Ve=!0,e.inject({scheduleRefresh(){}})&&(e._instrumentationIsActive=!0)),e.inject=r=>{let c=n(r);return q.add(r),e._instrumentationIsActive=!0,te.forEach(s=>s()),c};}(e.renderers.size||e._instrumentationIsActive||de())&&t?.();}catch{}},ze=()=>At.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),z=t=>ze()?(ne(t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Be(t),We=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),qe=()=>{try{We()&&z();}catch{}},fe=0,pe=1;var me=5;var he=11,ge=13;var ye=15,ve=16;var _e=19;var Se=26,Ce=27,be=28,we=30;var oe=t=>{let e=t;return typeof e=="function"?e:typeof e=="object"&&e?oe(e.type||e.render):null},ie=t=>{let e=t;if(typeof e=="string")return e;if(typeof e!="function"&&!(typeof e=="object"&&e))return null;let n=e.displayName||e.name||null;if(n)return n;let r=oe(e);return r&&(r.displayName||r.name)||null};var Ee=t=>z(()=>{let e=z();t.onActive?.(),e._instrumentationSource=t.name??re;let n=e.onCommitFiberRoot;t.onCommitFiberRoot&&(e.onCommitFiberRoot=(s,o,a)=>{n&&n(s,o,a),t.onCommitFiberRoot?.(s,o,a);});let r=e.onCommitFiberUnmount;t.onCommitFiberUnmount&&(e.onCommitFiberUnmount=(s,o)=>{r&&r(s,o),t.onCommitFiberUnmount?.(s,o);});let c=e.onPostCommitFiberRoot;t.onPostCommitFiberRoot&&(e.onPostCommitFiberRoot=(s,o)=>{c&&c(s,o),t.onPostCommitFiberRoot?.(s,o);});}),Te=t=>{let e=z();for(let n of e.renderers.values())try{let r=n.findFiberByHostInstance?.(t);if(r)return r}catch{}if(typeof t=="object"&&t!=null){if("_reactRootContainer"in t)return t._reactRootContainer?._internalRoot?.current?.child;for(let n in t)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return t[n]||null}return null},Le=new Set;qe();var Gt=Object.create,Ke=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Xe=Object.getOwnPropertyNames,Vt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty,G=(t,e)=>function(){return e||(0, t[Xe(t)[0]])((e={exports:{}}).exports,e),e.exports},zt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var c=Xe(e),s=0,o=c.length,a;s<o;s++)a=c[s],!Bt.call(t,a)&&a!==n&&Ke(t,a,{get:(u=>e[u]).bind(null,a),enumerable:!(r=Ut(e,a))||r.enumerable});return t},Wt=(t,e,n)=>(n=t!=null?Gt(Vt(t)):{},zt(Ke(n,"default",{value:t,enumerable:true}),t)),Ye=/^\s*at .*(\S+:\d+|\(native\))/m,qt=/^(eval@)?(\[native code\])?$/;function Kt(t,e){return t.match(Ye)?Xt(t,e):Yt(t,e)}function Qe(t){if(!t.includes(":"))return [t,void 0,void 0];let n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return [n[1],n[2]||void 0,n[3]||void 0]}function Je(t,e){return e&&e.slice!=null?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function Xt(t,e){return Je(t.split(`
10
+ `).filter(r=>!!r.match(Ye)),e).map(r=>{r.includes("(eval ")&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let c=r.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=c.match(/ (\(.+\)$)/);c=s?c.replace(s[0],""):c;let o=Qe(s?s[1]:c),a=s&&c||void 0,u=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return {function:a,file:u,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:r}})}function Yt(t,e){return Je(t.split(`
11
+ `).filter(r=>!r.match(qt)),e).map(r=>{if(r.includes(" > eval")&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!r.includes("@")&&!r.includes(":"))return {function:r};{let c=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=r.match(c),o=s&&s[1]?s[1]:void 0,a=Qe(r.replace(c,""));return {function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:r}}})}var Qt=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(n){if(0<=n&&n<e.length)return e[n];throw new TypeError("Must be between 0 and 63: "+n)},t.decode=function(n){var r=65,c=90,s=97,o=122,a=48,u=57,l=43,y=47,g=26,p=52;return r<=n&&n<=c?n-r:s<=n&&n<=o?n-s+g:a<=n&&n<=u?n-a+p:n==l?62:n==y?63:-1};}}),Ze=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js"(t){var e=Qt(),n=5,r=1<<n,c=r-1,s=r;function o(u){return u<0?(-u<<1)+1:(u<<1)+0}function a(u){var l=(u&1)===1,y=u>>1;return l?-y:y}t.encode=function(l){var y="",g,p=o(l);do g=p&c,p>>>=n,p>0&&(g|=s),y+=e.encode(g);while(p>0);return y},t.decode=function(l,y,g){var p=l.length,i=0,f=0,m,d;do{if(y>=p)throw new Error("Expected more digits in base 64 VLQ value.");if(d=e.decode(l.charCodeAt(y++)),d===-1)throw new Error("Invalid base64 digit: "+l.charAt(y-1));m=!!(d&s),d&=c,i=i+(d<<f),f+=n;}while(m);g.value=a(i),g.rest=y;};}}),Q=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js"(t){function e(v,_,w){if(_ in v)return v[_];if(arguments.length===3)return w;throw new Error('"'+_+'" is a required argument.')}t.getArg=e;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function c(v){var _=v.match(n);return _?{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}:null}t.urlParse=c;function s(v){var _="";return v.scheme&&(_+=v.scheme+":"),_+="//",v.auth&&(_+=v.auth+"@"),v.host&&(_+=v.host),v.port&&(_+=":"+v.port),v.path&&(_+=v.path),_}t.urlGenerate=s;var o=32;function a(v){var _=[];return function(w){for(var C=0;C<_.length;C++)if(_[C].input===w){var P=_[0];return _[0]=_[C],_[C]=P,_[0].result}var A=v(w);return _.unshift({input:w,result:A}),_.length>o&&_.pop(),A}}var u=a(function(_){var w=_,C=c(_);if(C){if(!C.path)return _;w=C.path;}for(var P=t.isAbsolute(w),A=[],k=0,O=0;;)if(k=O,O=w.indexOf("/",k),O===-1){A.push(w.slice(k));break}else for(A.push(w.slice(k,O));O<w.length&&w[O]==="/";)O++;for(var V,D=0,O=A.length-1;O>=0;O--)V=A[O],V==="."?A.splice(O,1):V===".."?D++:D>0&&(V===""?(A.splice(O+1,D),D=0):(A.splice(O,2),D--));return w=A.join("/"),w===""&&(w=P?"/":"."),C?(C.path=w,s(C)):w});t.normalize=u;function l(v,_){v===""&&(v="."),_===""&&(_=".");var w=c(_),C=c(v);if(C&&(v=C.path||"/"),w&&!w.scheme)return C&&(w.scheme=C.scheme),s(w);if(w||_.match(r))return _;if(C&&!C.host&&!C.path)return C.host=_,s(C);var P=_.charAt(0)==="/"?_:u(v.replace(/\/+$/,"")+"/"+_);return C?(C.path=P,s(C)):P}t.join=l,t.isAbsolute=function(v){return v.charAt(0)==="/"||n.test(v)};function y(v,_){v===""&&(v="."),v=v.replace(/\/$/,"");for(var w=0;_.indexOf(v+"/")!==0;){var C=v.lastIndexOf("/");if(C<0||(v=v.slice(0,C),v.match(/^([^\/]+:\/)?\/*$/)))return _;++w;}return Array(w+1).join("../")+_.substr(v.length+1)}t.relative=y;var g=function(){var v=Object.create(null);return !("__proto__"in v)}();function p(v){return v}function i(v){return m(v)?"$"+v:v}t.toSetString=g?p:i;function f(v){return m(v)?v.slice(1):v}t.fromSetString=g?p:f;function m(v){if(!v)return false;var _=v.length;if(_<9||v.charCodeAt(_-1)!==95||v.charCodeAt(_-2)!==95||v.charCodeAt(_-3)!==111||v.charCodeAt(_-4)!==116||v.charCodeAt(_-5)!==111||v.charCodeAt(_-6)!==114||v.charCodeAt(_-7)!==112||v.charCodeAt(_-8)!==95||v.charCodeAt(_-9)!==95)return false;for(var w=_-10;w>=0;w--)if(v.charCodeAt(w)!==36)return false;return true}function d(v,_,w){var C=E(v.source,_.source);return C!==0||(C=v.originalLine-_.originalLine,C!==0)||(C=v.originalColumn-_.originalColumn,C!==0||w)||(C=v.generatedColumn-_.generatedColumn,C!==0)||(C=v.generatedLine-_.generatedLine,C!==0)?C:E(v.name,_.name)}t.compareByOriginalPositions=d;function h(v,_,w){var C;return C=v.originalLine-_.originalLine,C!==0||(C=v.originalColumn-_.originalColumn,C!==0||w)||(C=v.generatedColumn-_.generatedColumn,C!==0)||(C=v.generatedLine-_.generatedLine,C!==0)?C:E(v.name,_.name)}t.compareByOriginalPositionsNoSource=h;function S(v,_,w){var C=v.generatedLine-_.generatedLine;return C!==0||(C=v.generatedColumn-_.generatedColumn,C!==0||w)||(C=E(v.source,_.source),C!==0)||(C=v.originalLine-_.originalLine,C!==0)||(C=v.originalColumn-_.originalColumn,C!==0)?C:E(v.name,_.name)}t.compareByGeneratedPositionsDeflated=S;function b(v,_,w){var C=v.generatedColumn-_.generatedColumn;return C!==0||w||(C=E(v.source,_.source),C!==0)||(C=v.originalLine-_.originalLine,C!==0)||(C=v.originalColumn-_.originalColumn,C!==0)?C:E(v.name,_.name)}t.compareByGeneratedPositionsDeflatedNoLine=b;function E(v,_){return v===_?0:v===null?1:_===null?-1:v>_?1:-1}function T(v,_){var w=v.generatedLine-_.generatedLine;return w!==0||(w=v.generatedColumn-_.generatedColumn,w!==0)||(w=E(v.source,_.source),w!==0)||(w=v.originalLine-_.originalLine,w!==0)||(w=v.originalColumn-_.originalColumn,w!==0)?w:E(v.name,_.name)}t.compareByGeneratedPositionsInflated=T;function L(v){return JSON.parse(v.replace(/^\)]}'[^\n]*\n/,""))}t.parseSourceMapInput=L;function R(v,_,w){if(_=_||"",v&&(v[v.length-1]!=="/"&&_[0]!=="/"&&(v+="/"),_=v+_),w){var C=c(w);if(!C)throw new Error("sourceMapURL could not be parsed");if(C.path){var P=C.path.lastIndexOf("/");P>=0&&(C.path=C.path.substring(0,P+1));}_=l(s(C),_);}return u(_)}t.computeSourceURL=R;}}),et=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js"(t){var e=Q(),n=Object.prototype.hasOwnProperty,r=typeof Map<"u";function c(){this._array=[],this._set=r?new Map:Object.create(null);}c.fromArray=function(o,a){for(var u=new c,l=0,y=o.length;l<y;l++)u.add(o[l],a);return u},c.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},c.prototype.add=function(o,a){var u=r?o:e.toSetString(o),l=r?this.has(o):n.call(this._set,u),y=this._array.length;(!l||a)&&this._array.push(o),l||(r?this._set.set(o,y):this._set[u]=y);},c.prototype.has=function(o){if(r)return this._set.has(o);var a=e.toSetString(o);return n.call(this._set,a)},c.prototype.indexOf=function(o){if(r){var a=this._set.get(o);if(a>=0)return a}else {var u=e.toSetString(o);if(n.call(this._set,u))return this._set[u]}throw new Error('"'+o+'" is not in the set.')},c.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},c.prototype.toArray=function(){return this._array.slice()},t.ArraySet=c;}}),Jt=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js"(t){var e=Q();function n(c,s){var o=c.generatedLine,a=s.generatedLine,u=c.generatedColumn,l=s.generatedColumn;return a>o||a==o&&l>=u||e.compareByGeneratedPositionsInflated(c,s)<=0}function r(){this._array=[],this._sorted=true,this._last={generatedLine:-1,generatedColumn:0};}r.prototype.unsortedForEach=function(s,o){this._array.forEach(s,o);},r.prototype.add=function(s){n(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=false,this._array.push(s));},r.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=true),this._array},t.MappingList=r;}}),tt=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js"(t){var e=Ze(),n=Q(),r=et().ArraySet,c=Jt().MappingList;function s(o){o||(o={}),this._file=n.getArg(o,"file",null),this._sourceRoot=n.getArg(o,"sourceRoot",null),this._skipValidation=n.getArg(o,"skipValidation",false),this._ignoreInvalidMapping=n.getArg(o,"ignoreInvalidMapping",false),this._sources=new r,this._names=new r,this._mappings=new c,this._sourcesContents=null;}s.prototype._version=3,s.fromSourceMap=function(a,u){var l=a.sourceRoot,y=new s(Object.assign(u||{},{file:a.file,sourceRoot:l}));return a.eachMapping(function(g){var p={generated:{line:g.generatedLine,column:g.generatedColumn}};g.source!=null&&(p.source=g.source,l!=null&&(p.source=n.relative(l,p.source)),p.original={line:g.originalLine,column:g.originalColumn},g.name!=null&&(p.name=g.name)),y.addMapping(p);}),a.sources.forEach(function(g){var p=g;l!==null&&(p=n.relative(l,g)),y._sources.has(p)||y._sources.add(p);var i=a.sourceContentFor(g);i!=null&&y.setSourceContent(g,i);}),y},s.prototype.addMapping=function(a){var u=n.getArg(a,"generated"),l=n.getArg(a,"original",null),y=n.getArg(a,"source",null),g=n.getArg(a,"name",null);!this._skipValidation&&this._validateMapping(u,l,y,g)===false||(y!=null&&(y=String(y),this._sources.has(y)||this._sources.add(y)),g!=null&&(g=String(g),this._names.has(g)||this._names.add(g)),this._mappings.add({generatedLine:u.line,generatedColumn:u.column,originalLine:l!=null&&l.line,originalColumn:l!=null&&l.column,source:y,name:g}));},s.prototype.setSourceContent=function(a,u){var l=a;this._sourceRoot!=null&&(l=n.relative(this._sourceRoot,l)),u!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(l)]=u):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(l)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null));},s.prototype.applySourceMap=function(a,u,l){var y=u;if(u==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);y=a.file;}var g=this._sourceRoot;g!=null&&(y=n.relative(g,y));var p=new r,i=new r;this._mappings.unsortedForEach(function(f){if(f.source===y&&f.originalLine!=null){var m=a.originalPositionFor({line:f.originalLine,column:f.originalColumn});m.source!=null&&(f.source=m.source,l!=null&&(f.source=n.join(l,f.source)),g!=null&&(f.source=n.relative(g,f.source)),f.originalLine=m.line,f.originalColumn=m.column,m.name!=null&&(f.name=m.name));}var d=f.source;d!=null&&!p.has(d)&&p.add(d);var h=f.name;h!=null&&!i.has(h)&&i.add(h);},this),this._sources=p,this._names=i,a.sources.forEach(function(f){var m=a.sourceContentFor(f);m!=null&&(l!=null&&(f=n.join(l,f)),g!=null&&(f=n.relative(g,f)),this.setSourceContent(f,m));},this);},s.prototype._validateMapping=function(a,u,l,y){if(u&&typeof u.line!="number"&&typeof u.column!="number"){var g="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(g),false;throw new Error(g)}if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!u&&!l&&!y)){if(a&&"line"in a&&"column"in a&&u&&"line"in u&&"column"in u&&a.line>0&&a.column>=0&&u.line>0&&u.column>=0&&l)return;var g="Invalid mapping: "+JSON.stringify({generated:a,source:l,original:u,name:y});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(g),false;throw new Error(g)}},s.prototype._serializeMappings=function(){for(var a=0,u=1,l=0,y=0,g=0,p=0,i="",f,m,d,h,S=this._mappings.toArray(),b=0,E=S.length;b<E;b++){if(m=S[b],f="",m.generatedLine!==u)for(a=0;m.generatedLine!==u;)f+=";",u++;else if(b>0){if(!n.compareByGeneratedPositionsInflated(m,S[b-1]))continue;f+=",";}f+=e.encode(m.generatedColumn-a),a=m.generatedColumn,m.source!=null&&(h=this._sources.indexOf(m.source),f+=e.encode(h-p),p=h,f+=e.encode(m.originalLine-1-y),y=m.originalLine-1,f+=e.encode(m.originalColumn-l),l=m.originalColumn,m.name!=null&&(d=this._names.indexOf(m.name),f+=e.encode(d-g),g=d)),i+=f;}return i},s.prototype._generateSourcesContent=function(a,u){return a.map(function(l){if(!this._sourcesContents)return null;u!=null&&(l=n.relative(u,l));var y=n.toSetString(l);return Object.prototype.hasOwnProperty.call(this._sourcesContents,y)?this._sourcesContents[y]:null},this)},s.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s;}}),Zt=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js"(t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2;function e(n,r,c,s,o,a){var u=Math.floor((r-n)/2)+n,l=o(c,s[u],true);return l===0?u:l>0?r-u>1?e(u,r,c,s,o,a):a==t.LEAST_UPPER_BOUND?r<s.length?r:-1:u:u-n>1?e(n,u,c,s,o,a):a==t.LEAST_UPPER_BOUND?u:n<0?-1:n}t.search=function(r,c,s,o){if(c.length===0)return -1;var a=e(-1,c.length,r,c,s,o||t.GREATEST_LOWER_BOUND);if(a<0)return -1;for(;a-1>=0&&s(c[a],c[a-1],true)===0;)--a;return a};}}),en=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js"(t){function e(c){function s(u,l,y){var g=u[l];u[l]=u[y],u[y]=g;}function o(u,l){return Math.round(u+Math.random()*(l-u))}function a(u,l,y,g){if(y<g){var p=o(y,g),i=y-1;s(u,p,g);for(var f=u[g],m=y;m<g;m++)l(u[m],f,false)<=0&&(i+=1,s(u,i,m));s(u,i+1,m);var d=i+1;a(u,l,y,d-1),a(u,l,d+1,g);}}return a}function n(c){let s=e.toString();return new Function(`return ${s}`)()(c)}let r=new WeakMap;t.quickSort=function(c,s,o=0){let a=r.get(s);a===void 0&&(a=n(s),r.set(s,a)),a(c,s,o,c.length-1);};}}),tn=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js"(t){var e=Q(),n=Zt(),r=et().ArraySet,c=Ze(),s=en().quickSort;function o(p,i){var f=p;return typeof p=="string"&&(f=e.parseSourceMapInput(p)),f.sections!=null?new g(f,i):new a(f,i)}o.fromSourceMap=function(p,i){return a.fromSourceMap(p,i)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(i,f){var m=i.charAt(f);return m===";"||m===","},o.prototype._parseMappings=function(i,f){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(i,f,m){var d=f||null,h=m||o.GENERATED_ORDER,S;switch(h){case o.GENERATED_ORDER:S=this._generatedMappings;break;case o.ORIGINAL_ORDER:S=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var b=this.sourceRoot,E=i.bind(d),T=this._names,L=this._sources,R=this._sourceMapURL,v=0,_=S.length;v<_;v++){var w=S[v],C=w.source===null?null:L.at(w.source);C!==null&&(C=e.computeSourceURL(b,C,R)),E({source:C,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:T.at(w.name)});}},o.prototype.allGeneratedPositionsFor=function(i){var f=e.getArg(i,"line"),m={source:e.getArg(i,"source"),originalLine:f,originalColumn:e.getArg(i,"column",0)};if(m.source=this._findSourceIndex(m.source),m.source<0)return [];var d=[],h=this._findMapping(m,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,n.LEAST_UPPER_BOUND);if(h>=0){var S=this._originalMappings[h];if(i.column===void 0)for(var b=S.originalLine;S&&S.originalLine===b;)d.push({line:e.getArg(S,"generatedLine",null),column:e.getArg(S,"generatedColumn",null),lastColumn:e.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++h];else for(var E=S.originalColumn;S&&S.originalLine===f&&S.originalColumn==E;)d.push({line:e.getArg(S,"generatedLine",null),column:e.getArg(S,"generatedColumn",null),lastColumn:e.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++h];}return d},t.SourceMapConsumer=o;function a(p,i){var f=p;typeof p=="string"&&(f=e.parseSourceMapInput(p));var m=e.getArg(f,"version"),d=e.getArg(f,"sources"),h=e.getArg(f,"names",[]),S=e.getArg(f,"sourceRoot",null),b=e.getArg(f,"sourcesContent",null),E=e.getArg(f,"mappings"),T=e.getArg(f,"file",null);if(m!=this._version)throw new Error("Unsupported version: "+m);S&&(S=e.normalize(S)),d=d.map(String).map(e.normalize).map(function(L){return S&&e.isAbsolute(S)&&e.isAbsolute(L)?e.relative(S,L):L}),this._names=r.fromArray(h.map(String),true),this._sources=r.fromArray(d,true),this._absoluteSources=this._sources.toArray().map(function(L){return e.computeSourceURL(S,L,i)}),this.sourceRoot=S,this.sourcesContent=b,this._mappings=E,this._sourceMapURL=i,this.file=T;}a.prototype=Object.create(o.prototype),a.prototype.consumer=o,a.prototype._findSourceIndex=function(p){var i=p;if(this.sourceRoot!=null&&(i=e.relative(this.sourceRoot,i)),this._sources.has(i))return this._sources.indexOf(i);var f;for(f=0;f<this._absoluteSources.length;++f)if(this._absoluteSources[f]==p)return f;return -1},a.fromSourceMap=function(i,f){var m=Object.create(a.prototype),d=m._names=r.fromArray(i._names.toArray(),true),h=m._sources=r.fromArray(i._sources.toArray(),true);m.sourceRoot=i._sourceRoot,m.sourcesContent=i._generateSourcesContent(m._sources.toArray(),m.sourceRoot),m.file=i._file,m._sourceMapURL=f,m._absoluteSources=m._sources.toArray().map(function(_){return e.computeSourceURL(m.sourceRoot,_,f)});for(var S=i._mappings.toArray().slice(),b=m.__generatedMappings=[],E=m.__originalMappings=[],T=0,L=S.length;T<L;T++){var R=S[T],v=new u;v.generatedLine=R.generatedLine,v.generatedColumn=R.generatedColumn,R.source&&(v.source=h.indexOf(R.source),v.originalLine=R.originalLine,v.originalColumn=R.originalColumn,R.name&&(v.name=d.indexOf(R.name)),E.push(v)),b.push(v);}return s(m.__originalMappings,e.compareByOriginalPositions),m},a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null;}let l=e.compareByGeneratedPositionsDeflatedNoLine;function y(p,i){let f=p.length,m=p.length-i;if(!(m<=1))if(m==2){let d=p[i],h=p[i+1];l(d,h)>0&&(p[i]=h,p[i+1]=d);}else if(m<20)for(let d=i;d<f;d++)for(let h=d;h>i;h--){let S=p[h-1],b=p[h];if(l(S,b)<=0)break;p[h-1]=b,p[h]=S;}else s(p,l,i);}a.prototype._parseMappings=function(i,f){var m=1,d=0,h=0,S=0,b=0,E=0,T=i.length,L=0,v={},_=[],w=[],C,A,k,O;let V=0;for(;L<T;)if(i.charAt(L)===";")m++,L++,d=0,y(w,V),V=w.length;else if(i.charAt(L)===",")L++;else {for(C=new u,C.generatedLine=m,k=L;k<T&&!this._charIsMappingSeparator(i,k);k++);for(i.slice(L,k),A=[];L<k;)c.decode(i,L,v),O=v.value,L=v.rest,A.push(O);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");if(C.generatedColumn=d+A[0],d=C.generatedColumn,A.length>1&&(C.source=b+A[1],b+=A[1],C.originalLine=h+A[2],h=C.originalLine,C.originalLine+=1,C.originalColumn=S+A[3],S=C.originalColumn,A.length>4&&(C.name=E+A[4],E+=A[4])),w.push(C),typeof C.originalLine=="number"){let M=C.source;for(;_.length<=M;)_.push(null);_[M]===null&&(_[M]=[]),_[M].push(C);}}y(w,V),this.__generatedMappings=w;for(var D=0;D<_.length;D++)_[D]!=null&&s(_[D],e.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(..._);},a.prototype._findMapping=function(i,f,m,d,h,S){if(i[m]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+i[m]);if(i[d]<0)throw new TypeError("Column must be greater than or equal to 0, got "+i[d]);return n.search(i,f,h,S)},a.prototype.computeColumnSpans=function(){for(var i=0;i<this._generatedMappings.length;++i){var f=this._generatedMappings[i];if(i+1<this._generatedMappings.length){var m=this._generatedMappings[i+1];if(f.generatedLine===m.generatedLine){f.lastGeneratedColumn=m.generatedColumn-1;continue}}f.lastGeneratedColumn=1/0;}},a.prototype.originalPositionFor=function(i){var f={generatedLine:e.getArg(i,"line"),generatedColumn:e.getArg(i,"column")},m=this._findMapping(f,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(i,"bias",o.GREATEST_LOWER_BOUND));if(m>=0){var d=this._generatedMappings[m];if(d.generatedLine===f.generatedLine){var h=e.getArg(d,"source",null);h!==null&&(h=this._sources.at(h),h=e.computeSourceURL(this.sourceRoot,h,this._sourceMapURL));var S=e.getArg(d,"name",null);return S!==null&&(S=this._names.at(S)),{source:h,line:e.getArg(d,"originalLine",null),column:e.getArg(d,"originalColumn",null),name:S}}}return {source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(i){return i==null}):false},a.prototype.sourceContentFor=function(i,f){if(!this.sourcesContent)return null;var m=this._findSourceIndex(i);if(m>=0)return this.sourcesContent[m];var d=i;this.sourceRoot!=null&&(d=e.relative(this.sourceRoot,d));var h;if(this.sourceRoot!=null&&(h=e.urlParse(this.sourceRoot))){var S=d.replace(/^file:\/\//,"");if(h.scheme=="file"&&this._sources.has(S))return this.sourcesContent[this._sources.indexOf(S)];if((!h.path||h.path=="/")&&this._sources.has("/"+d))return this.sourcesContent[this._sources.indexOf("/"+d)]}if(f)return null;throw new Error('"'+d+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(i){var f=e.getArg(i,"source");if(f=this._findSourceIndex(f),f<0)return {line:null,column:null,lastColumn:null};var m={source:f,originalLine:e.getArg(i,"line"),originalColumn:e.getArg(i,"column")},d=this._findMapping(m,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(i,"bias",o.GREATEST_LOWER_BOUND));if(d>=0){var h=this._originalMappings[d];if(h.source===m.source)return {line:e.getArg(h,"generatedLine",null),column:e.getArg(h,"generatedColumn",null),lastColumn:e.getArg(h,"lastGeneratedColumn",null)}}return {line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=a;function g(p,i){var f=p;typeof p=="string"&&(f=e.parseSourceMapInput(p));var m=e.getArg(f,"version"),d=e.getArg(f,"sections");if(m!=this._version)throw new Error("Unsupported version: "+m);this._sources=new r,this._names=new r;var h={line:-1,column:0};this._sections=d.map(function(S){if(S.url)throw new Error("Support for url field in sections not implemented.");var b=e.getArg(S,"offset"),E=e.getArg(b,"line"),T=e.getArg(b,"column");if(E<h.line||E===h.line&&T<h.column)throw new Error("Section offsets must be ordered and non-overlapping.");return h=b,{generatedOffset:{generatedLine:E+1,generatedColumn:T+1},consumer:new o(e.getArg(S,"map"),i)}});}g.prototype=Object.create(o.prototype),g.prototype.constructor=o,g.prototype._version=3,Object.defineProperty(g.prototype,"sources",{get:function(){for(var p=[],i=0;i<this._sections.length;i++)for(var f=0;f<this._sections[i].consumer.sources.length;f++)p.push(this._sections[i].consumer.sources[f]);return p}}),g.prototype.originalPositionFor=function(i){var f={generatedLine:e.getArg(i,"line"),generatedColumn:e.getArg(i,"column")},m=n.search(f,this._sections,function(h,S){var b=h.generatedLine-S.generatedOffset.generatedLine;return b||h.generatedColumn-S.generatedOffset.generatedColumn}),d=this._sections[m];return d?d.consumer.originalPositionFor({line:f.generatedLine-(d.generatedOffset.generatedLine-1),column:f.generatedColumn-(d.generatedOffset.generatedLine===f.generatedLine?d.generatedOffset.generatedColumn-1:0),bias:i.bias}):{source:null,line:null,column:null,name:null}},g.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(i){return i.consumer.hasContentsOfAllSources()})},g.prototype.sourceContentFor=function(i,f){for(var m=0;m<this._sections.length;m++){var d=this._sections[m],h=d.consumer.sourceContentFor(i,true);if(h||h==="")return h}if(f)return null;throw new Error('"'+i+'" is not in the SourceMap.')},g.prototype.generatedPositionFor=function(i){for(var f=0;f<this._sections.length;f++){var m=this._sections[f];if(m.consumer._findSourceIndex(e.getArg(i,"source"))!==-1){var d=m.consumer.generatedPositionFor(i);if(d){var h={line:d.line+(m.generatedOffset.generatedLine-1),column:d.column+(m.generatedOffset.generatedLine===d.line?m.generatedOffset.generatedColumn-1:0)};return h}}}return {line:null,column:null}},g.prototype._parseMappings=function(i,f){this.__generatedMappings=[],this.__originalMappings=[];for(var m=0;m<this._sections.length;m++)for(var d=this._sections[m],h=d.consumer._generatedMappings,S=0;S<h.length;S++){var b=h[S],E=d.consumer._sources.at(b.source);E!==null&&(E=e.computeSourceURL(d.consumer.sourceRoot,E,this._sourceMapURL)),this._sources.add(E),E=this._sources.indexOf(E);var T=null;b.name&&(T=d.consumer._names.at(b.name),this._names.add(T),T=this._names.indexOf(T));var L={source:E,generatedLine:b.generatedLine+(d.generatedOffset.generatedLine-1),generatedColumn:b.generatedColumn+(d.generatedOffset.generatedLine===b.generatedLine?d.generatedOffset.generatedColumn-1:0),originalLine:b.originalLine,originalColumn:b.originalColumn,name:T};this.__generatedMappings.push(L),typeof L.originalLine=="number"&&this.__originalMappings.push(L);}s(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),s(this.__originalMappings,e.compareByOriginalPositions);},t.IndexedSourceMapConsumer=g;}}),nn=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js"(t){var e=tt().SourceMapGenerator,n=Q(),r=/(\r?\n)/,c=10,s="$$$isSourceNode$$$";function o(a,u,l,y,g){this.children=[],this.sourceContents={},this.line=a??null,this.column=u??null,this.source=l??null,this.name=g??null,this[s]=true,y!=null&&this.add(y);}o.fromStringWithSourceMap=function(u,l,y){var g=new o,p=u.split(r),i=0,f=function(){var b=T(),E=T()||"";return b+E;function T(){return i<p.length?p[i++]:void 0}},m=1,d=0,h=null;return l.eachMapping(function(b){if(h!==null)if(m<b.generatedLine)S(h,f()),m++,d=0;else {var E=p[i]||"",T=E.substr(0,b.generatedColumn-d);p[i]=E.substr(b.generatedColumn-d),d=b.generatedColumn,S(h,T),h=b;return}for(;m<b.generatedLine;)g.add(f()),m++;if(d<b.generatedColumn){var E=p[i]||"";g.add(E.substr(0,b.generatedColumn)),p[i]=E.substr(b.generatedColumn),d=b.generatedColumn;}h=b;},this),i<p.length&&(h&&S(h,f()),g.add(p.splice(i).join(""))),l.sources.forEach(function(b){var E=l.sourceContentFor(b);E!=null&&(y!=null&&(b=n.join(y,b)),g.setSourceContent(b,E));}),g;function S(b,E){if(b===null||b.source===void 0)g.add(E);else {var T=y?n.join(y,b.source):b.source;g.add(new o(b.originalLine,b.originalColumn,T,E,b.name));}}},o.prototype.add=function(u){if(Array.isArray(u))u.forEach(function(l){this.add(l);},this);else if(u[s]||typeof u=="string")u&&this.children.push(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},o.prototype.prepend=function(u){if(Array.isArray(u))for(var l=u.length-1;l>=0;l--)this.prepend(u[l]);else if(u[s]||typeof u=="string")this.children.unshift(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},o.prototype.walk=function(u){for(var l,y=0,g=this.children.length;y<g;y++)l=this.children[y],l[s]?l.walk(u):l!==""&&u(l,{source:this.source,line:this.line,column:this.column,name:this.name});},o.prototype.join=function(u){var l,y,g=this.children.length;if(g>0){for(l=[],y=0;y<g-1;y++)l.push(this.children[y]),l.push(u);l.push(this.children[y]),this.children=l;}return this},o.prototype.replaceRight=function(u,l){var y=this.children[this.children.length-1];return y[s]?y.replaceRight(u,l):typeof y=="string"?this.children[this.children.length-1]=y.replace(u,l):this.children.push("".replace(u,l)),this},o.prototype.setSourceContent=function(u,l){this.sourceContents[n.toSetString(u)]=l;},o.prototype.walkSourceContents=function(u){for(var l=0,y=this.children.length;l<y;l++)this.children[l][s]&&this.children[l].walkSourceContents(u);for(var g=Object.keys(this.sourceContents),l=0,y=g.length;l<y;l++)u(n.fromSetString(g[l]),this.sourceContents[g[l]]);},o.prototype.toString=function(){var u="";return this.walk(function(l){u+=l;}),u},o.prototype.toStringWithSourceMap=function(u){var l={code:"",line:1,column:0},y=new e(u),g=false,p=null,i=null,f=null,m=null;return this.walk(function(d,h){l.code+=d,h.source!==null&&h.line!==null&&h.column!==null?((p!==h.source||i!==h.line||f!==h.column||m!==h.name)&&y.addMapping({source:h.source,original:{line:h.line,column:h.column},generated:{line:l.line,column:l.column},name:h.name}),p=h.source,i=h.line,f=h.column,m=h.name,g=true):g&&(y.addMapping({generated:{line:l.line,column:l.column}}),p=null,g=false);for(var S=0,b=d.length;S<b;S++)d.charCodeAt(S)===c?(l.line++,l.column=0,S+1===b?(p=null,g=false):g&&y.addMapping({source:h.source,original:{line:h.line,column:h.column},generated:{line:l.line,column:l.column},name:h.name})):l.column++;}),this.walkSourceContents(function(d,h){y.setSourceContent(d,h);}),{code:l.code,map:y}},t.SourceNode=o;}}),rn=G({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js"(t){t.SourceMapGenerator=tt().SourceMapGenerator,t.SourceMapConsumer=tn().SourceMapConsumer,t.SourceNode=nn().SourceNode;}}),on=Wt(rn()),Re=false,W=t=>`
12
+ in ${t}`,sn=/^data:application\/json[^,]+base64,/,an=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,nt=async(t,e)=>{let n=e.split(`
13
+ `),r;for(let o=n.length-1;o>=0&&!r;o--){let a=n[o].match(an);a&&(r=a[1]);}if(!r)return null;if(!(sn.test(r)||r.startsWith("/"))){let o=t.split("/");o[o.length-1]=r,r=o.join("/");}let s=await(await fetch(r)).json();return new on.SourceMapConsumer(s)},rt=async(t,e)=>{let n=Kt(t);if(!n.length)return [];let r=n.slice(0,e);return (await Promise.all(r.map(async({file:s,line:o,col:a=0})=>{if(!s||!o)return null;try{let u=await fetch(s);if(u.ok){let l=await u.text(),y=await nt(s,l);if(y){let g=y.originalPositionFor({line:o,column:a});return {fileName:(y.file||g.source).replace(/^file:\/\//,""),lineNumber:g.line,columnNumber:g.column}}}return {fileName:s.replace(/^file:\/\//,""),lineNumber:o,columnNumber:a}}catch{return {fileName:s.replace(/^file:\/\//,""),lineNumber:o,columnNumber:a}}}))).filter(s=>s!==null)},se=(t,e)=>{if(!t||Re)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Re=true;let r=ot();Me(null);let c=console.error,s=console.warn;console.error=()=>{},console.warn=()=>{};try{let u={DetermineComponentFrameRoot(){let p;try{if(e){let i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[]);}catch(f){p=f;}Reflect.construct(t,[],i);}else {try{i.call();}catch(f){p=f;}t.call(i.prototype);}}else {try{throw Error()}catch(f){p=f;}let i=t();i&&typeof i.catch=="function"&&i.catch(()=>{});}}catch(i){if(i&&p&&typeof i.stack=="string")return [i.stack,p.stack]}return [null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[y,g]=u.DetermineComponentFrameRoot();if(y&&g){let p=y.split(`
14
+ `),i=g.split(`
15
+ `),f=0,m=0;for(;f<p.length&&!p[f].includes("DetermineComponentFrameRoot");)f++;for(;m<i.length&&!i[m].includes("DetermineComponentFrameRoot");)m++;if(f===p.length||m===i.length)for(f=p.length-1,m=i.length-1;f>=1&&m>=0&&p[f]!==i[m];)m--;for(;f>=1&&m>=0;f--,m--)if(p[f]!==i[m]){if(f!==1||m!==1)do if(f--,m--,m<0||p[f]!==i[m]){let d=`
16
+ ${p[f].replace(" at new "," at ")}`,h=ie(t);return h&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",h)),d}while(f>=1&&m>=0);break}}}finally{Re=false,Error.prepareStackTrace=n,Me(r),console.error=c,console.warn=s;}let o=t?ie(t):"";return o?W(o):""},ot=()=>{let t=z();for(let e of [...Array.from(q),...Array.from(t.renderers.values())]){let n=e.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Me=t=>{for(let e of q){let n=e.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=t:n.current=t);}};var it=(t,e)=>{switch(t.tag){case Se:case Ce:case me:return W(t.type);case ve:return W("Lazy");case ge:return t.child!==e&&e!==null?W("Suspense Fallback"):W("Suspense");case _e:return W("SuspenseList");case fe:case ye:return se(t.type,false);case he:return se(t.type.render,false);case pe:return se(t.type,true);case be:return W("Activity");case we:return W("ViewTransition");default:return ""}},st=(t,e,n)=>{let r=`
17
+ in ${t}`;return e&&(r+=` (at ${e})`),r},Ae=t=>{try{let e="",n=t,r=null;do{e+=it(n,r);let c=n._debugInfo;if(c&&Array.isArray(c))for(let s=c.length-1;s>=0;s--){let o=c[s];typeof o.name=="string"&&(e+=st(o.name,o.env,o.debugLocation));}r=n,n=n.return;}while(n);return e}catch(e){return e instanceof Error?`
18
+ Error generating stack: ${e.message}
19
+ ${e.stack}`:""}},at=t=>t.length?t[0]===t[0].toUpperCase():false,Oe=async t=>{let e=/\n\s+(?:in|at)\s+([^\s(]+)(?:\s+\((?:at\s+)?([^)]+)\))?/g,n=[],r;for(r=e.exec(t);r!==null;){let c=r[1],s=r[2];if(!at(c)){r=e.exec(t),n.push({name:c,source:void 0});continue}let o;if(s&&s!=="Server")try{let a=` at ${c} (${s})`,u=await rt(a,1);u.length>0&&(o=u[0]);}catch{}n.push({name:c,source:o||void 0}),r=e.exec(t);}return n};var ln=Le;Ee({onCommitFiberRoot(t,e){ln.add(e);}});var lt=async t=>{let e=Te(t);if(!e)return null;let n=Ae(e);return (await Oe(n)).map(s=>({componentName:s.name,fileName:s.source?.fileName}))},ct=t=>t.filter(e=>e.fileName&&!e.fileName.includes("node_modules")&&e.componentName.length>1&&!e.fileName.startsWith("_")),cn=t=>{if(t.length===0)return "";if(t.length===1){let r=t[0].lastIndexOf("/");return r>0?t[0].substring(0,r+1):""}let e=t[0];for(let r=1;r<t.length;r++){let c=t[r],s=0;for(;s<e.length&&s<c.length&&e[s]===c[s];)s++;e=e.substring(0,s);}let n=e.lastIndexOf("/");return n>0?e.substring(0,n+1):""},ut=t=>{let e=t.map(r=>r.fileName).filter(r=>!!r),n=cn(e);return t.map(r=>{let c=r.fileName;return c&&n&&(c=c.startsWith(n)?c.substring(n.length):c),`${r.componentName}${c?` (${c})`:""}`}).join(`
20
+ `)},dt=t=>{let e=new Set(["article","aside","footer","form","header","main","nav","section"]),n=d=>{let h=d.tagName.toLowerCase();if(e.has(h)||d.id)return true;if(d.className&&typeof d.className=="string"){let S=d.className.trim();if(S&&S.length>0)return true}return Array.from(d.attributes).some(S=>S.name.startsWith("data-"))},r=(d,h=10)=>{let S=[],b=d.parentElement,E=0;for(;b&&E<h&&b.tagName!=="BODY"&&!(n(b)&&(S.push(b),S.length>=3));)b=b.parentElement,E++;return S.reverse()},c=d=>{let h=[],S=d,b=0,E=5;for(;S&&b<E&&S.tagName!=="BODY";){let T=S.tagName.toLowerCase();if(S.id){T+=`#${S.id}`,h.unshift(T);break}else if(S.className&&typeof S.className=="string"&&S.className.trim()){let L=S.className.trim().split(/\s+/).slice(0,2);T+=`.${L.join(".")}`;}if(!S.id&&(!S.className||!S.className.trim())&&S.parentElement){let L=Array.from(S.parentElement.children),R=L.indexOf(S);R>=0&&L.length>1&&(T+=`:nth-child(${R+1})`);}h.unshift(T),S=S.parentElement,b++;}return h.join(" > ")},s=(d,h=false)=>{let S=d.tagName.toLowerCase(),b=[];if(d.id&&b.push(`id="${d.id}"`),d.className&&typeof d.className=="string"){let R=d.className.trim().split(/\s+/);if(R.length>0&&R[0]){let _=(h?R.slice(0,3):R).join(" ");_.length>30&&(_=_.substring(0,30)+"..."),b.push(`class="${_}"`);}}let E=Array.from(d.attributes).filter(R=>R.name.startsWith("data-")),T=h?E.slice(0,1):E;for(let R of T){let v=R.value;v.length>20&&(v=v.substring(0,20)+"..."),b.push(`${R.name}="${v}"`);}let L=d.getAttribute("aria-label");if(L&&!h){let R=L;R.length>20&&(R=R.substring(0,20)+"..."),b.push(`aria-label="${R}"`);}return b.length>0?`<${S} ${b.join(" ")}>`:`<${S}>`},o=d=>`</${d.tagName.toLowerCase()}>`,a=d=>{let h=d.textContent||"";h=h.trim().replace(/\s+/g," ");let S=60;return h.length>S&&(h=h.substring(0,S)+"..."),h},u=d=>{if(d.id)return `#${d.id}`;if(d.className&&typeof d.className=="string"){let h=d.className.trim().split(/\s+/);if(h.length>0&&h[0])return `.${h[0]}`}return null},l=[];l.push(`Path: ${c(t)}`),l.push("");let y=r(t);for(let d=0;d<y.length;d++){let h=" ".repeat(d);l.push(h+s(y[d],true));}let g=t.parentElement,p=-1;if(g){let d=Array.from(g.children);if(p=d.indexOf(t),p>0){let h=d[p-1];if(u(h)&&p<=2){let b=" ".repeat(y.length);l.push(`${b} ${s(h,true)}`),l.push(`${b} </${h.tagName.toLowerCase()}>`);}else if(p>0){let b=" ".repeat(y.length);l.push(`${b} ... (${p} element${p===1?"":"s"})`);}}}let i=" ".repeat(y.length);l.push(i+" <!-- SELECTED -->");let f=a(t),m=t.children.length;if(f&&m===0&&f.length<40?l.push(`${i} ${s(t)}${f}${o(t)}`):(l.push(i+" "+s(t)),f&&l.push(`${i} ${f}`),m>0&&l.push(`${i} ... (${m} element${m===1?"":"s"})`),l.push(i+" "+o(t))),g&&p>=0){let d=Array.from(g.children),h=d.length-p-1;if(h>0){let S=d[p+1];u(S)&&h<=2?(l.push(`${i} ${s(S,true)}`),l.push(`${i} </${S.tagName.toLowerCase()}>`)):l.push(`${i} ... (${h} element${h===1?"":"s"})`);}}for(let d=y.length-1;d>=0;d--){let h=" ".repeat(d);l.push(h+o(y[d]));}return l.join(`
21
+ `)};var ae=(t,e,n)=>t+(e-t)*n;var un=({borderRadius:t,height:e,transform:n,width:r,x:c,y:s})=>{let o=document.createElement("div");return o.style.position="fixed",o.style.top=`${s}px`,o.style.left=`${c}px`,o.style.width=`${r}px`,o.style.height=`${e}px`,o.style.borderRadius=t,o.style.transform=n,o.style.pointerEvents="none",o.style.border="1px solid rgb(210, 57, 192)",o.style.backgroundColor="rgba(210, 57, 192, 0.2)",o.style.zIndex="2147483646",o.style.boxSizing="border-box",o.style.display="none",o},dn=(t,{borderRadius:e,height:n,transform:r,width:c,x:s,y:o})=>{let a=parseFloat(t.style.top)||0,u=parseFloat(t.style.left)||0,l=parseFloat(t.style.width)||0,y=parseFloat(t.style.height)||0,g=`${ae(a,o,.95)}px`,p=`${ae(u,s,.95)}px`,i=`${ae(l,c,.95)}px`,f=`${ae(y,n,.95)}px`;t.style.top!==g&&(t.style.top=g),t.style.left!==p&&(t.style.left=p),t.style.width!==i&&(t.style.width=i),t.style.height!==f&&(t.style.height=f),t.style.borderRadius!==e&&(t.style.borderRadius=e),t.style.transform!==r&&(t.style.transform=r);},ft=t=>{let e=un({borderRadius:"0px",height:0,transform:"none",width:0,x:-1e3,y:-1e3});t.appendChild(e);let n=false;return {hide:()=>{n=false,e.style.display="none";},isVisible:()=>n,show:()=>{n=true,e.style.display="block";},update:r=>{dn(e,r);}}},pt=(t,e)=>{let n=document.createElement("div");n.style.position="fixed",n.style.top=`${e.y}px`,n.style.left=`${e.x}px`,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n.style.borderRadius=e.borderRadius,n.style.transform=e.transform,n.style.pointerEvents="none",n.style.border="1px solid rgb(210, 57, 192)",n.style.backgroundColor="rgba(210, 57, 192, 0.2)",n.style.zIndex="2147483646",n.style.boxSizing="border-box",n.style.transition="opacity 0.3s ease-out",n.style.opacity="1",t.appendChild(n),requestAnimationFrame(()=>{n.style.opacity="0";}),setTimeout(()=>{n.remove();},300);},fn=()=>{let t=document.createElement("span");return t.style.display="inline-block",t.style.width="8px",t.style.height="8px",t.style.border="1.5px solid rgb(210, 57, 192)",t.style.borderTopColor="transparent",t.style.borderRadius="50%",t.style.marginRight="4px",t.style.verticalAlign="middle",t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0}),t},J=null,mt=()=>{let t=document.createElement("div");return t.style.position="fixed",t.style.top="calc(8px + env(safe-area-inset-top))",t.style.padding="2px 6px",t.style.backgroundColor="#fde7f7",t.style.color="#b21c8e",t.style.border="1px solid #f7c5ec",t.style.borderRadius="4px",t.style.fontSize="11px",t.style.fontWeight="500",t.style.fontFamily="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",t.style.zIndex="2147483647",t.style.pointerEvents="none",t.style.opacity="0",t.style.transition="opacity 0.2s ease-in-out",t.style.display="flex",t.style.alignItems="center",t.style.maxWidth="calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)))",t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap",t},ht=(t,e,n,r)=>{let c=J,s=false;if(c||(c=mt(),t.appendChild(c),J=c,s=true,xe=false),!xe){let b=c.querySelector("span");if(b){let E=document.createElement("span");E.textContent=r?`<${r}>`:"<element>",E.style.fontFamily="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",E.style.fontVariantNumeric="tabular-nums",b.replaceChildren(E);}else {let E=document.createElement("span"),T=document.createElement("span");T.textContent=r?`<${r}>`:"<element>",T.style.fontFamily="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",T.style.fontVariantNumeric="tabular-nums",E.appendChild(T),c.appendChild(E);}}let o=c.getBoundingClientRect(),a=window.innerWidth,u=window.innerHeight,l=Math.round(e),y=Math.round(n)-o.height-6,g=4,p=8,i=8,f=a-o.width-8,m=u-o.height-8,d=l<p,h=y<i,S=d||h;l=Math.max(p,Math.min(l,f)),y=Math.max(i,Math.min(y,m)),S&&(l+=g,y+=g),c.style.left=`${l}px`,c.style.top=`${y}px`,c.style.right="auto",s?requestAnimationFrame(()=>{c.style.opacity="1";}):c.style.opacity!=="1"&&(c.style.opacity="1");},xe=false,le=new Set,gt=(t,e,n)=>{let r=mt();r.style.zIndex="2147483648",t.appendChild(r),le.add(r);let c=()=>{if(e===void 0||n===void 0)return;let a=r.getBoundingClientRect(),u=window.innerWidth,l=window.innerHeight,y=Math.round(e),g=Math.round(n)-a.height-6,p=4,i=8,f=8,m=u-a.width-8,d=l-a.height-8,h=y<i,S=g<f,b=h||S;y=Math.max(i,Math.min(y,m)),g=Math.max(f,Math.min(g,d)),b&&(y+=p,g+=p),r.style.left=`${y}px`,r.style.top=`${g}px`,r.style.right="auto";},s=fn(),o=document.createElement("span");return o.textContent="Grabbing\u2026",r.appendChild(s),r.appendChild(o),c(),requestAnimationFrame(()=>{r.style.opacity="1";}),a=>{r.textContent="";let u=document.createElement("span");u.textContent="\u2713",u.style.display="inline-block",u.style.marginRight="4px",u.style.fontWeight="600";let l=document.createElement("span"),y=document.createElement("span");y.textContent=a?`<${a}>`:"<element>",y.style.fontFamily="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",y.style.fontVariantNumeric="tabular-nums",l.appendChild(document.createTextNode("Grabbed ")),l.appendChild(y),r.appendChild(u),r.appendChild(l),requestAnimationFrame(()=>{c();}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>{r.remove(),le.delete(r);},200);},1500);}},K=()=>{J&&(J.remove(),J=null),xe=false;},Ie=()=>{for(let t of le)t.remove();le.clear();},U=null,pn=()=>{let t=document.createElement("div");t.style.position="fixed",t.style.zIndex="2147483647",t.style.pointerEvents="none",t.style.opacity="0",t.style.transition="opacity 0.1s ease-in-out";let e=document.createElement("div");e.style.width="32px",e.style.height="2px",e.style.backgroundColor="rgba(178, 28, 142, 0.2)",e.style.borderRadius="1px",e.style.overflow="hidden",e.style.position="relative";let n=document.createElement("div");return n.style.width="0%",n.style.height="100%",n.style.backgroundColor="#b21c8e",n.style.borderRadius="1px",n.style.transition="width 0.05s linear",n.setAttribute("data-progress-fill","true"),e.appendChild(n),t.appendChild(e),t},Fe=(t,e,n,r)=>{U||(U=pn(),t.appendChild(U),requestAnimationFrame(()=>{U&&(U.style.opacity="1");}));let c=U,s=c.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight,u=14,l=8,y=n-s.width/2,g=r+u;g+s.height+l>a&&(g=r-s.height-u),g=Math.max(l,Math.min(g,a-s.height-l)),y=Math.max(l,Math.min(y,o-s.width-l)),c.style.top=`${g}px`,c.style.left=`${y}px`;let p=c.querySelector("[data-progress-fill]");if(p){let i=Math.min(100,Math.max(0,e*100));p.style.width=`${i}%`;}},yt=()=>{U&&(U.style.opacity="0",setTimeout(()=>{U&&(U.remove(),U=null);},100));};var mn=typeof window<"u"&&window.navigator.clipboard&&window.isSecureContext,Ne=async t=>{if(mn)try{return await navigator.clipboard.writeText(t),!0}catch{}let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="fixed",e.style.top="-9999px",e.style.opacity="0",e.style.pointerEvents="none";let n=document.body||document.documentElement;n.appendChild(e),e.select(),e.setSelectionRange(0,e.value.length);let r=false;try{r=document.execCommand("copy");}catch{r=false;}finally{n.removeChild(e);}return r};var vt=(t,e=window.getComputedStyle(t))=>e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0";var X="data-react-grab",_t=()=>{let t=document.querySelector(`[${X}]`);if(t){let s=t.shadowRoot?.querySelector(`[${X}]`);if(s instanceof HTMLDivElement&&t.shadowRoot)return s}let e=document.createElement("div");e.setAttribute(X,"true"),e.style.zIndex="2147483646",e.style.position="fixed",e.style.top="0",e.style.left="0";let n=e.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(X,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(e),r};var St=t=>{let e=new Map,n=0,r,c=g=>{let p=r,i=typeof g=="function"?g(p):g,f={...p,...i};r=f;for(let m of e.values())if(m.type==="selected"){let d=m.selector(f),h=m.prevSelectedValue;Object.is(h,d)||(m.prevSelectedValue=d,m.listener(d,h));}else m.listener(f,p);return r},s=()=>r,o=t(c,s);r=o;let a=(g,p)=>{let i=String(n++),m={listener:(d,h)=>g(d,h),prevSelectedValue:p(r),selector:p,type:"selected"};return e.set(i,m),()=>{e.delete(i);}},u=g=>{let p=String(n++),i={listener:g,type:"full"};return e.set(p,i),()=>{e.delete(p);}};function l(g,p){return p?a(g,p):u(g)}return {getInitialState(){return o},getState:s,setState:c,subscribe:l}};var I=St(()=>({keyPressTimestamps:new Map,mouseX:-1e3,mouseY:-1e3,overlayMode:"hidden",pressedKeys:new Set})),hn=(t={})=>{if(t.enabled===false)return;let e={adapter:void 0,enabled:true,hotkey:["Meta","C"],keyHoldDuration:500,...t},n=_t(),r=ft(n),c=null,s=null,o=false,a=null,u=null,l=()=>{if(Array.isArray(e.hotkey)){for(let M of e.hotkey)if(!ue(M))return false;return true}return ue(e.hotkey)},y=()=>{if(u===null)return;let M=Date.now()-u,N=Math.min(1,M/e.keyHoldDuration),{mouseX:j,mouseY:F}=I.getState();Fe(n,N,j,F),N<1&&(a=requestAnimationFrame(y));},g=()=>{if(a!==null)return;u=Date.now();let{mouseX:M,mouseY:N}=I.getState();Fe(n,0,M,N),a=requestAnimationFrame(y);},p=()=>{a!==null&&(cancelAnimationFrame(a),a=null),u=null,yt();},i=null,f=M=>{let{overlayMode:N}=I.getState();if(M.has("Escape")||M.has("Esc")){I.setState(F=>{let x=new Set(F.pressedKeys);x.delete("Escape"),x.delete("Esc");let $=new Map(F.keyPressTimestamps);$.delete("Escape"),$.delete("Esc");let B=Array.isArray(e.hotkey)?e.hotkey:[e.hotkey];for(let H of B)H.length===1?(x.delete(H.toLowerCase()),x.delete(H.toUpperCase()),$.delete(H.toLowerCase()),$.delete(H.toUpperCase())):(x.delete(H),$.delete(H));return {...F,keyPressTimestamps:$,overlayMode:"hidden",pressedKeys:x}}),i&&(i(),i=null),p();return}if(!l()){i&&(i(),i=null),N!=="hidden"&&I.setState(F=>({...F,overlayMode:"hidden"})),p();return}N==="hidden"&&!i&&(g(),i=De(e.hotkey,e.keyHoldDuration,()=>{I.setState(F=>({...F,overlayMode:"visible"})),p(),i=null;}));},m=I.subscribe(f,M=>M.pressedKeys),d=false,h=-1e3,S=-1e3,b=M=>{h=M.clientX,S=M.clientY,!d&&(d=true,requestAnimationFrame(()=>{d=false,I.setState(N=>({...N,mouseX:h,mouseY:S}));}));},E=M=>{if(M.button!==0)return;let{overlayMode:N}=I.getState();N!=="hidden"&&(M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation(),I.setState(j=>({...j,overlayMode:"copying"})));},T=()=>{document.hidden&&(Ie(),K());},L=false,R=()=>{L||(L=true,requestAnimationFrame(()=>{L=false,O();}));},v=false,_=()=>{v||(v=true,requestAnimationFrame(()=>{v=false,O();}));};window.addEventListener("mousemove",b),window.addEventListener("mousedown",E),window.addEventListener("scroll",R,true),window.addEventListener("resize",_),document.addEventListener("visibilitychange",T);let w=Pe(),C=(M,N)=>{let j=document.elementsFromPoint(M,N);for(let F of j){if(F.closest(`[${X}]`))continue;let x=window.getComputedStyle(F);if(vt(F,x))return F}return null},P=async M=>{let N=(M.tagName||"").toLowerCase(),j=M.getBoundingClientRect(),F=gt(n,j.left,j.top);try{let x=dt(M);await Ne(`
3
22
 
4
- /**
5
- * @license MIT
6
- *
7
- * Copyright (c) 2025 Aiden Bai
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
-
13
- // src/hotkeys.ts
14
- var FORM_TAGS_AND_ROLES = [
15
- "input",
16
- "textarea",
17
- "select",
18
- "searchbox",
19
- "slider",
20
- "spinbutton",
21
- "menuitem",
22
- "menuitemcheckbox",
23
- "menuitemradio",
24
- "option",
25
- "radio",
26
- "textbox"
27
- ];
28
- var isCustomElement = (element) => {
29
- return Boolean(element.tagName) && !element.tagName.startsWith("-") && element.tagName.includes("-");
30
- };
31
- var isReadonlyArray = (value) => {
32
- return Array.isArray(value);
33
- };
34
- var isHotkeyEnabledOnTagName = (event, enabledOnTags = false) => {
35
- const { composed, target } = event;
36
- let targetTagName;
37
- let targetRole;
38
- if (target instanceof HTMLElement && isCustomElement(target) && composed) {
39
- const composedPath = event.composedPath();
40
- const targetElement = composedPath[0];
41
- if (targetElement instanceof HTMLElement) {
42
- targetTagName = targetElement.tagName;
43
- targetRole = targetElement.role;
44
- }
45
- } else if (target instanceof HTMLElement) {
46
- targetTagName = target.tagName;
47
- targetRole = target.role;
48
- }
49
- if (isReadonlyArray(enabledOnTags)) {
50
- return Boolean(
51
- targetTagName && enabledOnTags && enabledOnTags.some(
52
- (tag) => typeof targetTagName === "string" && tag.toLowerCase() === targetTagName.toLowerCase() || tag === targetRole
53
- )
54
- );
55
- }
56
- return Boolean(targetTagName && enabledOnTags && enabledOnTags);
57
- };
58
- var isKeyboardEventTriggeredByInput = (event) => {
59
- return isHotkeyEnabledOnTagName(event, FORM_TAGS_AND_ROLES);
60
- };
61
- var trackHotkeys = () => {
62
- const handleKeyDown = (event) => {
63
- if (isKeyboardEventTriggeredByInput(event)) {
64
- return;
65
- }
66
- if (event.code === void 0) {
67
- return;
68
- }
69
- libStore.setState((state) => {
70
- const newTimestamps = new Map(state.keyPressTimestamps);
71
- if (!state.pressedKeys.has(event.key)) {
72
- newTimestamps.set(event.key, Date.now());
73
- }
74
- return {
75
- ...state,
76
- keyPressTimestamps: newTimestamps,
77
- pressedKeys: /* @__PURE__ */ new Set([event.key, ...state.pressedKeys])
78
- };
79
- });
80
- };
81
- const handleKeyUp = (event) => {
82
- if (event.code === void 0) {
83
- return;
84
- }
85
- libStore.setState((state) => {
86
- const newTimestamps = new Map(state.keyPressTimestamps);
87
- newTimestamps.delete(event.key);
88
- return {
89
- ...state,
90
- keyPressTimestamps: newTimestamps,
91
- pressedKeys: new Set(
92
- [...state.pressedKeys].filter((key) => key !== event.key)
93
- )
94
- };
95
- });
96
- };
97
- const handleBlur = () => {
98
- libStore.setState((state) => ({
99
- ...state,
100
- keyPressTimestamps: /* @__PURE__ */ new Map(),
101
- pressedKeys: /* @__PURE__ */ new Set()
102
- }));
103
- };
104
- const handleContextmenu = () => {
105
- libStore.setState((state) => ({
106
- ...state,
107
- keyPressTimestamps: /* @__PURE__ */ new Map(),
108
- pressedKeys: /* @__PURE__ */ new Set()
109
- }));
110
- };
111
- document.addEventListener("keydown", handleKeyDown);
112
- document.addEventListener("keyup", handleKeyUp);
113
- window.addEventListener("blur", handleBlur);
114
- window.addEventListener("contextmenu", handleContextmenu);
115
- return () => {
116
- document.removeEventListener("keydown", handleKeyDown);
117
- document.removeEventListener("keyup", handleKeyUp);
118
- window.removeEventListener("blur", handleBlur);
119
- window.removeEventListener("contextmenu", handleContextmenu);
120
- };
121
- };
122
- var isKeyPressed = (key) => {
123
- const { pressedKeys } = libStore.getState();
124
- if (key.length === 1) {
125
- return pressedKeys.has(key.toLowerCase()) || pressedKeys.has(key.toUpperCase());
126
- }
127
- return pressedKeys.has(key);
128
- };
129
- var watchKeyHeldFor = (key, duration, onHeld) => {
130
- let timeoutId = null;
131
- let unsubscribe = null;
132
- const cleanup = () => {
133
- if (timeoutId !== null) {
134
- clearTimeout(timeoutId);
135
- timeoutId = null;
136
- }
137
- if (unsubscribe !== null) {
138
- unsubscribe();
139
- unsubscribe = null;
140
- }
141
- };
142
- const checkSingleKeyPressed = (keyToCheck, pressedKeys) => {
143
- if (keyToCheck.length === 1) {
144
- return pressedKeys.has(keyToCheck.toLowerCase()) || pressedKeys.has(keyToCheck.toUpperCase());
145
- }
146
- return pressedKeys.has(keyToCheck);
147
- };
148
- const checkAllKeysPressed = (pressedKeys) => {
149
- if (Array.isArray(key)) {
150
- return key.every(
151
- (keyFromCombo) => checkSingleKeyPressed(keyFromCombo, pressedKeys)
152
- );
153
- }
154
- return checkSingleKeyPressed(key, pressedKeys);
155
- };
156
- const getKeyFromTimestamps = (keyToFind, timestamps) => {
157
- if (keyToFind.length === 1) {
158
- return timestamps.get(keyToFind.toLowerCase()) || timestamps.get(keyToFind.toUpperCase());
159
- }
160
- return timestamps.get(keyToFind);
161
- };
162
- const getEarliestPressTime = (timestamps) => {
163
- const keysToInspect = Array.isArray(key) ? key : [key];
164
- let earliest;
165
- for (const keyFromCombo of keysToInspect) {
166
- const timestamp = getKeyFromTimestamps(keyFromCombo, timestamps);
167
- if (timestamp === void 0) {
168
- return void 0;
169
- }
170
- if (earliest === void 0 || timestamp < earliest) {
171
- earliest = timestamp;
172
- }
173
- }
174
- return earliest;
175
- };
176
- const scheduleCallback = () => {
177
- const state = libStore.getState();
178
- const { keyPressTimestamps, pressedKeys } = state;
179
- if (!checkAllKeysPressed(pressedKeys)) {
180
- if (timeoutId !== null) {
181
- clearTimeout(timeoutId);
182
- timeoutId = null;
183
- }
184
- return;
185
- }
186
- const earliestPressTime = getEarliestPressTime(keyPressTimestamps);
187
- if (earliestPressTime === void 0) {
188
- if (timeoutId !== null) {
189
- clearTimeout(timeoutId);
190
- timeoutId = null;
191
- }
192
- return;
193
- }
194
- const elapsed = Date.now() - earliestPressTime;
195
- const remaining = duration - elapsed;
196
- if (remaining <= 0) {
197
- onHeld();
198
- cleanup();
199
- return;
200
- }
201
- if (timeoutId !== null) {
202
- clearTimeout(timeoutId);
203
- }
204
- timeoutId = setTimeout(() => {
205
- onHeld();
206
- cleanup();
207
- }, remaining);
208
- };
209
- unsubscribe = libStore.subscribe(
210
- () => {
211
- scheduleCallback();
212
- },
213
- (state) => state.pressedKeys
214
- );
215
- scheduleCallback();
216
- return cleanup;
217
- };
218
-
219
- // ../../node_modules/.pnpm/bippy@0.3.31_@types+react@19.2.2_react@19.2.0/node_modules/bippy/dist/src-R2iEnVC1.js
220
- var version = "0.3.31";
221
- var BIPPY_INSTRUMENTATION_STRING = `bippy-${version}`;
222
- var objectDefineProperty = Object.defineProperty;
223
- var objectHasOwnProperty = Object.prototype.hasOwnProperty;
224
- var NO_OP = () => {
225
- };
226
- var checkDCE = (fn) => {
227
- try {
228
- const code = Function.prototype.toString.call(fn);
229
- if (code.indexOf("^_^") > -1) setTimeout(() => {
230
- throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build");
231
- });
232
- } catch {
233
- }
234
- };
235
- var isRealReactDevtools = (rdtHook = getRDTHook()) => {
236
- return "getFiberRoots" in rdtHook;
237
- };
238
- var isReactRefreshOverride = false;
239
- var injectFnStr = void 0;
240
- var isReactRefresh = (rdtHook = getRDTHook()) => {
241
- if (isReactRefreshOverride) return true;
242
- if (typeof rdtHook.inject === "function") injectFnStr = rdtHook.inject.toString();
243
- return Boolean(injectFnStr?.includes("(injected)"));
244
- };
245
- var onActiveListeners = /* @__PURE__ */ new Set();
246
- var _renderers = /* @__PURE__ */ new Set();
247
- var installRDTHook = (onActive) => {
248
- const renderers = /* @__PURE__ */ new Map();
249
- let i = 0;
250
- let rdtHook = {
251
- checkDCE,
252
- supportsFiber: true,
253
- supportsFlight: true,
254
- hasUnsupportedRendererAttached: false,
255
- renderers,
256
- onCommitFiberRoot: NO_OP,
257
- onCommitFiberUnmount: NO_OP,
258
- onPostCommitFiberRoot: NO_OP,
259
- on: NO_OP,
260
- inject(renderer) {
261
- const nextID = ++i;
262
- renderers.set(nextID, renderer);
263
- _renderers.add(renderer);
264
- if (!rdtHook._instrumentationIsActive) {
265
- rdtHook._instrumentationIsActive = true;
266
- onActiveListeners.forEach((listener) => listener());
267
- }
268
- return nextID;
269
- },
270
- _instrumentationSource: BIPPY_INSTRUMENTATION_STRING,
271
- _instrumentationIsActive: false
272
- };
273
- try {
274
- objectDefineProperty(globalThis, "__REACT_DEVTOOLS_GLOBAL_HOOK__", {
275
- get() {
276
- return rdtHook;
277
- },
278
- set(newHook) {
279
- if (newHook && typeof newHook === "object") {
280
- const ourRenderers = rdtHook.renderers;
281
- rdtHook = newHook;
282
- if (ourRenderers.size > 0) {
283
- ourRenderers.forEach((renderer, id) => {
284
- _renderers.add(renderer);
285
- newHook.renderers.set(id, renderer);
286
- });
287
- patchRDTHook(onActive);
288
- }
289
- }
290
- },
291
- configurable: true,
292
- enumerable: true
293
- });
294
- const originalWindowHasOwnProperty = window.hasOwnProperty;
295
- let hasRanHack = false;
296
- objectDefineProperty(window, "hasOwnProperty", {
297
- value: function() {
298
- try {
299
- if (!hasRanHack && arguments[0] === "__REACT_DEVTOOLS_GLOBAL_HOOK__") {
300
- globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__ = void 0;
301
- hasRanHack = true;
302
- return -0;
303
- }
304
- } catch {
305
- }
306
- return originalWindowHasOwnProperty.apply(this, arguments);
307
- },
308
- configurable: true,
309
- writable: true
310
- });
311
- } catch {
312
- patchRDTHook(onActive);
313
- }
314
- return rdtHook;
315
- };
316
- var patchRDTHook = (onActive) => {
317
- if (onActive) onActiveListeners.add(onActive);
318
- try {
319
- const rdtHook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
320
- if (!rdtHook) return;
321
- if (!rdtHook._instrumentationSource) {
322
- rdtHook.checkDCE = checkDCE;
323
- rdtHook.supportsFiber = true;
324
- rdtHook.supportsFlight = true;
325
- rdtHook.hasUnsupportedRendererAttached = false;
326
- rdtHook._instrumentationSource = BIPPY_INSTRUMENTATION_STRING;
327
- rdtHook._instrumentationIsActive = false;
328
- rdtHook.on = NO_OP;
329
- if (rdtHook.renderers.size) {
330
- rdtHook._instrumentationIsActive = true;
331
- onActiveListeners.forEach((listener) => listener());
332
- return;
333
- }
334
- const prevInject = rdtHook.inject;
335
- if (isReactRefresh(rdtHook) && !isRealReactDevtools()) {
336
- isReactRefreshOverride = true;
337
- const nextID = rdtHook.inject({ scheduleRefresh() {
338
- } });
339
- if (nextID) rdtHook._instrumentationIsActive = true;
340
- }
341
- rdtHook.inject = (renderer) => {
342
- const id = prevInject(renderer);
343
- _renderers.add(renderer);
344
- rdtHook._instrumentationIsActive = true;
345
- onActiveListeners.forEach((listener) => listener());
346
- return id;
347
- };
348
- }
349
- if (rdtHook.renderers.size || rdtHook._instrumentationIsActive || isReactRefresh()) onActive?.();
350
- } catch {
351
- }
352
- };
353
- var hasRDTHook = () => {
354
- return objectHasOwnProperty.call(globalThis, "__REACT_DEVTOOLS_GLOBAL_HOOK__");
355
- };
356
- var getRDTHook = (onActive) => {
357
- if (!hasRDTHook()) return installRDTHook(onActive);
358
- patchRDTHook(onActive);
359
- return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
360
- };
361
- var isClientEnvironment = () => {
362
- return Boolean(typeof window !== "undefined" && (window.document?.createElement || window.navigator?.product === "ReactNative"));
363
- };
364
- var safelyInstallRDTHook = () => {
365
- try {
366
- if (isClientEnvironment()) getRDTHook();
367
- } catch {
368
- }
369
- };
370
- var FunctionComponentTag = 0;
371
- var ClassComponentTag = 1;
372
- var HostComponentTag = 5;
373
- var ForwardRefTag = 11;
374
- var SuspenseComponentTag = 13;
375
- var SimpleMemoComponentTag = 15;
376
- var LazyComponentTag = 16;
377
- var SuspenseListComponentTag = 19;
378
- var HostHoistableTag = 26;
379
- var HostSingletonTag = 27;
380
- var ActivityComponentTag = 28;
381
- var ViewTransitionComponentTag = 30;
382
- var getType = (type) => {
383
- const currentType = type;
384
- if (typeof currentType === "function") return currentType;
385
- if (typeof currentType === "object" && currentType) return getType(currentType.type || currentType.render);
386
- return null;
387
- };
388
- var getDisplayName = (type) => {
389
- const currentType = type;
390
- if (typeof currentType === "string") return currentType;
391
- if (typeof currentType !== "function" && !(typeof currentType === "object" && currentType)) return null;
392
- const name = currentType.displayName || currentType.name || null;
393
- if (name) return name;
394
- const unwrappedType = getType(currentType);
395
- if (!unwrappedType) return null;
396
- return unwrappedType.displayName || unwrappedType.name || null;
397
- };
398
- var instrument = (options) => {
399
- return getRDTHook(() => {
400
- const rdtHook = getRDTHook();
401
- options.onActive?.();
402
- rdtHook._instrumentationSource = options.name ?? BIPPY_INSTRUMENTATION_STRING;
403
- const prevOnCommitFiberRoot = rdtHook.onCommitFiberRoot;
404
- if (options.onCommitFiberRoot) rdtHook.onCommitFiberRoot = (rendererID, root, priority) => {
405
- if (prevOnCommitFiberRoot) prevOnCommitFiberRoot(rendererID, root, priority);
406
- options.onCommitFiberRoot?.(rendererID, root, priority);
407
- };
408
- const prevOnCommitFiberUnmount = rdtHook.onCommitFiberUnmount;
409
- if (options.onCommitFiberUnmount) rdtHook.onCommitFiberUnmount = (rendererID, root) => {
410
- if (prevOnCommitFiberUnmount) prevOnCommitFiberUnmount(rendererID, root);
411
- options.onCommitFiberUnmount?.(rendererID, root);
412
- };
413
- const prevOnPostCommitFiberRoot = rdtHook.onPostCommitFiberRoot;
414
- if (options.onPostCommitFiberRoot) rdtHook.onPostCommitFiberRoot = (rendererID, root) => {
415
- if (prevOnPostCommitFiberRoot) prevOnPostCommitFiberRoot(rendererID, root);
416
- options.onPostCommitFiberRoot?.(rendererID, root);
417
- };
418
- });
419
- };
420
- var getFiberFromHostInstance = (hostInstance) => {
421
- const rdtHook = getRDTHook();
422
- for (const renderer of rdtHook.renderers.values()) try {
423
- const fiber = renderer.findFiberByHostInstance?.(hostInstance);
424
- if (fiber) return fiber;
425
- } catch {
426
- }
427
- if (typeof hostInstance === "object" && hostInstance != null) {
428
- if ("_reactRootContainer" in hostInstance) return hostInstance._reactRootContainer?._internalRoot?.current?.child;
429
- for (const key in hostInstance) if (key.startsWith("__reactContainer$") || key.startsWith("__reactInternalInstance$") || key.startsWith("__reactFiber")) return hostInstance[key] || null;
430
- }
431
- return null;
432
- };
433
- var _fiberRoots = /* @__PURE__ */ new Set();
434
- safelyInstallRDTHook();
435
-
436
- // ../../node_modules/.pnpm/bippy@0.3.31_@types+react@19.2.2_react@19.2.0/node_modules/bippy/dist/source-DWOhEbf2.js
437
- var __create = Object.create;
438
- var __defProp = Object.defineProperty;
439
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
440
- var __getOwnPropNames = Object.getOwnPropertyNames;
441
- var __getProtoOf = Object.getPrototypeOf;
442
- var __hasOwnProp = Object.prototype.hasOwnProperty;
443
- var __commonJS = (cb, mod) => function() {
444
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
445
- };
446
- var __copyProps = (to, from, except, desc) => {
447
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
448
- key = keys[i];
449
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
450
- get: ((k) => from[k]).bind(null, key),
451
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
452
- });
453
- }
454
- return to;
455
- };
456
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(__defProp(target, "default", {
457
- value: mod,
458
- enumerable: true
459
- }) , mod));
460
- var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
461
- var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
462
- function parseStack(stackString, options) {
463
- if (stackString.match(CHROME_IE_STACK_REGEXP)) return parseV8OrIeString(stackString);
464
- else return parseFFOrSafariString(stackString);
465
- }
466
- function extractLocation(urlLike) {
467
- if (!urlLike.includes(":")) return [
468
- urlLike,
469
- void 0,
470
- void 0
471
- ];
472
- const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
473
- const parts = regExp.exec(urlLike.replace(/[()]/g, ""));
474
- return [
475
- parts[1],
476
- parts[2] || void 0,
477
- parts[3] || void 0
478
- ];
479
- }
480
- function applySlice(lines, options) {
481
- return lines;
482
- }
483
- function parseV8OrIeString(stack, options) {
484
- const filtered = applySlice(stack.split("\n").filter((line) => {
485
- return !!line.match(CHROME_IE_STACK_REGEXP);
486
- }));
487
- return filtered.map((line) => {
488
- if (line.includes("(eval ")) line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
489
- let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
490
- const location = sanitizedLine.match(/ (\(.+\)$)/);
491
- sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
492
- const locationParts = extractLocation(location ? location[1] : sanitizedLine);
493
- const functionName = location && sanitizedLine || void 0;
494
- const fileName = ["eval", "<anonymous>"].includes(locationParts[0]) ? void 0 : locationParts[0];
495
- return {
496
- function: functionName,
497
- file: fileName,
498
- line: locationParts[1] ? +locationParts[1] : void 0,
499
- col: locationParts[2] ? +locationParts[2] : void 0,
500
- raw: line
501
- };
502
- });
503
- }
504
- function parseFFOrSafariString(stack, options) {
505
- const filtered = applySlice(stack.split("\n").filter((line) => {
506
- return !line.match(SAFARI_NATIVE_CODE_REGEXP);
507
- }));
508
- return filtered.map((line) => {
509
- if (line.includes(" > eval")) line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
510
- if (!line.includes("@") && !line.includes(":")) return { function: line };
511
- else {
512
- const functionNameRegex = /(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/;
513
- const matches = line.match(functionNameRegex);
514
- const functionName = matches && matches[1] ? matches[1] : void 0;
515
- const locationParts = extractLocation(line.replace(functionNameRegex, ""));
516
- return {
517
- function: functionName,
518
- file: locationParts[0],
519
- line: locationParts[1] ? +locationParts[1] : void 0,
520
- col: locationParts[2] ? +locationParts[2] : void 0,
521
- raw: line
522
- };
523
- }
524
- });
525
- }
526
- var require_base64 = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(exports) {
527
- var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
528
- exports.encode = function(number) {
529
- if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
530
- throw new TypeError("Must be between 0 and 63: " + number);
531
- };
532
- exports.decode = function(charCode) {
533
- var bigA = 65;
534
- var bigZ = 90;
535
- var littleA = 97;
536
- var littleZ = 122;
537
- var zero = 48;
538
- var nine = 57;
539
- var plus = 43;
540
- var slash = 47;
541
- var littleOffset = 26;
542
- var numberOffset = 52;
543
- if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
544
- if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
545
- if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
546
- if (charCode == plus) return 62;
547
- if (charCode == slash) return 63;
548
- return -1;
549
- };
550
- } });
551
- var require_base64_vlq = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js"(exports) {
552
- var base64 = require_base64();
553
- var VLQ_BASE_SHIFT = 5;
554
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
555
- var VLQ_BASE_MASK = VLQ_BASE - 1;
556
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
557
- function toVLQSigned(aValue) {
558
- return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
559
- }
560
- function fromVLQSigned(aValue) {
561
- var isNegative = (aValue & 1) === 1;
562
- var shifted = aValue >> 1;
563
- return isNegative ? -shifted : shifted;
564
- }
565
- exports.encode = function base64VLQ_encode(aValue) {
566
- var encoded = "";
567
- var digit;
568
- var vlq = toVLQSigned(aValue);
569
- do {
570
- digit = vlq & VLQ_BASE_MASK;
571
- vlq >>>= VLQ_BASE_SHIFT;
572
- if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
573
- encoded += base64.encode(digit);
574
- } while (vlq > 0);
575
- return encoded;
576
- };
577
- exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
578
- var strLen = aStr.length;
579
- var result = 0;
580
- var shift = 0;
581
- var continuation, digit;
582
- do {
583
- if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
584
- digit = base64.decode(aStr.charCodeAt(aIndex++));
585
- if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
586
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
587
- digit &= VLQ_BASE_MASK;
588
- result = result + (digit << shift);
589
- shift += VLQ_BASE_SHIFT;
590
- } while (continuation);
591
- aOutParam.value = fromVLQSigned(result);
592
- aOutParam.rest = aIndex;
593
- };
594
- } });
595
- var require_util = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js"(exports) {
596
- function getArg(aArgs, aName, aDefaultValue) {
597
- if (aName in aArgs) return aArgs[aName];
598
- else if (arguments.length === 3) return aDefaultValue;
599
- else throw new Error('"' + aName + '" is a required argument.');
600
- }
601
- exports.getArg = getArg;
602
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
603
- var dataUrlRegexp = /^data:.+\,.+$/;
604
- function urlParse(aUrl) {
605
- var match = aUrl.match(urlRegexp);
606
- if (!match) return null;
607
- return {
608
- scheme: match[1],
609
- auth: match[2],
610
- host: match[3],
611
- port: match[4],
612
- path: match[5]
613
- };
614
- }
615
- exports.urlParse = urlParse;
616
- function urlGenerate(aParsedUrl) {
617
- var url = "";
618
- if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":";
619
- url += "//";
620
- if (aParsedUrl.auth) url += aParsedUrl.auth + "@";
621
- if (aParsedUrl.host) url += aParsedUrl.host;
622
- if (aParsedUrl.port) url += ":" + aParsedUrl.port;
623
- if (aParsedUrl.path) url += aParsedUrl.path;
624
- return url;
625
- }
626
- exports.urlGenerate = urlGenerate;
627
- var MAX_CACHED_INPUTS = 32;
628
- function lruMemoize(f) {
629
- var cache = [];
630
- return function(input) {
631
- for (var i = 0; i < cache.length; i++) if (cache[i].input === input) {
632
- var temp = cache[0];
633
- cache[0] = cache[i];
634
- cache[i] = temp;
635
- return cache[0].result;
636
- }
637
- var result = f(input);
638
- cache.unshift({
639
- input,
640
- result
641
- });
642
- if (cache.length > MAX_CACHED_INPUTS) cache.pop();
643
- return result;
644
- };
645
- }
646
- var normalize = lruMemoize(function normalize$1(aPath) {
647
- var path = aPath;
648
- var url = urlParse(aPath);
649
- if (url) {
650
- if (!url.path) return aPath;
651
- path = url.path;
652
- }
653
- var isAbsolute = exports.isAbsolute(path);
654
- var parts = [];
655
- var start = 0;
656
- var i = 0;
657
- while (true) {
658
- start = i;
659
- i = path.indexOf("/", start);
660
- if (i === -1) {
661
- parts.push(path.slice(start));
662
- break;
663
- } else {
664
- parts.push(path.slice(start, i));
665
- while (i < path.length && path[i] === "/") i++;
666
- }
667
- }
668
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
669
- part = parts[i];
670
- if (part === ".") parts.splice(i, 1);
671
- else if (part === "..") up++;
672
- else if (up > 0) if (part === "") {
673
- parts.splice(i + 1, up);
674
- up = 0;
675
- } else {
676
- parts.splice(i, 2);
677
- up--;
678
- }
679
- }
680
- path = parts.join("/");
681
- if (path === "") path = isAbsolute ? "/" : ".";
682
- if (url) {
683
- url.path = path;
684
- return urlGenerate(url);
685
- }
686
- return path;
687
- });
688
- exports.normalize = normalize;
689
- function join(aRoot, aPath) {
690
- if (aRoot === "") aRoot = ".";
691
- if (aPath === "") aPath = ".";
692
- var aPathUrl = urlParse(aPath);
693
- var aRootUrl = urlParse(aRoot);
694
- if (aRootUrl) aRoot = aRootUrl.path || "/";
695
- if (aPathUrl && !aPathUrl.scheme) {
696
- if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
697
- return urlGenerate(aPathUrl);
698
- }
699
- if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
700
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
701
- aRootUrl.host = aPath;
702
- return urlGenerate(aRootUrl);
703
- }
704
- var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
705
- if (aRootUrl) {
706
- aRootUrl.path = joined;
707
- return urlGenerate(aRootUrl);
708
- }
709
- return joined;
710
- }
711
- exports.join = join;
712
- exports.isAbsolute = function(aPath) {
713
- return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
714
- };
715
- function relative(aRoot, aPath) {
716
- if (aRoot === "") aRoot = ".";
717
- aRoot = aRoot.replace(/\/$/, "");
718
- var level = 0;
719
- while (aPath.indexOf(aRoot + "/") !== 0) {
720
- var index = aRoot.lastIndexOf("/");
721
- if (index < 0) return aPath;
722
- aRoot = aRoot.slice(0, index);
723
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
724
- ++level;
725
- }
726
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
727
- }
728
- exports.relative = relative;
729
- var supportsNullProto = function() {
730
- var obj = /* @__PURE__ */ Object.create(null);
731
- return !("__proto__" in obj);
732
- }();
733
- function identity(s) {
734
- return s;
735
- }
736
- function toSetString(aStr) {
737
- if (isProtoString(aStr)) return "$" + aStr;
738
- return aStr;
739
- }
740
- exports.toSetString = supportsNullProto ? identity : toSetString;
741
- function fromSetString(aStr) {
742
- if (isProtoString(aStr)) return aStr.slice(1);
743
- return aStr;
744
- }
745
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
746
- function isProtoString(s) {
747
- if (!s) return false;
748
- var length = s.length;
749
- if (length < 9) return false;
750
- if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) return false;
751
- for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false;
752
- return true;
753
- }
754
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
755
- var cmp = strcmp(mappingA.source, mappingB.source);
756
- if (cmp !== 0) return cmp;
757
- cmp = mappingA.originalLine - mappingB.originalLine;
758
- if (cmp !== 0) return cmp;
759
- cmp = mappingA.originalColumn - mappingB.originalColumn;
760
- if (cmp !== 0 || onlyCompareOriginal) return cmp;
761
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
762
- if (cmp !== 0) return cmp;
763
- cmp = mappingA.generatedLine - mappingB.generatedLine;
764
- if (cmp !== 0) return cmp;
765
- return strcmp(mappingA.name, mappingB.name);
766
- }
767
- exports.compareByOriginalPositions = compareByOriginalPositions;
768
- function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
769
- var cmp;
770
- cmp = mappingA.originalLine - mappingB.originalLine;
771
- if (cmp !== 0) return cmp;
772
- cmp = mappingA.originalColumn - mappingB.originalColumn;
773
- if (cmp !== 0 || onlyCompareOriginal) return cmp;
774
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
775
- if (cmp !== 0) return cmp;
776
- cmp = mappingA.generatedLine - mappingB.generatedLine;
777
- if (cmp !== 0) return cmp;
778
- return strcmp(mappingA.name, mappingB.name);
779
- }
780
- exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
781
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
782
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
783
- if (cmp !== 0) return cmp;
784
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
785
- if (cmp !== 0 || onlyCompareGenerated) return cmp;
786
- cmp = strcmp(mappingA.source, mappingB.source);
787
- if (cmp !== 0) return cmp;
788
- cmp = mappingA.originalLine - mappingB.originalLine;
789
- if (cmp !== 0) return cmp;
790
- cmp = mappingA.originalColumn - mappingB.originalColumn;
791
- if (cmp !== 0) return cmp;
792
- return strcmp(mappingA.name, mappingB.name);
793
- }
794
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
795
- function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
796
- var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
797
- if (cmp !== 0 || onlyCompareGenerated) return cmp;
798
- cmp = strcmp(mappingA.source, mappingB.source);
799
- if (cmp !== 0) return cmp;
800
- cmp = mappingA.originalLine - mappingB.originalLine;
801
- if (cmp !== 0) return cmp;
802
- cmp = mappingA.originalColumn - mappingB.originalColumn;
803
- if (cmp !== 0) return cmp;
804
- return strcmp(mappingA.name, mappingB.name);
805
- }
806
- exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
807
- function strcmp(aStr1, aStr2) {
808
- if (aStr1 === aStr2) return 0;
809
- if (aStr1 === null) return 1;
810
- if (aStr2 === null) return -1;
811
- if (aStr1 > aStr2) return 1;
812
- return -1;
813
- }
814
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
815
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
816
- if (cmp !== 0) return cmp;
817
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
818
- if (cmp !== 0) return cmp;
819
- cmp = strcmp(mappingA.source, mappingB.source);
820
- if (cmp !== 0) return cmp;
821
- cmp = mappingA.originalLine - mappingB.originalLine;
822
- if (cmp !== 0) return cmp;
823
- cmp = mappingA.originalColumn - mappingB.originalColumn;
824
- if (cmp !== 0) return cmp;
825
- return strcmp(mappingA.name, mappingB.name);
826
- }
827
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
828
- function parseSourceMapInput(str) {
829
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
830
- }
831
- exports.parseSourceMapInput = parseSourceMapInput;
832
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
833
- sourceURL = sourceURL || "";
834
- if (sourceRoot) {
835
- if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/";
836
- sourceURL = sourceRoot + sourceURL;
837
- }
838
- if (sourceMapURL) {
839
- var parsed = urlParse(sourceMapURL);
840
- if (!parsed) throw new Error("sourceMapURL could not be parsed");
841
- if (parsed.path) {
842
- var index = parsed.path.lastIndexOf("/");
843
- if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
844
- }
845
- sourceURL = join(urlGenerate(parsed), sourceURL);
846
- }
847
- return normalize(sourceURL);
848
- }
849
- exports.computeSourceURL = computeSourceURL;
850
- } });
851
- var require_array_set = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js"(exports) {
852
- var util$4 = require_util();
853
- var has = Object.prototype.hasOwnProperty;
854
- var hasNativeMap = typeof Map !== "undefined";
855
- function ArraySet$2() {
856
- this._array = [];
857
- this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
858
- }
859
- ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
860
- var set = new ArraySet$2();
861
- for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
862
- return set;
863
- };
864
- ArraySet$2.prototype.size = function ArraySet_size() {
865
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
866
- };
867
- ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
868
- var sStr = hasNativeMap ? aStr : util$4.toSetString(aStr);
869
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
870
- var idx = this._array.length;
871
- if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
872
- if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
873
- else this._set[sStr] = idx;
874
- };
875
- ArraySet$2.prototype.has = function ArraySet_has(aStr) {
876
- if (hasNativeMap) return this._set.has(aStr);
877
- else {
878
- var sStr = util$4.toSetString(aStr);
879
- return has.call(this._set, sStr);
880
- }
881
- };
882
- ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
883
- if (hasNativeMap) {
884
- var idx = this._set.get(aStr);
885
- if (idx >= 0) return idx;
886
- } else {
887
- var sStr = util$4.toSetString(aStr);
888
- if (has.call(this._set, sStr)) return this._set[sStr];
889
- }
890
- throw new Error('"' + aStr + '" is not in the set.');
891
- };
892
- ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
893
- if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
894
- throw new Error("No element indexed by " + aIdx);
895
- };
896
- ArraySet$2.prototype.toArray = function ArraySet_toArray() {
897
- return this._array.slice();
898
- };
899
- exports.ArraySet = ArraySet$2;
900
- } });
901
- var require_mapping_list = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js"(exports) {
902
- var util$3 = require_util();
903
- function generatedPositionAfter(mappingA, mappingB) {
904
- var lineA = mappingA.generatedLine;
905
- var lineB = mappingB.generatedLine;
906
- var columnA = mappingA.generatedColumn;
907
- var columnB = mappingB.generatedColumn;
908
- return lineB > lineA || lineB == lineA && columnB >= columnA || util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
909
- }
910
- function MappingList$1() {
911
- this._array = [];
912
- this._sorted = true;
913
- this._last = {
914
- generatedLine: -1,
915
- generatedColumn: 0
916
- };
917
- }
918
- MappingList$1.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
919
- this._array.forEach(aCallback, aThisArg);
920
- };
921
- MappingList$1.prototype.add = function MappingList_add(aMapping) {
922
- if (generatedPositionAfter(this._last, aMapping)) {
923
- this._last = aMapping;
924
- this._array.push(aMapping);
925
- } else {
926
- this._sorted = false;
927
- this._array.push(aMapping);
928
- }
929
- };
930
- MappingList$1.prototype.toArray = function MappingList_toArray() {
931
- if (!this._sorted) {
932
- this._array.sort(util$3.compareByGeneratedPositionsInflated);
933
- this._sorted = true;
934
- }
935
- return this._array;
936
- };
937
- exports.MappingList = MappingList$1;
938
- } });
939
- var require_source_map_generator = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js"(exports) {
940
- var base64VLQ$1 = require_base64_vlq();
941
- var util$2 = require_util();
942
- var ArraySet$1 = require_array_set().ArraySet;
943
- var MappingList = require_mapping_list().MappingList;
944
- function SourceMapGenerator$1(aArgs) {
945
- if (!aArgs) aArgs = {};
946
- this._file = util$2.getArg(aArgs, "file", null);
947
- this._sourceRoot = util$2.getArg(aArgs, "sourceRoot", null);
948
- this._skipValidation = util$2.getArg(aArgs, "skipValidation", false);
949
- this._ignoreInvalidMapping = util$2.getArg(aArgs, "ignoreInvalidMapping", false);
950
- this._sources = new ArraySet$1();
951
- this._names = new ArraySet$1();
952
- this._mappings = new MappingList();
953
- this._sourcesContents = null;
954
- }
955
- SourceMapGenerator$1.prototype._version = 3;
956
- SourceMapGenerator$1.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
957
- var sourceRoot = aSourceMapConsumer.sourceRoot;
958
- var generator = new SourceMapGenerator$1(Object.assign(generatorOps || {}, {
959
- file: aSourceMapConsumer.file,
960
- sourceRoot
961
- }));
962
- aSourceMapConsumer.eachMapping(function(mapping) {
963
- var newMapping = { generated: {
964
- line: mapping.generatedLine,
965
- column: mapping.generatedColumn
966
- } };
967
- if (mapping.source != null) {
968
- newMapping.source = mapping.source;
969
- if (sourceRoot != null) newMapping.source = util$2.relative(sourceRoot, newMapping.source);
970
- newMapping.original = {
971
- line: mapping.originalLine,
972
- column: mapping.originalColumn
973
- };
974
- if (mapping.name != null) newMapping.name = mapping.name;
975
- }
976
- generator.addMapping(newMapping);
977
- });
978
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
979
- var sourceRelative = sourceFile;
980
- if (sourceRoot !== null) sourceRelative = util$2.relative(sourceRoot, sourceFile);
981
- if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
982
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
983
- if (content != null) generator.setSourceContent(sourceFile, content);
984
- });
985
- return generator;
986
- };
987
- SourceMapGenerator$1.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
988
- var generated = util$2.getArg(aArgs, "generated");
989
- var original = util$2.getArg(aArgs, "original", null);
990
- var source = util$2.getArg(aArgs, "source", null);
991
- var name = util$2.getArg(aArgs, "name", null);
992
- if (!this._skipValidation) {
993
- if (this._validateMapping(generated, original, source, name) === false) return;
994
- }
995
- if (source != null) {
996
- source = String(source);
997
- if (!this._sources.has(source)) this._sources.add(source);
998
- }
999
- if (name != null) {
1000
- name = String(name);
1001
- if (!this._names.has(name)) this._names.add(name);
1002
- }
1003
- this._mappings.add({
1004
- generatedLine: generated.line,
1005
- generatedColumn: generated.column,
1006
- originalLine: original != null && original.line,
1007
- originalColumn: original != null && original.column,
1008
- source,
1009
- name
1010
- });
1011
- };
1012
- SourceMapGenerator$1.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
1013
- var source = aSourceFile;
1014
- if (this._sourceRoot != null) source = util$2.relative(this._sourceRoot, source);
1015
- if (aSourceContent != null) {
1016
- if (!this._sourcesContents) this._sourcesContents = /* @__PURE__ */ Object.create(null);
1017
- this._sourcesContents[util$2.toSetString(source)] = aSourceContent;
1018
- } else if (this._sourcesContents) {
1019
- delete this._sourcesContents[util$2.toSetString(source)];
1020
- if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
1021
- }
1022
- };
1023
- SourceMapGenerator$1.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
1024
- var sourceFile = aSourceFile;
1025
- if (aSourceFile == null) {
1026
- if (aSourceMapConsumer.file == null) throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);
1027
- sourceFile = aSourceMapConsumer.file;
1028
- }
1029
- var sourceRoot = this._sourceRoot;
1030
- if (sourceRoot != null) sourceFile = util$2.relative(sourceRoot, sourceFile);
1031
- var newSources = new ArraySet$1();
1032
- var newNames = new ArraySet$1();
1033
- this._mappings.unsortedForEach(function(mapping) {
1034
- if (mapping.source === sourceFile && mapping.originalLine != null) {
1035
- var original = aSourceMapConsumer.originalPositionFor({
1036
- line: mapping.originalLine,
1037
- column: mapping.originalColumn
1038
- });
1039
- if (original.source != null) {
1040
- mapping.source = original.source;
1041
- if (aSourceMapPath != null) mapping.source = util$2.join(aSourceMapPath, mapping.source);
1042
- if (sourceRoot != null) mapping.source = util$2.relative(sourceRoot, mapping.source);
1043
- mapping.originalLine = original.line;
1044
- mapping.originalColumn = original.column;
1045
- if (original.name != null) mapping.name = original.name;
1046
- }
1047
- }
1048
- var source = mapping.source;
1049
- if (source != null && !newSources.has(source)) newSources.add(source);
1050
- var name = mapping.name;
1051
- if (name != null && !newNames.has(name)) newNames.add(name);
1052
- }, this);
1053
- this._sources = newSources;
1054
- this._names = newNames;
1055
- aSourceMapConsumer.sources.forEach(function(sourceFile$1) {
1056
- var content = aSourceMapConsumer.sourceContentFor(sourceFile$1);
1057
- if (content != null) {
1058
- if (aSourceMapPath != null) sourceFile$1 = util$2.join(aSourceMapPath, sourceFile$1);
1059
- if (sourceRoot != null) sourceFile$1 = util$2.relative(sourceRoot, sourceFile$1);
1060
- this.setSourceContent(sourceFile$1, content);
1061
- }
1062
- }, this);
1063
- };
1064
- SourceMapGenerator$1.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
1065
- if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
1066
- var message = "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";
1067
- if (this._ignoreInvalidMapping) {
1068
- if (typeof console !== "undefined" && console.warn) console.warn(message);
1069
- return false;
1070
- } else throw new Error(message);
1071
- }
1072
- if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
1073
- else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return;
1074
- else {
1075
- var message = "Invalid mapping: " + JSON.stringify({
1076
- generated: aGenerated,
1077
- source: aSource,
1078
- original: aOriginal,
1079
- name: aName
1080
- });
1081
- if (this._ignoreInvalidMapping) {
1082
- if (typeof console !== "undefined" && console.warn) console.warn(message);
1083
- return false;
1084
- } else throw new Error(message);
1085
- }
1086
- };
1087
- SourceMapGenerator$1.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
1088
- var previousGeneratedColumn = 0;
1089
- var previousGeneratedLine = 1;
1090
- var previousOriginalColumn = 0;
1091
- var previousOriginalLine = 0;
1092
- var previousName = 0;
1093
- var previousSource = 0;
1094
- var result = "";
1095
- var next;
1096
- var mapping;
1097
- var nameIdx;
1098
- var sourceIdx;
1099
- var mappings = this._mappings.toArray();
1100
- for (var i = 0, len = mappings.length; i < len; i++) {
1101
- mapping = mappings[i];
1102
- next = "";
1103
- if (mapping.generatedLine !== previousGeneratedLine) {
1104
- previousGeneratedColumn = 0;
1105
- while (mapping.generatedLine !== previousGeneratedLine) {
1106
- next += ";";
1107
- previousGeneratedLine++;
1108
- }
1109
- } else if (i > 0) {
1110
- if (!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
1111
- next += ",";
1112
- }
1113
- next += base64VLQ$1.encode(mapping.generatedColumn - previousGeneratedColumn);
1114
- previousGeneratedColumn = mapping.generatedColumn;
1115
- if (mapping.source != null) {
1116
- sourceIdx = this._sources.indexOf(mapping.source);
1117
- next += base64VLQ$1.encode(sourceIdx - previousSource);
1118
- previousSource = sourceIdx;
1119
- next += base64VLQ$1.encode(mapping.originalLine - 1 - previousOriginalLine);
1120
- previousOriginalLine = mapping.originalLine - 1;
1121
- next += base64VLQ$1.encode(mapping.originalColumn - previousOriginalColumn);
1122
- previousOriginalColumn = mapping.originalColumn;
1123
- if (mapping.name != null) {
1124
- nameIdx = this._names.indexOf(mapping.name);
1125
- next += base64VLQ$1.encode(nameIdx - previousName);
1126
- previousName = nameIdx;
1127
- }
1128
- }
1129
- result += next;
1130
- }
1131
- return result;
1132
- };
1133
- SourceMapGenerator$1.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
1134
- return aSources.map(function(source) {
1135
- if (!this._sourcesContents) return null;
1136
- if (aSourceRoot != null) source = util$2.relative(aSourceRoot, source);
1137
- var key = util$2.toSetString(source);
1138
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
1139
- }, this);
1140
- };
1141
- SourceMapGenerator$1.prototype.toJSON = function SourceMapGenerator_toJSON() {
1142
- var map = {
1143
- version: this._version,
1144
- sources: this._sources.toArray(),
1145
- names: this._names.toArray(),
1146
- mappings: this._serializeMappings()
1147
- };
1148
- if (this._file != null) map.file = this._file;
1149
- if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot;
1150
- if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
1151
- return map;
1152
- };
1153
- SourceMapGenerator$1.prototype.toString = function SourceMapGenerator_toString() {
1154
- return JSON.stringify(this.toJSON());
1155
- };
1156
- exports.SourceMapGenerator = SourceMapGenerator$1;
1157
- } });
1158
- var require_binary_search = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js"(exports) {
1159
- exports.GREATEST_LOWER_BOUND = 1;
1160
- exports.LEAST_UPPER_BOUND = 2;
1161
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
1162
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
1163
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
1164
- if (cmp === 0) return mid;
1165
- else if (cmp > 0) {
1166
- if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
1167
- if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
1168
- else return mid;
1169
- } else {
1170
- if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
1171
- if (aBias == exports.LEAST_UPPER_BOUND) return mid;
1172
- else return aLow < 0 ? -1 : aLow;
1173
- }
1174
- }
1175
- exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
1176
- if (aHaystack.length === 0) return -1;
1177
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
1178
- if (index < 0) return -1;
1179
- while (index - 1 >= 0) {
1180
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break;
1181
- --index;
1182
- }
1183
- return index;
1184
- };
1185
- } });
1186
- var require_quick_sort = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js"(exports) {
1187
- function SortTemplate(comparator) {
1188
- function swap(ary, x, y) {
1189
- var temp = ary[x];
1190
- ary[x] = ary[y];
1191
- ary[y] = temp;
1192
- }
1193
- function randomIntInRange(low, high) {
1194
- return Math.round(low + Math.random() * (high - low));
1195
- }
1196
- function doQuickSort(ary, comparator$1, p, r) {
1197
- if (p < r) {
1198
- var pivotIndex = randomIntInRange(p, r);
1199
- var i = p - 1;
1200
- swap(ary, pivotIndex, r);
1201
- var pivot = ary[r];
1202
- for (var j = p; j < r; j++) if (comparator$1(ary[j], pivot, false) <= 0) {
1203
- i += 1;
1204
- swap(ary, i, j);
1205
- }
1206
- swap(ary, i + 1, j);
1207
- var q = i + 1;
1208
- doQuickSort(ary, comparator$1, p, q - 1);
1209
- doQuickSort(ary, comparator$1, q + 1, r);
1210
- }
1211
- }
1212
- return doQuickSort;
1213
- }
1214
- function cloneSort(comparator) {
1215
- let template = SortTemplate.toString();
1216
- let templateFn = new Function(`return ${template}`)();
1217
- return templateFn(comparator);
1218
- }
1219
- let sortCache = /* @__PURE__ */ new WeakMap();
1220
- exports.quickSort = function(ary, comparator, start = 0) {
1221
- let doQuickSort = sortCache.get(comparator);
1222
- if (doQuickSort === void 0) {
1223
- doQuickSort = cloneSort(comparator);
1224
- sortCache.set(comparator, doQuickSort);
1225
- }
1226
- doQuickSort(ary, comparator, start, ary.length - 1);
1227
- };
1228
- } });
1229
- var require_source_map_consumer = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js"(exports) {
1230
- var util$1 = require_util();
1231
- var binarySearch = require_binary_search();
1232
- var ArraySet = require_array_set().ArraySet;
1233
- var base64VLQ = require_base64_vlq();
1234
- var quickSort = require_quick_sort().quickSort;
1235
- function SourceMapConsumer$1(aSourceMap, aSourceMapURL) {
1236
- var sourceMap = aSourceMap;
1237
- if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
1238
- return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
1239
- }
1240
- SourceMapConsumer$1.fromSourceMap = function(aSourceMap, aSourceMapURL) {
1241
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
1242
- };
1243
- SourceMapConsumer$1.prototype._version = 3;
1244
- SourceMapConsumer$1.prototype.__generatedMappings = null;
1245
- Object.defineProperty(SourceMapConsumer$1.prototype, "_generatedMappings", {
1246
- configurable: true,
1247
- enumerable: true,
1248
- get: function() {
1249
- if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
1250
- return this.__generatedMappings;
1251
- }
1252
- });
1253
- SourceMapConsumer$1.prototype.__originalMappings = null;
1254
- Object.defineProperty(SourceMapConsumer$1.prototype, "_originalMappings", {
1255
- configurable: true,
1256
- enumerable: true,
1257
- get: function() {
1258
- if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
1259
- return this.__originalMappings;
1260
- }
1261
- });
1262
- SourceMapConsumer$1.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
1263
- var c = aStr.charAt(index);
1264
- return c === ";" || c === ",";
1265
- };
1266
- SourceMapConsumer$1.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1267
- throw new Error("Subclasses must implement _parseMappings");
1268
- };
1269
- SourceMapConsumer$1.GENERATED_ORDER = 1;
1270
- SourceMapConsumer$1.ORIGINAL_ORDER = 2;
1271
- SourceMapConsumer$1.GREATEST_LOWER_BOUND = 1;
1272
- SourceMapConsumer$1.LEAST_UPPER_BOUND = 2;
1273
- SourceMapConsumer$1.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
1274
- var context = aContext || null;
1275
- var order = aOrder || SourceMapConsumer$1.GENERATED_ORDER;
1276
- var mappings;
1277
- switch (order) {
1278
- case SourceMapConsumer$1.GENERATED_ORDER:
1279
- mappings = this._generatedMappings;
1280
- break;
1281
- case SourceMapConsumer$1.ORIGINAL_ORDER:
1282
- mappings = this._originalMappings;
1283
- break;
1284
- default:
1285
- throw new Error("Unknown order of iteration.");
1286
- }
1287
- var sourceRoot = this.sourceRoot;
1288
- var boundCallback = aCallback.bind(context);
1289
- var names = this._names;
1290
- var sources = this._sources;
1291
- var sourceMapURL = this._sourceMapURL;
1292
- for (var i = 0, n = mappings.length; i < n; i++) {
1293
- var mapping = mappings[i];
1294
- var source = mapping.source === null ? null : sources.at(mapping.source);
1295
- if (source !== null) source = util$1.computeSourceURL(sourceRoot, source, sourceMapURL);
1296
- boundCallback({
1297
- source,
1298
- generatedLine: mapping.generatedLine,
1299
- generatedColumn: mapping.generatedColumn,
1300
- originalLine: mapping.originalLine,
1301
- originalColumn: mapping.originalColumn,
1302
- name: mapping.name === null ? null : names.at(mapping.name)
1303
- });
1304
- }
1305
- };
1306
- SourceMapConsumer$1.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
1307
- var line = util$1.getArg(aArgs, "line");
1308
- var needle = {
1309
- source: util$1.getArg(aArgs, "source"),
1310
- originalLine: line,
1311
- originalColumn: util$1.getArg(aArgs, "column", 0)
1312
- };
1313
- needle.source = this._findSourceIndex(needle.source);
1314
- if (needle.source < 0) return [];
1315
- var mappings = [];
1316
- var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util$1.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
1317
- if (index >= 0) {
1318
- var mapping = this._originalMappings[index];
1319
- if (aArgs.column === void 0) {
1320
- var originalLine = mapping.originalLine;
1321
- while (mapping && mapping.originalLine === originalLine) {
1322
- mappings.push({
1323
- line: util$1.getArg(mapping, "generatedLine", null),
1324
- column: util$1.getArg(mapping, "generatedColumn", null),
1325
- lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1326
- });
1327
- mapping = this._originalMappings[++index];
1328
- }
1329
- } else {
1330
- var originalColumn = mapping.originalColumn;
1331
- while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
1332
- mappings.push({
1333
- line: util$1.getArg(mapping, "generatedLine", null),
1334
- column: util$1.getArg(mapping, "generatedColumn", null),
1335
- lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1336
- });
1337
- mapping = this._originalMappings[++index];
1338
- }
1339
- }
1340
- }
1341
- return mappings;
1342
- };
1343
- exports.SourceMapConsumer = SourceMapConsumer$1;
1344
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
1345
- var sourceMap = aSourceMap;
1346
- if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
1347
- var version2 = util$1.getArg(sourceMap, "version");
1348
- var sources = util$1.getArg(sourceMap, "sources");
1349
- var names = util$1.getArg(sourceMap, "names", []);
1350
- var sourceRoot = util$1.getArg(sourceMap, "sourceRoot", null);
1351
- var sourcesContent = util$1.getArg(sourceMap, "sourcesContent", null);
1352
- var mappings = util$1.getArg(sourceMap, "mappings");
1353
- var file = util$1.getArg(sourceMap, "file", null);
1354
- if (version2 != this._version) throw new Error("Unsupported version: " + version2);
1355
- if (sourceRoot) sourceRoot = util$1.normalize(sourceRoot);
1356
- sources = sources.map(String).map(util$1.normalize).map(function(source) {
1357
- return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source) ? util$1.relative(sourceRoot, source) : source;
1358
- });
1359
- this._names = ArraySet.fromArray(names.map(String), true);
1360
- this._sources = ArraySet.fromArray(sources, true);
1361
- this._absoluteSources = this._sources.toArray().map(function(s) {
1362
- return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
1363
- });
1364
- this.sourceRoot = sourceRoot;
1365
- this.sourcesContent = sourcesContent;
1366
- this._mappings = mappings;
1367
- this._sourceMapURL = aSourceMapURL;
1368
- this.file = file;
1369
- }
1370
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$1.prototype);
1371
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$1;
1372
- BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
1373
- var relativeSource = aSource;
1374
- if (this.sourceRoot != null) relativeSource = util$1.relative(this.sourceRoot, relativeSource);
1375
- if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
1376
- var i;
1377
- for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i;
1378
- return -1;
1379
- };
1380
- BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
1381
- var smc = Object.create(BasicSourceMapConsumer.prototype);
1382
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
1383
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
1384
- smc.sourceRoot = aSourceMap._sourceRoot;
1385
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
1386
- smc.file = aSourceMap._file;
1387
- smc._sourceMapURL = aSourceMapURL;
1388
- smc._absoluteSources = smc._sources.toArray().map(function(s) {
1389
- return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
1390
- });
1391
- var generatedMappings = aSourceMap._mappings.toArray().slice();
1392
- var destGeneratedMappings = smc.__generatedMappings = [];
1393
- var destOriginalMappings = smc.__originalMappings = [];
1394
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
1395
- var srcMapping = generatedMappings[i];
1396
- var destMapping = new Mapping();
1397
- destMapping.generatedLine = srcMapping.generatedLine;
1398
- destMapping.generatedColumn = srcMapping.generatedColumn;
1399
- if (srcMapping.source) {
1400
- destMapping.source = sources.indexOf(srcMapping.source);
1401
- destMapping.originalLine = srcMapping.originalLine;
1402
- destMapping.originalColumn = srcMapping.originalColumn;
1403
- if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
1404
- destOriginalMappings.push(destMapping);
1405
- }
1406
- destGeneratedMappings.push(destMapping);
1407
- }
1408
- quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);
1409
- return smc;
1410
- };
1411
- BasicSourceMapConsumer.prototype._version = 3;
1412
- Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() {
1413
- return this._absoluteSources.slice();
1414
- } });
1415
- function Mapping() {
1416
- this.generatedLine = 0;
1417
- this.generatedColumn = 0;
1418
- this.source = null;
1419
- this.originalLine = null;
1420
- this.originalColumn = null;
1421
- this.name = null;
1422
- }
1423
- const compareGenerated = util$1.compareByGeneratedPositionsDeflatedNoLine;
1424
- function sortGenerated(array, start) {
1425
- let l = array.length;
1426
- let n = array.length - start;
1427
- if (n <= 1) return;
1428
- else if (n == 2) {
1429
- let a = array[start];
1430
- let b = array[start + 1];
1431
- if (compareGenerated(a, b) > 0) {
1432
- array[start] = b;
1433
- array[start + 1] = a;
1434
- }
1435
- } else if (n < 20) for (let i = start; i < l; i++) for (let j = i; j > start; j--) {
1436
- let a = array[j - 1];
1437
- let b = array[j];
1438
- if (compareGenerated(a, b) <= 0) break;
1439
- array[j - 1] = b;
1440
- array[j] = a;
1441
- }
1442
- else quickSort(array, compareGenerated, start);
1443
- }
1444
- BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1445
- var generatedLine = 1;
1446
- var previousGeneratedColumn = 0;
1447
- var previousOriginalLine = 0;
1448
- var previousOriginalColumn = 0;
1449
- var previousSource = 0;
1450
- var previousName = 0;
1451
- var length = aStr.length;
1452
- var index = 0;
1453
- var temp = {};
1454
- var originalMappings = [];
1455
- var generatedMappings = [];
1456
- var mapping, segment, end, value;
1457
- let subarrayStart = 0;
1458
- while (index < length) if (aStr.charAt(index) === ";") {
1459
- generatedLine++;
1460
- index++;
1461
- previousGeneratedColumn = 0;
1462
- sortGenerated(generatedMappings, subarrayStart);
1463
- subarrayStart = generatedMappings.length;
1464
- } else if (aStr.charAt(index) === ",") index++;
1465
- else {
1466
- mapping = new Mapping();
1467
- mapping.generatedLine = generatedLine;
1468
- for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break;
1469
- aStr.slice(index, end);
1470
- segment = [];
1471
- while (index < end) {
1472
- base64VLQ.decode(aStr, index, temp);
1473
- value = temp.value;
1474
- index = temp.rest;
1475
- segment.push(value);
1476
- }
1477
- if (segment.length === 2) throw new Error("Found a source, but no line and column");
1478
- if (segment.length === 3) throw new Error("Found a source and line, but no column");
1479
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
1480
- previousGeneratedColumn = mapping.generatedColumn;
1481
- if (segment.length > 1) {
1482
- mapping.source = previousSource + segment[1];
1483
- previousSource += segment[1];
1484
- mapping.originalLine = previousOriginalLine + segment[2];
1485
- previousOriginalLine = mapping.originalLine;
1486
- mapping.originalLine += 1;
1487
- mapping.originalColumn = previousOriginalColumn + segment[3];
1488
- previousOriginalColumn = mapping.originalColumn;
1489
- if (segment.length > 4) {
1490
- mapping.name = previousName + segment[4];
1491
- previousName += segment[4];
1492
- }
1493
- }
1494
- generatedMappings.push(mapping);
1495
- if (typeof mapping.originalLine === "number") {
1496
- let currentSource = mapping.source;
1497
- while (originalMappings.length <= currentSource) originalMappings.push(null);
1498
- if (originalMappings[currentSource] === null) originalMappings[currentSource] = [];
1499
- originalMappings[currentSource].push(mapping);
1500
- }
1501
- }
1502
- sortGenerated(generatedMappings, subarrayStart);
1503
- this.__generatedMappings = generatedMappings;
1504
- for (var i = 0; i < originalMappings.length; i++) if (originalMappings[i] != null) quickSort(originalMappings[i], util$1.compareByOriginalPositionsNoSource);
1505
- this.__originalMappings = [].concat(...originalMappings);
1506
- };
1507
- BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
1508
- if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
1509
- if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
1510
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1511
- };
1512
- BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
1513
- for (var index = 0; index < this._generatedMappings.length; ++index) {
1514
- var mapping = this._generatedMappings[index];
1515
- if (index + 1 < this._generatedMappings.length) {
1516
- var nextMapping = this._generatedMappings[index + 1];
1517
- if (mapping.generatedLine === nextMapping.generatedLine) {
1518
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1519
- continue;
1520
- }
1521
- }
1522
- mapping.lastGeneratedColumn = Infinity;
1523
- }
1524
- };
1525
- BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
1526
- var needle = {
1527
- generatedLine: util$1.getArg(aArgs, "line"),
1528
- generatedColumn: util$1.getArg(aArgs, "column")
1529
- };
1530
- var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util$1.compareByGeneratedPositionsDeflated, util$1.getArg(aArgs, "bias", SourceMapConsumer$1.GREATEST_LOWER_BOUND));
1531
- if (index >= 0) {
1532
- var mapping = this._generatedMappings[index];
1533
- if (mapping.generatedLine === needle.generatedLine) {
1534
- var source = util$1.getArg(mapping, "source", null);
1535
- if (source !== null) {
1536
- source = this._sources.at(source);
1537
- source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
1538
- }
1539
- var name = util$1.getArg(mapping, "name", null);
1540
- if (name !== null) name = this._names.at(name);
1541
- return {
1542
- source,
1543
- line: util$1.getArg(mapping, "originalLine", null),
1544
- column: util$1.getArg(mapping, "originalColumn", null),
1545
- name
1546
- };
1547
- }
1548
- }
1549
- return {
1550
- source: null,
1551
- line: null,
1552
- column: null,
1553
- name: null
1554
- };
1555
- };
1556
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
1557
- if (!this.sourcesContent) return false;
1558
- return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
1559
- return sc == null;
1560
- });
1561
- };
1562
- BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1563
- if (!this.sourcesContent) return null;
1564
- var index = this._findSourceIndex(aSource);
1565
- if (index >= 0) return this.sourcesContent[index];
1566
- var relativeSource = aSource;
1567
- if (this.sourceRoot != null) relativeSource = util$1.relative(this.sourceRoot, relativeSource);
1568
- var url;
1569
- if (this.sourceRoot != null && (url = util$1.urlParse(this.sourceRoot))) {
1570
- var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
1571
- if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
1572
- if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
1573
- }
1574
- if (nullOnMissing) return null;
1575
- else throw new Error('"' + relativeSource + '" is not in the SourceMap.');
1576
- };
1577
- BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
1578
- var source = util$1.getArg(aArgs, "source");
1579
- source = this._findSourceIndex(source);
1580
- if (source < 0) return {
1581
- line: null,
1582
- column: null,
1583
- lastColumn: null
1584
- };
1585
- var needle = {
1586
- source,
1587
- originalLine: util$1.getArg(aArgs, "line"),
1588
- originalColumn: util$1.getArg(aArgs, "column")
1589
- };
1590
- var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util$1.compareByOriginalPositions, util$1.getArg(aArgs, "bias", SourceMapConsumer$1.GREATEST_LOWER_BOUND));
1591
- if (index >= 0) {
1592
- var mapping = this._originalMappings[index];
1593
- if (mapping.source === needle.source) return {
1594
- line: util$1.getArg(mapping, "generatedLine", null),
1595
- column: util$1.getArg(mapping, "generatedColumn", null),
1596
- lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1597
- };
1598
- }
1599
- return {
1600
- line: null,
1601
- column: null,
1602
- lastColumn: null
1603
- };
1604
- };
1605
- exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1606
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
1607
- var sourceMap = aSourceMap;
1608
- if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
1609
- var version2 = util$1.getArg(sourceMap, "version");
1610
- var sections = util$1.getArg(sourceMap, "sections");
1611
- if (version2 != this._version) throw new Error("Unsupported version: " + version2);
1612
- this._sources = new ArraySet();
1613
- this._names = new ArraySet();
1614
- var lastOffset = {
1615
- line: -1,
1616
- column: 0
1617
- };
1618
- this._sections = sections.map(function(s) {
1619
- if (s.url) throw new Error("Support for url field in sections not implemented.");
1620
- var offset = util$1.getArg(s, "offset");
1621
- var offsetLine = util$1.getArg(offset, "line");
1622
- var offsetColumn = util$1.getArg(offset, "column");
1623
- if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
1624
- lastOffset = offset;
1625
- return {
1626
- generatedOffset: {
1627
- generatedLine: offsetLine + 1,
1628
- generatedColumn: offsetColumn + 1
1629
- },
1630
- consumer: new SourceMapConsumer$1(util$1.getArg(s, "map"), aSourceMapURL)
1631
- };
1632
- });
1633
- }
1634
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$1.prototype);
1635
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$1;
1636
- IndexedSourceMapConsumer.prototype._version = 3;
1637
- Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
1638
- var sources = [];
1639
- for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]);
1640
- return sources;
1641
- } });
1642
- IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
1643
- var needle = {
1644
- generatedLine: util$1.getArg(aArgs, "line"),
1645
- generatedColumn: util$1.getArg(aArgs, "column")
1646
- };
1647
- var sectionIndex = binarySearch.search(needle, this._sections, function(needle$1, section$1) {
1648
- var cmp = needle$1.generatedLine - section$1.generatedOffset.generatedLine;
1649
- if (cmp) return cmp;
1650
- return needle$1.generatedColumn - section$1.generatedOffset.generatedColumn;
1651
- });
1652
- var section = this._sections[sectionIndex];
1653
- if (!section) return {
1654
- source: null,
1655
- line: null,
1656
- column: null,
1657
- name: null
1658
- };
1659
- return section.consumer.originalPositionFor({
1660
- line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
1661
- column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1662
- bias: aArgs.bias
1663
- });
1664
- };
1665
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
1666
- return this._sections.every(function(s) {
1667
- return s.consumer.hasContentsOfAllSources();
1668
- });
1669
- };
1670
- IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1671
- for (var i = 0; i < this._sections.length; i++) {
1672
- var section = this._sections[i];
1673
- var content = section.consumer.sourceContentFor(aSource, true);
1674
- if (content || content === "") return content;
1675
- }
1676
- if (nullOnMissing) return null;
1677
- else throw new Error('"' + aSource + '" is not in the SourceMap.');
1678
- };
1679
- IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
1680
- for (var i = 0; i < this._sections.length; i++) {
1681
- var section = this._sections[i];
1682
- if (section.consumer._findSourceIndex(util$1.getArg(aArgs, "source")) === -1) continue;
1683
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1684
- if (generatedPosition) {
1685
- var ret = {
1686
- line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
1687
- column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
1688
- };
1689
- return ret;
1690
- }
1691
- }
1692
- return {
1693
- line: null,
1694
- column: null
1695
- };
1696
- };
1697
- IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1698
- this.__generatedMappings = [];
1699
- this.__originalMappings = [];
1700
- for (var i = 0; i < this._sections.length; i++) {
1701
- var section = this._sections[i];
1702
- var sectionMappings = section.consumer._generatedMappings;
1703
- for (var j = 0; j < sectionMappings.length; j++) {
1704
- var mapping = sectionMappings[j];
1705
- var source = section.consumer._sources.at(mapping.source);
1706
- if (source !== null) source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
1707
- this._sources.add(source);
1708
- source = this._sources.indexOf(source);
1709
- var name = null;
1710
- if (mapping.name) {
1711
- name = section.consumer._names.at(mapping.name);
1712
- this._names.add(name);
1713
- name = this._names.indexOf(name);
1714
- }
1715
- var adjustedMapping = {
1716
- source,
1717
- generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
1718
- generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1719
- originalLine: mapping.originalLine,
1720
- originalColumn: mapping.originalColumn,
1721
- name
1722
- };
1723
- this.__generatedMappings.push(adjustedMapping);
1724
- if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
1725
- }
1726
- }
1727
- quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
1728
- quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
1729
- };
1730
- exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1731
- } });
1732
- var require_source_node = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js"(exports) {
1733
- var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1734
- var util = require_util();
1735
- var REGEX_NEWLINE = /(\r?\n)/;
1736
- var NEWLINE_CODE = 10;
1737
- var isSourceNode = "$$$isSourceNode$$$";
1738
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
1739
- this.children = [];
1740
- this.sourceContents = {};
1741
- this.line = aLine == null ? null : aLine;
1742
- this.column = aColumn == null ? null : aColumn;
1743
- this.source = aSource == null ? null : aSource;
1744
- this.name = aName == null ? null : aName;
1745
- this[isSourceNode] = true;
1746
- if (aChunks != null) this.add(aChunks);
1747
- }
1748
- SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
1749
- var node = new SourceNode();
1750
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
1751
- var remainingLinesIndex = 0;
1752
- var shiftNextLine = function() {
1753
- var lineContents = getNextLine();
1754
- var newLine = getNextLine() || "";
1755
- return lineContents + newLine;
1756
- function getNextLine() {
1757
- return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
1758
- }
1759
- };
1760
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
1761
- var lastMapping = null;
1762
- aSourceMapConsumer.eachMapping(function(mapping) {
1763
- if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) {
1764
- addMappingWithCode(lastMapping, shiftNextLine());
1765
- lastGeneratedLine++;
1766
- lastGeneratedColumn = 0;
1767
- } else {
1768
- var nextLine = remainingLines[remainingLinesIndex] || "";
1769
- var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
1770
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
1771
- lastGeneratedColumn = mapping.generatedColumn;
1772
- addMappingWithCode(lastMapping, code);
1773
- lastMapping = mapping;
1774
- return;
1775
- }
1776
- while (lastGeneratedLine < mapping.generatedLine) {
1777
- node.add(shiftNextLine());
1778
- lastGeneratedLine++;
1779
- }
1780
- if (lastGeneratedColumn < mapping.generatedColumn) {
1781
- var nextLine = remainingLines[remainingLinesIndex] || "";
1782
- node.add(nextLine.substr(0, mapping.generatedColumn));
1783
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
1784
- lastGeneratedColumn = mapping.generatedColumn;
1785
- }
1786
- lastMapping = mapping;
1787
- }, this);
1788
- if (remainingLinesIndex < remainingLines.length) {
1789
- if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
1790
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
1791
- }
1792
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
1793
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1794
- if (content != null) {
1795
- if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile);
1796
- node.setSourceContent(sourceFile, content);
1797
- }
1798
- });
1799
- return node;
1800
- function addMappingWithCode(mapping, code) {
1801
- if (mapping === null || mapping.source === void 0) node.add(code);
1802
- else {
1803
- var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
1804
- node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
1805
- }
1806
- }
1807
- };
1808
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
1809
- if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
1810
- this.add(chunk);
1811
- }, this);
1812
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1813
- if (aChunk) this.children.push(aChunk);
1814
- } else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1815
- return this;
1816
- };
1817
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
1818
- if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]);
1819
- else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk);
1820
- else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1821
- return this;
1822
- };
1823
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
1824
- var chunk;
1825
- for (var i = 0, len = this.children.length; i < len; i++) {
1826
- chunk = this.children[i];
1827
- if (chunk[isSourceNode]) chunk.walk(aFn);
1828
- else if (chunk !== "") aFn(chunk, {
1829
- source: this.source,
1830
- line: this.line,
1831
- column: this.column,
1832
- name: this.name
1833
- });
1834
- }
1835
- };
1836
- SourceNode.prototype.join = function SourceNode_join(aSep) {
1837
- var newChildren;
1838
- var i;
1839
- var len = this.children.length;
1840
- if (len > 0) {
1841
- newChildren = [];
1842
- for (i = 0; i < len - 1; i++) {
1843
- newChildren.push(this.children[i]);
1844
- newChildren.push(aSep);
1845
- }
1846
- newChildren.push(this.children[i]);
1847
- this.children = newChildren;
1848
- }
1849
- return this;
1850
- };
1851
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
1852
- var lastChild = this.children[this.children.length - 1];
1853
- if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
1854
- else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
1855
- else this.children.push("".replace(aPattern, aReplacement));
1856
- return this;
1857
- };
1858
- SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
1859
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
1860
- };
1861
- SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
1862
- for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
1863
- var sources = Object.keys(this.sourceContents);
1864
- for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
1865
- };
1866
- SourceNode.prototype.toString = function SourceNode_toString() {
1867
- var str = "";
1868
- this.walk(function(chunk) {
1869
- str += chunk;
1870
- });
1871
- return str;
1872
- };
1873
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
1874
- var generated = {
1875
- code: "",
1876
- line: 1,
1877
- column: 0
1878
- };
1879
- var map = new SourceMapGenerator(aArgs);
1880
- var sourceMappingActive = false;
1881
- var lastOriginalSource = null;
1882
- var lastOriginalLine = null;
1883
- var lastOriginalColumn = null;
1884
- var lastOriginalName = null;
1885
- this.walk(function(chunk, original) {
1886
- generated.code += chunk;
1887
- if (original.source !== null && original.line !== null && original.column !== null) {
1888
- if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
1889
- source: original.source,
1890
- original: {
1891
- line: original.line,
1892
- column: original.column
1893
- },
1894
- generated: {
1895
- line: generated.line,
1896
- column: generated.column
1897
- },
1898
- name: original.name
1899
- });
1900
- lastOriginalSource = original.source;
1901
- lastOriginalLine = original.line;
1902
- lastOriginalColumn = original.column;
1903
- lastOriginalName = original.name;
1904
- sourceMappingActive = true;
1905
- } else if (sourceMappingActive) {
1906
- map.addMapping({ generated: {
1907
- line: generated.line,
1908
- column: generated.column
1909
- } });
1910
- lastOriginalSource = null;
1911
- sourceMappingActive = false;
1912
- }
1913
- for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
1914
- generated.line++;
1915
- generated.column = 0;
1916
- if (idx + 1 === length) {
1917
- lastOriginalSource = null;
1918
- sourceMappingActive = false;
1919
- } else if (sourceMappingActive) map.addMapping({
1920
- source: original.source,
1921
- original: {
1922
- line: original.line,
1923
- column: original.column
1924
- },
1925
- generated: {
1926
- line: generated.line,
1927
- column: generated.column
1928
- },
1929
- name: original.name
1930
- });
1931
- } else generated.column++;
1932
- });
1933
- this.walkSourceContents(function(sourceFile, sourceContent) {
1934
- map.setSourceContent(sourceFile, sourceContent);
1935
- });
1936
- return {
1937
- code: generated.code,
1938
- map
1939
- };
1940
- };
1941
- exports.SourceNode = SourceNode;
1942
- } });
1943
- var require_source_map = __commonJS({ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js"(exports) {
1944
- exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1945
- exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
1946
- exports.SourceNode = require_source_node().SourceNode;
1947
- } });
1948
- var import_source_map = __toESM(require_source_map());
1949
- var reentry = false;
1950
- var describeBuiltInComponentFrame = (name) => {
1951
- return `
1952
- in ${name}`;
1953
- };
1954
- var INLINE_SOURCEMAP_REGEX = /^data:application\/json[^,]+base64,/;
1955
- var SOURCEMAP_REGEX = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/;
1956
- var getSourceMap = async (url, content) => {
1957
- const lines = content.split("\n");
1958
- let sourceMapUrl;
1959
- for (let i = lines.length - 1; i >= 0 && !sourceMapUrl; i--) {
1960
- const result = lines[i].match(SOURCEMAP_REGEX);
1961
- if (result) sourceMapUrl = result[1];
1962
- }
1963
- if (!sourceMapUrl) return null;
1964
- if (!(INLINE_SOURCEMAP_REGEX.test(sourceMapUrl) || sourceMapUrl.startsWith("/"))) {
1965
- const parsedURL = url.split("/");
1966
- parsedURL[parsedURL.length - 1] = sourceMapUrl;
1967
- sourceMapUrl = parsedURL.join("/");
1968
- }
1969
- const response = await fetch(sourceMapUrl);
1970
- const rawSourceMap = await response.json();
1971
- return new import_source_map.SourceMapConsumer(rawSourceMap);
1972
- };
1973
- var parseStackFrame = async (frame, maxDepth) => {
1974
- const sources = parseStack(frame);
1975
- if (!sources.length) return [];
1976
- const pendingSources = sources.slice(0, maxDepth) ;
1977
- const results = await Promise.all(pendingSources.map(async ({ file: fileName, line: lineNumber, col: columnNumber = 0 }) => {
1978
- if (!fileName || !lineNumber) return null;
1979
- try {
1980
- const response = await fetch(fileName);
1981
- if (response.ok) {
1982
- const content = await response.text();
1983
- const sourcemap = await getSourceMap(fileName, content);
1984
- if (sourcemap) {
1985
- const result = sourcemap.originalPositionFor({
1986
- line: lineNumber,
1987
- column: columnNumber
1988
- });
1989
- return {
1990
- fileName: (sourcemap.file || result.source).replace(/^file:\/\//, ""),
1991
- lineNumber: result.line,
1992
- columnNumber: result.column
1993
- };
1994
- }
1995
- }
1996
- return {
1997
- fileName: fileName.replace(/^file:\/\//, ""),
1998
- lineNumber,
1999
- columnNumber
2000
- };
2001
- } catch {
2002
- return {
2003
- fileName: fileName.replace(/^file:\/\//, ""),
2004
- lineNumber,
2005
- columnNumber
2006
- };
2007
- }
2008
- }));
2009
- return results.filter((result) => result !== null);
2010
- };
2011
- var describeNativeComponentFrame = (fn, construct) => {
2012
- if (!fn || reentry) return "";
2013
- const previousPrepareStackTrace = Error.prepareStackTrace;
2014
- Error.prepareStackTrace = void 0;
2015
- reentry = true;
2016
- const previousDispatcher = getCurrentDispatcher();
2017
- setCurrentDispatcher(null);
2018
- const prevError = console.error;
2019
- const prevWarn = console.warn;
2020
- console.error = () => {
2021
- };
2022
- console.warn = () => {
2023
- };
2024
- try {
2025
- const RunInRootFrame = { DetermineComponentFrameRoot() {
2026
- let control;
2027
- try {
2028
- if (construct) {
2029
- const Fake = function() {
2030
- throw Error();
2031
- };
2032
- Object.defineProperty(Fake.prototype, "props", { set: function() {
2033
- throw Error();
2034
- } });
2035
- if (typeof Reflect === "object" && Reflect.construct) {
2036
- try {
2037
- Reflect.construct(Fake, []);
2038
- } catch (x) {
2039
- control = x;
2040
- }
2041
- Reflect.construct(fn, [], Fake);
2042
- } else {
2043
- try {
2044
- Fake.call();
2045
- } catch (x) {
2046
- control = x;
2047
- }
2048
- fn.call(Fake.prototype);
2049
- }
2050
- } else {
2051
- try {
2052
- throw Error();
2053
- } catch (x) {
2054
- control = x;
2055
- }
2056
- const maybePromise = fn();
2057
- if (maybePromise && typeof maybePromise.catch === "function") maybePromise.catch(() => {
2058
- });
2059
- }
2060
- } catch (sample) {
2061
- if (sample && control && typeof sample.stack === "string") return [sample.stack, control.stack];
2062
- }
2063
- return [null, null];
2064
- } };
2065
- RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
2066
- const namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, "name");
2067
- if (namePropDescriptor?.configurable) Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { value: "DetermineComponentFrameRoot" });
2068
- const [sampleStack, controlStack] = RunInRootFrame.DetermineComponentFrameRoot();
2069
- if (sampleStack && controlStack) {
2070
- const sampleLines = sampleStack.split("\n");
2071
- const controlLines = controlStack.split("\n");
2072
- let sampleIndex = 0;
2073
- let controlIndex = 0;
2074
- while (sampleIndex < sampleLines.length && !sampleLines[sampleIndex].includes("DetermineComponentFrameRoot")) sampleIndex++;
2075
- while (controlIndex < controlLines.length && !controlLines[controlIndex].includes("DetermineComponentFrameRoot")) controlIndex++;
2076
- if (sampleIndex === sampleLines.length || controlIndex === controlLines.length) {
2077
- sampleIndex = sampleLines.length - 1;
2078
- controlIndex = controlLines.length - 1;
2079
- while (sampleIndex >= 1 && controlIndex >= 0 && sampleLines[sampleIndex] !== controlLines[controlIndex]) controlIndex--;
2080
- }
2081
- for (; sampleIndex >= 1 && controlIndex >= 0; sampleIndex--, controlIndex--) if (sampleLines[sampleIndex] !== controlLines[controlIndex]) {
2082
- if (sampleIndex !== 1 || controlIndex !== 1) do {
2083
- sampleIndex--;
2084
- controlIndex--;
2085
- if (controlIndex < 0 || sampleLines[sampleIndex] !== controlLines[controlIndex]) {
2086
- let frame = `
2087
- ${sampleLines[sampleIndex].replace(" at new ", " at ")}`;
2088
- const displayName = getDisplayName(fn);
2089
- if (displayName && frame.includes("<anonymous>")) frame = frame.replace("<anonymous>", displayName);
2090
- return frame;
2091
- }
2092
- } while (sampleIndex >= 1 && controlIndex >= 0);
2093
- break;
2094
- }
2095
- }
2096
- } finally {
2097
- reentry = false;
2098
- Error.prepareStackTrace = previousPrepareStackTrace;
2099
- setCurrentDispatcher(previousDispatcher);
2100
- console.error = prevError;
2101
- console.warn = prevWarn;
2102
- }
2103
- const name = fn ? getDisplayName(fn) : "";
2104
- const syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
2105
- return syntheticFrame;
2106
- };
2107
- var getCurrentDispatcher = () => {
2108
- const rdtHook = getRDTHook();
2109
- for (const renderer of [...Array.from(_renderers), ...Array.from(rdtHook.renderers.values())]) {
2110
- const currentDispatcherRef = renderer.currentDispatcherRef;
2111
- if (currentDispatcherRef && typeof currentDispatcherRef === "object") return "H" in currentDispatcherRef ? currentDispatcherRef.H : currentDispatcherRef.current;
2112
- }
2113
- return null;
2114
- };
2115
- var setCurrentDispatcher = (value) => {
2116
- for (const renderer of _renderers) {
2117
- const currentDispatcherRef = renderer.currentDispatcherRef;
2118
- if (currentDispatcherRef && typeof currentDispatcherRef === "object") if ("H" in currentDispatcherRef) currentDispatcherRef.H = value;
2119
- else currentDispatcherRef.current = value;
2120
- }
2121
- };
2122
- var describeFiber = (fiber, childFiber) => {
2123
- const tag = fiber.tag;
2124
- switch (tag) {
2125
- case HostHoistableTag:
2126
- case HostSingletonTag:
2127
- case HostComponentTag:
2128
- return describeBuiltInComponentFrame(fiber.type);
2129
- case LazyComponentTag:
2130
- return describeBuiltInComponentFrame("Lazy");
2131
- case SuspenseComponentTag:
2132
- if (fiber.child !== childFiber && childFiber !== null) return describeBuiltInComponentFrame("Suspense Fallback");
2133
- return describeBuiltInComponentFrame("Suspense");
2134
- case SuspenseListComponentTag:
2135
- return describeBuiltInComponentFrame("SuspenseList");
2136
- case FunctionComponentTag:
2137
- case SimpleMemoComponentTag:
2138
- return describeNativeComponentFrame(fiber.type, false);
2139
- case ForwardRefTag:
2140
- return describeNativeComponentFrame(fiber.type.render, false);
2141
- case ClassComponentTag:
2142
- return describeNativeComponentFrame(fiber.type, true);
2143
- case ActivityComponentTag:
2144
- return describeBuiltInComponentFrame("Activity");
2145
- case ViewTransitionComponentTag:
2146
- return describeBuiltInComponentFrame("ViewTransition");
2147
- default:
2148
- return "";
2149
- }
2150
- };
2151
- var describeDebugInfoFrame = (name, env, _debugLocation) => {
2152
- let result = `
2153
- in ${name}`;
2154
- if (env) result += ` (at ${env})`;
2155
- return result;
2156
- };
2157
- var getFiberStackTrace = (workInProgress) => {
2158
- try {
2159
- let info = "";
2160
- let node = workInProgress;
2161
- let previous = null;
2162
- do {
2163
- info += describeFiber(node, previous);
2164
- const debugInfo = node._debugInfo;
2165
- if (debugInfo && Array.isArray(debugInfo)) for (let i = debugInfo.length - 1; i >= 0; i--) {
2166
- const entry = debugInfo[i];
2167
- if (typeof entry.name === "string") info += describeDebugInfoFrame(entry.name, entry.env, entry.debugLocation);
2168
- }
2169
- previous = node;
2170
- node = node.return;
2171
- } while (node);
2172
- return info;
2173
- } catch (error) {
2174
- if (error instanceof Error) return `
2175
- Error generating stack: ${error.message}
2176
- ${error.stack}`;
2177
- return "";
2178
- }
2179
- };
2180
- var isCapitalized = (str) => {
2181
- if (!str.length) return false;
2182
- return str[0] === str[0].toUpperCase();
2183
- };
2184
- var getOwnerStack = async (stackTrace) => {
2185
- const componentPattern = /\n\s+(?:in|at)\s+([^\s(]+)(?:\s+\((?:at\s+)?([^)]+)\))?/g;
2186
- const matches = [];
2187
- let match;
2188
- match = componentPattern.exec(stackTrace);
2189
- while (match !== null) {
2190
- const name = match[1];
2191
- const locationStr = match[2];
2192
- if (!isCapitalized(name)) {
2193
- match = componentPattern.exec(stackTrace);
2194
- matches.push({
2195
- name,
2196
- source: void 0
2197
- });
2198
- continue;
2199
- }
2200
- let source;
2201
- if (locationStr && locationStr !== "Server") try {
2202
- const mockFrame = ` at ${name} (${locationStr})`;
2203
- const parsedSources = await parseStackFrame(mockFrame, 1);
2204
- if (parsedSources.length > 0) source = parsedSources[0];
2205
- } catch {
2206
- }
2207
- matches.push({
2208
- name,
2209
- source: source || void 0
2210
- });
2211
- match = componentPattern.exec(stackTrace);
2212
- }
2213
- return matches;
2214
- };
2215
-
2216
- // src/instrumentation.ts
2217
- var fiberRoots = _fiberRoots;
2218
- instrument({
2219
- onCommitFiberRoot(_, fiberRoot) {
2220
- fiberRoots.add(fiberRoot);
2221
- }
2222
- });
2223
- var getStack = async (element) => {
2224
- const fiber = getFiberFromHostInstance(element);
2225
- if (!fiber) return null;
2226
- const stackTrace = getFiberStackTrace(fiber);
2227
- const rawOwnerStack = await getOwnerStack(stackTrace);
2228
- const stack = rawOwnerStack.map((item) => ({
2229
- componentName: item.name,
2230
- fileName: item.source?.fileName
2231
- }));
2232
- return stack;
2233
- };
2234
- var filterStack = (stack) => {
2235
- return stack.filter(
2236
- (item) => item.fileName && !item.fileName.includes("node_modules") && item.componentName.length > 1 && !item.fileName.startsWith("_")
2237
- );
2238
- };
2239
- var findCommonRoot = (paths) => {
2240
- if (paths.length === 0) return "";
2241
- if (paths.length === 1) {
2242
- const lastSlash2 = paths[0].lastIndexOf("/");
2243
- return lastSlash2 > 0 ? paths[0].substring(0, lastSlash2 + 1) : "";
2244
- }
2245
- let commonPrefix = paths[0];
2246
- for (let i = 1; i < paths.length; i++) {
2247
- const path = paths[i];
2248
- let j = 0;
2249
- while (j < commonPrefix.length && j < path.length && commonPrefix[j] === path[j]) {
2250
- j++;
2251
- }
2252
- commonPrefix = commonPrefix.substring(0, j);
2253
- }
2254
- const lastSlash = commonPrefix.lastIndexOf("/");
2255
- return lastSlash > 0 ? commonPrefix.substring(0, lastSlash + 1) : "";
2256
- };
2257
- var serializeStack = (stack) => {
2258
- const filePaths = stack.map((item) => item.fileName).filter((path) => !!path);
2259
- const commonRoot = findCommonRoot(filePaths);
2260
- return stack.map((item) => {
2261
- let fileName = item.fileName;
2262
- if (fileName && commonRoot) {
2263
- fileName = fileName.startsWith(commonRoot) ? fileName.substring(commonRoot.length) : fileName;
2264
- }
2265
- return `${item.componentName}${fileName ? ` (${fileName})` : ""}`;
2266
- }).join("\n");
2267
- };
2268
- var getHTMLSnippet = (element) => {
2269
- const semanticTags = /* @__PURE__ */ new Set([
2270
- "article",
2271
- "aside",
2272
- "footer",
2273
- "form",
2274
- "header",
2275
- "main",
2276
- "nav",
2277
- "section"
2278
- ]);
2279
- const hasDistinguishingFeatures = (el) => {
2280
- const tagName = el.tagName.toLowerCase();
2281
- if (semanticTags.has(tagName)) return true;
2282
- if (el.id) return true;
2283
- if (el.className && typeof el.className === "string") {
2284
- const classes = el.className.trim();
2285
- if (classes && classes.length > 0) return true;
2286
- }
2287
- return Array.from(el.attributes).some(
2288
- (attr) => attr.name.startsWith("data-")
2289
- );
2290
- };
2291
- const getAncestorChain = (el, maxDepth = 10) => {
2292
- const ancestors2 = [];
2293
- let current = el.parentElement;
2294
- let depth = 0;
2295
- while (current && depth < maxDepth && current.tagName !== "BODY") {
2296
- if (hasDistinguishingFeatures(current)) {
2297
- ancestors2.push(current);
2298
- if (ancestors2.length >= 3) break;
2299
- }
2300
- current = current.parentElement;
2301
- depth++;
2302
- }
2303
- return ancestors2.reverse();
2304
- };
2305
- const getCSSPath = (el) => {
2306
- const parts = [];
2307
- let current = el;
2308
- let depth = 0;
2309
- const maxDepth = 5;
2310
- while (current && depth < maxDepth && current.tagName !== "BODY") {
2311
- let selector = current.tagName.toLowerCase();
2312
- if (current.id) {
2313
- selector += `#${current.id}`;
2314
- parts.unshift(selector);
2315
- break;
2316
- } else if (current.className && typeof current.className === "string" && current.className.trim()) {
2317
- const classes = current.className.trim().split(/\s+/).slice(0, 2);
2318
- selector += `.${classes.join(".")}`;
2319
- }
2320
- if (!current.id && (!current.className || !current.className.trim()) && current.parentElement) {
2321
- const siblings = Array.from(current.parentElement.children);
2322
- const index = siblings.indexOf(current);
2323
- if (index >= 0 && siblings.length > 1) {
2324
- selector += `:nth-child(${index + 1})`;
2325
- }
2326
- }
2327
- parts.unshift(selector);
2328
- current = current.parentElement;
2329
- depth++;
2330
- }
2331
- return parts.join(" > ");
2332
- };
2333
- const getElementTag = (el, compact = false) => {
2334
- const tagName = el.tagName.toLowerCase();
2335
- const attrs = [];
2336
- if (el.id) {
2337
- attrs.push(`id="${el.id}"`);
2338
- }
2339
- if (el.className && typeof el.className === "string") {
2340
- const classes = el.className.trim().split(/\s+/);
2341
- if (classes.length > 0 && classes[0]) {
2342
- const displayClasses = compact ? classes.slice(0, 3) : classes;
2343
- let classStr = displayClasses.join(" ");
2344
- if (classStr.length > 30) {
2345
- classStr = classStr.substring(0, 30) + "...";
2346
- }
2347
- attrs.push(`class="${classStr}"`);
2348
- }
2349
- }
2350
- const dataAttrs = Array.from(el.attributes).filter(
2351
- (attr) => attr.name.startsWith("data-")
2352
- );
2353
- const displayDataAttrs = compact ? dataAttrs.slice(0, 1) : dataAttrs;
2354
- for (const attr of displayDataAttrs) {
2355
- let value = attr.value;
2356
- if (value.length > 20) {
2357
- value = value.substring(0, 20) + "...";
2358
- }
2359
- attrs.push(`${attr.name}="${value}"`);
2360
- }
2361
- const ariaLabel = el.getAttribute("aria-label");
2362
- if (ariaLabel && !compact) {
2363
- let value = ariaLabel;
2364
- if (value.length > 20) {
2365
- value = value.substring(0, 20) + "...";
2366
- }
2367
- attrs.push(`aria-label="${value}"`);
2368
- }
2369
- return attrs.length > 0 ? `<${tagName} ${attrs.join(" ")}>` : `<${tagName}>`;
2370
- };
2371
- const getClosingTag = (el) => {
2372
- return `</${el.tagName.toLowerCase()}>`;
2373
- };
2374
- const getTextContent = (el) => {
2375
- let text = el.textContent || "";
2376
- text = text.trim().replace(/\s+/g, " ");
2377
- const maxLength = 60;
2378
- if (text.length > maxLength) {
2379
- text = text.substring(0, maxLength) + "...";
2380
- }
2381
- return text;
2382
- };
2383
- const getSiblingIdentifier = (el) => {
2384
- if (el.id) return `#${el.id}`;
2385
- if (el.className && typeof el.className === "string") {
2386
- const classes = el.className.trim().split(/\s+/);
2387
- if (classes.length > 0 && classes[0]) {
2388
- return `.${classes[0]}`;
2389
- }
2390
- }
2391
- return null;
2392
- };
2393
- const lines = [];
2394
- lines.push(`Path: ${getCSSPath(element)}`);
2395
- lines.push("");
2396
- const ancestors = getAncestorChain(element);
2397
- for (let i = 0; i < ancestors.length; i++) {
2398
- const indent2 = " ".repeat(i);
2399
- lines.push(indent2 + getElementTag(ancestors[i], true));
2400
- }
2401
- const parent = element.parentElement;
2402
- let targetIndex = -1;
2403
- if (parent) {
2404
- const siblings = Array.from(parent.children);
2405
- targetIndex = siblings.indexOf(element);
2406
- if (targetIndex > 0) {
2407
- const prevSibling = siblings[targetIndex - 1];
2408
- const prevId = getSiblingIdentifier(prevSibling);
2409
- if (prevId && targetIndex <= 2) {
2410
- const indent2 = " ".repeat(ancestors.length);
2411
- lines.push(`${indent2} ${getElementTag(prevSibling, true)}`);
2412
- lines.push(`${indent2} </${prevSibling.tagName.toLowerCase()}>`);
2413
- } else if (targetIndex > 0) {
2414
- const indent2 = " ".repeat(ancestors.length);
2415
- lines.push(
2416
- `${indent2} ... (${targetIndex} element${targetIndex === 1 ? "" : "s"})`
2417
- );
2418
- }
2419
- }
2420
- }
2421
- const indent = " ".repeat(ancestors.length);
2422
- lines.push(indent + " <!-- SELECTED -->");
2423
- const textContent = getTextContent(element);
2424
- const childrenCount = element.children.length;
2425
- if (textContent && childrenCount === 0 && textContent.length < 40) {
2426
- lines.push(
2427
- `${indent} ${getElementTag(element)}${textContent}${getClosingTag(
2428
- element
2429
- )}`
2430
- );
2431
- } else {
2432
- lines.push(indent + " " + getElementTag(element));
2433
- if (textContent) {
2434
- lines.push(`${indent} ${textContent}`);
2435
- }
2436
- if (childrenCount > 0) {
2437
- lines.push(
2438
- `${indent} ... (${childrenCount} element${childrenCount === 1 ? "" : "s"})`
2439
- );
2440
- }
2441
- lines.push(indent + " " + getClosingTag(element));
2442
- }
2443
- if (parent && targetIndex >= 0) {
2444
- const siblings = Array.from(parent.children);
2445
- const siblingsAfter = siblings.length - targetIndex - 1;
2446
- if (siblingsAfter > 0) {
2447
- const nextSibling = siblings[targetIndex + 1];
2448
- const nextId = getSiblingIdentifier(nextSibling);
2449
- if (nextId && siblingsAfter <= 2) {
2450
- lines.push(`${indent} ${getElementTag(nextSibling, true)}`);
2451
- lines.push(`${indent} </${nextSibling.tagName.toLowerCase()}>`);
2452
- } else {
2453
- lines.push(
2454
- `${indent} ... (${siblingsAfter} element${siblingsAfter === 1 ? "" : "s"})`
2455
- );
2456
- }
2457
- }
2458
- }
2459
- for (let i = ancestors.length - 1; i >= 0; i--) {
2460
- const indent2 = " ".repeat(i);
2461
- lines.push(indent2 + getClosingTag(ancestors[i]));
2462
- }
2463
- return lines.join("\n");
2464
- };
2465
-
2466
- // src/overlay.ts
2467
- var VIEWPORT_MARGIN_PX = 8;
2468
- var LABEL_OFFSET_PX = 6;
2469
- var INDICATOR_CLAMP_PADDING_PX = 4;
2470
- var INDICATOR_SUCCESS_VISIBLE_MS = 1500;
2471
- var INDICATOR_FADE_MS = 200;
2472
- var INDICATOR_TOTAL_HIDE_DELAY_MS = INDICATOR_SUCCESS_VISIBLE_MS + INDICATOR_FADE_MS;
2473
- var lerp = (start, end, factor) => {
2474
- return start + (end - start) * factor;
2475
- };
2476
- var SELECTION_LERP_FACTOR = 0.95;
2477
- var createSelectionElement = ({
2478
- borderRadius,
2479
- height,
2480
- transform,
2481
- width,
2482
- x,
2483
- y
2484
- }) => {
2485
- const overlay = document.createElement("div");
2486
- overlay.style.position = "fixed";
2487
- overlay.style.top = `${y}px`;
2488
- overlay.style.left = `${x}px`;
2489
- overlay.style.width = `${width}px`;
2490
- overlay.style.height = `${height}px`;
2491
- overlay.style.borderRadius = borderRadius;
2492
- overlay.style.transform = transform;
2493
- overlay.style.pointerEvents = "none";
2494
- overlay.style.border = "1px solid rgb(210, 57, 192)";
2495
- overlay.style.backgroundColor = "rgba(210, 57, 192, 0.2)";
2496
- overlay.style.zIndex = "2147483646";
2497
- overlay.style.boxSizing = "border-box";
2498
- overlay.style.display = "none";
2499
- return overlay;
2500
- };
2501
- var updateSelectionElement = (element, { borderRadius, height, transform, width, x, y }) => {
2502
- const currentTop = parseFloat(element.style.top) || 0;
2503
- const currentLeft = parseFloat(element.style.left) || 0;
2504
- const currentWidth = parseFloat(element.style.width) || 0;
2505
- const currentHeight = parseFloat(element.style.height) || 0;
2506
- const topValue = `${lerp(currentTop, y, SELECTION_LERP_FACTOR)}px`;
2507
- const leftValue = `${lerp(currentLeft, x, SELECTION_LERP_FACTOR)}px`;
2508
- const widthValue = `${lerp(currentWidth, width, SELECTION_LERP_FACTOR)}px`;
2509
- const heightValue = `${lerp(currentHeight, height, SELECTION_LERP_FACTOR)}px`;
2510
- if (element.style.top !== topValue) {
2511
- element.style.top = topValue;
2512
- }
2513
- if (element.style.left !== leftValue) {
2514
- element.style.left = leftValue;
2515
- }
2516
- if (element.style.width !== widthValue) {
2517
- element.style.width = widthValue;
2518
- }
2519
- if (element.style.height !== heightValue) {
2520
- element.style.height = heightValue;
2521
- }
2522
- if (element.style.borderRadius !== borderRadius) {
2523
- element.style.borderRadius = borderRadius;
2524
- }
2525
- if (element.style.transform !== transform) {
2526
- element.style.transform = transform;
2527
- }
2528
- };
2529
- var createSelectionOverlay = (root) => {
2530
- const element = createSelectionElement({
2531
- borderRadius: "0px",
2532
- height: 0,
2533
- transform: "none",
2534
- width: 0,
2535
- x: -1e3,
2536
- y: -1e3
2537
- });
2538
- root.appendChild(element);
2539
- let visible = false;
2540
- return {
2541
- hide: () => {
2542
- visible = false;
2543
- element.style.display = "none";
2544
- element.style.pointerEvents = "none";
2545
- },
2546
- isVisible: () => visible,
2547
- show: () => {
2548
- visible = true;
2549
- element.style.display = "block";
2550
- element.style.pointerEvents = "auto";
2551
- },
2552
- update: (selection) => {
2553
- updateSelectionElement(element, selection);
2554
- }
2555
- };
2556
- };
2557
- var createSpinner = () => {
2558
- const spinner = document.createElement("span");
2559
- spinner.style.display = "inline-block";
2560
- spinner.style.width = "8px";
2561
- spinner.style.height = "8px";
2562
- spinner.style.border = "1.5px solid rgb(210, 57, 192)";
2563
- spinner.style.borderTopColor = "transparent";
2564
- spinner.style.borderRadius = "50%";
2565
- spinner.style.marginRight = "4px";
2566
- spinner.style.verticalAlign = "middle";
2567
- spinner.animate(
2568
- [{ transform: "rotate(0deg)" }, { transform: "rotate(360deg)" }],
2569
- {
2570
- duration: 600,
2571
- easing: "linear",
2572
- iterations: Infinity
2573
- }
2574
- );
2575
- return spinner;
2576
- };
2577
- var activeIndicator = null;
2578
- var createIndicator = () => {
2579
- const indicator = document.createElement("div");
2580
- indicator.style.position = "fixed";
2581
- indicator.style.top = "calc(8px + env(safe-area-inset-top))";
2582
- indicator.style.padding = "2px 6px";
2583
- indicator.style.backgroundColor = "#fde7f7";
2584
- indicator.style.color = "#b21c8e";
2585
- indicator.style.border = "1px solid #f7c5ec";
2586
- indicator.style.borderRadius = "4px";
2587
- indicator.style.fontSize = "11px";
2588
- indicator.style.fontWeight = "500";
2589
- indicator.style.fontFamily = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
2590
- indicator.style.zIndex = "2147483647";
2591
- indicator.style.pointerEvents = "none";
2592
- indicator.style.opacity = "0";
2593
- indicator.style.transition = "opacity 0.2s ease-in-out";
2594
- indicator.style.display = "flex";
2595
- indicator.style.alignItems = "center";
2596
- indicator.style.maxWidth = "calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)))";
2597
- indicator.style.overflow = "hidden";
2598
- indicator.style.textOverflow = "ellipsis";
2599
- indicator.style.whiteSpace = "nowrap";
2600
- return indicator;
2601
- };
2602
- var showLabel = (selectionLeftPx, selectionTopPx, tagName) => {
2603
- let indicator = activeIndicator;
2604
- let isNewIndicator = false;
2605
- if (!indicator) {
2606
- indicator = createIndicator();
2607
- document.body.appendChild(indicator);
2608
- activeIndicator = indicator;
2609
- isNewIndicator = true;
2610
- isProcessing = false;
2611
- }
2612
- if (!isProcessing) {
2613
- const labelText = indicator.querySelector("span");
2614
- if (labelText) {
2615
- const tagNameMonospace = document.createElement("span");
2616
- tagNameMonospace.textContent = tagName ? `<${tagName}>` : "<element>";
2617
- tagNameMonospace.style.fontFamily = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace";
2618
- tagNameMonospace.style.fontVariantNumeric = "tabular-nums";
2619
- labelText.replaceChildren(tagNameMonospace);
2620
- } else {
2621
- const newLabelText = document.createElement("span");
2622
- const tagNameMonospace = document.createElement("span");
2623
- tagNameMonospace.textContent = tagName ? `<${tagName}>` : "<element>";
2624
- tagNameMonospace.style.fontFamily = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace";
2625
- tagNameMonospace.style.fontVariantNumeric = "tabular-nums";
2626
- newLabelText.appendChild(tagNameMonospace);
2627
- indicator.appendChild(newLabelText);
2628
- }
2629
- }
2630
- const indicatorRect = indicator.getBoundingClientRect();
2631
- const viewportWidthPx = window.innerWidth;
2632
- const viewportHeightPx = window.innerHeight;
2633
- let indicatorLeftPx = Math.round(selectionLeftPx);
2634
- let indicatorTopPx = Math.round(selectionTopPx) - indicatorRect.height - LABEL_OFFSET_PX;
2635
- const CLAMPED_PADDING = INDICATOR_CLAMP_PADDING_PX;
2636
- const minLeft = VIEWPORT_MARGIN_PX;
2637
- const minTop = VIEWPORT_MARGIN_PX;
2638
- const maxLeft = viewportWidthPx - indicatorRect.width - VIEWPORT_MARGIN_PX;
2639
- const maxTop = viewportHeightPx - indicatorRect.height - VIEWPORT_MARGIN_PX;
2640
- const willClampLeft = indicatorLeftPx < minLeft;
2641
- const willClampTop = indicatorTopPx < minTop;
2642
- const isClamped = willClampLeft || willClampTop;
2643
- indicatorLeftPx = Math.max(minLeft, Math.min(indicatorLeftPx, maxLeft));
2644
- indicatorTopPx = Math.max(minTop, Math.min(indicatorTopPx, maxTop));
2645
- if (isClamped) {
2646
- indicatorLeftPx += CLAMPED_PADDING;
2647
- indicatorTopPx += CLAMPED_PADDING;
2648
- }
2649
- indicator.style.left = `${indicatorLeftPx}px`;
2650
- indicator.style.top = `${indicatorTopPx}px`;
2651
- indicator.style.right = "auto";
2652
- if (isNewIndicator) {
2653
- requestAnimationFrame(() => {
2654
- indicator.style.opacity = "1";
2655
- });
2656
- } else if (indicator.style.opacity !== "1") {
2657
- indicator.style.opacity = "1";
2658
- }
2659
- };
2660
- var isProcessing = false;
2661
- var updateLabelToProcessing = () => {
2662
- if (!activeIndicator || isProcessing) return () => {
2663
- };
2664
- isProcessing = true;
2665
- const indicator = activeIndicator;
2666
- indicator.innerHTML = "";
2667
- const loadingSpinner = createSpinner();
2668
- const labelText = document.createElement("span");
2669
- labelText.textContent = "Grabbing\u2026";
2670
- indicator.appendChild(loadingSpinner);
2671
- indicator.appendChild(labelText);
2672
- return (tagName) => {
2673
- if (!activeIndicator) {
2674
- isProcessing = false;
2675
- return;
2676
- }
2677
- indicator.textContent = "";
2678
- const checkmarkIcon = document.createElement("span");
2679
- checkmarkIcon.textContent = "\u2713";
2680
- checkmarkIcon.style.display = "inline-block";
2681
- checkmarkIcon.style.marginRight = "4px";
2682
- checkmarkIcon.style.fontWeight = "600";
2683
- const newLabelText = document.createElement("span");
2684
- const tagNameMonospace = document.createElement("span");
2685
- tagNameMonospace.textContent = tagName ? `<${tagName}>` : "<element>";
2686
- tagNameMonospace.style.fontFamily = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace";
2687
- tagNameMonospace.style.fontVariantNumeric = "tabular-nums";
2688
- newLabelText.appendChild(document.createTextNode("Grabbed "));
2689
- newLabelText.appendChild(tagNameMonospace);
2690
- indicator.appendChild(checkmarkIcon);
2691
- indicator.appendChild(newLabelText);
2692
- setTimeout(() => {
2693
- indicator.style.opacity = "0";
2694
- setTimeout(() => {
2695
- indicator.remove();
2696
- if (activeIndicator === indicator) {
2697
- activeIndicator = null;
2698
- }
2699
- isProcessing = false;
2700
- }, INDICATOR_FADE_MS);
2701
- }, INDICATOR_SUCCESS_VISIBLE_MS);
2702
- };
2703
- };
2704
- var hideLabel = () => {
2705
- if (activeIndicator) {
2706
- activeIndicator.remove();
2707
- activeIndicator = null;
2708
- }
2709
- isProcessing = false;
2710
- };
2711
-
2712
- // src/utils/copy-text.ts
2713
- var IS_NAVIGATOR_CLIPBOARD_AVAILABLE = typeof window !== "undefined" && window.navigator.clipboard && window.isSecureContext;
2714
- var copyTextToClipboard = async (text) => {
2715
- if (IS_NAVIGATOR_CLIPBOARD_AVAILABLE) {
2716
- try {
2717
- await navigator.clipboard.writeText(text);
2718
- return true;
2719
- } catch {
2720
- }
2721
- }
2722
- const textareaElement = document.createElement("textarea");
2723
- textareaElement.value = text;
2724
- textareaElement.setAttribute("readonly", "");
2725
- textareaElement.style.position = "fixed";
2726
- textareaElement.style.top = "-9999px";
2727
- textareaElement.style.opacity = "0";
2728
- textareaElement.style.pointerEvents = "none";
2729
- const doc = document.body || document.documentElement;
2730
- doc.appendChild(textareaElement);
2731
- textareaElement.select();
2732
- textareaElement.setSelectionRange(0, textareaElement.value.length);
2733
- let didCopyToClipboard = false;
2734
- try {
2735
- didCopyToClipboard = document.execCommand("copy");
2736
- } catch {
2737
- didCopyToClipboard = false;
2738
- } finally {
2739
- doc.removeChild(textareaElement);
2740
- }
2741
- return didCopyToClipboard;
2742
- };
2743
-
2744
- // src/utils/is-element-visible.ts
2745
- var isElementVisible = (element, computedStyle = window.getComputedStyle(element)) => {
2746
- return computedStyle.display !== "none" && computedStyle.visibility !== "hidden" && computedStyle.opacity !== "0";
2747
- };
2748
-
2749
- // src/utils/mount-root.ts
2750
- var ATTRIBUTE_NAME = "data-react-grab";
2751
- var mountRoot = () => {
2752
- const mountedHost = document.querySelector(`[${ATTRIBUTE_NAME}]`);
2753
- if (mountedHost) {
2754
- const mountedRoot = mountedHost.shadowRoot?.querySelector(
2755
- `[${ATTRIBUTE_NAME}]`
2756
- );
2757
- if (mountedRoot instanceof HTMLDivElement && mountedHost.shadowRoot) {
2758
- return mountedRoot;
2759
- }
2760
- }
2761
- const host = document.createElement("div");
2762
- host.setAttribute(ATTRIBUTE_NAME, "true");
2763
- host.style.zIndex = "2147483646";
2764
- host.style.position = "fixed";
2765
- host.style.top = "0";
2766
- host.style.left = "0";
2767
- const shadowRoot = host.attachShadow({ mode: "open" });
2768
- const root = document.createElement("div");
2769
- root.setAttribute(ATTRIBUTE_NAME, "true");
2770
- shadowRoot.appendChild(root);
2771
- const doc = document.body ?? document.documentElement;
2772
- doc.appendChild(host);
2773
- return root;
2774
- };
2775
-
2776
- // src/utils/schedule-run-when-idle.ts
2777
- var scheduleRunWhenIdle = (callback) => {
2778
- if ("scheduler" in globalThis) {
2779
- return globalThis.scheduler.postTask(callback, {
2780
- priority: "background"
2781
- });
2782
- }
2783
- if ("requestIdleCallback" in window) {
2784
- return requestIdleCallback(callback);
2785
- }
2786
- return setTimeout(callback, 0);
2787
- };
2788
-
2789
- // src/utils/store.ts
2790
- var createStore = (initializer) => {
2791
- const subscriberMap = /* @__PURE__ */ new Map();
2792
- let currentListenerIndex = 0;
2793
- let currentState;
2794
- const setState = (maybeStateOrReducer) => {
2795
- const prevState = currentState;
2796
- const resolvedState = typeof maybeStateOrReducer === "function" ? maybeStateOrReducer(prevState) : maybeStateOrReducer;
2797
- const nextState = {
2798
- ...prevState,
2799
- ...resolvedState
2800
- };
2801
- currentState = nextState;
2802
- for (const entry of subscriberMap.values()) {
2803
- if (entry.type === "selected" /* Selected */) {
2804
- const nextSelectedValue = entry.selector(nextState);
2805
- const prevSelectedValue = entry.prevSelectedValue;
2806
- if (!Object.is(prevSelectedValue, nextSelectedValue)) {
2807
- entry.prevSelectedValue = nextSelectedValue;
2808
- entry.listener(nextSelectedValue, prevSelectedValue);
2809
- }
2810
- } else {
2811
- entry.listener(nextState, prevState);
2812
- }
2813
- }
2814
- return currentState;
2815
- };
2816
- const getState = () => {
2817
- return currentState;
2818
- };
2819
- const initialState = initializer(setState, getState);
2820
- currentState = initialState;
2821
- const subscribeWithSelector = (listener, selector) => {
2822
- const index = String(currentListenerIndex++);
2823
- const wrappedListener = (value, prevValue) => listener(value, prevValue);
2824
- const entry = {
2825
- listener: wrappedListener,
2826
- prevSelectedValue: selector(currentState),
2827
- selector,
2828
- type: "selected" /* Selected */
2829
- };
2830
- subscriberMap.set(index, entry);
2831
- return () => {
2832
- subscriberMap.delete(index);
2833
- };
2834
- };
2835
- const subscribeToFullState = (listener) => {
2836
- const index = String(currentListenerIndex++);
2837
- const entry = {
2838
- listener,
2839
- type: "full" /* Full */
2840
- };
2841
- subscriberMap.set(index, entry);
2842
- return () => {
2843
- subscriberMap.delete(index);
2844
- };
2845
- };
2846
- function subscribe(subscriber, selector) {
2847
- return selector ? subscribeWithSelector(subscriber, selector) : subscribeToFullState(subscriber);
2848
- }
2849
- const store = {
2850
- getInitialState() {
2851
- return initialState;
2852
- },
2853
- getState,
2854
- setState,
2855
- subscribe
2856
- };
2857
- return store;
2858
- };
2859
-
2860
- // src/utils/throttle.ts
2861
- var throttle = (fn, delay) => {
2862
- let timeout = null;
2863
- const throttled = (...args) => {
2864
- if (timeout) {
2865
- return;
2866
- }
2867
- timeout = window.setTimeout(() => {
2868
- fn(...args);
2869
- timeout = null;
2870
- }, delay);
2871
- };
2872
- throttled.cancel = () => {
2873
- if (timeout) {
2874
- window.clearTimeout(timeout);
2875
- timeout = null;
2876
- }
2877
- };
2878
- return throttled;
2879
- };
2880
-
2881
- // src/index.ts
2882
- var THROTTLE_DELAY = 16;
2883
- var libStore = createStore(() => ({
2884
- keyPressTimestamps: /* @__PURE__ */ new Map(),
2885
- mouseX: -1e3,
2886
- mouseY: -1e3,
2887
- overlayMode: "hidden",
2888
- pressedKeys: /* @__PURE__ */ new Set()
2889
- }));
2890
- var init = (options = {}) => {
2891
- if (options.enabled === false) {
2892
- return;
2893
- }
2894
- const resolvedOptions = {
2895
- hotkey: ["Meta", "C"],
2896
- keyHoldDuration: 500,
2897
- ...options
2898
- };
2899
- const root = mountRoot();
2900
- const selectionOverlay = createSelectionOverlay(root);
2901
- let hoveredElement = null;
2902
- let isCopying = false;
2903
- const checkIsActivationHotkeyPressed = () => {
2904
- if (Array.isArray(resolvedOptions.hotkey)) {
2905
- for (const key of resolvedOptions.hotkey) {
2906
- if (!isKeyPressed(key)) {
2907
- return false;
2908
- }
2909
- }
2910
- return true;
2911
- }
2912
- return isKeyPressed(resolvedOptions.hotkey);
2913
- };
2914
- let cleanupActivationHotkeyWatcher = null;
2915
- const handleKeyStateChange = (pressedKeys) => {
2916
- const { overlayMode } = libStore.getState();
2917
- if (pressedKeys.has("Escape") || pressedKeys.has("Esc")) {
2918
- libStore.setState((state) => {
2919
- const nextPressedKeys = new Set(state.pressedKeys);
2920
- nextPressedKeys.delete("Escape");
2921
- nextPressedKeys.delete("Esc");
2922
- const nextTimestamps = new Map(state.keyPressTimestamps);
2923
- nextTimestamps.delete("Escape");
2924
- nextTimestamps.delete("Esc");
2925
- const activationKeys = Array.isArray(resolvedOptions.hotkey) ? resolvedOptions.hotkey : [resolvedOptions.hotkey];
2926
- for (const activationKey of activationKeys) {
2927
- if (activationKey.length === 1) {
2928
- nextPressedKeys.delete(activationKey.toLowerCase());
2929
- nextPressedKeys.delete(activationKey.toUpperCase());
2930
- nextTimestamps.delete(activationKey.toLowerCase());
2931
- nextTimestamps.delete(activationKey.toUpperCase());
2932
- } else {
2933
- nextPressedKeys.delete(activationKey);
2934
- nextTimestamps.delete(activationKey);
2935
- }
2936
- }
2937
- return {
2938
- ...state,
2939
- keyPressTimestamps: nextTimestamps,
2940
- overlayMode: "hidden",
2941
- pressedKeys: nextPressedKeys
2942
- };
2943
- });
2944
- if (cleanupActivationHotkeyWatcher) {
2945
- cleanupActivationHotkeyWatcher();
2946
- cleanupActivationHotkeyWatcher = null;
2947
- }
2948
- return;
2949
- }
2950
- const isActivationHotkeyPressed = checkIsActivationHotkeyPressed();
2951
- if (!isActivationHotkeyPressed) {
2952
- if (cleanupActivationHotkeyWatcher) {
2953
- cleanupActivationHotkeyWatcher();
2954
- cleanupActivationHotkeyWatcher = null;
2955
- }
2956
- if (overlayMode !== "hidden") {
2957
- libStore.setState((state) => ({
2958
- ...state,
2959
- overlayMode: "hidden"
2960
- }));
2961
- }
2962
- return;
2963
- }
2964
- if (overlayMode === "hidden" && !cleanupActivationHotkeyWatcher) {
2965
- cleanupActivationHotkeyWatcher = watchKeyHeldFor(
2966
- resolvedOptions.hotkey,
2967
- resolvedOptions.keyHoldDuration,
2968
- () => {
2969
- libStore.setState((state) => ({
2970
- ...state,
2971
- overlayMode: "visible"
2972
- }));
2973
- cleanupActivationHotkeyWatcher = null;
2974
- }
2975
- );
2976
- }
2977
- };
2978
- const cleanupKeyStateChangeSubscription = libStore.subscribe(
2979
- handleKeyStateChange,
2980
- (state) => state.pressedKeys
2981
- );
2982
- const handleMouseMove = throttle((event) => {
2983
- libStore.setState((state) => ({
2984
- ...state,
2985
- mouseX: event.clientX,
2986
- mouseY: event.clientY
2987
- }));
2988
- }, THROTTLE_DELAY);
2989
- const handleMouseDown = (event) => {
2990
- if (event.button !== 0) {
2991
- return;
2992
- }
2993
- const { overlayMode } = libStore.getState();
2994
- if (overlayMode === "hidden") {
2995
- return;
2996
- }
2997
- event.preventDefault();
2998
- event.stopPropagation();
2999
- event.stopImmediatePropagation();
3000
- libStore.setState((state) => ({
3001
- ...state,
3002
- overlayMode: "copying"
3003
- }));
3004
- };
3005
- window.addEventListener("mousemove", handleMouseMove);
3006
- window.addEventListener("mousedown", handleMouseDown);
3007
- const cleanupTrackHotkeys = trackHotkeys();
3008
- const getElementAtPosition = (x, y) => {
3009
- const elements = document.elementsFromPoint(x, y);
3010
- for (const element of elements) {
3011
- if (element.closest(`[${ATTRIBUTE_NAME}]`)) {
3012
- continue;
3013
- }
3014
- const computedStyle = window.getComputedStyle(element);
3015
- if (!isElementVisible(element, computedStyle)) {
3016
- continue;
3017
- }
3018
- return element;
3019
- }
3020
- return null;
3021
- };
3022
- const handleCopy = async (element) => {
3023
- const cleanupIndicator = updateLabelToProcessing();
3024
- try {
3025
- const stack = await getStack(element);
3026
- const htmlSnippet = getHTMLSnippet(element);
3027
- let text = htmlSnippet;
3028
- if (stack) {
3029
- const filteredStack = filterStack(stack);
3030
- const serializedStack = serializeStack(filteredStack);
3031
- text = `${htmlSnippet}
23
+ <referenced_element>
24
+ ${x}
25
+ </referenced_element>`),F(N);let $=await lt(M);if($){let B=ct($),H=ut(B),Z=`${x}
3032
26
 
3033
27
  Component owner stack:
3034
- ${serializedStack}`;
3035
- }
3036
- await copyTextToClipboard(
3037
- `
28
+ ${H}`;await Ne(`
3038
29
 
3039
30
  <referenced_element>
3040
- ${text}
3041
- </referenced_element>`
3042
- );
3043
- const tagName = (element.tagName || "").toLowerCase();
3044
- cleanupIndicator(tagName);
3045
- } catch {
3046
- cleanupIndicator();
3047
- }
3048
- };
3049
- const handleRender = throttle((state) => {
3050
- const { mouseX, mouseY, overlayMode } = state;
3051
- if (overlayMode === "hidden") {
3052
- if (selectionOverlay.isVisible()) {
3053
- selectionOverlay.hide();
3054
- if (!isCopying) {
3055
- hideLabel();
3056
- }
3057
- hoveredElement = null;
3058
- }
3059
- return;
3060
- }
3061
- if (overlayMode === "copying" && hoveredElement) {
3062
- const computedStyle2 = window.getComputedStyle(hoveredElement);
3063
- const rect2 = hoveredElement.getBoundingClientRect();
3064
- selectionOverlay.update({
3065
- borderRadius: computedStyle2.borderRadius || "0px",
3066
- height: rect2.height,
3067
- transform: computedStyle2.transform || "none",
3068
- width: rect2.width,
3069
- x: rect2.left,
3070
- y: rect2.top
3071
- });
3072
- if (!selectionOverlay.isVisible()) {
3073
- selectionOverlay.show();
3074
- }
3075
- if (!isCopying) {
3076
- isCopying = true;
3077
- void handleCopy(hoveredElement).finally(() => {
3078
- libStore.setState((state2) => ({
3079
- ...state2,
3080
- overlayMode: "hidden"
3081
- }));
3082
- selectionOverlay.hide();
3083
- window.setTimeout(() => {
3084
- isCopying = false;
3085
- }, INDICATOR_TOTAL_HIDE_DELAY_MS);
3086
- });
3087
- }
3088
- return;
3089
- }
3090
- const element = getElementAtPosition(mouseX, mouseY);
3091
- if (!element) {
3092
- if (selectionOverlay.isVisible()) {
3093
- selectionOverlay.hide();
3094
- if (!isCopying) {
3095
- hideLabel();
3096
- }
3097
- }
3098
- hoveredElement = null;
3099
- return;
3100
- }
3101
- const tagName = (element.tagName || "").toLowerCase();
3102
- hoveredElement = element;
3103
- const rect = element.getBoundingClientRect();
3104
- const computedStyle = window.getComputedStyle(element);
3105
- const borderRadius = computedStyle.borderRadius || "0px";
3106
- const transform = computedStyle.transform || "none";
3107
- selectionOverlay.update({
3108
- borderRadius,
3109
- height: rect.height,
3110
- transform,
3111
- width: rect.width,
3112
- x: rect.left,
3113
- y: rect.top
3114
- });
3115
- if (!selectionOverlay.isVisible()) {
3116
- selectionOverlay.show();
3117
- }
3118
- showLabel(rect.left, rect.top, tagName);
3119
- }, 10);
3120
- const cleanupRenderSubscription = libStore.subscribe((state) => {
3121
- scheduleRunWhenIdle(() => {
3122
- handleRender(state);
3123
- });
3124
- });
3125
- let timeout = null;
3126
- const render = () => {
3127
- timeout = window.setTimeout(() => {
3128
- scheduleRunWhenIdle(() => {
3129
- handleRender(libStore.getState());
3130
- render();
3131
- });
3132
- }, 100);
3133
- };
3134
- render();
3135
- return () => {
3136
- window.removeEventListener("mousemove", handleMouseMove);
3137
- window.removeEventListener("mousedown", handleMouseDown);
3138
- cleanupTrackHotkeys();
3139
- cleanupRenderSubscription();
3140
- cleanupKeyStateChangeSubscription();
3141
- if (timeout) {
3142
- window.clearTimeout(timeout);
3143
- }
3144
- if (cleanupActivationHotkeyWatcher) {
3145
- cleanupActivationHotkeyWatcher();
3146
- }
3147
- };
3148
- };
3149
- if (typeof window !== "undefined" && typeof document !== "undefined") {
3150
- const currentScript = document.currentScript;
3151
- let options = {};
3152
- if (currentScript) {
3153
- const maybeOptions = currentScript.getAttribute("data-options");
3154
- if (maybeOptions) {
3155
- try {
3156
- options = JSON.parse(maybeOptions);
3157
- } catch {
3158
- }
3159
- }
3160
- }
3161
- init(options);
3162
- }
3163
- /*! Bundled license information:
3164
-
3165
- bippy/dist/src-R2iEnVC1.js:
3166
- (**
3167
- * @license bippy
3168
- *
3169
- * Copyright (c) Aiden Bai
3170
- *
3171
- * This source code is licensed under the MIT license found in the
3172
- * LICENSE file in the root directory of this source tree.
3173
- *)
31
+ ${Z}
32
+ </referenced_element>`).catch(()=>{}),e.adapter&&e.adapter.open(Z);}else e.adapter&&e.adapter.open(x);}catch{F(N);}},A=M=>{let{mouseX:N,mouseY:j,overlayMode:F}=M;if(F==="hidden"){r.isVisible()&&r.hide(),o||K(),c=null,s=null;return}if(F==="copying"&&c){if(!o){o=true,s=c;let ke=window.getComputedStyle(c),ee=c.getBoundingClientRect();pt(n,{borderRadius:ke.borderRadius||"0px",height:ee.height,transform:ke.transform||"none",width:ee.width,x:ee.left,y:ee.top}),P(c).finally(()=>{o=false;});let bt=l();I.setState(wt=>({...wt,overlayMode:bt?"visible":"hidden"}));}return}let x=C(N,j);if(!x){r.isVisible()&&r.hide(),o||K(),c=null;return}if(s&&x!==s&&(s=null),x===s){r.isVisible()&&r.hide(),o||K(),c=x;return}let $=(x.tagName||"").toLowerCase();c=x;let B=x.getBoundingClientRect(),H=window.getComputedStyle(x),Z=H.borderRadius||"0px",Ct=H.transform||"none";r.update({borderRadius:Z,height:B.height,transform:Ct,width:B.width,x:B.left,y:B.top}),r.isVisible()||r.show(),ht(n,B.left,B.top,$);},k=false,O=()=>{k||(k=true,requestAnimationFrame(()=>{k=false,A(I.getState());}));},V=I.subscribe(()=>{O();}),D=()=>{O(),requestAnimationFrame(D);};return D(),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mousedown",E),window.removeEventListener("scroll",R,true),window.removeEventListener("resize",_),document.removeEventListener("visibilitychange",T),w(),V(),m(),i&&i(),p(),Ie(),K();}};if(typeof window<"u"&&typeof document<"u"){let t=document.currentScript,e={};if(t?.dataset){let{adapter:n,enabled:r,hotkey:c,keyHoldDuration:s}=t.dataset;if(n!==void 0&&n==="cursor"&&(e.adapter=ce),r!==void 0&&(e.enabled=r==="true"),c!==void 0){let o=c.split(",").map(a=>a.trim());e.hotkey=o.length===1?o[0]:o;}if(s!==void 0){let o=Number(s);Number.isNaN(o)||(e.keyHoldDuration=o);}}hn(e);}/*! Bundled license information:
3174
33
 
3175
- bippy/dist/index.js:
3176
- (**
3177
- * @license bippy
3178
- *
3179
- * Copyright (c) Aiden Bai
3180
- *
3181
- * This source code is licensed under the MIT license found in the
3182
- * LICENSE file in the root directory of this source tree.
3183
- *)
3184
-
3185
- bippy/dist/source-DWOhEbf2.js:
3186
- (**
3187
- * @license bippy
3188
- *
3189
- * Copyright (c) Aiden Bai
3190
- *
3191
- * This source code is licensed under the MIT license found in the
3192
- * LICENSE file in the root directory of this source tree.
3193
- *)
3194
-
3195
- bippy/dist/source.js:
3196
- (**
3197
- * @license bippy
3198
- *
3199
- * Copyright (c) Aiden Bai
3200
- *
3201
- * This source code is licensed under the MIT license found in the
3202
- * LICENSE file in the root directory of this source tree.
3203
- *)
3204
- */
34
+ bippy/dist/src-R2iEnVC1.js:
35
+ (**
36
+ * @license bippy
37
+ *
38
+ * Copyright (c) Aiden Bai
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ *)
3205
43
 
3206
- exports.init = init;
3207
- exports.libStore = libStore;
44
+ bippy/dist/index.js:
45
+ (**
46
+ * @license bippy
47
+ *
48
+ * Copyright (c) Aiden Bai
49
+ *
50
+ * This source code is licensed under the MIT license found in the
51
+ * LICENSE file in the root directory of this source tree.
52
+ *)
3208
53
 
3209
- return exports;
54
+ bippy/dist/source-DWOhEbf2.js:
55
+ (**
56
+ * @license bippy
57
+ *
58
+ * Copyright (c) Aiden Bai
59
+ *
60
+ * This source code is licensed under the MIT license found in the
61
+ * LICENSE file in the root directory of this source tree.
62
+ *)
3210
63
 
3211
- })({});
64
+ bippy/dist/source.js:
65
+ (**
66
+ * @license bippy
67
+ *
68
+ * Copyright (c) Aiden Bai
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE file in the root directory of this source tree.
72
+ *)
73
+ */exports.cursorAdapter=ce;exports.init=hn;exports.libStore=I;return exports;})({});