/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@oxc-parser/wasm@0.60.0/web/oxc_parser_wasm.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
let wasm;const heap=new Array(128).fill(void 0);heap.push(void 0,null,!0,!1);let heap_next=heap.length;function addHeapObject(e){heap_next===heap.length&&heap.push(heap.length+1);const t=heap_next;return heap_next=heap[t],heap[t]=e,t}function getObject(e){return heap[e]}function dropObject(e){e<132||(heap[e]=heap_next,heap_next=e)}function takeObject(e){const t=getObject(e);return dropObject(e),t}function handleError(e,t){try{return e.apply(this,t)}catch(e){wasm.__wbindgen_export_0(addHeapObject(e))}}function debugString(e){const t=typeof e;if("number"==t||"boolean"==t||null==e)return`${e}`;if("string"==t)return`"${e}"`;if("symbol"==t){const t=e.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=e.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(e)){const t=e.length;let n="[";t>0&&(n+=debugString(e[0]));for(let r=1;r<t;r++)n+=", "+debugString(e[r]);return n+="]",n}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(n&&n.length>1))return toString.call(e);if(r=n[1],"Object"==r)try{return"Object("+JSON.stringify(e)+")"}catch(e){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}let WASM_VECTOR_LEN=0,cachedUint8ArrayMemory0=null;function getUint8ArrayMemory0(){return null!==cachedUint8ArrayMemory0&&0!==cachedUint8ArrayMemory0.byteLength||(cachedUint8ArrayMemory0=new Uint8Array(wasm.memory.buffer)),cachedUint8ArrayMemory0}const cachedTextEncoder="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},encodeString="function"==typeof cachedTextEncoder.encodeInto?function(e,t){return cachedTextEncoder.encodeInto(e,t)}:function(e,t){const n=cachedTextEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}};function passStringToWasm0(e,t,n){if(void 0===n){const n=cachedTextEncoder.encode(e),r=t(n.length,1)>>>0;return getUint8ArrayMemory0().subarray(r,r+n.length).set(n),WASM_VECTOR_LEN=n.length,r}let r=e.length,a=t(r,1)>>>0;const i=getUint8ArrayMemory0();let o=0;for(;o<r;o++){const t=e.charCodeAt(o);if(t>127)break;i[a+o]=t}if(o!==r){0!==o&&(e=e.slice(o)),a=n(a,r,r=o+3*e.length,1)>>>0;const t=getUint8ArrayMemory0().subarray(a+o,a+r);o+=encodeString(e,t).written,a=n(a,r,o,1)>>>0}return WASM_VECTOR_LEN=o,a}let cachedDataViewMemory0=null;function getDataViewMemory0(){return(null===cachedDataViewMemory0||!0===cachedDataViewMemory0.buffer.detached||void 0===cachedDataViewMemory0.buffer.detached&&cachedDataViewMemory0.buffer!==wasm.memory.buffer)&&(cachedDataViewMemory0=new DataView(wasm.memory.buffer)),cachedDataViewMemory0}const cachedTextDecoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};function getStringFromWasm0(e,t){return e>>>=0,cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(e,e+t))}function isLikeNone(e){return null==e}function getArrayJsValueFromWasm0(e,t){e>>>=0;const n=getDataViewMemory0(),r=[];for(let a=e;a<e+4*t;a+=4)r.push(takeObject(n.getUint32(a,!0)));return r}"undefined"!=typeof TextDecoder&&cachedTextDecoder.decode();export function parseSync(e,t){try{const a=wasm.__wbindgen_add_to_stack_pointer(-16),i=passStringToWasm0(e,wasm.__wbindgen_export_1,wasm.__wbindgen_export_2),o=WASM_VECTOR_LEN;wasm.parseSync(a,i,o,isLikeNone(t)?0:addHeapObject(t));var n=getDataViewMemory0().getInt32(a+0,!0),r=getDataViewMemory0().getInt32(a+4,!0);if(getDataViewMemory0().getInt32(a+8,!0))throw takeObject(r);return ParseResult.__wrap(n)}finally{wasm.__wbindgen_add_to_stack_pointer(16)}}const ParseResultFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>wasm.__wbg_parseresult_free(e>>>0,1)));export class ParseResult{__program;get program(){return this.__program?this.__program:this.__program=JSON.parse(this.programJson,(function(e,t){if(null===t&&"value"===e&&Object.hasOwn(this,"type")&&"Literal"===this.type){if(Object.hasOwn(this,"bigint"))return BigInt(this.bigint);if(Object.hasOwn(this,"regex")){const{regex:e}=this;try{return RegExp(e.pattern,e.flags)}catch(e){}}}return t}))}static __wrap(e){e>>>=0;const t=Object.create(ParseResult.prototype);return t.__wbg_ptr=e,ParseResultFinalization.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ParseResultFinalization.unregister(this),e}free(){const e=this.__destroy_into_raw();wasm.__wbg_parseresult_free(e,0)}get programJson(){let e,t;try{const a=wasm.__wbindgen_add_to_stack_pointer(-16);wasm.__wbg_get_parseresult_programJson(a,this.__wbg_ptr);var n=getDataViewMemory0().getInt32(a+0,!0),r=getDataViewMemory0().getInt32(a+4,!0);return e=n,t=r,getStringFromWasm0(n,r)}finally{wasm.__wbindgen_add_to_stack_pointer(16),wasm.__wbindgen_export_3(e,t,1)}}get comments(){try{const r=wasm.__wbindgen_add_to_stack_pointer(-16);wasm.__wbg_get_parseresult_comments(r,this.__wbg_ptr);var e=getDataViewMemory0().getInt32(r+0,!0),t=getDataViewMemory0().getInt32(r+4,!0),n=getArrayJsValueFromWasm0(e,t).slice();return wasm.__wbindgen_export_3(e,4*t,4),n}finally{wasm.__wbindgen_add_to_stack_pointer(16)}}get errors(){try{const r=wasm.__wbindgen_add_to_stack_pointer(-16);wasm.__wbg_get_parseresult_errors(r,this.__wbg_ptr);var e=getDataViewMemory0().getInt32(r+0,!0),t=getDataViewMemory0().getInt32(r+4,!0),n=getArrayJsValueFromWasm0(e,t).slice();return wasm.__wbindgen_export_3(e,4*t,4),n}finally{wasm.__wbindgen_add_to_stack_pointer(16)}}}async function __wbg_load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function __wbg_get_imports(){const e={wbg:{}};return e.wbg.__wbg_new_405e22f390576ce2=function(){return addHeapObject(new Object)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(e,t,n){getObject(e)[takeObject(t)]=takeObject(n)},e.wbg.__wbg_stringify_f7ed6987935b4a24=function(){return handleError((function(e){return addHeapObject(JSON.stringify(getObject(e)))}),arguments)},e.wbg.__wbindgen_bigint_from_u64=function(e){return addHeapObject(BigInt.asUintN(64,e))},e.wbg.__wbindgen_debug_string=function(e,t){const n=passStringToWasm0(debugString(getObject(t)),wasm.__wbindgen_export_1,wasm.__wbindgen_export_2),r=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(e+4,r,!0),getDataViewMemory0().setInt32(e+0,n,!0)},e.wbg.__wbindgen_error_new=function(e,t){return addHeapObject(new Error(getStringFromWasm0(e,t)))},e.wbg.__wbindgen_is_undefined=function(e){return void 0===getObject(e)},e.wbg.__wbindgen_number_new=function(e){return addHeapObject(e)},e.wbg.__wbindgen_object_clone_ref=function(e){return addHeapObject(getObject(e))},e.wbg.__wbindgen_object_drop_ref=function(e){takeObject(e)},e.wbg.__wbindgen_string_get=function(e,t){const n=getObject(t),r="string"==typeof n?n:void 0;var a=isLikeNone(r)?0:passStringToWasm0(r,wasm.__wbindgen_export_1,wasm.__wbindgen_export_2),i=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(e+4,i,!0),getDataViewMemory0().setInt32(e+0,a,!0)},e.wbg.__wbindgen_string_new=function(e,t){return addHeapObject(getStringFromWasm0(e,t))},e.wbg.__wbindgen_throw=function(e,t){throw new Error(getStringFromWasm0(e,t))},e}function __wbg_init_memory(e,t){}function __wbg_finalize_init(e,t){return wasm=e.exports,__wbg_init.__wbindgen_wasm_module=t,cachedDataViewMemory0=null,cachedUint8ArrayMemory0=null,wasm}function initSync(e){if(void 0!==wasm)return wasm;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=__wbg_get_imports();__wbg_init_memory(t),e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return __wbg_finalize_init(new WebAssembly.Instance(e,t),e)}async function __wbg_init(e){if(void 0!==wasm)return wasm;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===e&&(e=new URL("oxc_parser_wasm_bg.wasm",import.meta.url));const t=__wbg_get_imports();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e)),__wbg_init_memory(t);const{instance:n,module:r}=await __wbg_load(await e,t);return __wbg_finalize_init(n,r)}export{initSync};export default __wbg_init;
//# sourceMappingURL=/sm/91334ebbde31c948d8728752d9ecd11860674cc715db9f95ae859dfbb5eb3330.map