{
  "schemaVersion": 1,
  "kind": "kittycord-studio",
  "language": "javascript",
  "metadata": {
    "id": "local.text-toolbox",
    "name": "Text Toolbox",
    "version": "1.0.0",
    "author": "Local author"
  },
  "source": "globalThis.kittycordPlugin = /** @type {KittyPlugin} */ ({\n    start(api) {\n        let result = \"Enter text in settings, then analyze it locally.\";\n        const show = () => api.publishPanel({title:\"Text Toolbox\",text:result,actions:[{id:\"analyze\",label:\"Analyze text\"},{id:\"clear\",label:\"Clear result\"}],settings:[{id:\"text\",label:\"Text to analyze locally\",type:\"text\",default:\"\"}]});\n        api.onAction(id => { if(id === \"analyze\") { const text = String(api.settings.text ?? \"\"); const words = text.match(/[\\p{L}\\p{N}]+/gu) ?? []; result = \"Characters: \" + Array.from(text).length + \". Words: \" + words.length + \". Unique words: \" + new Set(words.map(word => word.toLowerCase())).size; } else if(id === \"clear\") result = \"Result cleared.\"; show(); });\n        api.onSettings(() => { result = \"Settings saved locally. Choose Analyze text.\"; show(); }); show();\n    }\n});",
  "tokens": [],
  "tests": [],
  "api": "utility-v1"
}