{"version":3,"file":"index-Ck94bTpt.cjs","sources":["../../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js"],"sourcesContent":["// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value) {\n    let result = value.trim();\n    result = result\n        .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n        .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n    result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n    let start = 0;\n    let end = result.length;\n    // Trim the delimiter from around the output string.\n    while (result.charAt(start) === \"\\0\")\n        start++;\n    if (start === end)\n        return [];\n    while (result.charAt(end - 1) === \"\\0\")\n        end--;\n    return result.slice(start, end).split(/\\0/g);\n}\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value) {\n    const words = split(value);\n    for (let i = 0; i < words.length; i++) {\n        const word = words[i];\n        const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n        if (match) {\n            const offset = match.index + (match[1] ?? match[2]).length;\n            words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n        }\n    }\n    return words;\n}\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    return (prefix +\n        words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n        suffix);\n}\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    const lower = lowerFactory(options?.locale);\n    const upper = upperFactory(options?.locale);\n    const transform = options?.mergeAmbiguousCharacters\n        ? capitalCaseTransformFactory(lower, upper)\n        : pascalCaseTransformFactory(lower, upper);\n    return (prefix +\n        words\n            .map((word, index) => {\n            if (index === 0)\n                return lower(word);\n            return transform(word, index);\n        })\n            .join(options?.delimiter ?? \"\") +\n        suffix);\n}\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    const lower = lowerFactory(options?.locale);\n    const upper = upperFactory(options?.locale);\n    const transform = options?.mergeAmbiguousCharacters\n        ? capitalCaseTransformFactory(lower, upper)\n        : pascalCaseTransformFactory(lower, upper);\n    return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input, options) {\n    return capitalCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    const lower = lowerFactory(options?.locale);\n    const upper = upperFactory(options?.locale);\n    return (prefix +\n        words\n            .map(capitalCaseTransformFactory(lower, upper))\n            .join(options?.delimiter ?? \" \") +\n        suffix);\n}\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    return (prefix +\n        words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n        suffix);\n}\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input, options) {\n    return noCase(input, { delimiter: \".\", ...options });\n}\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input, options) {\n    return noCase(input, { delimiter: \"-\", ...options });\n}\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input, options) {\n    return noCase(input, { delimiter: \"/\", ...options });\n}\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input, options) {\n    const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n    const lower = lowerFactory(options?.locale);\n    const upper = upperFactory(options?.locale);\n    const transform = capitalCaseTransformFactory(lower, upper);\n    return (prefix +\n        words\n            .map((word, index) => {\n            if (index === 0)\n                return transform(word);\n            return lower(word);\n        })\n            .join(options?.delimiter ?? \" \") +\n        suffix);\n}\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input, options) {\n    return noCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input, options) {\n    return capitalCase(input, { delimiter: \"-\", ...options });\n}\nfunction lowerFactory(locale) {\n    return locale === false\n        ? (input) => input.toLowerCase()\n        : (input) => input.toLocaleLowerCase(locale);\n}\nfunction upperFactory(locale) {\n    return locale === false\n        ? (input) => input.toUpperCase()\n        : (input) => input.toLocaleUpperCase(locale);\n}\nfunction capitalCaseTransformFactory(lower, upper) {\n    return (word) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\nfunction pascalCaseTransformFactory(lower, upper) {\n    return (word, index) => {\n        const char0 = word[0];\n        const initial = index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n        return initial + lower(word.slice(1));\n    };\n}\nfunction splitPrefixSuffix(input, options = {}) {\n    const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n    const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n    const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n    let prefixIndex = 0;\n    let suffixIndex = input.length;\n    while (prefixIndex < input.length) {\n        const char = input.charAt(prefixIndex);\n        if (!prefixCharacters.includes(char))\n            break;\n        prefixIndex++;\n    }\n    while (suffixIndex > prefixIndex) {\n        const index = suffixIndex - 1;\n        const char = input.charAt(index);\n        if (!suffixCharacters.includes(char))\n            break;\n        suffixIndex = index;\n    }\n    return [\n        input.slice(0, prefixIndex),\n        splitFn(input.slice(prefixIndex, suffixIndex)),\n        input.slice(suffixIndex),\n    ];\n}\n//# sourceMappingURL=index.js.map"],"names":["SPLIT_LOWER_UPPER_RE","SPLIT_UPPER_UPPER_RE","RegExp","SPLIT_SEPARATE_NUMBER_RE","DEFAULT_STRIP_REGEXP","SPLIT_REPLACE_VALUE","split","value","result","trim","replace","start","end","length","charAt","slice","splitSeparateNumbers","words","i","word","match","exec","offset","index","splice","lowerFactory","locale","input","toLowerCase","toLocaleLowerCase","splitPrefixSuffix","options","splitFn","separateNumbers","prefixCharacters","suffixCharacters","prefixIndex","suffixIndex","char","includes","prefix","suffix","lower","upper","toLocaleUpperCase","upperFactory","transform","char0","pascalCaseTransformFactory","map","join","delimiter","noCase"],"mappings":"aACA,MAAMA,EAAuB,WAAA,0BAAA,MACvBC,EAAuB,IAAAC,OAAA,gCAAA,MAEvBC,EAA2B,IAAAD,OAAA,2BAAA,KAE3BE,EAAuB,iBAEvBC,EAAsB,SAMrB,SAASC,EAAMC,GAClB,IAAIC,EAASD,EAAME,OACnBD,EAASA,EACJE,QAAQV,EAAsBK,GAC9BK,QAAQT,EAAsBI,GACnCG,EAASA,EAAOE,QAAQN,EAAsB,MAC9C,IAAIO,EAAQ,EACRC,EAAMJ,EAAOK,OAEjB,KAAgC,OAAzBL,EAAOM,OAAOH,IACjBA,IACJ,GAAIA,IAAUC,EACV,MAAO,GACX,KAAkC,OAA3BJ,EAAOM,OAAOF,EAAM,IACvBA,IACJ,OAAOJ,EAAOO,MAAMJ,EAAOC,GAAKN,MAAM,MAC1C,CAIO,SAASU,EAAqBT,GACjC,MAAM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