@utilix-tech/sdk 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +62 -25
  3. package/SECURITY.md +16 -0
  4. package/dist/{chunk-OKSWDVOM.js → chunk-GX7H6TAX.js} +1 -1
  5. package/dist/{chunk-W4UBLYFU.js → chunk-HFRTZE7T.js} +2 -2
  6. package/dist/{chunk-ROTPLW7T.js → chunk-IPR7FSX4.js} +2 -2
  7. package/dist/chunk-N7C52YGL.js +134 -0
  8. package/dist/{chunk-XST6X3HT.js → chunk-QJE743LY.js} +10 -10
  9. package/dist/{chunk-NSOARQCM.js → chunk-V5S6OJ4A.js} +14 -14
  10. package/dist/{chunk-XXYZLLHI.js → chunk-YBBYFAOV.js} +167 -1
  11. package/dist/index.cjs +327 -29
  12. package/dist/index.d.cts +2 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.js +7 -6
  15. package/dist/media-DF2cx3pK.d.cts +28 -0
  16. package/dist/media-DF2cx3pK.d.ts +28 -0
  17. package/dist/{text-DqAjPtQ0.d.cts → text-CI7JAl7F.d.cts} +28 -2
  18. package/dist/{text-DqAjPtQ0.d.ts → text-CI7JAl7F.d.ts} +28 -2
  19. package/dist/tools/api.cjs +2 -2
  20. package/dist/tools/api.js +1 -1
  21. package/dist/tools/code.cjs +14 -14
  22. package/dist/tools/code.js +1 -1
  23. package/dist/tools/encoding.cjs +2 -2
  24. package/dist/tools/encoding.js +1 -1
  25. package/dist/tools/media.cjs +130 -0
  26. package/dist/tools/media.d.cts +1 -0
  27. package/dist/tools/media.d.ts +1 -0
  28. package/dist/tools/media.js +2 -0
  29. package/dist/tools/misc.cjs +1 -1
  30. package/dist/tools/misc.js +1 -1
  31. package/dist/tools/text.cjs +166 -0
  32. package/dist/tools/text.d.cts +1 -1
  33. package/dist/tools/text.d.ts +1 -1
  34. package/dist/tools/text.js +1 -1
  35. package/dist/tools/units.cjs +10 -10
  36. package/dist/tools/units.js +1 -1
  37. package/package.json +23 -4
@@ -0,0 +1,28 @@
1
+ type ImageFormat = 'png' | 'jpeg' | 'gif' | 'webp' | 'bmp';
2
+ interface ImageInfo {
3
+ format: ImageFormat;
4
+ width: number;
5
+ height: number;
6
+ bitDepth?: number;
7
+ colorType?: string;
8
+ hasAlpha?: boolean;
9
+ }
10
+ interface ImageInfoError {
11
+ error: string;
12
+ }
13
+ /**
14
+ * Read image format, dimensions, and basic color info straight from file
15
+ * bytes — no decoding, no image library, no canvas. Supports PNG, JPEG,
16
+ * GIF, WebP, and BMP.
17
+ */
18
+ declare function readImageInfo(bytes: Uint8Array): ImageInfo | ImageInfoError;
19
+
20
+ type media_ImageFormat = ImageFormat;
21
+ type media_ImageInfo = ImageInfo;
22
+ type media_ImageInfoError = ImageInfoError;
23
+ declare const media_readImageInfo: typeof readImageInfo;
24
+ declare namespace media {
25
+ export { type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, media_readImageInfo as readImageInfo };
26
+ }
27
+
28
+ export { type ImageFormat as I, type ImageInfo as a, type ImageInfoError as b, media as m, readImageInfo as r };
@@ -0,0 +1,28 @@
1
+ type ImageFormat = 'png' | 'jpeg' | 'gif' | 'webp' | 'bmp';
2
+ interface ImageInfo {
3
+ format: ImageFormat;
4
+ width: number;
5
+ height: number;
6
+ bitDepth?: number;
7
+ colorType?: string;
8
+ hasAlpha?: boolean;
9
+ }
10
+ interface ImageInfoError {
11
+ error: string;
12
+ }
13
+ /**
14
+ * Read image format, dimensions, and basic color info straight from file
15
+ * bytes — no decoding, no image library, no canvas. Supports PNG, JPEG,
16
+ * GIF, WebP, and BMP.
17
+ */
18
+ declare function readImageInfo(bytes: Uint8Array): ImageInfo | ImageInfoError;
19
+
20
+ type media_ImageFormat = ImageFormat;
21
+ type media_ImageInfo = ImageInfo;
22
+ type media_ImageInfoError = ImageInfoError;
23
+ declare const media_readImageInfo: typeof readImageInfo;
24
+ declare namespace media {
25
+ export { type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, media_readImageInfo as readImageInfo };
26
+ }
27
+
28
+ export { type ImageFormat as I, type ImageInfo as a, type ImageInfoError as b, media as m, readImageInfo as r };
@@ -234,6 +234,28 @@ declare function getMorseTiming(morse: string): Array<{
234
234
  type: 'dot' | 'dash' | 'gap' | 'wordgap';
235
235
  duration: number;
236
236
  }>;
237
+ interface PassiveVoiceMatch {
238
+ phrase: string;
239
+ hasAgent: boolean;
240
+ }
241
+ interface PassiveVoiceSentence {
242
+ index: number;
243
+ text: string;
244
+ isPassive: boolean;
245
+ matches: PassiveVoiceMatch[];
246
+ }
247
+ interface PassiveVoiceResult {
248
+ sentences: PassiveVoiceSentence[];
249
+ totalSentences: number;
250
+ passiveSentences: number;
251
+ passivePercent: number;
252
+ }
253
+ /**
254
+ * Heuristic passive-voice detector: flags sentences containing a "to be" verb
255
+ * followed (optionally through up to 2 adverbs) by a past participle, e.g.
256
+ * "was written", "is being reviewed", "were quickly approved by the team".
257
+ */
258
+ declare function detectPassiveVoice(text: string): PassiveVoiceResult;
237
259
 
238
260
  type text_AsciiFont = AsciiFont;
239
261
  type text_AsciiOptions = AsciiOptions;
@@ -258,6 +280,9 @@ type text_MarkdownResult = MarkdownResult;
258
280
  type text_MorseOptions = MorseOptions;
259
281
  type text_ParsedDiff = ParsedDiff;
260
282
  type text_ParsedTable = ParsedTable;
283
+ type text_PassiveVoiceMatch = PassiveVoiceMatch;
284
+ type text_PassiveVoiceResult = PassiveVoiceResult;
285
+ type text_PassiveVoiceSentence = PassiveVoiceSentence;
261
286
  type text_ReadabilityScore = ReadabilityScore;
262
287
  type text_SlugSeparator = SlugSeparator;
263
288
  type text_TableOptions = TableOptions;
@@ -274,6 +299,7 @@ declare const text_countWords: typeof countWords;
274
299
  declare const text_csvToHtml: typeof csvToHtml;
275
300
  declare const text_csvToMarkdown: typeof csvToMarkdown;
276
301
  declare const text_detectDelimiter: typeof detectDelimiter;
302
+ declare const text_detectPassiveVoice: typeof detectPassiveVoice;
277
303
  declare const text_diffLines: typeof diffLines;
278
304
  declare const text_diffLinesSimple: typeof diffLinesSimple;
279
305
  declare const text_diffStats: typeof diffStats;
@@ -313,7 +339,7 @@ declare const text_textToMorse: typeof textToMorse;
313
339
  declare const text_unescapeString: typeof unescapeString;
314
340
  declare const text_wordFrequency: typeof wordFrequency;
315
341
  declare namespace text {
316
- export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
342
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
317
343
  }
318
344
 
319
- export { generateWords as $, type AsciiFont as A, csvToHtml as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, csvToMarkdown as F, detectDelimiter as G, diffLines as H, diffLinesSimple as I, diffStats as J, escapeAll as K, LINE_OPS as L, MORSE_CODE as M, escapeString as N, extractHeadings as O, type ParsedDiff as P, formatReadingTime as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, generate as U, generateDiff as V, type WordCountResult as W, generateHtmlTable as X, generateMarkdownTable as Y, generateParagraphs as Z, generateSentences as _, type AsciiOptions as a, getAvailableFonts as a0, getMorseForChar as a1, getMorseTiming as a2, htmlToMarkdown as a3, isValidMorse as a4, markdownToHtml as a5, morseToText as a6, numberToOrdinal as a7, numberToRoman as a8, numberToWords as a9, ordinalWords as aa, parseDiff as ab, parseTableData as ac, readabilityScore as ad, renderMarkdown as ae, romanToNumber as af, sentenceCount as ag, slugify as ah, slugifyAll as ai, syllableCount as aj, textToAscii as ak, textToMorse as al, unescapeString as am, wordFrequency as an, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type TextAnalysis as q, addBorder as r, analyzeText as s, text as t, applyOp as u, applyOps as v, centerText as w, convertAll as x, convertCase as y, countWords as z };
345
+ export { generateHtmlTable as $, type AsciiFont as A, convertAll as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, convertCase as F, countWords as G, csvToHtml as H, csvToMarkdown as I, detectDelimiter as J, detectPassiveVoice as K, LINE_OPS as L, MORSE_CODE as M, diffLines as N, diffLinesSimple as O, type ParsedDiff as P, diffStats as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, escapeAll as U, escapeString as V, type WordCountResult as W, extractHeadings as X, formatReadingTime as Y, generate as Z, generateDiff as _, type AsciiOptions as a, generateMarkdownTable as a0, generateParagraphs as a1, generateSentences as a2, generateWords as a3, getAvailableFonts as a4, getMorseForChar as a5, getMorseTiming as a6, htmlToMarkdown as a7, isValidMorse as a8, markdownToHtml as a9, morseToText as aa, numberToOrdinal as ab, numberToRoman as ac, numberToWords as ad, ordinalWords as ae, parseDiff as af, parseTableData as ag, readabilityScore as ah, renderMarkdown as ai, romanToNumber as aj, sentenceCount as ak, slugify as al, slugifyAll as am, syllableCount as an, textToAscii as ao, textToMorse as ap, unescapeString as aq, wordFrequency as ar, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type PassiveVoiceMatch as q, type PassiveVoiceResult as r, type PassiveVoiceSentence as s, text as t, type TextAnalysis as u, addBorder as v, analyzeText as w, applyOp as x, applyOps as y, centerText as z };
@@ -234,6 +234,28 @@ declare function getMorseTiming(morse: string): Array<{
234
234
  type: 'dot' | 'dash' | 'gap' | 'wordgap';
235
235
  duration: number;
236
236
  }>;
237
+ interface PassiveVoiceMatch {
238
+ phrase: string;
239
+ hasAgent: boolean;
240
+ }
241
+ interface PassiveVoiceSentence {
242
+ index: number;
243
+ text: string;
244
+ isPassive: boolean;
245
+ matches: PassiveVoiceMatch[];
246
+ }
247
+ interface PassiveVoiceResult {
248
+ sentences: PassiveVoiceSentence[];
249
+ totalSentences: number;
250
+ passiveSentences: number;
251
+ passivePercent: number;
252
+ }
253
+ /**
254
+ * Heuristic passive-voice detector: flags sentences containing a "to be" verb
255
+ * followed (optionally through up to 2 adverbs) by a past participle, e.g.
256
+ * "was written", "is being reviewed", "were quickly approved by the team".
257
+ */
258
+ declare function detectPassiveVoice(text: string): PassiveVoiceResult;
237
259
 
238
260
  type text_AsciiFont = AsciiFont;
239
261
  type text_AsciiOptions = AsciiOptions;
@@ -258,6 +280,9 @@ type text_MarkdownResult = MarkdownResult;
258
280
  type text_MorseOptions = MorseOptions;
259
281
  type text_ParsedDiff = ParsedDiff;
260
282
  type text_ParsedTable = ParsedTable;
283
+ type text_PassiveVoiceMatch = PassiveVoiceMatch;
284
+ type text_PassiveVoiceResult = PassiveVoiceResult;
285
+ type text_PassiveVoiceSentence = PassiveVoiceSentence;
261
286
  type text_ReadabilityScore = ReadabilityScore;
262
287
  type text_SlugSeparator = SlugSeparator;
263
288
  type text_TableOptions = TableOptions;
@@ -274,6 +299,7 @@ declare const text_countWords: typeof countWords;
274
299
  declare const text_csvToHtml: typeof csvToHtml;
275
300
  declare const text_csvToMarkdown: typeof csvToMarkdown;
276
301
  declare const text_detectDelimiter: typeof detectDelimiter;
302
+ declare const text_detectPassiveVoice: typeof detectPassiveVoice;
277
303
  declare const text_diffLines: typeof diffLines;
278
304
  declare const text_diffLinesSimple: typeof diffLinesSimple;
279
305
  declare const text_diffStats: typeof diffStats;
@@ -313,7 +339,7 @@ declare const text_textToMorse: typeof textToMorse;
313
339
  declare const text_unescapeString: typeof unescapeString;
314
340
  declare const text_wordFrequency: typeof wordFrequency;
315
341
  declare namespace text {
316
- export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
342
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
317
343
  }
318
344
 
319
- export { generateWords as $, type AsciiFont as A, csvToHtml as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, csvToMarkdown as F, detectDelimiter as G, diffLines as H, diffLinesSimple as I, diffStats as J, escapeAll as K, LINE_OPS as L, MORSE_CODE as M, escapeString as N, extractHeadings as O, type ParsedDiff as P, formatReadingTime as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, generate as U, generateDiff as V, type WordCountResult as W, generateHtmlTable as X, generateMarkdownTable as Y, generateParagraphs as Z, generateSentences as _, type AsciiOptions as a, getAvailableFonts as a0, getMorseForChar as a1, getMorseTiming as a2, htmlToMarkdown as a3, isValidMorse as a4, markdownToHtml as a5, morseToText as a6, numberToOrdinal as a7, numberToRoman as a8, numberToWords as a9, ordinalWords as aa, parseDiff as ab, parseTableData as ac, readabilityScore as ad, renderMarkdown as ae, romanToNumber as af, sentenceCount as ag, slugify as ah, slugifyAll as ai, syllableCount as aj, textToAscii as ak, textToMorse as al, unescapeString as am, wordFrequency as an, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type TextAnalysis as q, addBorder as r, analyzeText as s, text as t, applyOp as u, applyOps as v, centerText as w, convertAll as x, convertCase as y, countWords as z };
345
+ export { generateHtmlTable as $, type AsciiFont as A, convertAll as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, convertCase as F, countWords as G, csvToHtml as H, csvToMarkdown as I, detectDelimiter as J, detectPassiveVoice as K, LINE_OPS as L, MORSE_CODE as M, diffLines as N, diffLinesSimple as O, type ParsedDiff as P, diffStats as Q, type ReadabilityScore as R, type SlugSeparator as S, type TableOptions as T, escapeAll as U, escapeString as V, type WordCountResult as W, extractHeadings as X, formatReadingTime as Y, generate as Z, generateDiff as _, type AsciiOptions as a, generateMarkdownTable as a0, generateParagraphs as a1, generateSentences as a2, generateWords as a3, getAvailableFonts as a4, getMorseForChar as a5, getMorseTiming as a6, htmlToMarkdown as a7, isValidMorse as a8, markdownToHtml as a9, morseToText as aa, numberToOrdinal as ab, numberToRoman as ac, numberToWords as ad, ordinalWords as ae, parseDiff as af, parseTableData as ag, readabilityScore as ah, renderMarkdown as ai, romanToNumber as aj, sentenceCount as ak, slugify as al, slugifyAll as am, syllableCount as an, textToAscii as ao, textToMorse as ap, unescapeString as aq, wordFrequency as ar, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type LineOp as k, type LineType as l, type LoremUnit as m, type MarkdownResult as n, type MorseOptions as o, type ParsedTable as p, type PassiveVoiceMatch as q, type PassiveVoiceResult as r, type PassiveVoiceSentence as s, text as t, type TextAnalysis as u, addBorder as v, analyzeText as w, applyOp as x, applyOps as y, centerText as z };
@@ -410,13 +410,13 @@ function decodeJwt(token) {
410
410
  try {
411
411
  header = decodeSegment(rawHeader);
412
412
  } catch {
413
- return { ok: false, error: "Failed to decode header \u2014 not valid base64url JSON" };
413
+ return { ok: false, error: "Failed to decode header: not valid base64url JSON" };
414
414
  }
415
415
  let payload;
416
416
  try {
417
417
  payload = decodeSegment(rawPayload);
418
418
  } catch {
419
- return { ok: false, error: "Failed to decode payload \u2014 not valid base64url JSON" };
419
+ return { ok: false, error: "Failed to decode payload: not valid base64url JSON" };
420
420
  }
421
421
  const algorithm = typeof header.alg === "string" ? header.alg : "unknown";
422
422
  const now = Math.floor(Date.now() / 1e3);
package/dist/tools/api.js CHANGED
@@ -1,2 +1,2 @@
1
- export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-W4UBLYFU.js';
1
+ export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-HFRTZE7T.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -87,24 +87,24 @@ var CHEATSHEET = [
87
87
  { pattern: "{n}", description: "Matches exactly n repetitions", example: "\\d{3} matches exactly 3 digits", category: "Quantifiers" },
88
88
  { pattern: "{n,}", description: "Matches n or more repetitions", example: "\\d{2,} matches 2 or more digits", category: "Quantifiers" },
89
89
  { pattern: "{n,m}", description: "Matches between n and m repetitions", example: "\\d{2,4} matches 2 to 4 digits", category: "Quantifiers" },
90
- { pattern: "*?", description: "Lazy match \u2014 matches as few characters as possible", example: "<.*?> matches the shortest possible HTML tag", category: "Quantifiers" },
90
+ { pattern: "*?", description: "Lazy match: matches as few characters as possible", example: "<.*?> matches the shortest possible HTML tag", category: "Quantifiers" },
91
91
  { pattern: "+?", description: "Lazy version of +", example: "a+? matches as few 'a's as possible", category: "Quantifiers" },
92
- { pattern: "(abc)", description: "Capturing group \u2014 captures the matched substring", example: "(\\d+) captures digit sequences", category: "Groups" },
93
- { pattern: "(?:abc)", description: "Non-capturing group \u2014 groups without capturing", example: "(?:foo|bar)baz matches 'foobaz' or 'barbaz'", category: "Groups" },
92
+ { pattern: "(abc)", description: "Capturing group: captures the matched substring", example: "(\\d+) captures digit sequences", category: "Groups" },
93
+ { pattern: "(?:abc)", description: "Non-capturing group: groups without capturing", example: "(?:foo|bar)baz matches 'foobaz' or 'barbaz'", category: "Groups" },
94
94
  { pattern: "(?<name>abc)", description: "Named capturing group", example: "(?<year>\\d{4}) captures year by name", category: "Groups" },
95
- { pattern: "a|b", description: "Alternation \u2014 matches either a or b", example: "cat|dog matches 'cat' or 'dog'", category: "Groups" },
95
+ { pattern: "a|b", description: "Alternation: matches either a or b", example: "cat|dog matches 'cat' or 'dog'", category: "Groups" },
96
96
  { pattern: "\\1", description: "Backreference to the first capturing group", example: "(\\w+) \\1 matches repeated words like 'the the'", category: "Groups" },
97
97
  { pattern: "\\k<name>", description: "Backreference to a named capturing group", example: "(?<word>\\w+) \\k<word> matches repeated named group", category: "Groups" },
98
- { pattern: "(?=abc)", description: "Positive lookahead \u2014 asserts what follows matches", example: "\\d+(?= dollars) matches digits followed by ' dollars'", category: "Lookahead/Lookbehind" },
99
- { pattern: "(?!abc)", description: "Negative lookahead \u2014 asserts what follows does not match", example: "\\d+(?! dollars) matches digits not followed by ' dollars'", category: "Lookahead/Lookbehind" },
100
- { pattern: "(?<=abc)", description: "Positive lookbehind \u2014 asserts what precedes matches", example: "(?<=\\$)\\d+ matches digits preceded by '$'", category: "Lookahead/Lookbehind" },
101
- { pattern: "(?<!abc)", description: "Negative lookbehind \u2014 asserts what precedes does not match", example: "(?<!\\$)\\d+ matches digits not preceded by '$'", category: "Lookahead/Lookbehind" },
102
- { pattern: "g", description: "Global flag \u2014 finds all matches rather than stopping at the first", example: "/\\d+/g finds all numbers in a string", category: "Flags" },
103
- { pattern: "i", description: "Case-insensitive flag \u2014 ignores letter case", example: "/hello/i matches 'Hello', 'HELLO', 'hello'", category: "Flags" },
104
- { pattern: "m", description: "Multiline flag \u2014 ^ and $ match start/end of each line", example: "/^\\w+/m matches the first word of each line", category: "Flags" },
105
- { pattern: "s", description: "Dotall flag \u2014 makes . match newline characters too", example: "/a.b/s matches 'a\\nb'", category: "Flags" },
106
- { pattern: "u", description: "Unicode flag \u2014 enables full Unicode matching", example: "/\\u{1F600}/u matches a Unicode emoji", category: "Flags" },
107
- { pattern: "y", description: "Sticky flag \u2014 matches only from the lastIndex position", example: "/\\d+/y matches digits starting at the current position", category: "Flags" },
98
+ { pattern: "(?=abc)", description: "Positive lookahead: asserts what follows matches", example: "\\d+(?= dollars) matches digits followed by ' dollars'", category: "Lookahead/Lookbehind" },
99
+ { pattern: "(?!abc)", description: "Negative lookahead: asserts what follows does not match", example: "\\d+(?! dollars) matches digits not followed by ' dollars'", category: "Lookahead/Lookbehind" },
100
+ { pattern: "(?<=abc)", description: "Positive lookbehind: asserts what precedes matches", example: "(?<=\\$)\\d+ matches digits preceded by '$'", category: "Lookahead/Lookbehind" },
101
+ { pattern: "(?<!abc)", description: "Negative lookbehind: asserts what precedes does not match", example: "(?<!\\$)\\d+ matches digits not preceded by '$'", category: "Lookahead/Lookbehind" },
102
+ { pattern: "g", description: "Global flag: finds all matches rather than stopping at the first", example: "/\\d+/g finds all numbers in a string", category: "Flags" },
103
+ { pattern: "i", description: "Case-insensitive flag: ignores letter case", example: "/hello/i matches 'Hello', 'HELLO', 'hello'", category: "Flags" },
104
+ { pattern: "m", description: "Multiline flag: ^ and $ match start/end of each line", example: "/^\\w+/m matches the first word of each line", category: "Flags" },
105
+ { pattern: "s", description: "Dotall flag: makes . match newline characters too", example: "/a.b/s matches 'a\\nb'", category: "Flags" },
106
+ { pattern: "u", description: "Unicode flag: enables full Unicode matching", example: "/\\u{1F600}/u matches a Unicode emoji", category: "Flags" },
107
+ { pattern: "y", description: "Sticky flag: matches only from the lastIndex position", example: "/\\d+/y matches digits starting at the current position", category: "Flags" },
108
108
  { pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", description: "Matches a basic email address", example: "user@example.com", category: "Common Patterns" },
109
109
  { pattern: "https?://[\\w\\-]+(\\.[\\w\\-]+)+([\\w.,@?^=%&:/~+#\\-]*[\\w@?^=%&/~+#\\-])?", description: "Matches an HTTP or HTTPS URL", example: "https://www.example.com/path?query=value", category: "Common Patterns" },
110
110
  { pattern: "^(?:\\+1)?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}$", description: "Matches a North American phone number in various formats", example: "(555) 123-4567 or 555-123-4567", category: "Common Patterns" },
@@ -1,2 +1,2 @@
1
- export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-NSOARQCM.js';
1
+ export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-V5S6OJ4A.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -28,7 +28,7 @@ function decodeBase64(input, variant = "standard") {
28
28
  const output = bytes.toString("utf8");
29
29
  return { ok: true, output, outputBytes: bytes.length };
30
30
  } catch {
31
- return { ok: false, error: "Invalid Base64 \u2014 check the input and variant setting" };
31
+ return { ok: false, error: "Invalid Base64: check the input and variant setting" };
32
32
  }
33
33
  }
34
34
  function encodeUrl(input, mode = "component") {
@@ -47,7 +47,7 @@ function decodeUrl(input, mode = "component") {
47
47
  const output = mode === "component" ? decodeURIComponent(trimmed) : decodeURI(trimmed);
48
48
  return { ok: true, output, changed: output !== trimmed };
49
49
  } catch {
50
- return { ok: false, error: "Invalid percent-encoding \u2014 check the input" };
50
+ return { ok: false, error: "Invalid percent-encoding: check the input" };
51
51
  }
52
52
  }
53
53
  function diffSegments(original, encoded) {
@@ -1,2 +1,2 @@
1
- export { ALPHABETS, base32Decode, base32DecodeBytes, base32Encode, base32EncodeBytes, decodeBase64, decodeHtmlEntities, decodeUrl, diffSegments, encodeBase64, encodeHtmlEntities, encodeHtmlEntitiesAll, encodeUrl, isValidBase32 } from '../chunk-ROTPLW7T.js';
1
+ export { ALPHABETS, base32Decode, base32DecodeBytes, base32Encode, base32EncodeBytes, decodeBase64, decodeHtmlEntities, decodeUrl, diffSegments, encodeBase64, encodeHtmlEntities, encodeHtmlEntitiesAll, encodeUrl, isValidBase32 } from '../chunk-IPR7FSX4.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -0,0 +1,130 @@
1
+ 'use strict';
2
+
3
+ // src/tools/media.ts
4
+ function readU32BE(bytes, offset) {
5
+ return (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
6
+ }
7
+ function readI32LE(bytes, offset) {
8
+ return bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24;
9
+ }
10
+ var PNG_COLOR_TYPES = {
11
+ 0: "grayscale",
12
+ 2: "rgb",
13
+ 3: "palette",
14
+ 4: "grayscale+alpha",
15
+ 6: "rgba"
16
+ };
17
+ function readPng(bytes) {
18
+ if (bytes.length < 33) return { error: "Truncated PNG file" };
19
+ const width = readU32BE(bytes, 16);
20
+ const height = readU32BE(bytes, 20);
21
+ const bitDepth = bytes[24];
22
+ const colorTypeNum = bytes[25];
23
+ const colorType = PNG_COLOR_TYPES[colorTypeNum] ?? "unknown";
24
+ const hasAlpha = colorTypeNum === 4 || colorTypeNum === 6;
25
+ return { format: "png", width, height, bitDepth, colorType, hasAlpha };
26
+ }
27
+ function readGif(bytes) {
28
+ if (bytes.length < 10) return { error: "Truncated GIF file" };
29
+ const width = bytes[6] | bytes[7] << 8;
30
+ const height = bytes[8] | bytes[9] << 8;
31
+ return { format: "gif", width, height };
32
+ }
33
+ function readBmp(bytes) {
34
+ if (bytes.length < 30) return { error: "Truncated BMP file" };
35
+ const width = readI32LE(bytes, 18);
36
+ const heightRaw = readI32LE(bytes, 22);
37
+ const bitDepth = bytes[28] | bytes[29] << 8;
38
+ return { format: "bmp", width: Math.abs(width), height: Math.abs(heightRaw), bitDepth };
39
+ }
40
+ function readWebp(bytes) {
41
+ if (bytes.length < 16) return { error: "Truncated WebP file" };
42
+ const fourCC = String.fromCharCode(bytes[12], bytes[13], bytes[14], bytes[15]);
43
+ if (fourCC === "VP8 ") {
44
+ if (bytes.length < 30) return { error: "Truncated WebP file" };
45
+ const width = (bytes[26] | bytes[27] << 8) & 16383;
46
+ const height = (bytes[28] | bytes[29] << 8) & 16383;
47
+ return { format: "webp", width, height };
48
+ }
49
+ if (fourCC === "VP8L") {
50
+ if (bytes.length < 25) return { error: "Truncated WebP file" };
51
+ const bits = bytes[21] | bytes[22] << 8 | bytes[23] << 16 | bytes[24] << 24;
52
+ const width = (bits & 16383) + 1;
53
+ const height = (bits >>> 14 & 16383) + 1;
54
+ const hasAlpha = !!(bits >>> 28 & 1);
55
+ return { format: "webp", width, height, hasAlpha };
56
+ }
57
+ if (fourCC === "VP8X") {
58
+ if (bytes.length < 30) return { error: "Truncated WebP file" };
59
+ const flags = bytes[20];
60
+ const hasAlpha = !!(flags & 16);
61
+ const width = (bytes[24] | bytes[25] << 8 | bytes[26] << 16) + 1;
62
+ const height = (bytes[27] | bytes[28] << 8 | bytes[29] << 16) + 1;
63
+ return { format: "webp", width, height, hasAlpha };
64
+ }
65
+ return { error: "Unrecognized WebP chunk format" };
66
+ }
67
+ var JPEG_SOF_MARKERS = /* @__PURE__ */ new Set([
68
+ 192,
69
+ 193,
70
+ 194,
71
+ 195,
72
+ 197,
73
+ 198,
74
+ 199,
75
+ 201,
76
+ 202,
77
+ 203,
78
+ 205,
79
+ 206,
80
+ 207
81
+ ]);
82
+ function readJpeg(bytes) {
83
+ let offset = 2;
84
+ while (offset < bytes.length - 1) {
85
+ if (bytes[offset] !== 255) {
86
+ offset++;
87
+ continue;
88
+ }
89
+ const marker = bytes[offset + 1];
90
+ if (marker === 216 || marker === 1 || marker >= 208 && marker <= 215) {
91
+ offset += 2;
92
+ continue;
93
+ }
94
+ if (marker === 217) break;
95
+ if (offset + 3 >= bytes.length) break;
96
+ const segmentLength = bytes[offset + 2] << 8 | bytes[offset + 3];
97
+ if (JPEG_SOF_MARKERS.has(marker)) {
98
+ if (offset + 9 >= bytes.length) return { error: "Truncated JPEG SOF segment" };
99
+ const bitDepth = bytes[offset + 4];
100
+ const height = bytes[offset + 5] << 8 | bytes[offset + 6];
101
+ const width = bytes[offset + 7] << 8 | bytes[offset + 8];
102
+ const components = bytes[offset + 9];
103
+ const colorType = components === 1 ? "grayscale" : components === 3 ? "rgb" : components === 4 ? "cmyk" : "unknown";
104
+ return { format: "jpeg", width, height, bitDepth, colorType };
105
+ }
106
+ offset += 2 + segmentLength;
107
+ }
108
+ return { error: "No SOF marker found in JPEG (file may be corrupt)" };
109
+ }
110
+ function readImageInfo(bytes) {
111
+ if (bytes.length < 10) return { error: "File too small to determine format" };
112
+ if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71 && bytes[4] === 13 && bytes[5] === 10 && bytes[6] === 26 && bytes[7] === 10) {
113
+ return readPng(bytes);
114
+ }
115
+ if (bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70) {
116
+ return readGif(bytes);
117
+ }
118
+ if (bytes[0] === 66 && bytes[1] === 77) {
119
+ return readBmp(bytes);
120
+ }
121
+ if (bytes[0] === 82 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 70 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) {
122
+ return readWebp(bytes);
123
+ }
124
+ if (bytes[0] === 255 && bytes[1] === 216) {
125
+ return readJpeg(bytes);
126
+ }
127
+ return { error: "Unrecognized image format. Supported formats: PNG, JPEG, GIF, WebP, BMP" };
128
+ }
129
+
130
+ exports.readImageInfo = readImageInfo;
@@ -0,0 +1 @@
1
+ export { I as ImageFormat, a as ImageInfo, b as ImageInfoError, r as readImageInfo } from '../media-DF2cx3pK.cjs';
@@ -0,0 +1 @@
1
+ export { I as ImageFormat, a as ImageInfo, b as ImageInfoError, r as readImageInfo } from '../media-DF2cx3pK.js';
@@ -0,0 +1,2 @@
1
+ export { readImageInfo } from '../chunk-N7C52YGL.js';
2
+ import '../chunk-MLKGABMK.js';
@@ -531,7 +531,7 @@ function getConversionWarnings(from, to) {
531
531
  warnings.push("Transparency will be lost if the WebP image has an alpha channel");
532
532
  }
533
533
  if (to === "image/jpeg") {
534
- warnings.push("JPEG uses lossy compression \u2014 some quality may be reduced");
534
+ warnings.push("JPEG uses lossy compression: some quality may be reduced");
535
535
  }
536
536
  return warnings;
537
537
  }
@@ -1,2 +1,2 @@
1
- export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, DEFAULT_QR_OPTIONS, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateMetaHtml, generateQrDataUrl, generateQrSvg, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, parseMetaTags, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape, validateOgTags } from '../chunk-OKSWDVOM.js';
1
+ export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, DEFAULT_QR_OPTIONS, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateMetaHtml, generateQrDataUrl, generateQrSvg, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, parseMetaTags, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape, validateOgTags } from '../chunk-GX7H6TAX.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -2167,6 +2167,171 @@ function getMorseTiming(morse) {
2167
2167
  }
2168
2168
  return result;
2169
2169
  }
2170
+ var BE_VERBS = /* @__PURE__ */ new Set(["am", "is", "are", "was", "were", "be", "been", "being"]);
2171
+ var IRREGULAR_PARTICIPLES = /* @__PURE__ */ new Set([
2172
+ "awoken",
2173
+ "been",
2174
+ "become",
2175
+ "begun",
2176
+ "bent",
2177
+ "bet",
2178
+ "bitten",
2179
+ "bled",
2180
+ "blown",
2181
+ "born",
2182
+ "bought",
2183
+ "bound",
2184
+ "bred",
2185
+ "broken",
2186
+ "brought",
2187
+ "built",
2188
+ "burnt",
2189
+ "burst",
2190
+ "caught",
2191
+ "chosen",
2192
+ "clung",
2193
+ "come",
2194
+ "cost",
2195
+ "crept",
2196
+ "cut",
2197
+ "dealt",
2198
+ "dived",
2199
+ "done",
2200
+ "drawn",
2201
+ "dreamt",
2202
+ "driven",
2203
+ "drunk",
2204
+ "dug",
2205
+ "eaten",
2206
+ "fallen",
2207
+ "fed",
2208
+ "felt",
2209
+ "fit",
2210
+ "fled",
2211
+ "flown",
2212
+ "forbidden",
2213
+ "forgiven",
2214
+ "forgotten",
2215
+ "fought",
2216
+ "found",
2217
+ "frozen",
2218
+ "given",
2219
+ "gone",
2220
+ "gotten",
2221
+ "grown",
2222
+ "hidden",
2223
+ "held",
2224
+ "hung",
2225
+ "hurt",
2226
+ "kept",
2227
+ "knelt",
2228
+ "knit",
2229
+ "known",
2230
+ "laid",
2231
+ "lain",
2232
+ "led",
2233
+ "left",
2234
+ "lent",
2235
+ "let",
2236
+ "lit",
2237
+ "lost",
2238
+ "made",
2239
+ "meant",
2240
+ "met",
2241
+ "mistaken",
2242
+ "paid",
2243
+ "proven",
2244
+ "put",
2245
+ "quit",
2246
+ "read",
2247
+ "rid",
2248
+ "ridden",
2249
+ "risen",
2250
+ "run",
2251
+ "said",
2252
+ "sat",
2253
+ "sawn",
2254
+ "seen",
2255
+ "sent",
2256
+ "set",
2257
+ "sewn",
2258
+ "shaken",
2259
+ "shed",
2260
+ "shone",
2261
+ "shot",
2262
+ "shown",
2263
+ "shrunk",
2264
+ "shut",
2265
+ "sold",
2266
+ "sought",
2267
+ "sown",
2268
+ "spent",
2269
+ "spoken",
2270
+ "spread",
2271
+ "sprung",
2272
+ "stolen",
2273
+ "stood",
2274
+ "stuck",
2275
+ "stung",
2276
+ "struck",
2277
+ "strung",
2278
+ "sung",
2279
+ "sunk",
2280
+ "swept",
2281
+ "sworn",
2282
+ "swum",
2283
+ "swung",
2284
+ "taken",
2285
+ "taught",
2286
+ "thought",
2287
+ "thrown",
2288
+ "told",
2289
+ "torn",
2290
+ "understood",
2291
+ "upset",
2292
+ "woken",
2293
+ "won",
2294
+ "worn",
2295
+ "wound",
2296
+ "woven",
2297
+ "written"
2298
+ ]);
2299
+ function isPastParticiple(word) {
2300
+ const w = word.toLowerCase();
2301
+ if (IRREGULAR_PARTICIPLES.has(w)) return true;
2302
+ return w.length > 3 && /^[a-z]+ed$/.test(w);
2303
+ }
2304
+ function splitIntoSentences(text) {
2305
+ const matches = text.match(/[^.!?]+[.!?]*/g);
2306
+ if (!matches) return [];
2307
+ return matches.map((s) => s.trim()).filter((s) => s.length > 0);
2308
+ }
2309
+ function detectPassiveVoice(text) {
2310
+ const sentences = splitIntoSentences(text);
2311
+ const analyzed = sentences.map((sentence, index) => {
2312
+ const words = sentence.match(/[a-zA-Z']+/g) ?? [];
2313
+ const matches = [];
2314
+ for (let i = 0; i < words.length; i++) {
2315
+ if (!BE_VERBS.has(words[i].toLowerCase())) continue;
2316
+ let j = i + 1;
2317
+ let adverbCount = 0;
2318
+ while (j < words.length && adverbCount < 2 && /ly$/i.test(words[j]) && !isPastParticiple(words[j])) {
2319
+ j++;
2320
+ adverbCount++;
2321
+ }
2322
+ if (j < words.length && isPastParticiple(words[j])) {
2323
+ const hasAgent = words.slice(j + 1, j + 5).some((w) => w.toLowerCase() === "by");
2324
+ matches.push({ phrase: words.slice(i, j + 1).join(" "), hasAgent });
2325
+ i = j;
2326
+ }
2327
+ }
2328
+ return { index, text: sentence, isPassive: matches.length > 0, matches };
2329
+ });
2330
+ const totalSentences = analyzed.length;
2331
+ const passiveSentences = analyzed.filter((s) => s.isPassive).length;
2332
+ const passivePercent = totalSentences > 0 ? Math.round(passiveSentences / totalSentences * 1e3) / 10 : 0;
2333
+ return { sentences: analyzed, totalSentences, passiveSentences, passivePercent };
2334
+ }
2170
2335
 
2171
2336
  exports.CASE_FORMATS = CASE_FORMATS;
2172
2337
  exports.DEFAULT_CONVERT_OPTIONS = DEFAULT_CONVERT_OPTIONS;
@@ -2184,6 +2349,7 @@ exports.countWords = countWords;
2184
2349
  exports.csvToHtml = csvToHtml;
2185
2350
  exports.csvToMarkdown = csvToMarkdown;
2186
2351
  exports.detectDelimiter = detectDelimiter;
2352
+ exports.detectPassiveVoice = detectPassiveVoice;
2187
2353
  exports.diffLines = diffLines;
2188
2354
  exports.diffLinesSimple = diffLinesSimple;
2189
2355
  exports.diffStats = diffStats;