n8n-nodes-mq 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Mq/MqEngine.d.ts +3 -3
- package/dist/nodes/Mq/MqEngine.d.ts.map +1 -1
- package/dist/nodes/Mq/MqEngine.js +24 -110
- package/dist/nodes/Mq/MqEngine.js.map +1 -1
- package/dist/nodes/Mq/wasm/core.cjs +2 -0
- package/dist/nodes/Mq/wasm/core.d.cts +69 -0
- package/dist/nodes/Mq/wasm/core.d.ts +69 -0
- package/dist/nodes/Mq/wasm/core.js +2 -0
- package/dist/nodes/Mq/wasm/index.cjs +2 -0
- package/dist/nodes/Mq/wasm/index.d.cts +31 -0
- package/dist/nodes/Mq/wasm/index.d.ts +31 -0
- package/dist/nodes/Mq/wasm/index.js +2 -0
- package/dist/nodes/Mq/wasm/mq_wasm.js +798 -0
- package/dist/nodes/Mq/wasm/mq_wasm_bg.wasm +0 -0
- package/dist/nodes/Mq/wasm-data.d.ts +8 -0
- package/dist/nodes/Mq/wasm-data.d.ts.map +1 -0
- package/dist/nodes/Mq/wasm-data.js +19 -0
- package/dist/nodes/Mq/wasm-data.js.map +1 -0
- package/package.json +3 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MqEngine - Node.js wrapper for mq-web WASM module
|
|
3
3
|
*
|
|
4
|
-
* mq-web is
|
|
5
|
-
*
|
|
6
|
-
* file
|
|
4
|
+
* The mq-web WASM module is bundled directly in this package to avoid
|
|
5
|
+
* runtime dependencies, which are not allowed for verified n8n community nodes.
|
|
6
|
+
* The WASM binary is inlined as base64 to avoid file system operations.
|
|
7
7
|
*/
|
|
8
8
|
export interface MqRunOptions {
|
|
9
9
|
isUpdate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MqEngine.d.ts","sourceRoot":"","sources":["../../../nodes/Mq/MqEngine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"MqEngine.d.ts","sourceRoot":"","sources":["../../../nodes/Mq/MqEngine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAsCD;;GAEG;AACH,wBAAsB,GAAG,CACvB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG3D;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAGxE;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1D;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,EAAE,CAAC,CAG3B"}
|
|
@@ -2,132 +2,50 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* MqEngine - Node.js wrapper for mq-web WASM module
|
|
4
4
|
*
|
|
5
|
-
* mq-web is
|
|
6
|
-
*
|
|
7
|
-
* file
|
|
5
|
+
* The mq-web WASM module is bundled directly in this package to avoid
|
|
6
|
+
* runtime dependencies, which are not allowed for verified n8n community nodes.
|
|
7
|
+
* The WASM binary is inlined as base64 to avoid file system operations.
|
|
8
8
|
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
10
|
exports.run = run;
|
|
44
11
|
exports.format = format;
|
|
45
12
|
exports.diagnostics = diagnostics;
|
|
46
13
|
exports.toAst = toAst;
|
|
47
14
|
exports.definedValues = definedValues;
|
|
48
|
-
const
|
|
49
|
-
const path_1 = require("path");
|
|
15
|
+
const wasm_data_1 = require("./wasm-data");
|
|
50
16
|
let mqModule = null;
|
|
51
|
-
let initPromise = null;
|
|
52
17
|
let wasmInitialized = false;
|
|
53
|
-
let wasmBuffer = null;
|
|
54
|
-
let originalFetch = null;
|
|
55
|
-
/**
|
|
56
|
-
* Setup fetch patch for WASM loading
|
|
57
|
-
*/
|
|
58
|
-
function setupFetchPatch() {
|
|
59
|
-
if (originalFetch)
|
|
60
|
-
return; // Already patched
|
|
61
|
-
// Find the WASM file
|
|
62
|
-
const possiblePaths = [
|
|
63
|
-
(0, path_1.join)(__dirname, '../../node_modules/mq-web/dist/mq_wasm_bg.wasm'),
|
|
64
|
-
(0, path_1.join)(__dirname, '../../../node_modules/mq-web/dist/mq_wasm_bg.wasm'),
|
|
65
|
-
(0, path_1.join)((0, path_1.dirname)(require.resolve('mq-web')), 'mq_wasm_bg.wasm'),
|
|
66
|
-
];
|
|
67
|
-
for (const wasmPath of possiblePaths) {
|
|
68
|
-
try {
|
|
69
|
-
wasmBuffer = (0, fs_1.readFileSync)(wasmPath);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (!wasmBuffer) {
|
|
77
|
-
throw new Error('Could not find mq_wasm_bg.wasm file');
|
|
78
|
-
}
|
|
79
|
-
// Store original fetch and patch it
|
|
80
|
-
originalFetch = globalThis.fetch;
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
globalThis.fetch = async (input, init) => {
|
|
83
|
-
const url = String(input);
|
|
84
|
-
if (url.includes('mq_wasm_bg.wasm') || url.endsWith('.wasm')) {
|
|
85
|
-
return new Response(wasmBuffer, {
|
|
86
|
-
status: 200,
|
|
87
|
-
headers: { 'Content-Type': 'application/wasm' },
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return originalFetch(input, init);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
18
|
/**
|
|
94
|
-
* Initialize the mq WASM module for Node.js
|
|
19
|
+
* Initialize the mq WASM module for Node.js using initSync
|
|
95
20
|
*/
|
|
96
|
-
|
|
21
|
+
function initMqSync() {
|
|
97
22
|
if (mqModule && wasmInitialized) {
|
|
98
23
|
return mqModule;
|
|
99
24
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})();
|
|
109
|
-
await initPromise;
|
|
25
|
+
// Get the WASM buffer from inlined base64 data
|
|
26
|
+
const wasmBuffer = (0, wasm_data_1.getWasmBuffer)();
|
|
27
|
+
// Load the mq-web module
|
|
28
|
+
const mq = require('./wasm/index.cjs');
|
|
29
|
+
// Initialize synchronously with the WASM buffer
|
|
30
|
+
mq.initSync({ module: wasmBuffer });
|
|
31
|
+
mqModule = mq;
|
|
32
|
+
wasmInitialized = true;
|
|
110
33
|
return mqModule;
|
|
111
34
|
}
|
|
112
35
|
/**
|
|
113
|
-
*
|
|
36
|
+
* Get the initialized mq module
|
|
114
37
|
*/
|
|
115
|
-
|
|
116
|
-
if (wasmInitialized)
|
|
117
|
-
return;
|
|
118
|
-
const mq = await initMq();
|
|
119
|
-
await mq.format('.h');
|
|
120
|
-
wasmInitialized = true;
|
|
121
|
-
if (originalFetch) {
|
|
122
|
-
globalThis.fetch = originalFetch;
|
|
38
|
+
function getMq() {
|
|
39
|
+
if (!mqModule || !wasmInitialized) {
|
|
40
|
+
return initMqSync();
|
|
123
41
|
}
|
|
42
|
+
return mqModule;
|
|
124
43
|
}
|
|
125
44
|
/**
|
|
126
45
|
* Run an mq query on markdown content
|
|
127
46
|
*/
|
|
128
47
|
async function run(query, content, options) {
|
|
129
|
-
|
|
130
|
-
const mq = await initMq();
|
|
48
|
+
const mq = getMq();
|
|
131
49
|
return mq.run(query, content, {
|
|
132
50
|
isUpdate: false,
|
|
133
51
|
inputFormat: 'markdown',
|
|
@@ -141,32 +59,28 @@ async function run(query, content, options) {
|
|
|
141
59
|
* Format an mq query
|
|
142
60
|
*/
|
|
143
61
|
async function format(query) {
|
|
144
|
-
|
|
145
|
-
const mq = await initMq();
|
|
62
|
+
const mq = getMq();
|
|
146
63
|
return mq.format(query);
|
|
147
64
|
}
|
|
148
65
|
/**
|
|
149
66
|
* Get diagnostics for an mq query
|
|
150
67
|
*/
|
|
151
68
|
async function diagnostics(query) {
|
|
152
|
-
|
|
153
|
-
const mq = await initMq();
|
|
69
|
+
const mq = getMq();
|
|
154
70
|
return mq.diagnostics(query);
|
|
155
71
|
}
|
|
156
72
|
/**
|
|
157
73
|
* Get the AST of an mq query
|
|
158
74
|
*/
|
|
159
75
|
async function toAst(query) {
|
|
160
|
-
|
|
161
|
-
const mq = await initMq();
|
|
76
|
+
const mq = getMq();
|
|
162
77
|
return mq.toAst(query);
|
|
163
78
|
}
|
|
164
79
|
/**
|
|
165
80
|
* Get defined values from an mq query
|
|
166
81
|
*/
|
|
167
82
|
async function definedValues(query, module) {
|
|
168
|
-
|
|
169
|
-
const mq = await initMq();
|
|
83
|
+
const mq = getMq();
|
|
170
84
|
return mq.definedValues(query, module);
|
|
171
85
|
}
|
|
172
86
|
//# sourceMappingURL=MqEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MqEngine.js","sourceRoot":"","sources":["../../../nodes/Mq/MqEngine.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"MqEngine.js","sourceRoot":"","sources":["../../../nodes/Mq/MqEngine.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA4EH,kBAcC;AAKD,wBAGC;AAKD,kCAGC;AAKD,sBAGC;AAKD,sCAMC;AA3HD,2CAA4C;AAmC5C,IAAI,QAAQ,GAAoB,IAAI,CAAC;AACrC,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,SAAS,UAAU;IACjB,IAAI,QAAQ,IAAI,eAAe,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,+CAA+C;IAC/C,MAAM,UAAU,GAAG,IAAA,yBAAa,GAAE,CAAC;IAEnC,yBAAyB;IACzB,MAAM,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;IAEnD,gDAAgD;IAChD,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAEpC,QAAQ,GAAG,EAAE,CAAC;IACd,eAAe,GAAG,IAAI,CAAC;IAEvB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,KAAK;IACZ,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,EAAE,CAAC;QAClC,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,GAAG,CACvB,KAAa,EACb,OAAe,EACf,OAAsB;IAEtB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE;QAC5B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,MAAM;QACpB,cAAc,EAAE,OAAO;QACvB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,MAAM,CAAC,KAAa;IACxC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW,CAAC,KAAa;IAC7C,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,KAAK,CAAC,KAAa;IACvC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,MAAe;IAEf,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var W=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var I=(e,t)=>{for(var n in t)W(e,n,{get:t[n],enumerable:!0})},$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!C.call(e,o)&&o!==n&&W(e,o,{get:()=>t[o],enumerable:!(r=L(t,o))||r.enumerable});return e};var N=e=>$(W({},"__esModule",{value:!0}),e);var H={};I(H,{ConversionOptions:()=>h,RunOptions:()=>O,default:()=>D,definedValues:()=>rt,diagnostics:()=>ot,format:()=>it,htmlToMarkdown:()=>_t,initSync:()=>bt,run:()=>st,toAst:()=>ct,toHtml:()=>at});function s(e){S===d.length&&d.push(d.length+1);let t=S;return S=d[t],d[t]=e,t}function G(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function P(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){let o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){let o=e.length,a="[";o>0&&(a+=P(e[0]));for(let c=1;c<o;c++)a+=", "+P(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
2
|
+
${e.stack}`:r}function X(e){e<132||(d[e]=S,S=e)}function Y(e,t){return e=e>>>0,A().subarray(e/1,e/1+t)}function p(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==_.memory.buffer)&&(y=new DataView(_.memory.buffer)),y}function M(e,t){return e=e>>>0,Q(e,t)}function A(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(_.memory.buffer)),x}function i(e){return d[e]}function j(e,t){try{return e.apply(this,t)}catch(n){_.__wbindgen_export3(s(n))}}function w(e){return e==null}function J(e,t,n,r){let o={a:e,b:t,cnt:1,dtor:n},a=(...c)=>{o.cnt++;let f=o.a;o.a=0;try{return r(f,o.b,...c)}finally{o.a=f,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,v.unregister(o))},v.register(a,o,o),a}function b(e,t,n){if(n===void 0){let f=F.encode(e),l=t(f.length,1)>>>0;return A().subarray(l,l+f.length).set(f),u=f.length,l}let r=e.length,o=t(r,1)>>>0,a=A(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;let f=A().subarray(o+c,o+r),l=F.encodeInto(e,f);c+=l.written,o=n(o,r,c,1)>>>0}return u=c,o}function g(e){let t=i(e);return X(e),t}function Q(e,t){return E+=t,E>=K&&(k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),k.decode(),E=t),k.decode(A().subarray(e,e+t))}function Z(e,t,n){_.__wasm_bindgen_func_elem_3024(e,t,s(n))}function tt(e,t,n,r){_.__wasm_bindgen_func_elem_827(e,t,s(n),s(r))}function rt(e,t){let n=b(e,_.__wbindgen_export,_.__wbindgen_export2),r=u;var o=w(t)?0:b(t,_.__wbindgen_export,_.__wbindgen_export2),a=u;let c=_.definedValues(n,r,o,a);return g(c)}function ot(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.diagnostics(t,n);return g(r)}function it(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.format(t,n);return g(r)}function _t(e,t){let n=b(e,_.__wbindgen_export,_.__wbindgen_export2),r=u,o=0;w(t)||(G(t,h),o=t.__destroy_into_raw());let a=_.htmlToMarkdown(n,r,o);return g(a)}function st(e,t,n){let r=b(e,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=b(t,_.__wbindgen_export,_.__wbindgen_export2),c=u,f=_.run(r,o,a,c,s(n));return g(f)}function ct(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.toAst(t,n);return g(r)}function at(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.toHtml(t,n);return g(r)}async function ut(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&ft.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")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",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function U(){let e={};return e.wbg={},e.wbg.__wbg_Error_52673b7de5a0ca89=function(t,n){let r=Error(M(t,n));return s(r)},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(i(n)),o=b(r,_.__wbindgen_export,_.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(t){let n=i(t),r=typeof n=="boolean"?n:void 0;return w(r)?16777215:r?1:0},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){let r=P(i(n)),o=b(r,_.__wbindgen_export,_.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(t,n){return i(t)in i(n)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof i(t)=="function"},e.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(t){let n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(t){return typeof i(t)=="string"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return i(t)===void 0},e.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(t,n){return i(t)==i(n)},e.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(t,n){let r=i(n),o=typeof r=="number"?r:void 0;p().setFloat64(t+8,w(o)?0:o,!0),p().setInt32(t+0,!w(o),!0)},e.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(t,n){let r=i(n),o=typeof r=="string"?r:void 0;var a=w(o)?0:b(o,_.__wbindgen_export,_.__wbindgen_export2),c=u;p().setInt32(t+4,c,!0),p().setInt32(t+0,a,!0)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(M(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){i(t)._wbg_cb_unref()},e.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9=function(t){let n=i(t).arrayBuffer();return s(n)},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return j(function(t,n,r){let o=i(t).call(i(n),i(r));return s(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return j(function(t,n){let r=i(t).call(i(n));return s(r)},arguments)},e.wbg.__wbg_done_62ea16af4ce34b24=function(t){return i(t).done},e.wbg.__wbg_entries_7de5c9edd116e219=function(t){let n=i(t).entries();return s(n)},e.wbg.__wbg_entries_83c79938054e065f=function(t){let n=Object.entries(i(t));return s(n)},e.wbg.__wbg_from_29a8414a7a7cd19d=function(t){let n=Array.from(i(t));return s(n)},e.wbg.__wbg_getDirectory_9beed6c83b6861f5=function(t){let n=i(t).getDirectory();return s(n)},e.wbg.__wbg_getFile_3d12eaf635641f3a=function(t){let n=i(t).getFile();return s(n)},e.wbg.__wbg_get_6b7bd52aca3f9671=function(t,n){let r=i(t)[n>>>0];return s(r)},e.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(t,n){let r=i(t)[i(n)];return s(r)},e.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemDirectoryHandle_264085cadc86679a=function(t){let n;try{n=i(t)instanceof FileSystemDirectoryHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemFileHandle_214d69e0ae063fc8=function(t){let n;try{n=i(t)instanceof FileSystemFileHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_instanceof_Window_b5cf7783caa68180=function(t){let n;try{n=i(t)instanceof Window}catch{n=!1}return n},e.wbg.__wbg_length_22ac23eaec9d8053=function(t){return i(t).length},e.wbg.__wbg_length_d45040a40c570362=function(t){return i(t).length},e.wbg.__wbg_navigator_b49edef831236138=function(t){let n=i(t).navigator;return s(n)},e.wbg.__wbg_new_1ba21ce319a06297=function(){let t=new Object;return s(t)},e.wbg.__wbg_new_25f239778d6112b9=function(){let t=new Array;return s(t)},e.wbg.__wbg_new_6421f6084cc5bc5a=function(t){let n=new Uint8Array(i(t));return s(n)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(c,f)=>{let l=r.a;r.a=0;try{return tt(l,r.b,c,f)}finally{r.a=l}};let a=new Promise(o);return s(a)}finally{r.a=r.b=0}},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){let r=new Function(M(t,n));return s(r)},e.wbg.__wbg_next_b34c09a202bf4424=function(){return j(function(t){let n=i(t).next();return s(n)},arguments)},e.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(t,n,r){Uint8Array.prototype.set.call(Y(t,n),i(r))},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){let n=i(t).queueMicrotask;return s(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(i(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){let n=Promise.resolve(i(t));return s(n)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){i(t)[g(n)]=g(r)},e.wbg.__wbg_set_7df433eea03a5c14=function(t,n,r){i(t)[n>>>0]=g(r)},e.wbg.__wbg_size_82fbdb656de23326=function(t){return i(t).size},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){let t=typeof global>"u"?null:global;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){let t=typeof globalThis>"u"?null:globalThis;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){let t=typeof self>"u"?null:self;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){let t=typeof window>"u"?null:window;return w(t)?0:s(t)},e.wbg.__wbg_storage_b04c3b736f10dd3b=function(t){let n=i(t).storage;return s(n)},e.wbg.__wbg_then_429f7caf1026411d=function(t,n,r){let o=i(t).then(i(n),i(r));return s(o)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){let r=i(t).then(i(n));return s(r)},e.wbg.__wbg_value_57b7b035e117f7ee=function(t){let n=i(t).value;return s(n)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){let r=M(t,n);return s(r)},e.wbg.__wbindgen_cast_29480d6a48b8e833=function(t,n){let r=J(t,n,_.__wasm_bindgen_func_elem_3023,Z);return s(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return s(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=i(t);return s(n)},e.wbg.__wbindgen_object_drop_ref=function(t){g(t)},e}function V(e,t){return _=e.exports,z.__wbindgen_wasm_module=t,y=null,x=null,_}function bt(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=U();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return V(n,e)}async function z(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",gt.url));let t=U();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ut(await e,t);return V(n,r)}var gt,_,v,y,x,d,S,k,K,E,F,u,et,nt,h,O,ft,D,R=q(()=>{"use strict";gt={};v=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));y=null;x=null;d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);S=d.length;k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();K=2146435072,E=0;F=new TextEncoder;"encodeInto"in F||(F.encodeInto=function(e,t){let n=F.encode(e);return t.set(n),{read:e.length,written:n.length}});u=0;et=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_conversionoptions_free(e>>>0,1)),nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_runoptions_free(e>>>0,1)),h=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_conversionoptions_free(t,0)}get extract_scripts_as_code_blocks(){return _.__wbg_get_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr)!==0}set extract_scripts_as_code_blocks(t){_.__wbg_set_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr,t)}get generate_front_matter(){return _.__wbg_get_conversionoptions_generate_front_matter(this.__wbg_ptr)!==0}set generate_front_matter(t){_.__wbg_set_conversionoptions_generate_front_matter(this.__wbg_ptr,t)}get use_title_as_h1(){return _.__wbg_get_conversionoptions_use_title_as_h1(this.__wbg_ptr)!==0}set use_title_as_h1(t){_.__wbg_set_conversionoptions_use_title_as_h1(this.__wbg_ptr,t)}};Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);O=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_runoptions_free(t,0)}};Symbol.dispose&&(O.prototype[Symbol.dispose]=O.prototype.free);ft=new Set(["basic","cors","default"]);D=z});var xt={};I(xt,{definedValues:()=>yt,diagnostics:()=>pt,format:()=>lt,htmlToMarkdown:()=>mt,run:()=>wt,toAst:()=>dt,toHtml:()=>ht});module.exports=N(xt);R();var T=null;async function m(){return T||(await(async()=>{try{await D();let e=await Promise.resolve().then(()=>(R(),H));T={run:e.run,toAst:e.toAst,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues,htmlToMarkdown:e.htmlToMarkdown,toHtml:e.toHtml}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),T)}async function wt(e,t,n={}){return await(await m()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function dt(e){return await(await m()).toAst(e)}async function lt(e){return await(await m()).format(e)}async function pt(e){return await(await m()).diagnostics(e)}async function yt(e,t){return await(await m()).definedValues(e,t)}async function mt(e,t){return await(await m()).htmlToMarkdown(e,t)}async function ht(e){return await(await m()).toHtml(e)}0&&(module.exports={definedValues,diagnostics,format,htmlToMarkdown,run,toAst,toHtml});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
type DefinedValueType = 'Function' | 'Variable';
|
|
5
|
+
|
|
6
|
+
interface DefinedValue {
|
|
7
|
+
name: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
doc: string;
|
|
10
|
+
valueType: DefinedValueType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Diagnostic {
|
|
14
|
+
startLine: number,
|
|
15
|
+
startColumn: number,
|
|
16
|
+
endLine: number,
|
|
17
|
+
endColumn: number,
|
|
18
|
+
message: string,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Options {
|
|
22
|
+
isUpdate: boolean,
|
|
23
|
+
inputFormat: 'markdown' | 'text' | 'mdx' | 'html' | 'null' | 'raw' | null,
|
|
24
|
+
listStyle: 'dash' | 'plus' | 'star' | null,
|
|
25
|
+
linkTitleStyle: 'double' | 'single' | 'paren' | null,
|
|
26
|
+
linkUrlStyle: 'angle' | 'none' | null,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
declare class ConversionOptions {
|
|
32
|
+
private constructor();
|
|
33
|
+
free(): void;
|
|
34
|
+
[Symbol.dispose](): void;
|
|
35
|
+
extract_scripts_as_code_blocks: boolean;
|
|
36
|
+
generate_front_matter: boolean;
|
|
37
|
+
use_title_as_h1: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Run an mq
|
|
42
|
+
*/
|
|
43
|
+
declare function run(code: string, content: string, options?: Partial<Options>): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Convert mq code to its AST (Abstract Syntax Tree) representation.
|
|
46
|
+
*/
|
|
47
|
+
declare function toAst(code: string): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Format mq code
|
|
50
|
+
*/
|
|
51
|
+
declare function format(code: string): Promise<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Get diagnostics for mq code
|
|
54
|
+
*/
|
|
55
|
+
declare function diagnostics(code: string): Promise<ReadonlyArray<Diagnostic>>;
|
|
56
|
+
/**
|
|
57
|
+
* Get defined values from mq code
|
|
58
|
+
*/
|
|
59
|
+
declare function definedValues(code: string, module?: string): Promise<ReadonlyArray<DefinedValue>>;
|
|
60
|
+
/**
|
|
61
|
+
* Converts HTML input to Markdown
|
|
62
|
+
*/
|
|
63
|
+
declare function htmlToMarkdown(html: string, options?: ConversionOptions): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Markdown Input to HTML
|
|
66
|
+
*/
|
|
67
|
+
declare function toHtml(markdownInput: string): Promise<string>;
|
|
68
|
+
|
|
69
|
+
export { definedValues, diagnostics, format, htmlToMarkdown, run, toAst, toHtml };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
type DefinedValueType = 'Function' | 'Variable';
|
|
5
|
+
|
|
6
|
+
interface DefinedValue {
|
|
7
|
+
name: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
doc: string;
|
|
10
|
+
valueType: DefinedValueType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Diagnostic {
|
|
14
|
+
startLine: number,
|
|
15
|
+
startColumn: number,
|
|
16
|
+
endLine: number,
|
|
17
|
+
endColumn: number,
|
|
18
|
+
message: string,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Options {
|
|
22
|
+
isUpdate: boolean,
|
|
23
|
+
inputFormat: 'markdown' | 'text' | 'mdx' | 'html' | 'null' | 'raw' | null,
|
|
24
|
+
listStyle: 'dash' | 'plus' | 'star' | null,
|
|
25
|
+
linkTitleStyle: 'double' | 'single' | 'paren' | null,
|
|
26
|
+
linkUrlStyle: 'angle' | 'none' | null,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
declare class ConversionOptions {
|
|
32
|
+
private constructor();
|
|
33
|
+
free(): void;
|
|
34
|
+
[Symbol.dispose](): void;
|
|
35
|
+
extract_scripts_as_code_blocks: boolean;
|
|
36
|
+
generate_front_matter: boolean;
|
|
37
|
+
use_title_as_h1: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Run an mq
|
|
42
|
+
*/
|
|
43
|
+
declare function run(code: string, content: string, options?: Partial<Options>): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Convert mq code to its AST (Abstract Syntax Tree) representation.
|
|
46
|
+
*/
|
|
47
|
+
declare function toAst(code: string): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Format mq code
|
|
50
|
+
*/
|
|
51
|
+
declare function format(code: string): Promise<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Get diagnostics for mq code
|
|
54
|
+
*/
|
|
55
|
+
declare function diagnostics(code: string): Promise<ReadonlyArray<Diagnostic>>;
|
|
56
|
+
/**
|
|
57
|
+
* Get defined values from mq code
|
|
58
|
+
*/
|
|
59
|
+
declare function definedValues(code: string, module?: string): Promise<ReadonlyArray<DefinedValue>>;
|
|
60
|
+
/**
|
|
61
|
+
* Converts HTML input to Markdown
|
|
62
|
+
*/
|
|
63
|
+
declare function htmlToMarkdown(html: string, options?: ConversionOptions): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Markdown Input to HTML
|
|
66
|
+
*/
|
|
67
|
+
declare function toHtml(markdownInput: string): Promise<string>;
|
|
68
|
+
|
|
69
|
+
export { definedValues, diagnostics, format, htmlToMarkdown, run, toAst, toHtml };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var z=Object.defineProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var L=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})};var V={};L(V,{ConversionOptions:()=>h,RunOptions:()=>O,default:()=>P,definedValues:()=>Q,diagnostics:()=>Z,format:()=>tt,htmlToMarkdown:()=>et,initSync:()=>st,run:()=>nt,toAst:()=>rt,toHtml:()=>ot});function s(e){S===d.length&&d.push(d.length+1);let t=S;return S=d[t],d[t]=e,t}function B(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function E(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){let o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){let o=e.length,a="[";o>0&&(a+=E(e[0]));for(let c=1;c<o;c++)a+=", "+E(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
2
|
+
${e.stack}`:r}function C(e){e<132||(d[e]=S,S=e)}function q(e,t){return e=e>>>0,A().subarray(e/1,e/1+t)}function p(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==_.memory.buffer)&&(y=new DataView(_.memory.buffer)),y}function M(e,t){return e=e>>>0,G(e,t)}function A(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(_.memory.buffer)),x}function i(e){return d[e]}function W(e,t){try{return e.apply(this,t)}catch(n){_.__wbindgen_export3(s(n))}}function w(e){return e==null}function $(e,t,n,r){let o={a:e,b:t,cnt:1,dtor:n},a=(...c)=>{o.cnt++;let f=o.a;o.a=0;try{return r(f,o.b,...c)}finally{o.a=f,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,R.unregister(o))},R.register(a,o,o),a}function b(e,t,n){if(n===void 0){let f=F.encode(e),l=t(f.length,1)>>>0;return A().subarray(l,l+f.length).set(f),u=f.length,l}let r=e.length,o=t(r,1)>>>0,a=A(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;let f=A().subarray(o+c,o+r),l=F.encodeInto(e,f);c+=l.written,o=n(o,r,c,1)>>>0}return u=c,o}function g(e){let t=i(e);return C(e),t}function G(e,t){return j+=t,j>=N&&(k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),k.decode(),j=t),k.decode(A().subarray(e,e+t))}function X(e,t,n){_.__wasm_bindgen_func_elem_3024(e,t,s(n))}function Y(e,t,n,r){_.__wasm_bindgen_func_elem_827(e,t,s(n),s(r))}function Q(e,t){let n=b(e,_.__wbindgen_export,_.__wbindgen_export2),r=u;var o=w(t)?0:b(t,_.__wbindgen_export,_.__wbindgen_export2),a=u;let c=_.definedValues(n,r,o,a);return g(c)}function Z(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.diagnostics(t,n);return g(r)}function tt(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.format(t,n);return g(r)}function et(e,t){let n=b(e,_.__wbindgen_export,_.__wbindgen_export2),r=u,o=0;w(t)||(B(t,h),o=t.__destroy_into_raw());let a=_.htmlToMarkdown(n,r,o);return g(a)}function nt(e,t,n){let r=b(e,_.__wbindgen_export,_.__wbindgen_export2),o=u,a=b(t,_.__wbindgen_export,_.__wbindgen_export2),c=u,f=_.run(r,o,a,c,s(n));return g(f)}function rt(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.toAst(t,n);return g(r)}function ot(e){let t=b(e,_.__wbindgen_export,_.__wbindgen_export2),n=u,r=_.toHtml(t,n);return g(r)}async function _t(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&it.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")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",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function I(){let e={};return e.wbg={},e.wbg.__wbg_Error_52673b7de5a0ca89=function(t,n){let r=Error(M(t,n));return s(r)},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(i(n)),o=b(r,_.__wbindgen_export,_.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(t){let n=i(t),r=typeof n=="boolean"?n:void 0;return w(r)?16777215:r?1:0},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){let r=E(i(n)),o=b(r,_.__wbindgen_export,_.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(t,n){return i(t)in i(n)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof i(t)=="function"},e.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(t){let n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(t){return typeof i(t)=="string"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return i(t)===void 0},e.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(t,n){return i(t)==i(n)},e.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(t,n){let r=i(n),o=typeof r=="number"?r:void 0;p().setFloat64(t+8,w(o)?0:o,!0),p().setInt32(t+0,!w(o),!0)},e.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(t,n){let r=i(n),o=typeof r=="string"?r:void 0;var a=w(o)?0:b(o,_.__wbindgen_export,_.__wbindgen_export2),c=u;p().setInt32(t+4,c,!0),p().setInt32(t+0,a,!0)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(M(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){i(t)._wbg_cb_unref()},e.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9=function(t){let n=i(t).arrayBuffer();return s(n)},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return W(function(t,n,r){let o=i(t).call(i(n),i(r));return s(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return W(function(t,n){let r=i(t).call(i(n));return s(r)},arguments)},e.wbg.__wbg_done_62ea16af4ce34b24=function(t){return i(t).done},e.wbg.__wbg_entries_7de5c9edd116e219=function(t){let n=i(t).entries();return s(n)},e.wbg.__wbg_entries_83c79938054e065f=function(t){let n=Object.entries(i(t));return s(n)},e.wbg.__wbg_from_29a8414a7a7cd19d=function(t){let n=Array.from(i(t));return s(n)},e.wbg.__wbg_getDirectory_9beed6c83b6861f5=function(t){let n=i(t).getDirectory();return s(n)},e.wbg.__wbg_getFile_3d12eaf635641f3a=function(t){let n=i(t).getFile();return s(n)},e.wbg.__wbg_get_6b7bd52aca3f9671=function(t,n){let r=i(t)[n>>>0];return s(r)},e.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(t,n){let r=i(t)[i(n)];return s(r)},e.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemDirectoryHandle_264085cadc86679a=function(t){let n;try{n=i(t)instanceof FileSystemDirectoryHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemFileHandle_214d69e0ae063fc8=function(t){let n;try{n=i(t)instanceof FileSystemFileHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_instanceof_Window_b5cf7783caa68180=function(t){let n;try{n=i(t)instanceof Window}catch{n=!1}return n},e.wbg.__wbg_length_22ac23eaec9d8053=function(t){return i(t).length},e.wbg.__wbg_length_d45040a40c570362=function(t){return i(t).length},e.wbg.__wbg_navigator_b49edef831236138=function(t){let n=i(t).navigator;return s(n)},e.wbg.__wbg_new_1ba21ce319a06297=function(){let t=new Object;return s(t)},e.wbg.__wbg_new_25f239778d6112b9=function(){let t=new Array;return s(t)},e.wbg.__wbg_new_6421f6084cc5bc5a=function(t){let n=new Uint8Array(i(t));return s(n)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(c,f)=>{let l=r.a;r.a=0;try{return Y(l,r.b,c,f)}finally{r.a=l}};let a=new Promise(o);return s(a)}finally{r.a=r.b=0}},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){let r=new Function(M(t,n));return s(r)},e.wbg.__wbg_next_b34c09a202bf4424=function(){return W(function(t){let n=i(t).next();return s(n)},arguments)},e.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(t,n,r){Uint8Array.prototype.set.call(q(t,n),i(r))},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){let n=i(t).queueMicrotask;return s(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(i(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){let n=Promise.resolve(i(t));return s(n)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){i(t)[g(n)]=g(r)},e.wbg.__wbg_set_7df433eea03a5c14=function(t,n,r){i(t)[n>>>0]=g(r)},e.wbg.__wbg_size_82fbdb656de23326=function(t){return i(t).size},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){let t=typeof global>"u"?null:global;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){let t=typeof globalThis>"u"?null:globalThis;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){let t=typeof self>"u"?null:self;return w(t)?0:s(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){let t=typeof window>"u"?null:window;return w(t)?0:s(t)},e.wbg.__wbg_storage_b04c3b736f10dd3b=function(t){let n=i(t).storage;return s(n)},e.wbg.__wbg_then_429f7caf1026411d=function(t,n,r){let o=i(t).then(i(n),i(r));return s(o)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){let r=i(t).then(i(n));return s(r)},e.wbg.__wbg_value_57b7b035e117f7ee=function(t){let n=i(t).value;return s(n)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){let r=M(t,n);return s(r)},e.wbg.__wbindgen_cast_29480d6a48b8e833=function(t,n){let r=$(t,n,_.__wasm_bindgen_func_elem_3023,X);return s(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return s(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=i(t);return s(n)},e.wbg.__wbindgen_object_drop_ref=function(t){g(t)},e}function v(e,t){return _=e.exports,U.__wbindgen_wasm_module=t,y=null,x=null,_}function st(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=I();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return v(n,e)}async function U(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",import.meta.url));let t=I();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await _t(await e,t);return v(n,r)}var _,R,y,x,d,S,k,N,j,F,u,J,K,h,O,it,P,D=H(()=>{"use strict";R=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));y=null;x=null;d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);S=d.length;k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();N=2146435072,j=0;F=new TextEncoder;"encodeInto"in F||(F.encodeInto=function(e,t){let n=F.encode(e);return t.set(n),{read:e.length,written:n.length}});u=0;J=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_conversionoptions_free(e>>>0,1)),K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_runoptions_free(e>>>0,1)),h=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_conversionoptions_free(t,0)}get extract_scripts_as_code_blocks(){return _.__wbg_get_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr)!==0}set extract_scripts_as_code_blocks(t){_.__wbg_set_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr,t)}get generate_front_matter(){return _.__wbg_get_conversionoptions_generate_front_matter(this.__wbg_ptr)!==0}set generate_front_matter(t){_.__wbg_set_conversionoptions_generate_front_matter(this.__wbg_ptr,t)}get use_title_as_h1(){return _.__wbg_get_conversionoptions_use_title_as_h1(this.__wbg_ptr)!==0}set use_title_as_h1(t){_.__wbg_set_conversionoptions_use_title_as_h1(this.__wbg_ptr,t)}};Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);O=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_runoptions_free(t,0)}};Symbol.dispose&&(O.prototype[Symbol.dispose]=O.prototype.free);it=new Set(["basic","cors","default"]);P=U});D();var T=null;async function m(){return T||(await(async()=>{try{await P();let e=await Promise.resolve().then(()=>(D(),V));T={run:e.run,toAst:e.toAst,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues,htmlToMarkdown:e.htmlToMarkdown,toHtml:e.toHtml}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),T)}async function wt(e,t,n={}){return await(await m()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function dt(e){return await(await m()).toAst(e)}async function lt(e){return await(await m()).format(e)}async function pt(e){return await(await m()).diagnostics(e)}async function yt(e,t){return await(await m()).definedValues(e,t)}async function mt(e,t){return await(await m()).htmlToMarkdown(e,t)}async function ht(e){return await(await m()).toHtml(e)}export{yt as definedValues,pt as diagnostics,lt as format,mt as htmlToMarkdown,wt as run,dt as toAst,ht as toHtml};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(e,t)=>()=>(e&&(t=e(e=0)),t);var I=(e,t)=>{for(var n in t)T(e,n,{get:t[n],enumerable:!0})},J=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of G(t))!X.call(e,o)&&o!==n&&T(e,o,{get:()=>t[o],enumerable:!(r=N(t,o))||r.enumerable});return e};var K=e=>J(T({},"__esModule",{value:!0}),e);var H={};I(H,{ConversionOptions:()=>m,RunOptions:()=>F,default:()=>P,definedValues:()=>ct,diagnostics:()=>at,format:()=>ft,htmlToMarkdown:()=>ut,initSync:()=>pt,run:()=>bt,toAst:()=>gt,toHtml:()=>wt});function _(e){A===d.length&&d.push(d.length+1);let t=A;return A=d[t],d[t]=e,t}function Q(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function E(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){let o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){let o=e.length,a="[";o>0&&(a+=E(e[0]));for(let c=1;c<o;c++)a+=", "+E(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
2
|
+
${e.stack}`:r}function Z(e){e<132||(d[e]=A,A=e)}function tt(e,t){return e=e>>>0,x().subarray(e/1,e/1+t)}function p(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==s.memory.buffer)&&(y=new DataView(s.memory.buffer)),y}function M(e,t){return e=e>>>0,rt(e,t)}function x(){return(h===null||h.byteLength===0)&&(h=new Uint8Array(s.memory.buffer)),h}function i(e){return d[e]}function j(e,t){try{return e.apply(this,t)}catch(n){s.__wbindgen_export3(_(n))}}function w(e){return e==null}function et(e,t,n,r){let o={a:e,b:t,cnt:1,dtor:n},a=(...c)=>{o.cnt++;let f=o.a;o.a=0;try{return r(f,o.b,...c)}finally{o.a=f,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,V.unregister(o))},V.register(a,o,o),a}function b(e,t,n){if(n===void 0){let f=S.encode(e),l=t(f.length,1)>>>0;return x().subarray(l,l+f.length).set(f),u=f.length,l}let r=e.length,o=t(r,1)>>>0,a=x(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;let f=x().subarray(o+c,o+r),l=S.encodeInto(e,f);c+=l.written,o=n(o,r,c,1)>>>0}return u=c,o}function g(e){let t=i(e);return Z(e),t}function rt(e,t){return W+=t,W>=nt&&(k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),k.decode(),W=t),k.decode(x().subarray(e,e+t))}function ot(e,t,n){s.__wasm_bindgen_func_elem_3024(e,t,_(n))}function it(e,t,n,r){s.__wasm_bindgen_func_elem_827(e,t,_(n),_(r))}function ct(e,t){let n=b(e,s.__wbindgen_export,s.__wbindgen_export2),r=u;var o=w(t)?0:b(t,s.__wbindgen_export,s.__wbindgen_export2),a=u;let c=s.definedValues(n,r,o,a);return g(c)}function at(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.diagnostics(t,n);return g(r)}function ft(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.format(t,n);return g(r)}function ut(e,t){let n=b(e,s.__wbindgen_export,s.__wbindgen_export2),r=u,o=0;w(t)||(Q(t,m),o=t.__destroy_into_raw());let a=s.htmlToMarkdown(n,r,o);return g(a)}function bt(e,t,n){let r=b(e,s.__wbindgen_export,s.__wbindgen_export2),o=u,a=b(t,s.__wbindgen_export,s.__wbindgen_export2),c=u,f=s.run(r,o,a,c,_(n));return g(f)}function gt(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.toAst(t,n);return g(r)}function wt(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.toHtml(t,n);return g(r)}async function lt(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&dt.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")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",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function v(){let e={};return e.wbg={},e.wbg.__wbg_Error_52673b7de5a0ca89=function(t,n){let r=Error(M(t,n));return _(r)},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(i(n)),o=b(r,s.__wbindgen_export,s.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(t){let n=i(t),r=typeof n=="boolean"?n:void 0;return w(r)?16777215:r?1:0},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){let r=E(i(n)),o=b(r,s.__wbindgen_export,s.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(t,n){return i(t)in i(n)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof i(t)=="function"},e.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(t){let n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(t){return typeof i(t)=="string"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return i(t)===void 0},e.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(t,n){return i(t)==i(n)},e.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(t,n){let r=i(n),o=typeof r=="number"?r:void 0;p().setFloat64(t+8,w(o)?0:o,!0),p().setInt32(t+0,!w(o),!0)},e.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(t,n){let r=i(n),o=typeof r=="string"?r:void 0;var a=w(o)?0:b(o,s.__wbindgen_export,s.__wbindgen_export2),c=u;p().setInt32(t+4,c,!0),p().setInt32(t+0,a,!0)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(M(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){i(t)._wbg_cb_unref()},e.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9=function(t){let n=i(t).arrayBuffer();return _(n)},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return j(function(t,n,r){let o=i(t).call(i(n),i(r));return _(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return j(function(t,n){let r=i(t).call(i(n));return _(r)},arguments)},e.wbg.__wbg_done_62ea16af4ce34b24=function(t){return i(t).done},e.wbg.__wbg_entries_7de5c9edd116e219=function(t){let n=i(t).entries();return _(n)},e.wbg.__wbg_entries_83c79938054e065f=function(t){let n=Object.entries(i(t));return _(n)},e.wbg.__wbg_from_29a8414a7a7cd19d=function(t){let n=Array.from(i(t));return _(n)},e.wbg.__wbg_getDirectory_9beed6c83b6861f5=function(t){let n=i(t).getDirectory();return _(n)},e.wbg.__wbg_getFile_3d12eaf635641f3a=function(t){let n=i(t).getFile();return _(n)},e.wbg.__wbg_get_6b7bd52aca3f9671=function(t,n){let r=i(t)[n>>>0];return _(r)},e.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(t,n){let r=i(t)[i(n)];return _(r)},e.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemDirectoryHandle_264085cadc86679a=function(t){let n;try{n=i(t)instanceof FileSystemDirectoryHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemFileHandle_214d69e0ae063fc8=function(t){let n;try{n=i(t)instanceof FileSystemFileHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_instanceof_Window_b5cf7783caa68180=function(t){let n;try{n=i(t)instanceof Window}catch{n=!1}return n},e.wbg.__wbg_length_22ac23eaec9d8053=function(t){return i(t).length},e.wbg.__wbg_length_d45040a40c570362=function(t){return i(t).length},e.wbg.__wbg_navigator_b49edef831236138=function(t){let n=i(t).navigator;return _(n)},e.wbg.__wbg_new_1ba21ce319a06297=function(){let t=new Object;return _(t)},e.wbg.__wbg_new_25f239778d6112b9=function(){let t=new Array;return _(t)},e.wbg.__wbg_new_6421f6084cc5bc5a=function(t){let n=new Uint8Array(i(t));return _(n)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(c,f)=>{let l=r.a;r.a=0;try{return it(l,r.b,c,f)}finally{r.a=l}};let a=new Promise(o);return _(a)}finally{r.a=r.b=0}},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){let r=new Function(M(t,n));return _(r)},e.wbg.__wbg_next_b34c09a202bf4424=function(){return j(function(t){let n=i(t).next();return _(n)},arguments)},e.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(t,n,r){Uint8Array.prototype.set.call(tt(t,n),i(r))},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){let n=i(t).queueMicrotask;return _(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(i(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){let n=Promise.resolve(i(t));return _(n)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){i(t)[g(n)]=g(r)},e.wbg.__wbg_set_7df433eea03a5c14=function(t,n,r){i(t)[n>>>0]=g(r)},e.wbg.__wbg_size_82fbdb656de23326=function(t){return i(t).size},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){let t=typeof global>"u"?null:global;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){let t=typeof globalThis>"u"?null:globalThis;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){let t=typeof self>"u"?null:self;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){let t=typeof window>"u"?null:window;return w(t)?0:_(t)},e.wbg.__wbg_storage_b04c3b736f10dd3b=function(t){let n=i(t).storage;return _(n)},e.wbg.__wbg_then_429f7caf1026411d=function(t,n,r){let o=i(t).then(i(n),i(r));return _(o)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){let r=i(t).then(i(n));return _(r)},e.wbg.__wbg_value_57b7b035e117f7ee=function(t){let n=i(t).value;return _(n)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){let r=M(t,n);return _(r)},e.wbg.__wbindgen_cast_29480d6a48b8e833=function(t,n){let r=et(t,n,s.__wasm_bindgen_func_elem_3023,ot);return _(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return _(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=i(t);return _(n)},e.wbg.__wbindgen_object_drop_ref=function(t){g(t)},e}function U(e,t){return s=e.exports,z.__wbindgen_wasm_module=t,y=null,h=null,s}function pt(e){if(s!==void 0)return s;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=v();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return U(n,e)}async function z(e){if(s!==void 0)return s;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",yt.url));let t=v();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await lt(await e,t);return U(n,r)}var yt,s,V,y,h,d,A,k,nt,W,S,u,st,_t,m,F,dt,P,R=Y(()=>{"use strict";yt={};V=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));y=null;h=null;d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);A=d.length;k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();nt=2146435072,W=0;S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(e,t){let n=S.encode(e);return t.set(n),{read:e.length,written:n.length}});u=0;st=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>s.__wbg_conversionoptions_free(e>>>0,1)),_t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>s.__wbg_runoptions_free(e>>>0,1)),m=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,st.unregister(this),t}free(){let t=this.__destroy_into_raw();s.__wbg_conversionoptions_free(t,0)}get extract_scripts_as_code_blocks(){return s.__wbg_get_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr)!==0}set extract_scripts_as_code_blocks(t){s.__wbg_set_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr,t)}get generate_front_matter(){return s.__wbg_get_conversionoptions_generate_front_matter(this.__wbg_ptr)!==0}set generate_front_matter(t){s.__wbg_set_conversionoptions_generate_front_matter(this.__wbg_ptr,t)}get use_title_as_h1(){return s.__wbg_get_conversionoptions_use_title_as_h1(this.__wbg_ptr)!==0}set use_title_as_h1(t){s.__wbg_set_conversionoptions_use_title_as_h1(this.__wbg_ptr,t)}};Symbol.dispose&&(m.prototype[Symbol.dispose]=m.prototype.free);F=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_t.unregister(this),t}free(){let t=this.__destroy_into_raw();s.__wbg_runoptions_free(t,0)}};Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);dt=new Set(["basic","cors","default"]);P=z});var mt={};I(mt,{definedValues:()=>$,diagnostics:()=>C,format:()=>B,initSync:()=>pt,run:()=>L,toAst:()=>q});module.exports=K(mt);R();var D=null;async function O(){return D||(await(async()=>{try{await P();let e=await Promise.resolve().then(()=>(R(),H));D={run:e.run,toAst:e.toAst,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues,htmlToMarkdown:e.htmlToMarkdown,toHtml:e.toHtml}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),D)}async function L(e,t,n={}){return await(await O()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function q(e){return await(await O()).toAst(e)}async function B(e){return await(await O()).format(e)}async function C(e){return await(await O()).diagnostics(e)}async function $(e,t){return await(await O()).definedValues(e,t)}0&&(module.exports={definedValues,diagnostics,format,run,toAst});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { definedValues, diagnostics, format, run, toAst } from './core.cjs';
|
|
2
|
+
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
|
|
6
|
+
type DefinedValueType = 'Function' | 'Variable';
|
|
7
|
+
|
|
8
|
+
interface DefinedValue {
|
|
9
|
+
name: string;
|
|
10
|
+
args?: string[];
|
|
11
|
+
doc: string;
|
|
12
|
+
valueType: DefinedValueType;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Diagnostic {
|
|
16
|
+
startLine: number,
|
|
17
|
+
startColumn: number,
|
|
18
|
+
endLine: number,
|
|
19
|
+
endColumn: number,
|
|
20
|
+
message: string,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Options {
|
|
24
|
+
isUpdate: boolean,
|
|
25
|
+
inputFormat: 'markdown' | 'text' | 'mdx' | 'html' | 'null' | 'raw' | null,
|
|
26
|
+
listStyle: 'dash' | 'plus' | 'star' | null,
|
|
27
|
+
linkTitleStyle: 'double' | 'single' | 'paren' | null,
|
|
28
|
+
linkUrlStyle: 'angle' | 'none' | null,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type { DefinedValue, DefinedValueType, Diagnostic, Options };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { definedValues, diagnostics, format, run, toAst } from './core.js';
|
|
2
|
+
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
|
|
6
|
+
type DefinedValueType = 'Function' | 'Variable';
|
|
7
|
+
|
|
8
|
+
interface DefinedValue {
|
|
9
|
+
name: string;
|
|
10
|
+
args?: string[];
|
|
11
|
+
doc: string;
|
|
12
|
+
valueType: DefinedValueType;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Diagnostic {
|
|
16
|
+
startLine: number,
|
|
17
|
+
startColumn: number,
|
|
18
|
+
endLine: number,
|
|
19
|
+
endColumn: number,
|
|
20
|
+
message: string,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Options {
|
|
24
|
+
isUpdate: boolean,
|
|
25
|
+
inputFormat: 'markdown' | 'text' | 'mdx' | 'html' | 'null' | 'raw' | null,
|
|
26
|
+
listStyle: 'dash' | 'plus' | 'star' | null,
|
|
27
|
+
linkTitleStyle: 'double' | 'single' | 'paren' | null,
|
|
28
|
+
linkUrlStyle: 'angle' | 'none' | null,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type { DefinedValue, DefinedValueType, Diagnostic, Options };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var z=Object.defineProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var L=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})};var U={};L(U,{ConversionOptions:()=>m,RunOptions:()=>F,default:()=>E,definedValues:()=>Q,diagnostics:()=>Z,format:()=>tt,htmlToMarkdown:()=>et,initSync:()=>_t,run:()=>nt,toAst:()=>rt,toHtml:()=>ot});function _(e){A===d.length&&d.push(d.length+1);let t=A;return A=d[t],d[t]=e,t}function q(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function W(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){let o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){let o=e.length,a="[";o>0&&(a+=W(e[0]));for(let c=1;c<o;c++)a+=", "+W(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
2
|
+
${e.stack}`:r}function B(e){e<132||(d[e]=A,A=e)}function C(e,t){return e=e>>>0,x().subarray(e/1,e/1+t)}function p(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==s.memory.buffer)&&(y=new DataView(s.memory.buffer)),y}function M(e,t){return e=e>>>0,G(e,t)}function x(){return(h===null||h.byteLength===0)&&(h=new Uint8Array(s.memory.buffer)),h}function i(e){return d[e]}function T(e,t){try{return e.apply(this,t)}catch(n){s.__wbindgen_export3(_(n))}}function w(e){return e==null}function $(e,t,n,r){let o={a:e,b:t,cnt:1,dtor:n},a=(...c)=>{o.cnt++;let f=o.a;o.a=0;try{return r(f,o.b,...c)}finally{o.a=f,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--o.cnt===0&&(o.dtor(o.a,o.b),o.a=0,R.unregister(o))},R.register(a,o,o),a}function b(e,t,n){if(n===void 0){let f=S.encode(e),l=t(f.length,1)>>>0;return x().subarray(l,l+f.length).set(f),u=f.length,l}let r=e.length,o=t(r,1)>>>0,a=x(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;let f=x().subarray(o+c,o+r),l=S.encodeInto(e,f);c+=l.written,o=n(o,r,c,1)>>>0}return u=c,o}function g(e){let t=i(e);return B(e),t}function G(e,t){return j+=t,j>=N&&(k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),k.decode(),j=t),k.decode(x().subarray(e,e+t))}function X(e,t,n){s.__wasm_bindgen_func_elem_3024(e,t,_(n))}function Y(e,t,n,r){s.__wasm_bindgen_func_elem_827(e,t,_(n),_(r))}function Q(e,t){let n=b(e,s.__wbindgen_export,s.__wbindgen_export2),r=u;var o=w(t)?0:b(t,s.__wbindgen_export,s.__wbindgen_export2),a=u;let c=s.definedValues(n,r,o,a);return g(c)}function Z(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.diagnostics(t,n);return g(r)}function tt(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.format(t,n);return g(r)}function et(e,t){let n=b(e,s.__wbindgen_export,s.__wbindgen_export2),r=u,o=0;w(t)||(q(t,m),o=t.__destroy_into_raw());let a=s.htmlToMarkdown(n,r,o);return g(a)}function nt(e,t,n){let r=b(e,s.__wbindgen_export,s.__wbindgen_export2),o=u,a=b(t,s.__wbindgen_export,s.__wbindgen_export2),c=u,f=s.run(r,o,a,c,_(n));return g(f)}function rt(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.toAst(t,n);return g(r)}function ot(e){let t=b(e,s.__wbindgen_export,s.__wbindgen_export2),n=u,r=s.toHtml(t,n);return g(r)}async function st(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.ok&&it.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")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",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function I(){let e={};return e.wbg={},e.wbg.__wbg_Error_52673b7de5a0ca89=function(t,n){let r=Error(M(t,n));return _(r)},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(i(n)),o=b(r,s.__wbindgen_export,s.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(t){let n=i(t),r=typeof n=="boolean"?n:void 0;return w(r)?16777215:r?1:0},e.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(t,n){let r=W(i(n)),o=b(r,s.__wbindgen_export,s.__wbindgen_export2),a=u;p().setInt32(t+4,a,!0),p().setInt32(t+0,o,!0)},e.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(t,n){return i(t)in i(n)},e.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(t){return typeof i(t)=="function"},e.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(t){let n=i(t);return typeof n=="object"&&n!==null},e.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(t){return typeof i(t)=="string"},e.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(t){return i(t)===void 0},e.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(t,n){return i(t)==i(n)},e.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(t,n){let r=i(n),o=typeof r=="number"?r:void 0;p().setFloat64(t+8,w(o)?0:o,!0),p().setInt32(t+0,!w(o),!0)},e.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(t,n){let r=i(n),o=typeof r=="string"?r:void 0;var a=w(o)?0:b(o,s.__wbindgen_export,s.__wbindgen_export2),c=u;p().setInt32(t+4,c,!0),p().setInt32(t+0,a,!0)},e.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(t,n){throw new Error(M(t,n))},e.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7=function(t){i(t)._wbg_cb_unref()},e.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9=function(t){let n=i(t).arrayBuffer();return _(n)},e.wbg.__wbg_call_3020136f7a2d6e44=function(){return T(function(t,n,r){let o=i(t).call(i(n),i(r));return _(o)},arguments)},e.wbg.__wbg_call_abb4ff46ce38be40=function(){return T(function(t,n){let r=i(t).call(i(n));return _(r)},arguments)},e.wbg.__wbg_done_62ea16af4ce34b24=function(t){return i(t).done},e.wbg.__wbg_entries_7de5c9edd116e219=function(t){let n=i(t).entries();return _(n)},e.wbg.__wbg_entries_83c79938054e065f=function(t){let n=Object.entries(i(t));return _(n)},e.wbg.__wbg_from_29a8414a7a7cd19d=function(t){let n=Array.from(i(t));return _(n)},e.wbg.__wbg_getDirectory_9beed6c83b6861f5=function(t){let n=i(t).getDirectory();return _(n)},e.wbg.__wbg_getFile_3d12eaf635641f3a=function(t){let n=i(t).getFile();return _(n)},e.wbg.__wbg_get_6b7bd52aca3f9671=function(t,n){let r=i(t)[n>>>0];return _(r)},e.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(t,n){let r=i(t)[i(n)];return _(r)},e.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(t){let n;try{n=i(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemDirectoryHandle_264085cadc86679a=function(t){let n;try{n=i(t)instanceof FileSystemDirectoryHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_FileSystemFileHandle_214d69e0ae063fc8=function(t){let n;try{n=i(t)instanceof FileSystemFileHandle}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(t){let n;try{n=i(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_instanceof_Window_b5cf7783caa68180=function(t){let n;try{n=i(t)instanceof Window}catch{n=!1}return n},e.wbg.__wbg_length_22ac23eaec9d8053=function(t){return i(t).length},e.wbg.__wbg_length_d45040a40c570362=function(t){return i(t).length},e.wbg.__wbg_navigator_b49edef831236138=function(t){let n=i(t).navigator;return _(n)},e.wbg.__wbg_new_1ba21ce319a06297=function(){let t=new Object;return _(t)},e.wbg.__wbg_new_25f239778d6112b9=function(){let t=new Array;return _(t)},e.wbg.__wbg_new_6421f6084cc5bc5a=function(t){let n=new Uint8Array(i(t));return _(n)},e.wbg.__wbg_new_ff12d2b041fb48f1=function(t,n){try{var r={a:t,b:n},o=(c,f)=>{let l=r.a;r.a=0;try{return Y(l,r.b,c,f)}finally{r.a=l}};let a=new Promise(o);return _(a)}finally{r.a=r.b=0}},e.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(t,n){let r=new Function(M(t,n));return _(r)},e.wbg.__wbg_next_b34c09a202bf4424=function(){return T(function(t){let n=i(t).next();return _(n)},arguments)},e.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(t,n,r){Uint8Array.prototype.set.call(C(t,n),i(r))},e.wbg.__wbg_queueMicrotask_9b549dfce8865860=function(t){let n=i(t).queueMicrotask;return _(n)},e.wbg.__wbg_queueMicrotask_fca69f5bfad613a5=function(t){queueMicrotask(i(t))},e.wbg.__wbg_resolve_fd5bfbaa4ce36e1e=function(t){let n=Promise.resolve(i(t));return _(n)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){i(t)[g(n)]=g(r)},e.wbg.__wbg_set_7df433eea03a5c14=function(t,n,r){i(t)[n>>>0]=g(r)},e.wbg.__wbg_size_82fbdb656de23326=function(t){return i(t).size},e.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){let t=typeof global>"u"?null:global;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){let t=typeof globalThis>"u"?null:globalThis;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){let t=typeof self>"u"?null:self;return w(t)?0:_(t)},e.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){let t=typeof window>"u"?null:window;return w(t)?0:_(t)},e.wbg.__wbg_storage_b04c3b736f10dd3b=function(t){let n=i(t).storage;return _(n)},e.wbg.__wbg_then_429f7caf1026411d=function(t,n,r){let o=i(t).then(i(n),i(r));return _(o)},e.wbg.__wbg_then_4f95312d68691235=function(t,n){let r=i(t).then(i(n));return _(r)},e.wbg.__wbg_value_57b7b035e117f7ee=function(t){let n=i(t).value;return _(n)},e.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,n){let r=M(t,n);return _(r)},e.wbg.__wbindgen_cast_29480d6a48b8e833=function(t,n){let r=$(t,n,s.__wasm_bindgen_func_elem_3023,X);return _(r)},e.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return _(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=i(t);return _(n)},e.wbg.__wbindgen_object_drop_ref=function(t){g(t)},e}function V(e,t){return s=e.exports,v.__wbindgen_wasm_module=t,y=null,h=null,s}function _t(e){if(s!==void 0)return s;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=I();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return V(n,e)}async function v(e){if(s!==void 0)return s;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",import.meta.url));let t=I();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await st(await e,t);return V(n,r)}var s,R,y,h,d,A,k,N,j,S,u,J,K,m,F,it,E,P=H(()=>{"use strict";R=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>e.dtor(e.a,e.b));y=null;h=null;d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);A=d.length;k=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();N=2146435072,j=0;S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(e,t){let n=S.encode(e);return t.set(n),{read:e.length,written:n.length}});u=0;J=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>s.__wbg_conversionoptions_free(e>>>0,1)),K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>s.__wbg_runoptions_free(e>>>0,1)),m=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){let t=this.__destroy_into_raw();s.__wbg_conversionoptions_free(t,0)}get extract_scripts_as_code_blocks(){return s.__wbg_get_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr)!==0}set extract_scripts_as_code_blocks(t){s.__wbg_set_conversionoptions_extract_scripts_as_code_blocks(this.__wbg_ptr,t)}get generate_front_matter(){return s.__wbg_get_conversionoptions_generate_front_matter(this.__wbg_ptr)!==0}set generate_front_matter(t){s.__wbg_set_conversionoptions_generate_front_matter(this.__wbg_ptr,t)}get use_title_as_h1(){return s.__wbg_get_conversionoptions_use_title_as_h1(this.__wbg_ptr)!==0}set use_title_as_h1(t){s.__wbg_set_conversionoptions_use_title_as_h1(this.__wbg_ptr,t)}};Symbol.dispose&&(m.prototype[Symbol.dispose]=m.prototype.free);F=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),t}free(){let t=this.__destroy_into_raw();s.__wbg_runoptions_free(t,0)}};Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);it=new Set(["basic","cors","default"]);E=v});P();var D=null;async function O(){return D||(await(async()=>{try{await E();let e=await Promise.resolve().then(()=>(P(),U));D={run:e.run,toAst:e.toAst,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues,htmlToMarkdown:e.htmlToMarkdown,toHtml:e.toHtml}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),D)}async function ct(e,t,n={}){return await(await O()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function at(e){return await(await O()).toAst(e)}async function ft(e){return await(await O()).format(e)}async function ut(e){return await(await O()).diagnostics(e)}async function bt(e,t){return await(await O()).definedValues(e,t)}export{bt as definedValues,ut as diagnostics,ft as format,ct as run,at as toAst};
|