Files
update_field_api/node_modules/tsx/dist/register-CKju0f8h.cjs
T

3 lines
18 KiB
JavaScript
Raw Normal View History

2026-06-09 18:35:55 -03:00
"use strict";var ge=Object.defineProperty;var l=(e,r)=>ge(e,"name",{value:r,configurable:!0});var T=require("node:module"),he=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),ye=require("node:fs"),Pe=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),D=require("./client-D3mGB526.cjs"),S=require("node:path"),L=typeof document<"u"?document.currentScript:null;const F={active:!0,parsedTsconfig:void 0},V=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),Re=l(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(F,V(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Ue=l(()=>(F.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Se=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),Ee=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",W="tsx-commonjs-export-preparse",K=`${W}=1`,j="tsx-commonjs-virtual-query",I=new Map,B=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),J=l((e,r)=>{const t=B(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),ve=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Te=l(e=>{const r=ve(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),Le=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(a=>{if(a.d!==-1||a.n!==r)return!1;const m=Te(s.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(U);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+U.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),Y=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Z=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),k=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),we=y.isFeatureSupported(y.esmLoadReadFile),Fe=[`${j}=`],M=[`${W}=`,`${j}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),je=l(e=>{if(!e.searchParams.has(j))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),Q=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&je(r),o=s||t,a=r&&s?g.pathToFileURL(o).toString()+J(r.search,Fe):e;return{fileUrl:r,filePath:o,loadUrl:a}},"getFileLoadContext"),ee=l((e,r)=>{if(!r?.search)return e;const t=J(r.search,M);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),te=l((e,r,t)=>{const s=[...r?B(r.search,[U,...M]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Ie=new TextDecoder,re=l(e=>typeof e=="string"?e:Ie.decode(e),"decodeSource"),_e=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?Q(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(W),t.searchParams.delete(j),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),se=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=_e(e,r);return D.parent.send&&D.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),oe=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[Y];return t?.type?r:{...r,[Y]:{...t,type:"json"}}},"prepareJsonAttributes"),H=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ce=l(e=>{const r=l(async(t,s,o)=>{if(!se(e,t))return o(t,s);const a=E(t),{fileUrl:m,filePath:c,loadUrl:i}=Q(t),u=oe(i,s),d=await o(i,u);n.logEsm(3,"loaded by next loader",{url:t,loa