@takumi-rs/helpers 2.0.0-beta.9 → 2.0.0-rc.0
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/html.cjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/{index-Da14nnwt.d.mts → index-CKbRJZ7J.d.mts} +12 -3
- package/dist/{index-D4LX37aN.d.cts → index-CSvKdbgc.d.cts} +12 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/jsx.cjs +1 -1
- package/dist/jsx.mjs +1 -1
- package/dist/markup-D58RlLsR.mjs +2 -0
- package/dist/markup-uM2dO3dn.cjs +2 -0
- package/package.json +1 -1
- package/dist/markup-CIGgTVBH.mjs +0 -2
- package/dist/markup-UWqQuGMA.cjs +0 -2
package/dist/html.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./markup-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./markup-uM2dO3dn.cjs");function n(n){let{nodes:r,stylesheets:i}=t.t(n);return r.length===0?{node:e.t({}),stylesheets:i}:r.length===1&&r[0]?{node:r[0],stylesheets:i}:{node:e.t({style:{width:e.a(100),height:e.a(100)},children:r}),stylesheets:i}}exports.fromHtml=n;
|
package/dist/html.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,t}from"./helpers-CVQCT1Rh.mjs";import{t as n}from"./markup-
|
|
1
|
+
import{a as e,t}from"./helpers-CVQCT1Rh.mjs";import{t as n}from"./markup-D58RlLsR.mjs";function r(r){let{nodes:i,stylesheets:a}=n(r);return i.length===0?{node:t({}),stylesheets:a}:i.length===1&&i[0]?{node:i[0],stylesheets:a}:{node:t({style:{width:e(100),height:e(100)},children:i}),stylesheets:a}}export{r as fromHtml};
|
|
@@ -9725,13 +9725,13 @@ type FontStyle = "normal" | "italic";
|
|
|
9725
9725
|
type WeightRange = `${number}..${number}`;
|
|
9726
9726
|
type AxisValue = number | WeightRange;
|
|
9727
9727
|
type KnownGoogleFontFamily = { [K in keyof GoogleFontCatalog]: {
|
|
9728
|
-
|
|
9728
|
+
name: K; /** `400`, `[400, 700]`, or a range like `"100..900"` for the variable font. @default 400 */
|
|
9729
9729
|
weight?: GoogleFontCatalog[K]["weight"] | GoogleFontCatalog[K]["weight"][] | WeightRange; /** `"normal"`, `"italic"`, or both. @default "normal" */
|
|
9730
9730
|
style?: GoogleFontCatalog[K]["style"] | GoogleFontCatalog[K]["style"][]; /** Variable axes to vary, each at a value or `"min..max"` range, e.g. `{ opsz: "14..32" }`. */
|
|
9731
9731
|
axes?: [GoogleFontCatalog[K]["axis"]] extends [never] ? never : Partial<Record<GoogleFontCatalog[K]["axis"], AxisValue>>;
|
|
9732
9732
|
} }[keyof GoogleFontCatalog];
|
|
9733
9733
|
type GoogleFontFamilyObject = KnownGoogleFontFamily | {
|
|
9734
|
-
|
|
9734
|
+
name: string;
|
|
9735
9735
|
weight?: number | number[] | WeightRange;
|
|
9736
9736
|
style?: FontStyle | FontStyle[];
|
|
9737
9737
|
axes?: Record<string, AxisValue>;
|
|
@@ -9776,6 +9776,15 @@ declare function subsetFonts<T>({
|
|
|
9776
9776
|
fonts: T[];
|
|
9777
9777
|
source: string | Node | Node[];
|
|
9778
9778
|
}): T[];
|
|
9779
|
+
/**
|
|
9780
|
+
* Turn a font URL into a loader: fetches the bytes on demand, keyed by the URL so repeated renders
|
|
9781
|
+
* dedupe. Family name, weight, and style come from the font file. Lets `fonts` take a bare URL
|
|
9782
|
+
* string, e.g. `fonts: ["https://example.com/Inter.woff2"]`.
|
|
9783
|
+
*/
|
|
9784
|
+
declare function fontFromUrl(url: string): {
|
|
9785
|
+
key: string;
|
|
9786
|
+
data: () => Promise<ArrayBuffer>;
|
|
9787
|
+
};
|
|
9779
9788
|
/** Apply {@link subsetFonts} unless `subset` is `false`. Passes `undefined` fonts through. */
|
|
9780
9789
|
declare function pickFonts<T>({
|
|
9781
9790
|
fonts,
|
|
@@ -9813,4 +9822,4 @@ declare function rem(rem: number): `${number}rem`;
|
|
|
9813
9822
|
declare function fr(fr: number): `${number}fr`;
|
|
9814
9823
|
declare function rgba(r: number, g: number, b: number, a?: number): `rgb(${number} ${number} ${number} / ${number})`;
|
|
9815
9824
|
//#endregion
|
|
9816
|
-
export {
|
|
9825
|
+
export { extractResourceUrls as C, FetchResourcesOptions as S, fetchResources as T, googleFonts as _, percentage as a, FetchLike as b, style as c, vw as d, FontSubset as f, fontFromUrl as g, collectCodepoints as h, image as i, text as l, GoogleFontsOptions as m, em as n, rem as o, GoogleFontFamily as p, fr as r, rgba as s, container as t, vh as u, pickFonts as v, fetchOk as w, FetchOptions as x, subsetFonts as y };
|
|
@@ -9725,13 +9725,13 @@ type FontStyle = "normal" | "italic";
|
|
|
9725
9725
|
type WeightRange = `${number}..${number}`;
|
|
9726
9726
|
type AxisValue = number | WeightRange;
|
|
9727
9727
|
type KnownGoogleFontFamily = { [K in keyof GoogleFontCatalog]: {
|
|
9728
|
-
|
|
9728
|
+
name: K; /** `400`, `[400, 700]`, or a range like `"100..900"` for the variable font. @default 400 */
|
|
9729
9729
|
weight?: GoogleFontCatalog[K]["weight"] | GoogleFontCatalog[K]["weight"][] | WeightRange; /** `"normal"`, `"italic"`, or both. @default "normal" */
|
|
9730
9730
|
style?: GoogleFontCatalog[K]["style"] | GoogleFontCatalog[K]["style"][]; /** Variable axes to vary, each at a value or `"min..max"` range, e.g. `{ opsz: "14..32" }`. */
|
|
9731
9731
|
axes?: [GoogleFontCatalog[K]["axis"]] extends [never] ? never : Partial<Record<GoogleFontCatalog[K]["axis"], AxisValue>>;
|
|
9732
9732
|
} }[keyof GoogleFontCatalog];
|
|
9733
9733
|
type GoogleFontFamilyObject = KnownGoogleFontFamily | {
|
|
9734
|
-
|
|
9734
|
+
name: string;
|
|
9735
9735
|
weight?: number | number[] | WeightRange;
|
|
9736
9736
|
style?: FontStyle | FontStyle[];
|
|
9737
9737
|
axes?: Record<string, AxisValue>;
|
|
@@ -9776,6 +9776,15 @@ declare function subsetFonts<T>({
|
|
|
9776
9776
|
fonts: T[];
|
|
9777
9777
|
source: string | Node | Node[];
|
|
9778
9778
|
}): T[];
|
|
9779
|
+
/**
|
|
9780
|
+
* Turn a font URL into a loader: fetches the bytes on demand, keyed by the URL so repeated renders
|
|
9781
|
+
* dedupe. Family name, weight, and style come from the font file. Lets `fonts` take a bare URL
|
|
9782
|
+
* string, e.g. `fonts: ["https://example.com/Inter.woff2"]`.
|
|
9783
|
+
*/
|
|
9784
|
+
declare function fontFromUrl(url: string): {
|
|
9785
|
+
key: string;
|
|
9786
|
+
data: () => Promise<ArrayBuffer>;
|
|
9787
|
+
};
|
|
9779
9788
|
/** Apply {@link subsetFonts} unless `subset` is `false`. Passes `undefined` fonts through. */
|
|
9780
9789
|
declare function pickFonts<T>({
|
|
9781
9790
|
fonts,
|
|
@@ -9813,4 +9822,4 @@ declare function rem(rem: number): `${number}rem`;
|
|
|
9813
9822
|
declare function fr(fr: number): `${number}fr`;
|
|
9814
9823
|
declare function rgba(r: number, g: number, b: number, a?: number): `rgb(${number} ${number} ${number} / ${number})`;
|
|
9815
9824
|
//#endregion
|
|
9816
|
-
export {
|
|
9825
|
+
export { extractResourceUrls as C, FetchResourcesOptions as S, fetchResources as T, googleFonts as _, percentage as a, FetchLike as b, style as c, vw as d, FontSubset as f, fontFromUrl as g, collectCodepoints as h, image as i, text as l, GoogleFontsOptions as m, em as n, rem as o, GoogleFontFamily as p, fr as r, rgba as s, container as t, vh as u, pickFonts as v, fetchOk as w, FetchOptions as x, subsetFonts as y };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=/url\(\s*(['"]?)(.*?)\1\s*\)/g;function n(e){return e.startsWith(`https://`)||e.startsWith(`http://`)}function r(e,i){if(typeof e==`string`)for(let r of e.matchAll(t)){let e=r[2]?.trim();e&&n(e)&&i.add(e)}else if(Array.isArray(e))for(let t of e)r(t,i)}function i(e){let t=new Set,i=e=>{let a=e=>{e&&(r(e.backgroundImage,t),r(e.maskImage,t))};if(a(e.style),a(e.preset),r(e.tw,t),e.type===`image`){typeof e.src==`string`&&n(e.src)&&t.add(e.src);return}if(e.type===`container`)for(let t of e.children??[])i(t)};return i(e),[...t]}async function a(e,t={}){let n=t.fetch??globalThis.fetch,r=t.timeout===void 0?t.init?.signal:AbortSignal.timeout(t.timeout),i=await n(e,{...t.init,signal:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText} fetching ${e}`);return i}async function o(e,t){let n=t?.throwOnError??!0,r=t?.timeout??5e3,i=[...new Set(e)].map(async e=>{if(t?.cache?.has(e)){let n=t.cache.get(e);if(n)return{src:e,data:n}}let n=await a(e,{fetch:t?.fetch,timeout:r}).then(e=>e.arrayBuffer());return t?.cache?.set(e,n),{src:e,data:n}});return n?Promise.all(i):(await Promise.allSettled(i)).filter(e=>e.status===`fulfilled`).map(e=>e.value)}function s(e,t,n,r){let i=new Map(r),a=n.includes(`italic`),o=a?n.includes(`normal`)?[0,1]:[1]:[void 0],s=[...a?[`ital`]:[],...i.keys(),`wght`].sort(),c=o.flatMap(e=>t.map(t=>s.map(n=>n===`ital`?String(e):n===`wght`?t:i.get(n)??``).join(`,`))).sort();return`${e}:${s.join(`,`)}@${c.join(`;`)}`}function c(e){let t=new URL(`https://fonts.googleapis.com/css2`);for(let n of e.families){if(typeof n==`string`){t.searchParams.append(`family`,s(n,[`400`],[`normal`],[]));continue}let e=n.weight??400,r=(Array.isArray(e)?[...e].sort((e,t)=>e-t):[e]).map(String),i=n.style??`normal`,a=(Array.isArray(i)?i:[i]).map(String),o=Object.entries(n.axes??{}).filter(([e])=>e!==`ital`&&e!==`wght`).map(([e,t])=>[e,String(t)]);t.searchParams.append(`family`,s(n.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=/url\(\s*(['"]?)(.*?)\1\s*\)/g;function n(e){return e.startsWith(`https://`)||e.startsWith(`http://`)}function r(e,i){if(typeof e==`string`)for(let r of e.matchAll(t)){let e=r[2]?.trim();e&&n(e)&&i.add(e)}else if(Array.isArray(e))for(let t of e)r(t,i)}function i(e){let t=new Set,i=e=>{let a=e=>{e&&(r(e.backgroundImage,t),r(e.maskImage,t))};if(a(e.style),a(e.preset),r(e.tw,t),e.type===`image`){typeof e.src==`string`&&n(e.src)&&t.add(e.src);return}if(e.type===`container`)for(let t of e.children??[])i(t)};return i(e),[...t]}async function a(e,t={}){let n=t.fetch??globalThis.fetch,r=t.timeout===void 0?t.init?.signal:AbortSignal.timeout(t.timeout),i=await n(e,{...t.init,signal:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText} fetching ${e}`);return i}async function o(e,t){let n=t?.throwOnError??!0,r=t?.timeout??5e3,i=[...new Set(e)].map(async e=>{if(t?.cache?.has(e)){let n=t.cache.get(e);if(n)return{src:e,data:n}}let n=await a(e,{fetch:t?.fetch,timeout:r}).then(e=>e.arrayBuffer());return t?.cache?.set(e,n),{src:e,data:n}});return n?Promise.all(i):(await Promise.allSettled(i)).filter(e=>e.status===`fulfilled`).map(e=>e.value)}function s(e,t,n,r){let i=new Map(r),a=n.includes(`italic`),o=a?n.includes(`normal`)?[0,1]:[1]:[void 0],s=[...a?[`ital`]:[],...i.keys(),`wght`].sort(),c=o.flatMap(e=>t.map(t=>s.map(n=>n===`ital`?String(e):n===`wght`?t:i.get(n)??``).join(`,`))).sort();return`${e}:${s.join(`,`)}@${c.join(`;`)}`}function c(e){let t=new URL(`https://fonts.googleapis.com/css2`);for(let n of e.families){if(typeof n==`string`){t.searchParams.append(`family`,s(n,[`400`],[`normal`],[]));continue}let e=n.weight??400,r=(Array.isArray(e)?[...e].sort((e,t)=>e-t):[e]).map(String),i=n.style??`normal`,a=(Array.isArray(i)?i:[i]).map(String),o=Object.entries(n.axes??{}).filter(([e])=>e!==`ital`&&e!==`wght`).map(([e,t])=>[e,String(t)]);t.searchParams.append(`family`,s(n.name,r,a,o))}return e.display&&t.searchParams.set(`display`,e.display),t.toString()}function l(e,t){return a(e,{...t,init:{headers:{"User-Agent":`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36`}}}).then(e=>e.text())}async function u(e,t){let n=t.cache?.get(e);if(n!==void 0)return n;let r=await l(e,t);return t.cache?.set(e,r),r}const d=/(?:\/\*\s*([^*]+?)\s*\*\/\s*)?@font-face\s*\{([^}]*)\}/g;function f(e,t){let n=`${e.family} ${e.subset}`,r=e.ranges.map(([e,t])=>`${e}-${t}`).join(`,`);return{name:n,subsetOf:e.family,key:`${n}:${e.weight??``}:${e.style??``}:${r}`,weight:e.weight,style:e.style,ranges:e.ranges,data:()=>a(e.url,t).then(e=>e.arrayBuffer())}}function p(e){let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^U\+/i,``);if(e)if(e.includes(`-`)){let[n,r]=e.split(`-`);n&&r&&t.push([parseInt(n,16),parseInt(r,16)])}else if(e.includes(`?`))t.push([parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]);else{let n=parseInt(e,16);t.push([n,n])}}return t}function m(e){let t=[],n=0;for(let r of e.matchAll(d)){let e=r[2];if(!e)continue;let i=e.match(/src:\s*url\(([^)]+)\)/)?.[1]?.replace(/['"]/g,``).trim(),a=e.match(/font-family:\s*['"]?([^'";]+)['"]?/)?.[1]?.trim();if(!i||!a)continue;let o=e.match(/unicode-range:\s*([^;]+)/)?.[1],s=e.match(/font-weight:\s*(\d+)(?:\s+(\d+))?/);t.push({family:a,subset:r[1]?.trim()||`subset-${n}`,url:i,weight:s&&!s[2]?Number(s[1]):void 0,style:e.match(/font-style:\s*([a-z]+)/i)?.[1],ranges:o?p(o):[]}),n+=1}return t}function h(e){let t=new Map;for(let n of e){let e=t.get(n.url)??new Set;e.add(n.weight),t.set(n.url,e)}let n=new Set,r=[];for(let i of e){if(n.has(i.url))continue;n.add(i.url);let e=(t.get(i.url)?.size??0)>1;r.push(e?{...i,weight:void 0}:i)}return r}function g(e){let t=new Set,n=e=>{for(let n of e)t.add(n.codePointAt(0))},r=e=>{e.type===`text`?n(e.text):e.type===`container`&&e.children?.forEach(r)};return typeof e==`string`?n(e):Array.isArray(e)?e.forEach(r):r(e),t}function _(e,t){if(e.length===0)return!0;for(let n of t)for(let[t,r]of e)if(n>=t&&n<=r)return!0;return!1}function v({fonts:e,source:t}){let n=g(t);return e.filter(e=>_(e.ranges??[],n))}function y(e){return{key:e,data:()=>a(e).then(e=>e.arrayBuffer())}}function b({fonts:e,source:t,subset:n}){return e&&n!==!1?v({fonts:e,source:t}):e}async function x(e){return e.families.length===0?[]:h(m(await u(c(e),e))).map(t=>f(t,e))}exports.collectCodepoints=g,exports.container=e.t,exports.em=e.n,exports.extractResourceUrls=i,exports.fetchOk=a,exports.fetchResources=o,exports.fontFromUrl=y,exports.fr=e.r,exports.googleFonts=x,exports.image=e.i,exports.percentage=e.a,exports.pickFonts=b,exports.rem=e.o,exports.rgba=e.s,exports.style=e.c,exports.subsetFonts=v,exports.text=e.l,exports.vh=e.u,exports.vw=e.d;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as NodeMetadata, c as TextNode, i as NodeAttributes, n as ImageNode, o as ReactElementLike, r as Node, s as TextFit, t as ContainerNode } from "./types-xgX3CGse.cjs";
|
|
2
|
-
import { C as
|
|
3
|
-
export { ContainerNode, FetchLike, FetchOptions, FetchResourcesOptions, FontSubset, GoogleFontFamily, GoogleFontsOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextFit, TextNode, collectCodepoints, container, em, extractResourceUrls, fetchOk, fetchResources, fr, googleFonts, image, percentage, pickFonts, rem, rgba, style, subsetFonts, text, vh, vw };
|
|
2
|
+
import { C as extractResourceUrls, S as FetchResourcesOptions, T as fetchResources, _ as googleFonts, a as percentage, b as FetchLike, c as style, d as vw, f as FontSubset, g as fontFromUrl, h as collectCodepoints, i as image, l as text, m as GoogleFontsOptions, n as em, o as rem, p as GoogleFontFamily, r as fr, s as rgba, t as container, u as vh, v as pickFonts, w as fetchOk, x as FetchOptions, y as subsetFonts } from "./index-CSvKdbgc.cjs";
|
|
3
|
+
export { ContainerNode, FetchLike, FetchOptions, FetchResourcesOptions, FontSubset, GoogleFontFamily, GoogleFontsOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextFit, TextNode, collectCodepoints, container, em, extractResourceUrls, fetchOk, fetchResources, fontFromUrl, fr, googleFonts, image, percentage, pickFonts, rem, rgba, style, subsetFonts, text, vh, vw };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as NodeMetadata, c as TextNode, i as NodeAttributes, n as ImageNode, o as ReactElementLike, r as Node, s as TextFit, t as ContainerNode } from "./types-xgX3CGse.mjs";
|
|
2
|
-
import { C as
|
|
3
|
-
export { ContainerNode, FetchLike, FetchOptions, FetchResourcesOptions, FontSubset, GoogleFontFamily, GoogleFontsOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextFit, TextNode, collectCodepoints, container, em, extractResourceUrls, fetchOk, fetchResources, fr, googleFonts, image, percentage, pickFonts, rem, rgba, style, subsetFonts, text, vh, vw };
|
|
2
|
+
import { C as extractResourceUrls, S as FetchResourcesOptions, T as fetchResources, _ as googleFonts, a as percentage, b as FetchLike, c as style, d as vw, f as FontSubset, g as fontFromUrl, h as collectCodepoints, i as image, l as text, m as GoogleFontsOptions, n as em, o as rem, p as GoogleFontFamily, r as fr, s as rgba, t as container, u as vh, v as pickFonts, w as fetchOk, x as FetchOptions, y as subsetFonts } from "./index-CKbRJZ7J.mjs";
|
|
3
|
+
export { ContainerNode, FetchLike, FetchOptions, FetchResourcesOptions, FontSubset, GoogleFontFamily, GoogleFontsOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, TextFit, TextNode, collectCodepoints, container, em, extractResourceUrls, fetchOk, fetchResources, fontFromUrl, fr, googleFonts, image, percentage, pickFonts, rem, rgba, style, subsetFonts, text, vh, vw };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./helpers-CVQCT1Rh.mjs";const d=/url\(\s*(['"]?)(.*?)\1\s*\)/g;function f(e){return e.startsWith(`https://`)||e.startsWith(`http://`)}function p(e,t){if(typeof e==`string`)for(let n of e.matchAll(d)){let e=n[2]?.trim();e&&f(e)&&t.add(e)}else if(Array.isArray(e))for(let n of e)p(n,t)}function m(e){let t=new Set,n=e=>{let r=e=>{e&&(p(e.backgroundImage,t),p(e.maskImage,t))};if(r(e.style),r(e.preset),p(e.tw,t),e.type===`image`){typeof e.src==`string`&&f(e.src)&&t.add(e.src);return}if(e.type===`container`)for(let t of e.children??[])n(t)};return n(e),[...t]}async function h(e,t={}){let n=t.fetch??globalThis.fetch,r=t.timeout===void 0?t.init?.signal:AbortSignal.timeout(t.timeout),i=await n(e,{...t.init,signal:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText} fetching ${e}`);return i}async function g(e,t){let n=t?.throwOnError??!0,r=t?.timeout??5e3,i=[...new Set(e)].map(async e=>{if(t?.cache?.has(e)){let n=t.cache.get(e);if(n)return{src:e,data:n}}let n=await h(e,{fetch:t?.fetch,timeout:r}).then(e=>e.arrayBuffer());return t?.cache?.set(e,n),{src:e,data:n}});return n?Promise.all(i):(await Promise.allSettled(i)).filter(e=>e.status===`fulfilled`).map(e=>e.value)}function _(e,t,n,r){let i=new Map(r),a=n.includes(`italic`),o=a?n.includes(`normal`)?[0,1]:[1]:[void 0],s=[...a?[`ital`]:[],...i.keys(),`wght`].sort(),c=o.flatMap(e=>t.map(t=>s.map(n=>n===`ital`?String(e):n===`wght`?t:i.get(n)??``).join(`,`))).sort();return`${e}:${s.join(`,`)}@${c.join(`;`)}`}function v(e){let t=new URL(`https://fonts.googleapis.com/css2`);for(let n of e.families){if(typeof n==`string`){t.searchParams.append(`family`,_(n,[`400`],[`normal`],[]));continue}let e=n.weight??400,r=(Array.isArray(e)?[...e].sort((e,t)=>e-t):[e]).map(String),i=n.style??`normal`,a=(Array.isArray(i)?i:[i]).map(String),o=Object.entries(n.axes??{}).filter(([e])=>e!==`ital`&&e!==`wght`).map(([e,t])=>[e,String(t)]);t.searchParams.append(`family`,_(n.
|
|
1
|
+
import{a as e,c as t,d as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./helpers-CVQCT1Rh.mjs";const d=/url\(\s*(['"]?)(.*?)\1\s*\)/g;function f(e){return e.startsWith(`https://`)||e.startsWith(`http://`)}function p(e,t){if(typeof e==`string`)for(let n of e.matchAll(d)){let e=n[2]?.trim();e&&f(e)&&t.add(e)}else if(Array.isArray(e))for(let n of e)p(n,t)}function m(e){let t=new Set,n=e=>{let r=e=>{e&&(p(e.backgroundImage,t),p(e.maskImage,t))};if(r(e.style),r(e.preset),p(e.tw,t),e.type===`image`){typeof e.src==`string`&&f(e.src)&&t.add(e.src);return}if(e.type===`container`)for(let t of e.children??[])n(t)};return n(e),[...t]}async function h(e,t={}){let n=t.fetch??globalThis.fetch,r=t.timeout===void 0?t.init?.signal:AbortSignal.timeout(t.timeout),i=await n(e,{...t.init,signal:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText} fetching ${e}`);return i}async function g(e,t){let n=t?.throwOnError??!0,r=t?.timeout??5e3,i=[...new Set(e)].map(async e=>{if(t?.cache?.has(e)){let n=t.cache.get(e);if(n)return{src:e,data:n}}let n=await h(e,{fetch:t?.fetch,timeout:r}).then(e=>e.arrayBuffer());return t?.cache?.set(e,n),{src:e,data:n}});return n?Promise.all(i):(await Promise.allSettled(i)).filter(e=>e.status===`fulfilled`).map(e=>e.value)}function _(e,t,n,r){let i=new Map(r),a=n.includes(`italic`),o=a?n.includes(`normal`)?[0,1]:[1]:[void 0],s=[...a?[`ital`]:[],...i.keys(),`wght`].sort(),c=o.flatMap(e=>t.map(t=>s.map(n=>n===`ital`?String(e):n===`wght`?t:i.get(n)??``).join(`,`))).sort();return`${e}:${s.join(`,`)}@${c.join(`;`)}`}function v(e){let t=new URL(`https://fonts.googleapis.com/css2`);for(let n of e.families){if(typeof n==`string`){t.searchParams.append(`family`,_(n,[`400`],[`normal`],[]));continue}let e=n.weight??400,r=(Array.isArray(e)?[...e].sort((e,t)=>e-t):[e]).map(String),i=n.style??`normal`,a=(Array.isArray(i)?i:[i]).map(String),o=Object.entries(n.axes??{}).filter(([e])=>e!==`ital`&&e!==`wght`).map(([e,t])=>[e,String(t)]);t.searchParams.append(`family`,_(n.name,r,a,o))}return e.display&&t.searchParams.set(`display`,e.display),t.toString()}function y(e,t){return h(e,{...t,init:{headers:{"User-Agent":`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36`}}}).then(e=>e.text())}async function b(e,t){let n=t.cache?.get(e);if(n!==void 0)return n;let r=await y(e,t);return t.cache?.set(e,r),r}const x=/(?:\/\*\s*([^*]+?)\s*\*\/\s*)?@font-face\s*\{([^}]*)\}/g;function S(e,t){let n=`${e.family} ${e.subset}`,r=e.ranges.map(([e,t])=>`${e}-${t}`).join(`,`);return{name:n,subsetOf:e.family,key:`${n}:${e.weight??``}:${e.style??``}:${r}`,weight:e.weight,style:e.style,ranges:e.ranges,data:()=>h(e.url,t).then(e=>e.arrayBuffer())}}function C(e){let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^U\+/i,``);if(e)if(e.includes(`-`)){let[n,r]=e.split(`-`);n&&r&&t.push([parseInt(n,16),parseInt(r,16)])}else if(e.includes(`?`))t.push([parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]);else{let n=parseInt(e,16);t.push([n,n])}}return t}function w(e){let t=[],n=0;for(let r of e.matchAll(x)){let e=r[2];if(!e)continue;let i=e.match(/src:\s*url\(([^)]+)\)/)?.[1]?.replace(/['"]/g,``).trim(),a=e.match(/font-family:\s*['"]?([^'";]+)['"]?/)?.[1]?.trim();if(!i||!a)continue;let o=e.match(/unicode-range:\s*([^;]+)/)?.[1],s=e.match(/font-weight:\s*(\d+)(?:\s+(\d+))?/);t.push({family:a,subset:r[1]?.trim()||`subset-${n}`,url:i,weight:s&&!s[2]?Number(s[1]):void 0,style:e.match(/font-style:\s*([a-z]+)/i)?.[1],ranges:o?C(o):[]}),n+=1}return t}function T(e){let t=new Map;for(let n of e){let e=t.get(n.url)??new Set;e.add(n.weight),t.set(n.url,e)}let n=new Set,r=[];for(let i of e){if(n.has(i.url))continue;n.add(i.url);let e=(t.get(i.url)?.size??0)>1;r.push(e?{...i,weight:void 0}:i)}return r}function E(e){let t=new Set,n=e=>{for(let n of e)t.add(n.codePointAt(0))},r=e=>{e.type===`text`?n(e.text):e.type===`container`&&e.children?.forEach(r)};return typeof e==`string`?n(e):Array.isArray(e)?e.forEach(r):r(e),t}function D(e,t){if(e.length===0)return!0;for(let n of t)for(let[t,r]of e)if(n>=t&&n<=r)return!0;return!1}function O({fonts:e,source:t}){let n=E(t);return e.filter(e=>D(e.ranges??[],n))}function k(e){return{key:e,data:()=>h(e).then(e=>e.arrayBuffer())}}function A({fonts:e,source:t,subset:n}){return e&&n!==!1?O({fonts:e,source:t}):e}async function j(e){return e.families.length===0?[]:T(w(await b(v(e),e))).map(t=>S(t,e))}export{E as collectCodepoints,l as container,a as em,m as extractResourceUrls,h as fetchOk,g as fetchResources,k as fontFromUrl,s as fr,j as googleFonts,r as image,e as percentage,A as pickFonts,o as rem,c as rgba,t as style,O as subsetFonts,i as text,u as vh,n as vw};
|
package/dist/jsx.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./markup-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./markup-uM2dO3dn.cjs");function n(e){return typeof e==`string`||typeof e==`number`}function r(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function i(e){let n=[];for(let r in e)Object.hasOwn(e,r)&&n.push(`${t.n(r)}:${String(e[r]).trim()}`);return n.join(`;`)}const a=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function o(e,n){if(e===`children`||n==null)return;let o;if(o=e===`className`?`class`:a.has(e)?t.n(e):e,typeof n==`boolean`)return`${o}="${String(n)}"`;if(e===`style`&&typeof n==`object`){let e=i(n);if(e)return`style="${r(e)}"`}return`${o}="${r(String(n))}"`}function s(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=o(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const c=(e,n,r)=>{let i=e.props||{};if(t.r(e.type)){l(e.type(e.props),n,!1);return}if(typeof e.type==`symbol`||typeof e.type!=`string`)return;n.push(`<`,e.type),s(i,n,r&&e.type===`svg`);let a=i.children;n.push(`>`),l(a,n,!1),n.push(`</`,e.type,`>`)};function l(e,r,i){if(!(e==null||e===!1)){if(n(e)){r.push(String(e));return}if(Array.isArray(e)){for(let t of e)l(t,r,!1);return}t.l(e)&&c(e,r,i)}}function u(e){let t=[];return l(e,t,!0),t.join(``)}function d(){return{nodes:[],stylesheets:[]}}const f=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let p,m;async function h(n,r){let i={defaultStyles:_(r),presets:t.d(r?.defaultStyles),tailwindClassesProperty:r?.tailwindClassesProperty??`tw`},a=await g(n,i).catch(async e=>{if(!y(e))throw e;return await O(n,i)||g(n,i)}),o=a.nodes,s;return s=o.length===0?e.t({}):o.length===1&&o[0]!==void 0?o[0]:e.t({children:o,style:{width:e.a(100),height:e.a(100)}}),{node:s,stylesheets:a.stylesheets}}async function g(n,r){return n==null||n===!1?d():n instanceof Promise?g(await n,r):typeof n==`object`&&Symbol.iterator in n?B(n,r):t.l(n)?await N(n,r):{nodes:[e.l({text:String(n),preset:r.presets?.span})],stylesheets:[]}}function _(e){return e&&`defaultStyles`in e?e.defaultStyles??t.f:t.f}function v(e){return!t.l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function y(e){return e instanceof Error?f.some(t=>t.test(e.message)):!1}async function b(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&f.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function x(e,t,n){return b(()=>g(e(t),n))}function S(e,n){if(!(typeof e.type!=`object`||e.type===null)){if(t.o(e.type)&&`render`in e.type){let t=e.type;return x(e=>t.render(e,null),e.props,n)}if(t.c(e.type)&&`type`in e.type){let r=e.type.type;return t.r(r)?x(r,e.props,n):N({...e,type:r},n)}}}function C(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function w(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function T(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function E(){return m??=import(`react`).then(e=>{let t=e.default??e;return w(t)?t:null}).catch(()=>null),m}async function D(){return p??=import(`react-dom/server`).then(e=>{let t=e.default??e;return T(t)?t:null}).catch(()=>null),p}async function O(e,n){let[r,i]=await Promise.all([E(),D()]);return!r||!i?null:t.t(i.renderToStaticMarkup(r.createElement(r.Fragment??void 0,null,e)),{defaultStyles:n.defaultStyles,tailwindClassesProperty:n.tailwindClassesProperty})}function k(e){if(!t.l(e))return;let n=C(e);if(typeof n==`string`)return n;if(typeof n==`number`)return String(n);if(Array.isArray(n)||typeof n==`object`&&n&&Symbol.iterator in n)return M(n);if(t.l(n)&&t.s(n))return k(n)}function A(e){let t=[];for(let n of e){let e=j(n);if(e===void 0)return;t.push(e)}return t.join(``)}function j(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return A(e);if(!t.l(e))return;if(t.s(e))return j(C(e));let n=C(e);return n===void 0?``:typeof n==`object`&&n&&Symbol.iterator in n?A(n):j(n)}function M(e){let n=[];for(let r of e){if(t.l(r))return;if(typeof r==`string`){n.push(r);continue}if(typeof r==`number`){n.push(String(r));continue}return}return n.join(``)}async function N(n,r){if(v(n))return await O(n,r)||z(n,r);if(t.r(n.type))return x(n.type,n.props,r);let i=S(n,r);if(i!==void 0)return i;if(t.s(n))return z(n,r);if(t.i(n,`style`)){let e=j(C(n));return{nodes:[],stylesheets:e&&e.length>0?[e]:[]}}if(typeof n.type!=`string`||t.a(n.type))return d();let a=R(n,r);if(t.i(n,`br`))return{nodes:[e.l({text:`
|
|
2
2
|
`,preset:r.presets?.span,...a})],stylesheets:[]};if(t.i(n,`img`))return{nodes:[P(n,r)],stylesheets:[]};if(t.i(n,`svg`))return{nodes:[F(n,r)],stylesheets:[]};let o=k(n);if(o!==void 0)return{nodes:[e.l({text:o,...a})],stylesheets:[]};let s=await z(n,r);return{nodes:[e.t({children:s.nodes,...a})],stylesheets:s.stylesheets}}function P(t,n){if(!t.props.src)throw Error(`Image element must have a 'src' prop.`);let r=R(t,n),i=t.props.width===void 0?void 0:Number(t.props.width),a=t.props.height===void 0?void 0:Number(t.props.height);return e.i({src:t.props.src,width:i,height:a,...r})}function F(t,n){let r=R(t,n);return e.i({src:u(t),width:t.props.width===void 0?void 0:Number(t.props.width),height:t.props.height===void 0?void 0:Number(t.props.height),...r})}function I(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function L(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function R(e,n){let r=e.props,{preset:i,style:a}=I(e,n),o=L(e,n),s=t.u(r,n.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:r.className??r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:s,tw:o,style:a,preset:i}}function z(e,t){let n=C(e);return n===void 0?Promise.resolve(d()):g(n,t)}async function B(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=g(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}exports.defaultStylePresets=t.f,exports.fromJsx=h;
|
package/dist/jsx.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,l as n,t as r}from"./helpers-CVQCT1Rh.mjs";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./markup-
|
|
1
|
+
import{a as e,i as t,l as n,t as r}from"./helpers-CVQCT1Rh.mjs";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./markup-D58RlLsR.mjs";function g(e){return typeof e==`string`||typeof e==`number`}function _(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function v(e){let t=[];for(let n in e)Object.hasOwn(e,n)&&t.push(`${u(n)}:${String(e[n]).trim()}`);return t.join(`;`)}const y=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function b(e,t){if(e===`children`||t==null)return;let n;if(n=e===`className`?`class`:y.has(e)?u(e):e,typeof t==`boolean`)return`${n}="${String(t)}"`;if(e===`style`&&typeof t==`object`){let e=v(t);if(e)return`style="${_(e)}"`}return`${n}="${_(String(t))}"`}function x(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=b(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const S=(e,t,n)=>{let r=e.props||{};if(f(e.type)){C(e.type(e.props),t,!1);return}if(typeof e.type==`symbol`||typeof e.type!=`string`)return;t.push(`<`,e.type),x(r,t,n&&e.type===`svg`);let i=r.children;t.push(`>`),C(i,t,!1),t.push(`</`,e.type,`>`)};function C(e,t,n){if(!(e==null||e===!1)){if(g(e)){t.push(String(e));return}if(Array.isArray(e)){for(let n of e)C(n,t,!1);return}l(e)&&S(e,t,n)}}function w(e){let t=[];return C(e,t,!0),t.join(``)}function T(){return{nodes:[],stylesheets:[]}}const E=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let D,O;async function k(t,n){let i={defaultStyles:j(n),presets:o(n?.defaultStyles),tailwindClassesProperty:n?.tailwindClassesProperty??`tw`},a=await A(t,i).catch(async e=>{if(!N(e))throw e;return await H(t,i)||A(t,i)}),s=a.nodes,c;return c=s.length===0?r({}):s.length===1&&s[0]!==void 0?s[0]:r({children:s,style:{width:e(100),height:e(100)}}),{node:c,stylesheets:a.stylesheets}}async function A(e,t){return e==null||e===!1?T():e instanceof Promise?A(await e,t):typeof e==`object`&&Symbol.iterator in e?ee(e,t):l(e)?await q(e,t):{nodes:[n({text:String(e),preset:t.presets?.span})],stylesheets:[]}}function j(e){return e&&`defaultStyles`in e?e.defaultStyles??s:s}function M(e){return!l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function N(e){return e instanceof Error?E.some(t=>t.test(e.message)):!1}async function P(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&E.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function F(e,t,n){return P(()=>A(e(t),n))}function I(e,t){if(!(typeof e.type!=`object`||e.type===null)){if(d(e.type)&&`render`in e.type){let n=e.type;return F(e=>n.render(e,null),e.props,t)}if(a(e.type)&&`type`in e.type){let n=e.type.type;return f(n)?F(n,e.props,t):q({...e,type:n},t)}}}function L(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function R(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function z(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function B(){return O??=import(`react`).then(e=>{let t=e.default??e;return R(t)?t:null}).catch(()=>null),O}async function V(){return D??=import(`react-dom/server`).then(e=>{let t=e.default??e;return z(t)?t:null}).catch(()=>null),D}async function H(e,t){let[n,r]=await Promise.all([B(),V()]);return!n||!r?null:m(r.renderToStaticMarkup(n.createElement(n.Fragment??void 0,null,e)),{defaultStyles:t.defaultStyles,tailwindClassesProperty:t.tailwindClassesProperty})}function U(e){if(!l(e))return;let t=L(e);if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(Array.isArray(t)||typeof t==`object`&&t&&Symbol.iterator in t)return K(t);if(l(t)&&p(t))return U(t)}function W(e){let t=[];for(let n of e){let e=G(n);if(e===void 0)return;t.push(e)}return t.join(``)}function G(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return W(e);if(!l(e))return;if(p(e))return G(L(e));let t=L(e);return t===void 0?``:typeof t==`object`&&t&&Symbol.iterator in t?W(t):G(t)}function K(e){let t=[];for(let n of e){if(l(n))return;if(typeof n==`string`){t.push(n);continue}if(typeof n==`number`){t.push(String(n));continue}return}return t.join(``)}async function q(e,t){if(M(e))return await H(e,t)||$(e,t);if(f(e.type))return F(e.type,e.props,t);let a=I(e,t);if(a!==void 0)return a;if(p(e))return $(e,t);if(c(e,`style`)){let t=G(L(e));return{nodes:[],stylesheets:t&&t.length>0?[t]:[]}}if(typeof e.type!=`string`||i(e.type))return T();let o=Q(e,t);if(c(e,`br`))return{nodes:[n({text:`
|
|
2
2
|
`,preset:t.presets?.span,...o})],stylesheets:[]};if(c(e,`img`))return{nodes:[J(e,t)],stylesheets:[]};if(c(e,`svg`))return{nodes:[Y(e,t)],stylesheets:[]};let s=U(e);if(s!==void 0)return{nodes:[n({text:s,...o})],stylesheets:[]};let l=await $(e,t);return{nodes:[r({children:l.nodes,...o})],stylesheets:l.stylesheets}}function J(e,n){if(!e.props.src)throw Error(`Image element must have a 'src' prop.`);let r=Q(e,n),i=e.props.width===void 0?void 0:Number(e.props.width),a=e.props.height===void 0?void 0:Number(e.props.height);return t({src:e.props.src,width:i,height:a,...r})}function Y(e,n){let r=Q(e,n);return t({src:w(e),width:e.props.width===void 0?void 0:Number(e.props.width),height:e.props.height===void 0?void 0:Number(e.props.height),...r})}function X(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function Z(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function Q(e,t){let n=e.props,{preset:r,style:i}=X(e,t),a=Z(e,t),o=h(n,t.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:n.className??n.class,id:n.id,dir:n.dir,lang:n.lang,attributes:o,tw:a,style:i,preset:r}}function $(e,t){let n=L(e);return n===void 0?Promise.resolve(T()):A(n,t)}async function ee(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=A(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}export{s as defaultStylePresets,k as fromJsx};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,l as t,t as n}from"./helpers-CVQCT1Rh.mjs";const r={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},noscript:{display:`none`},datalist:{display:`none`},template:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figure:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figcaption:{display:`block`},address:{fontStyle:`italic`,display:`block`},article:{display:`block`},aside:{display:`block`},footer:{display:`block`},header:{display:`block`},hgroup:{display:`block`},main:{display:`block`},nav:{display:`block`},section:{display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},ul:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},ol:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},menu:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},li:{display:`block`},dl:{marginTop:`1em`,marginBottom:`1em`,display:`block`},dt:{display:`block`},dd:{marginLeft:40,display:`block`},form:{display:`block`},fieldset:{marginLeft:2,marginRight:2,paddingTop:`0.35em`,paddingRight:`0.75em`,paddingBottom:`0.625em`,paddingLeft:`0.75em`,borderWidth:2,display:`block`},legend:{paddingLeft:2,paddingRight:2,display:`block`},details:{display:`block`},summary:{display:`block`},search:{display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},ins:{textDecoration:`underline`},strong:{fontWeight:`bolder`},b:{fontWeight:`bolder`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},cite:{fontStyle:`italic`},dfn:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},samp:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,whiteSpace:`pre`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`larger`},small:{fontSize:`smaller`},s:{textDecoration:`line-through`},del:{textDecoration:`line-through`},sub:{fontSize:`smaller`,verticalAlign:`sub`},sup:{fontSize:`smaller`,verticalAlign:`super`},div:{display:`block`}};function i(e){if(e!==!1)return e??r}function a(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var o=Symbol(`Fragment`),s=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),c=new Set([`script`,`style`]),l=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,u=/[\@\.a-z0-9_\:\-]/i;function d(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let c=e[s];n===`none`?u.test(c)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):c===`=`&&r&&(n=`value`):n===`key`?u.test(c)||(r=e.substring(a,s),n=c===`=`?`value`:`none`):c===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(c===`"`||c===`'`)&&!o&&(a=s+1,o=c)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function f(e){let t=typeof e==`string`?e:e.value,n,r,i,a,o,u,f,p,m,h=[];l.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){a=t.substring(g,l.lastIndex-i[0].length),a&&r.children.push({type:2,value:a,parent:r})}for(;i=l.exec(t);){if(u=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],c.has(r.name)&&i[2]!==r.name){o=l.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(u===`<!--`){if(o=l.lastIndex-i[0].length,c.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(u===`<!`)o=l.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),c.has(r.name)){g=l.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:d(i[3]),parent:r,children:[],loc:[{start:l.lastIndex-i[0].length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||s.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}),a=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:a,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}));g=l.lastIndex}return a=t.slice(g),r.children.push({type:2,value:a,parent:r}),n}var p=Symbol(`HTMLString`),m=Symbol(`AttrString`),h=Symbol(`RenderFn`);function g(e,t=[p]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var _={"&":`&`,"<":`<`,">":`>`};function v(e){return e.replace(/[&<>]/g,e=>_[e]||e)}function y(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return g(t,[p,m])}function b(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function x(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>S(e)).join(``);if(h in e){let t=e[h](n,g(r));return t&&t[p]?t.value:v(String(t))}if(t===o)return r;let i=b(e);return i||s.has(t)?`<${e.name}${y(n).value}${i?` /`:``}>`:`<${e.name}${y(n).value}>${r}</${e.name}>`}function S(e){switch(e.type){case 0:return e.children.map(e=>S(e)).join(``);case 1:return x(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const C=new Set([`head`,`meta`,`link`,`style`,`script`]);function w(e){return C.has(e)}function T(e,t){return e.type===t&&`props`in e}function E(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function D(e){return typeof e==`object`&&!!e&&`type`in e}function O(e){return typeof e==`function`}const k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.fragment`);function M(e){return e.$$typeof===k}function N(e){return e.$$typeof===A}function P(e){return e.type===j}function F(e,t){let n=f(e),r={nodes:[],stylesheets:[]},a=i(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of n.children)I(e,a,o,r.nodes,r.stylesheets);return r}function I(r,i,a,o,s){if(r.type===3)return;if(r.type===2){let e=r.value??``;e&&o.push(t({text:e,preset:i?.span}));return}if(r.type===0){for(let e of r.children)I(e,i,a,o,s);return}if(r.type!==1)return;let c=r;if(c.name===`style`){let e=``;for(let t of c.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&s.push(e);return}let l=L(c,i,a);if(c.name===`br`){o.push(t({text:`
|
|
2
|
+
`,preset:i?.span,...l}));return}if(c.name===`img`){let t=c.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);o.push(e({src:t,width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}if(w(c.name))return;if(c.name===`svg`){o.push(e({src:S(c),width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}let u=!0,d=``;for(let e of c.children)if(e.type!==3){if(e.type!==2){u=!1;break}d+=e.value??``}if(u&&d){o.push(t({text:d,...l}));return}let f=[];for(let e of c.children)I(e,i,a,f,s);o.push(n({children:f,...l}))}function L(e,t,n){let r=e.attributes?R(e.attributes):{},i=typeof r.style==`string`?H(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=z(r))}return t}function z(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?B(Number(t))??e:n?B(Number.parseInt(n,16))??e:V[r]??e):e}function B(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const V={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function H(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[U(i)]=a)}return Object.keys(t).length>0?t:void 0}function U(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function W(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{w as a,N as c,i as d,r as f,T as i,D as l,E as n,M as o,O as r,P as s,F as t,a as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./helpers-4kGcvc-Q.cjs"),t={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},noscript:{display:`none`},datalist:{display:`none`},template:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figure:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figcaption:{display:`block`},address:{fontStyle:`italic`,display:`block`},article:{display:`block`},aside:{display:`block`},footer:{display:`block`},header:{display:`block`},hgroup:{display:`block`},main:{display:`block`},nav:{display:`block`},section:{display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},ul:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},ol:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},menu:{marginTop:`1em`,marginBottom:`1em`,paddingLeft:40,display:`block`},li:{display:`block`},dl:{marginTop:`1em`,marginBottom:`1em`,display:`block`},dt:{display:`block`},dd:{marginLeft:40,display:`block`},form:{display:`block`},fieldset:{marginLeft:2,marginRight:2,paddingTop:`0.35em`,paddingRight:`0.75em`,paddingBottom:`0.625em`,paddingLeft:`0.75em`,borderWidth:2,display:`block`},legend:{paddingLeft:2,paddingRight:2,display:`block`},details:{display:`block`},summary:{display:`block`},search:{display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},ins:{textDecoration:`underline`},strong:{fontWeight:`bolder`},b:{fontWeight:`bolder`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},cite:{fontStyle:`italic`},dfn:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},samp:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,whiteSpace:`pre`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`larger`},small:{fontSize:`smaller`},s:{textDecoration:`line-through`},del:{textDecoration:`line-through`},sub:{fontSize:`smaller`,verticalAlign:`sub`},sup:{fontSize:`smaller`,verticalAlign:`super`},div:{display:`block`}};function n(e){if(e!==!1)return e??t}function r(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var i=Symbol(`Fragment`),a=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),o=new Set([`script`,`style`]),s=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,c=/[\@\.a-z0-9_\:\-]/i;function l(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let l=e[s];n===`none`?c.test(l)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):l===`=`&&r&&(n=`value`):n===`key`?c.test(l)||(r=e.substring(a,s),n=l===`=`?`value`:`none`):l===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(l===`"`||l===`'`)&&!o&&(a=s+1,o=l)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function u(e){let t=typeof e==`string`?e:e.value,n,r,i,c,u,d,f,p,m,h=[];s.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){c=t.substring(g,s.lastIndex-i[0].length),c&&r.children.push({type:2,value:c,parent:r})}for(;i=s.exec(t);){if(d=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],o.has(r.name)&&i[2]!==r.name){u=s.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(d===`<!--`){if(u=s.lastIndex-i[0].length,o.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(d===`<!`)u=s.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),o.has(r.name)){g=s.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:l(i[3]),parent:r,children:[],loc:[{start:s.lastIndex-i[0].length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||a.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}),c=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:c,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}));g=s.lastIndex}return c=t.slice(g),r.children.push({type:2,value:c,parent:r}),n}var d=Symbol(`HTMLString`),f=Symbol(`AttrString`),p=Symbol(`RenderFn`);function m(e,t=[d]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var h={"&":`&`,"<":`<`,">":`>`};function g(e){return e.replace(/[&<>]/g,e=>h[e]||e)}function _(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return m(t,[d,f])}function v(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function y(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>b(e)).join(``);if(p in e){let t=e[p](n,m(r));return t&&t[d]?t.value:g(String(t))}if(t===i)return r;let o=v(e);return o||a.has(t)?`<${e.name}${_(n).value}${o?` /`:``}>`:`<${e.name}${_(n).value}>${r}</${e.name}>`}function b(e){switch(e.type){case 0:return e.children.map(e=>b(e)).join(``);case 1:return y(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const x=new Set([`head`,`meta`,`link`,`style`,`script`]);function S(e){return x.has(e)}function C(e,t){return e.type===t&&`props`in e}function w(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function T(e){return typeof e==`object`&&!!e&&`type`in e}function E(e){return typeof e==`function`}const D=Symbol.for(`react.forward_ref`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.fragment`);function A(e){return e.$$typeof===D}function j(e){return e.$$typeof===O}function M(e){return e.type===k}function N(e,t){let r=u(e),i={nodes:[],stylesheets:[]},a=n(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of r.children)P(e,a,o,i.nodes,i.stylesheets);return i}function P(t,n,r,i,a){if(t.type===3)return;if(t.type===2){let r=t.value??``;r&&i.push(e.l({text:r,preset:n?.span}));return}if(t.type===0){for(let e of t.children)P(e,n,r,i,a);return}if(t.type!==1)return;let o=t;if(o.name===`style`){let e=``;for(let t of o.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&a.push(e);return}let s=F(o,n,r);if(o.name===`br`){i.push(e.l({text:`
|
|
2
|
+
`,preset:n?.span,...s}));return}if(o.name===`img`){let t=o.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);i.push(e.i({src:t,width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}if(S(o.name))return;if(o.name===`svg`){i.push(e.i({src:b(o),width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}let c=!0,l=``;for(let e of o.children)if(e.type!==3){if(e.type!==2){c=!1;break}l+=e.value??``}if(c&&l){i.push(e.l({text:l,...s}));return}let u=[];for(let e of o.children)P(e,n,r,u,a);i.push(e.t({children:u,...s}))}function F(e,t,n){let i=e.attributes?I(e.attributes):{},a=typeof i.style==`string`?B(i.style):void 0,o=r(i,n),s=typeof i[n]==`string`?i[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,lang:i.lang,attributes:o,tw:s,style:a,preset:c}}function I(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=L(r))}return t}function L(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?R(Number(t))??e:n?R(Number.parseInt(n,16))??e:z[r]??e):e}function R(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const z={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function B(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[V(i)]=a)}return Object.keys(t).length>0?t:void 0}function V(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function H(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
|
package/package.json
CHANGED
package/dist/markup-CIGgTVBH.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,l as t,t as n}from"./helpers-CVQCT1Rh.mjs";const r={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figure:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figcaption:{display:`block`},address:{fontStyle:`italic`,display:`block`},article:{display:`block`},aside:{display:`block`},footer:{display:`block`},header:{display:`block`},hgroup:{display:`block`},main:{display:`block`},nav:{display:`block`},section:{display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},cite:{fontStyle:`italic`},dfn:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},samp:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,whiteSpace:`pre`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function i(e){if(e!==!1)return e??r}function a(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var o=Symbol(`Fragment`),s=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),c=new Set([`script`,`style`]),l=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,u=/[\@\.a-z0-9_\:\-]/i;function d(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let c=e[s];n===`none`?u.test(c)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):c===`=`&&r&&(n=`value`):n===`key`?u.test(c)||(r=e.substring(a,s),n=c===`=`?`value`:`none`):c===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(c===`"`||c===`'`)&&!o&&(a=s+1,o=c)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function f(e){let t=typeof e==`string`?e:e.value,n,r,i,a,o,u,f,p,m,h=[];l.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){a=t.substring(g,l.lastIndex-i[0].length),a&&r.children.push({type:2,value:a,parent:r})}for(;i=l.exec(t);){if(u=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],c.has(r.name)&&i[2]!==r.name){o=l.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(u===`<!--`){if(o=l.lastIndex-i[0].length,c.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(u===`<!`)o=l.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),c.has(r.name)){g=l.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:d(i[3]),parent:r,children:[],loc:[{start:l.lastIndex-i[0].length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||s.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}),a=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:a,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}));g=l.lastIndex}return a=t.slice(g),r.children.push({type:2,value:a,parent:r}),n}var p=Symbol(`HTMLString`),m=Symbol(`AttrString`),h=Symbol(`RenderFn`);function g(e,t=[p]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var _={"&":`&`,"<":`<`,">":`>`};function v(e){return e.replace(/[&<>]/g,e=>_[e]||e)}function y(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return g(t,[p,m])}function b(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function x(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>S(e)).join(``);if(h in e){let t=e[h](n,g(r));return t&&t[p]?t.value:v(String(t))}if(t===o)return r;let i=b(e);return i||s.has(t)?`<${e.name}${y(n).value}${i?` /`:``}>`:`<${e.name}${y(n).value}>${r}</${e.name}>`}function S(e){switch(e.type){case 0:return e.children.map(e=>S(e)).join(``);case 1:return x(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const C=new Set([`head`,`meta`,`link`,`style`,`script`]);function w(e){return C.has(e)}function T(e,t){return e.type===t&&`props`in e}function E(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function D(e){return typeof e==`object`&&!!e&&`type`in e}function O(e){return typeof e==`function`}const k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.fragment`);function M(e){return e.$$typeof===k}function N(e){return e.$$typeof===A}function P(e){return e.type===j}function F(e,t){let n=f(e),r={nodes:[],stylesheets:[]},a=i(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of n.children)I(e,a,o,r.nodes,r.stylesheets);return r}function I(r,i,a,o,s){if(r.type===3)return;if(r.type===2){let e=r.value??``;e&&o.push(t({text:e,preset:i?.span}));return}if(r.type===0){for(let e of r.children)I(e,i,a,o,s);return}if(r.type!==1)return;let c=r;if(c.name===`style`){let e=``;for(let t of c.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&s.push(e);return}let l=L(c,i,a);if(c.name===`br`){o.push(t({text:`
|
|
2
|
-
`,preset:i?.span,...l}));return}if(c.name===`img`){let t=c.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);o.push(e({src:t,width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}if(w(c.name))return;if(c.name===`svg`){o.push(e({src:S(c),width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}let u=!0,d=``;for(let e of c.children)if(e.type!==3){if(e.type!==2){u=!1;break}d+=e.value??``}if(u&&d){o.push(t({text:d,...l}));return}let f=[];for(let e of c.children)I(e,i,a,f,s);o.push(n({children:f,...l}))}function L(e,t,n){let r=e.attributes?R(e.attributes):{},i=typeof r.style==`string`?H(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,lang:r.lang,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=z(r))}return t}function z(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?B(Number(t))??e:n?B(Number.parseInt(n,16))??e:V[r]??e):e}function B(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const V={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function H(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[U(i)]=a)}return Object.keys(t).length>0?t:void 0}function U(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function W(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{w as a,N as c,i as d,r as f,T as i,D as l,E as n,M as o,O as r,P as s,F as t,a as u};
|
package/dist/markup-UWqQuGMA.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./helpers-4kGcvc-Q.cjs"),t={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figure:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},figcaption:{display:`block`},address:{fontStyle:`italic`,display:`block`},article:{display:`block`},aside:{display:`block`},footer:{display:`block`},header:{display:`block`},hgroup:{display:`block`},main:{display:`block`},nav:{display:`block`},section:{display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},cite:{fontStyle:`italic`},dfn:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},samp:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,whiteSpace:`pre`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function n(e){if(e!==!1)return e??t}function r(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var i=Symbol(`Fragment`),a=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),o=new Set([`script`,`style`]),s=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,c=/[\@\.a-z0-9_\:\-]/i;function l(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let l=e[s];n===`none`?c.test(l)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):l===`=`&&r&&(n=`value`):n===`key`?c.test(l)||(r=e.substring(a,s),n=l===`=`?`value`:`none`):l===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(l===`"`||l===`'`)&&!o&&(a=s+1,o=l)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function u(e){let t=typeof e==`string`?e:e.value,n,r,i,c,u,d,f,p,m,h=[];s.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){c=t.substring(g,s.lastIndex-i[0].length),c&&r.children.push({type:2,value:c,parent:r})}for(;i=s.exec(t);){if(d=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],o.has(r.name)&&i[2]!==r.name){u=s.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(d===`<!--`){if(u=s.lastIndex-i[0].length,o.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(d===`<!`)u=s.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),o.has(r.name)){g=s.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:l(i[3]),parent:r,children:[],loc:[{start:s.lastIndex-i[0].length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||a.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}),c=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:c,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}));g=s.lastIndex}return c=t.slice(g),r.children.push({type:2,value:c,parent:r}),n}var d=Symbol(`HTMLString`),f=Symbol(`AttrString`),p=Symbol(`RenderFn`);function m(e,t=[d]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var h={"&":`&`,"<":`<`,">":`>`};function g(e){return e.replace(/[&<>]/g,e=>h[e]||e)}function _(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return m(t,[d,f])}function v(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function y(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>b(e)).join(``);if(p in e){let t=e[p](n,m(r));return t&&t[d]?t.value:g(String(t))}if(t===i)return r;let o=v(e);return o||a.has(t)?`<${e.name}${_(n).value}${o?` /`:``}>`:`<${e.name}${_(n).value}>${r}</${e.name}>`}function b(e){switch(e.type){case 0:return e.children.map(e=>b(e)).join(``);case 1:return y(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const x=new Set([`head`,`meta`,`link`,`style`,`script`]);function S(e){return x.has(e)}function C(e,t){return e.type===t&&`props`in e}function w(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function T(e){return typeof e==`object`&&!!e&&`type`in e}function E(e){return typeof e==`function`}const D=Symbol.for(`react.forward_ref`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.fragment`);function A(e){return e.$$typeof===D}function j(e){return e.$$typeof===O}function M(e){return e.type===k}function N(e,t){let r=u(e),i={nodes:[],stylesheets:[]},a=n(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of r.children)P(e,a,o,i.nodes,i.stylesheets);return i}function P(t,n,r,i,a){if(t.type===3)return;if(t.type===2){let r=t.value??``;r&&i.push(e.l({text:r,preset:n?.span}));return}if(t.type===0){for(let e of t.children)P(e,n,r,i,a);return}if(t.type!==1)return;let o=t;if(o.name===`style`){let e=``;for(let t of o.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&a.push(e);return}let s=F(o,n,r);if(o.name===`br`){i.push(e.l({text:`
|
|
2
|
-
`,preset:n?.span,...s}));return}if(o.name===`img`){let t=o.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);i.push(e.i({src:t,width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}if(S(o.name))return;if(o.name===`svg`){i.push(e.i({src:b(o),width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}let c=!0,l=``;for(let e of o.children)if(e.type!==3){if(e.type!==2){c=!1;break}l+=e.value??``}if(c&&l){i.push(e.l({text:l,...s}));return}let u=[];for(let e of o.children)P(e,n,r,u,a);i.push(e.t({children:u,...s}))}function F(e,t,n){let i=e.attributes?I(e.attributes):{},a=typeof i.style==`string`?B(i.style):void 0,o=r(i,n),s=typeof i[n]==`string`?i[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,lang:i.lang,attributes:o,tw:s,style:a,preset:c}}function I(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=L(r))}return t}function L(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?R(Number(t))??e:n?R(Number.parseInt(n,16))??e:z[r]??e):e}function R(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const z={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function B(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[V(i)]=a)}return Object.keys(t).length>0?t:void 0}function V(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function H(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
|