@thallylabs/migrate 0.2.39 → 0.2.41

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.
@@ -86,6 +86,10 @@ var ALLOWED_ATTRIBUTES = /* @__PURE__ */ new Set([
86
86
  "fill-rule",
87
87
  "stroke",
88
88
  "stroke-width",
89
+ // Some SVG exporters persist React spellings. These remain fixed static
90
+ // drawing attributes; accepting them never grants arbitrary JSX execution.
91
+ "fillrule",
92
+ "cliprule",
89
93
  "stroke-opacity",
90
94
  "stroke-linecap",
91
95
  "stroke-linejoin",
@@ -207,6 +211,8 @@ var ALLOWED_ATTRIBUTES = /* @__PURE__ */ new Set([
207
211
  "limitingconeangle",
208
212
  "aria-hidden",
209
213
  "aria-label",
214
+ "aria-labelledby",
215
+ "aria-describedby",
210
216
  "role",
211
217
  "focusable",
212
218
  // Validated below: only in-document fragment references.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/svg-policy.ts"],"sourcesContent":["/**\n * Allowlist policy for imported SVG files.\n *\n * An SVG served from the docs origin and opened directly is a full document:\n * script, event handlers, `javascript:` links, animations that rewrite\n * `href`, foreign HTML, and remote references all run or load there. Regular\n * expressions miss namespace prefixes and entity-encoded values, so the file\n * is parsed as XML with entities decoded. It passes only if every element and\n * attribute is on a fixed allowlist of static drawing primitives, and every\n * reference stays inside the document. Anything else, including a\n * DOCTYPE, CDATA, or a parser error, sends the file to review.\n */\n\nimport { Parser } from \"htmlparser2\";\n\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nconst XLINK_NAMESPACE = \"http://www.w3.org/1999/xlink\";\n\n/** Static drawing elements; no script, style, animation, link, or image. */\nconst ALLOWED_ELEMENTS = new Set([\n \"svg\", \"g\", \"defs\", \"symbol\", \"use\", \"title\", \"desc\",\n \"path\", \"rect\", \"circle\", \"ellipse\", \"line\", \"polyline\", \"polygon\",\n \"text\", \"tspan\", \"textpath\",\n \"lineargradient\", \"radialgradient\", \"stop\",\n \"clippath\", \"mask\", \"pattern\", \"marker\",\n \"filter\", \"feblend\", \"fecolormatrix\", \"fecomponenttransfer\", \"fecomposite\",\n \"feconvolvematrix\", \"fediffuselighting\", \"fedisplacementmap\",\n \"fedistantlight\", \"fedropshadow\", \"feflood\", \"fefunca\", \"fefuncb\",\n \"fefuncg\", \"fefuncr\", \"fegaussianblur\", \"femerge\", \"femergenode\",\n \"femorphology\", \"feoffset\", \"fepointlight\", \"fespecularlighting\",\n \"fespotlight\", \"fetile\", \"feturbulence\",\n]);\n\n/** Geometry, paint, text, gradient, and filter attributes (lowercased). */\nconst ALLOWED_ATTRIBUTES = new Set([\n \"xmlns\", \"xmlns:xlink\", \"xml:space\", \"version\", \"baseprofile\",\n \"id\", \"class\", \"viewbox\", \"preserveaspectratio\", \"width\", \"height\",\n \"x\", \"y\", \"x1\", \"y1\", \"x2\", \"y2\", \"cx\", \"cy\", \"r\", \"rx\", \"ry\",\n \"d\", \"points\", \"pathlength\", \"transform\", \"transform-origin\",\n \"fill\", \"fill-opacity\", \"fill-rule\", \"stroke\", \"stroke-width\",\n \"stroke-opacity\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-dasharray\", \"stroke-dashoffset\",\n \"opacity\", \"color\", \"display\", \"visibility\", \"overflow\",\n \"clip-path\", \"clip-rule\", \"clippathunits\", \"mask\", \"maskunits\",\n \"maskcontentunits\", \"filter\", \"filterunits\", \"primitiveunits\",\n \"marker-start\", \"marker-mid\", \"marker-end\", \"markerwidth\", \"markerheight\",\n \"markerunits\", \"refx\", \"refy\", \"orient\",\n \"patternunits\", \"patterncontentunits\", \"patterntransform\",\n \"gradientunits\", \"gradienttransform\", \"spreadmethod\", \"fx\", \"fy\", \"fr\",\n \"offset\", \"stop-color\", \"stop-opacity\",\n \"font-family\", \"font-size\", \"font-weight\", \"font-style\", \"font-variant\",\n \"letter-spacing\", \"word-spacing\", \"text-anchor\", \"dominant-baseline\",\n \"alignment-baseline\", \"baseline-shift\", \"text-decoration\", \"dx\", \"dy\",\n \"rotate\", \"textlength\", \"lengthadjust\", \"startoffset\", \"writing-mode\",\n \"direction\", \"unicode-bidi\", \"shape-rendering\", \"text-rendering\",\n \"image-rendering\", \"color-interpolation\", \"color-interpolation-filters\",\n \"vector-effect\", \"paint-order\", \"mix-blend-mode\", \"isolation\",\n \"in\", \"in2\", \"result\", \"stddeviation\", \"mode\", \"type\", \"values\",\n \"tablevalues\", \"slope\", \"intercept\", \"amplitude\", \"exponent\",\n \"operator\", \"k1\", \"k2\", \"k3\", \"k4\", \"radius\", \"scale\",\n \"xchannelselector\", \"ychannelselector\", \"basefrequency\", \"numoctaves\",\n \"seed\", \"stitchtiles\", \"flood-color\", \"flood-opacity\", \"lighting-color\",\n \"surfacescale\", \"diffuseconstant\", \"specularconstant\",\n \"specularexponent\", \"kernelmatrix\", \"kernelunitlength\", \"order\",\n \"divisor\", \"bias\", \"targetx\", \"targety\", \"edgemode\", \"preservealpha\",\n \"azimuth\", \"elevation\", \"z\", \"pointsatx\", \"pointsaty\", \"pointsatz\",\n \"limitingconeangle\", \"aria-hidden\", \"aria-label\", \"role\", \"focusable\",\n // Validated below: only in-document fragment references.\n \"href\", \"xlink:href\",\n]);\n\n/** Paint and reference values may point only at in-document fragments. */\nfunction hasExternalReference(value: string): boolean {\n // CSS escapes can spell url()/schemes without their literal bytes. Drawing\n // attributes do not need escapes, so reject them rather than parse CSS twice.\n if (value.includes(\"\\\\\")) return true;\n const compact = value.replace(/[\\u0000- ]/gu, \"\").toLowerCase();\n if (/(?:java|vb)script:|data:|expression\\(|@import|<|>/u.test(compact)) {\n return true;\n }\n for (const match of compact.matchAll(/url\\(([^)]*)\\)/gu)) {\n if (!/^[\"']?#[a-z0-9_.:-]+[\"']?$/u.test(match[1])) return true;\n }\n // CSS consumes an unterminated url() through EOF and browsers can still load\n // it. A balanced-match loop alone therefore misses an external paint server.\n return compact.replace(/url\\(([^)]*)\\)/gu, \"\").includes(\"url(\");\n}\n\n/**\n * Only UTF-8 is accepted: a UTF-16/32 byte order mark or a declared\n * non-UTF-8 encoding would make browsers read different markup than the\n * policy parsed.\n */\nfunction utf8SvgText(content: Buffer): string | null {\n const hasUtf8Bom =\n content[0] === 0xef && content[1] === 0xbb && content[2] === 0xbf;\n const body = hasUtf8Bom ? content.subarray(3) : content;\n if (\n (body[0] === 0xfe && body[1] === 0xff) ||\n (body[0] === 0xff && body[1] === 0xfe) ||\n (body[0] === 0x00 && body[1] === 0x00) ||\n body.includes(0x00)\n ) {\n return null;\n }\n const text = body.toString(\"utf8\");\n if (text.includes(\"\\uFFFD\")) return null;\n const declaration = /^<\\?xml\\b[^>]*\\?>/iu.exec(text);\n if (declaration) {\n const encoding = /\\bencoding\\s*=\\s*[\"']([^\"']*)[\"']/iu.exec(declaration[0]);\n if (encoding && !/^utf-?8$/iu.test(encoding[1].trim())) return null;\n } else if (/<\\?xml\\b/iu.test(text)) {\n // A declaration anywhere but the very start is malformed XML.\n return null;\n }\n return text;\n}\n\n/** True when an SVG uses only static, self-contained drawing features. */\nexport function isPassiveSvg(content: Uint8Array): boolean {\n const text = utf8SvgText(Buffer.from(content.buffer, content.byteOffset, content.byteLength));\n if (text === null) return false;\n let isPassive = true;\n let depth = 0;\n let sawRoot = false;\n // Start offsets of open elements: an implied close is legitimate only for\n // a self-closing tag (same token); otherwise the markup is malformed.\n const openStarts: Array<number> = [];\n const fail = () => {\n isPassive = false;\n };\n const parser = new Parser(\n {\n onopentag(name, attributes) {\n const element = name.toLowerCase();\n if (depth === 0) {\n if (sawRoot || element !== \"svg\") fail();\n sawRoot = true;\n }\n depth += 1;\n openStarts.push(parser.startIndex);\n // Prefixed names (`s:script`) are rejected outright: the allowlist\n // is defined for the SVG namespace only.\n if (element.includes(\":\") || !ALLOWED_ELEMENTS.has(element)) fail();\n for (const [rawName, value] of Object.entries(attributes)) {\n const attribute = rawName.toLowerCase();\n if (!ALLOWED_ATTRIBUTES.has(attribute)) {\n fail();\n continue;\n }\n if (attribute === \"xmlns\" && value !== SVG_NAMESPACE) fail();\n if (attribute === \"xmlns:xlink\" && value !== XLINK_NAMESPACE) fail();\n if (\n (attribute === \"href\" || attribute === \"xlink:href\") &&\n !/^#[A-Za-z0-9_.:-]+$/u.test(value.trim())\n ) {\n fail();\n }\n if (hasExternalReference(value)) fail();\n }\n },\n onclosetag(_name, isImplied) {\n depth -= 1;\n const start = openStarts.pop();\n if (isImplied && start !== parser.startIndex) fail();\n },\n // DOCTYPE (and with it custom entities) or any other declaration other\n // than the XML prolog.\n onprocessinginstruction(name) {\n if (name.toLowerCase() !== \"?xml\") fail();\n },\n oncdatastart: fail,\n ontext(value) { if (depth === 0 && value.trim()) fail(); },\n onerror: fail,\n },\n { xmlMode: true, decodeEntities: true, recognizeSelfClosing: true },\n );\n try {\n parser.write(text);\n parser.end();\n } catch {\n return false;\n }\n return isPassive && sawRoot && depth === 0;\n}\n"],"mappings":";AAaA,SAAS,cAAc;AAEvB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAGxB,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC/B;AAAA,EAAO;AAAA,EAAK;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAO;AAAA,EAAS;AAAA,EAC9C;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAW;AAAA,EAAQ;AAAA,EAAY;AAAA,EACzD;AAAA,EAAQ;AAAA,EAAS;AAAA,EACjB;AAAA,EAAkB;AAAA,EAAkB;AAAA,EACpC;AAAA,EAAY;AAAA,EAAQ;AAAA,EAAW;AAAA,EAC/B;AAAA,EAAU;AAAA,EAAW;AAAA,EAAiB;AAAA,EAAuB;AAAA,EAC7D;AAAA,EAAoB;AAAA,EAAqB;AAAA,EACzC;AAAA,EAAkB;AAAA,EAAgB;AAAA,EAAW;AAAA,EAAW;AAAA,EACxD;AAAA,EAAW;AAAA,EAAW;AAAA,EAAkB;AAAA,EAAW;AAAA,EACnD;AAAA,EAAgB;AAAA,EAAY;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C,iBAAiB,IAAI,OAAO,EAAG,MAAK;AAClE,mBAAW,CAAC,SAAS,KAAK,KAAK,OAAO,QAAQ,UAAU,GAAG;AACzD,gBAAM,YAAY,QAAQ,YAAY;AACtC,cAAI,CAAC,mBAAmB,IAAI,SAAS,GAAG;AACtC,iBAAK;AACL;AAAA,UACF;AACA,cAAI,cAAc,WAAW,UAAU,cAAe,MAAK;AAC3D,cAAI,cAAc,iBAAiB,UAAU,gBAAiB,MAAK;AACnE,eACG,cAAc,UAAU,cAAc,iBACvC,CAAC,uBAAuB,KAAK,MAAM,KAAK,CAAC,GACzC;AACA,iBAAK;AAAA,UACP;AACA,cAAI,qBAAqB,KAAK,EAAG,MAAK;AAAA,QACxC;AAAA,MACF;AAAA,MACA,WAAW,OAAO,WAAW;AAC3B,iBAAS;AACT,cAAM,QAAQ,WAAW,IAAI;AAC7B,YAAI,aAAa,UAAU,OAAO,WAAY,MAAK;AAAA,MACrD;AAAA;AAAA;AAAA,MAGA,wBAAwB,MAAM;AAC5B,YAAI,KAAK,YAAY,MAAM,OAAQ,MAAK;AAAA,MAC1C;AAAA,MACA,cAAc;AAAA,MACd,OAAO,OAAO;AAAE,YAAI,UAAU,KAAK,MAAM,KAAK,EAAG,MAAK;AAAA,MAAG;AAAA,MACzD,SAAS;AAAA,IACX;AAAA,IACA,EAAE,SAAS,MAAM,gBAAgB,MAAM,sBAAsB,KAAK;AAAA,EACpE;AACA,MAAI;AACF,WAAO,MAAM,IAAI;AACjB,WAAO,IAAI;AAAA,EACb,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO,aAAa,WAAW,UAAU;AAC3C;","names":[]}
1
+ {"version":3,"sources":["../src/svg-policy.ts"],"sourcesContent":["/**\n * Allowlist policy for imported SVG files.\n *\n * An SVG served from the docs origin and opened directly is a full document:\n * script, event handlers, `javascript:` links, animations that rewrite\n * `href`, foreign HTML, and remote references all run or load there. Regular\n * expressions miss namespace prefixes and entity-encoded values, so the file\n * is parsed as XML with entities decoded. It passes only if every element and\n * attribute is on a fixed allowlist of static drawing primitives, and every\n * reference stays inside the document. Anything else, including a\n * DOCTYPE, CDATA, or a parser error, sends the file to review.\n */\n\nimport { Parser } from \"htmlparser2\";\n\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nconst XLINK_NAMESPACE = \"http://www.w3.org/1999/xlink\";\n\n/** Static drawing elements; no script, style, animation, link, or image. */\nconst ALLOWED_ELEMENTS = new Set([\n \"svg\", \"g\", \"defs\", \"symbol\", \"use\", \"title\", \"desc\",\n \"path\", \"rect\", \"circle\", \"ellipse\", \"line\", \"polyline\", \"polygon\",\n \"text\", \"tspan\", \"textpath\",\n \"lineargradient\", \"radialgradient\", \"stop\",\n \"clippath\", \"mask\", \"pattern\", \"marker\",\n \"filter\", \"feblend\", \"fecolormatrix\", \"fecomponenttransfer\", \"fecomposite\",\n \"feconvolvematrix\", \"fediffuselighting\", \"fedisplacementmap\",\n \"fedistantlight\", \"fedropshadow\", \"feflood\", \"fefunca\", \"fefuncb\",\n \"fefuncg\", \"fefuncr\", \"fegaussianblur\", \"femerge\", \"femergenode\",\n \"femorphology\", \"feoffset\", \"fepointlight\", \"fespecularlighting\",\n \"fespotlight\", \"fetile\", \"feturbulence\",\n]);\n\n/** Geometry, paint, text, gradient, and filter attributes (lowercased). */\nconst ALLOWED_ATTRIBUTES = new Set([\n \"xmlns\", \"xmlns:xlink\", \"xml:space\", \"version\", \"baseprofile\",\n \"id\", \"class\", \"viewbox\", \"preserveaspectratio\", \"width\", \"height\",\n \"x\", \"y\", \"x1\", \"y1\", \"x2\", \"y2\", \"cx\", \"cy\", \"r\", \"rx\", \"ry\",\n \"d\", \"points\", \"pathlength\", \"transform\", \"transform-origin\",\n \"fill\", \"fill-opacity\", \"fill-rule\", \"stroke\", \"stroke-width\",\n // Some SVG exporters persist React spellings. These remain fixed static\n // drawing attributes; accepting them never grants arbitrary JSX execution.\n \"fillrule\", \"cliprule\",\n \"stroke-opacity\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-dasharray\", \"stroke-dashoffset\",\n \"opacity\", \"color\", \"display\", \"visibility\", \"overflow\",\n \"clip-path\", \"clip-rule\", \"clippathunits\", \"mask\", \"maskunits\",\n \"maskcontentunits\", \"filter\", \"filterunits\", \"primitiveunits\",\n \"marker-start\", \"marker-mid\", \"marker-end\", \"markerwidth\", \"markerheight\",\n \"markerunits\", \"refx\", \"refy\", \"orient\",\n \"patternunits\", \"patterncontentunits\", \"patterntransform\",\n \"gradientunits\", \"gradienttransform\", \"spreadmethod\", \"fx\", \"fy\", \"fr\",\n \"offset\", \"stop-color\", \"stop-opacity\",\n \"font-family\", \"font-size\", \"font-weight\", \"font-style\", \"font-variant\",\n \"letter-spacing\", \"word-spacing\", \"text-anchor\", \"dominant-baseline\",\n \"alignment-baseline\", \"baseline-shift\", \"text-decoration\", \"dx\", \"dy\",\n \"rotate\", \"textlength\", \"lengthadjust\", \"startoffset\", \"writing-mode\",\n \"direction\", \"unicode-bidi\", \"shape-rendering\", \"text-rendering\",\n \"image-rendering\", \"color-interpolation\", \"color-interpolation-filters\",\n \"vector-effect\", \"paint-order\", \"mix-blend-mode\", \"isolation\",\n \"in\", \"in2\", \"result\", \"stddeviation\", \"mode\", \"type\", \"values\",\n \"tablevalues\", \"slope\", \"intercept\", \"amplitude\", \"exponent\",\n \"operator\", \"k1\", \"k2\", \"k3\", \"k4\", \"radius\", \"scale\",\n \"xchannelselector\", \"ychannelselector\", \"basefrequency\", \"numoctaves\",\n \"seed\", \"stitchtiles\", \"flood-color\", \"flood-opacity\", \"lighting-color\",\n \"surfacescale\", \"diffuseconstant\", \"specularconstant\",\n \"specularexponent\", \"kernelmatrix\", \"kernelunitlength\", \"order\",\n \"divisor\", \"bias\", \"targetx\", \"targety\", \"edgemode\", \"preservealpha\",\n \"azimuth\", \"elevation\", \"z\", \"pointsatx\", \"pointsaty\", \"pointsatz\",\n \"limitingconeangle\", \"aria-hidden\", \"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"role\", \"focusable\",\n // Validated below: only in-document fragment references.\n \"href\", \"xlink:href\",\n]);\n\n/** Paint and reference values may point only at in-document fragments. */\nfunction hasExternalReference(value: string): boolean {\n // CSS escapes can spell url()/schemes without their literal bytes. Drawing\n // attributes do not need escapes, so reject them rather than parse CSS twice.\n if (value.includes(\"\\\\\")) return true;\n const compact = value.replace(/[\\u0000- ]/gu, \"\").toLowerCase();\n if (/(?:java|vb)script:|data:|expression\\(|@import|<|>/u.test(compact)) {\n return true;\n }\n for (const match of compact.matchAll(/url\\(([^)]*)\\)/gu)) {\n if (!/^[\"']?#[a-z0-9_.:-]+[\"']?$/u.test(match[1])) return true;\n }\n // CSS consumes an unterminated url() through EOF and browsers can still load\n // it. A balanced-match loop alone therefore misses an external paint server.\n return compact.replace(/url\\(([^)]*)\\)/gu, \"\").includes(\"url(\");\n}\n\n/**\n * Only UTF-8 is accepted: a UTF-16/32 byte order mark or a declared\n * non-UTF-8 encoding would make browsers read different markup than the\n * policy parsed.\n */\nfunction utf8SvgText(content: Buffer): string | null {\n const hasUtf8Bom =\n content[0] === 0xef && content[1] === 0xbb && content[2] === 0xbf;\n const body = hasUtf8Bom ? content.subarray(3) : content;\n if (\n (body[0] === 0xfe && body[1] === 0xff) ||\n (body[0] === 0xff && body[1] === 0xfe) ||\n (body[0] === 0x00 && body[1] === 0x00) ||\n body.includes(0x00)\n ) {\n return null;\n }\n const text = body.toString(\"utf8\");\n if (text.includes(\"\\uFFFD\")) return null;\n const declaration = /^<\\?xml\\b[^>]*\\?>/iu.exec(text);\n if (declaration) {\n const encoding = /\\bencoding\\s*=\\s*[\"']([^\"']*)[\"']/iu.exec(declaration[0]);\n if (encoding && !/^utf-?8$/iu.test(encoding[1].trim())) return null;\n } else if (/<\\?xml\\b/iu.test(text)) {\n // A declaration anywhere but the very start is malformed XML.\n return null;\n }\n return text;\n}\n\n/** True when an SVG uses only static, self-contained drawing features. */\nexport function isPassiveSvg(content: Uint8Array): boolean {\n const text = utf8SvgText(Buffer.from(content.buffer, content.byteOffset, content.byteLength));\n if (text === null) return false;\n let isPassive = true;\n let depth = 0;\n let sawRoot = false;\n // Start offsets of open elements: an implied close is legitimate only for\n // a self-closing tag (same token); otherwise the markup is malformed.\n const openStarts: Array<number> = [];\n const fail = () => {\n isPassive = false;\n };\n const parser = new Parser(\n {\n onopentag(name, attributes) {\n const element = name.toLowerCase();\n if (depth === 0) {\n if (sawRoot || element !== \"svg\") fail();\n sawRoot = true;\n }\n depth += 1;\n openStarts.push(parser.startIndex);\n // Prefixed names (`s:script`) are rejected outright: the allowlist\n // is defined for the SVG namespace only.\n if (element.includes(\":\") || !ALLOWED_ELEMENTS.has(element)) fail();\n for (const [rawName, value] of Object.entries(attributes)) {\n const attribute = rawName.toLowerCase();\n if (!ALLOWED_ATTRIBUTES.has(attribute)) {\n fail();\n continue;\n }\n if (attribute === \"xmlns\" && value !== SVG_NAMESPACE) fail();\n if (attribute === \"xmlns:xlink\" && value !== XLINK_NAMESPACE) fail();\n if (\n (attribute === \"href\" || attribute === \"xlink:href\") &&\n !/^#[A-Za-z0-9_.:-]+$/u.test(value.trim())\n ) {\n fail();\n }\n if (hasExternalReference(value)) fail();\n }\n },\n onclosetag(_name, isImplied) {\n depth -= 1;\n const start = openStarts.pop();\n if (isImplied && start !== parser.startIndex) fail();\n },\n // DOCTYPE (and with it custom entities) or any other declaration other\n // than the XML prolog.\n onprocessinginstruction(name) {\n if (name.toLowerCase() !== \"?xml\") fail();\n },\n oncdatastart: fail,\n ontext(value) { if (depth === 0 && value.trim()) fail(); },\n onerror: fail,\n },\n { xmlMode: true, decodeEntities: true, recognizeSelfClosing: true },\n );\n try {\n parser.write(text);\n parser.end();\n } catch {\n return false;\n }\n return isPassive && sawRoot && depth === 0;\n}\n"],"mappings":";AAaA,SAAS,cAAc;AAEvB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAGxB,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC/B;A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AAM;AAC5B,YAAI,KAAK,YAAY,MAAM,OAAQ,MAAK;AAAA,MAC1C;AAAA,MACA,cAAc;AAAA,MACd,OAAO,OAAO;AAAE,YAAI,UAAU,KAAK,MAAM,KAAK,EAAG,MAAK;AAAA,MAAG;AAAA,MACzD,SAAS;AAAA,IACX;AAAA,IACA,EAAE,SAAS,MAAM,gBAAgB,MAAM,sBAAsB,KAAK;AAAA,EACpE;AACA,MAAI;AACF,WAAO,MAAM,IAAI;AACjB,WAAO,IAAI;AAAA,EACb,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO,aAAa,WAAW,UAAU;AAC3C;","names":[]}
@@ -1,5 +1,5 @@
1
- import { h as MigrationCapture } from './url-run-BOZvcGs1.js';
2
- export { a as MigrationAsset, f as MigrationBundle, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, g as MigrationDocsConfig, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, d as MigrationFetcher, o as MigrationJournalAsset, b as MigrationNavigationGroup, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, M as MigrationPage, e as MigrationPlatform, c as MigrationWarning, R as RenderedMigrationFile, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-run-BOZvcGs1.js';
1
+ import { h as MigrationCapture } from './url-run-mSKFqHx_.js';
2
+ export { a as MigrationAsset, f as MigrationBundle, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, g as MigrationDocsConfig, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, d as MigrationFetcher, o as MigrationJournalAsset, b as MigrationNavigationGroup, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, M as MigrationPage, e as MigrationPlatform, c as MigrationWarning, R as RenderedMigrationFile, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-run-mSKFqHx_.js';
3
3
 
4
4
  interface UrlMigrationScope {
5
5
  scopePath: string;