joplin-plugin-theme-studio 1.5.2 → 1.6.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/README.md CHANGED
@@ -15,7 +15,12 @@ Theme Studio is a modular palette and typography engine for Joplin. It applies u
15
15
  - CodeMirror Markdown Editor (gutters, syntax highlighting, active line, caret, selection).
16
16
  - TinyMCE Rich Text Editor (iframe document and toolbar).
17
17
  - Desktop Application Shell (Sidebar, Note List, Header, Search Bar, Splitters, and Sync Panel).
18
- - **12 Integrated Color Schemes:** Switch between dark and light palettes (Tokyo Night, Everforest, Catppuccin, Nord, Dracula, Gruvbox, Atom One) without restarting Joplin.
18
+ - **29 Integrated Color Schemes:** Switch between dark and light palettes (Tokyo Night, Everforest, Catppuccin, Nord, Dracula, Gruvbox, Atom One, One Dark Pro, Rose Pine, Solarized, GitHub, Monokai, SynthWave and more) without restarting Joplin.
19
+ - **Custom Palette Builder:** Pick three base colours (background, foreground, accent) and the plugin derives a complete palette automatically — headings, surfaces, code, tables, scrollbars, and syntax tokens.
20
+ - **Palette Import & Export:** Export every palette (built-in and imported) as shareable JSON, and import palettes back from the clipboard. Imported palettes join the theme selector and support automatic light/dark switching when they declare a pairing.
21
+ - **Per-Notebook / Per-Tag Theme Overrides:** Pin a different palette to specific notebooks (by ID or title) or tags, so e.g. work notes use one palette while personal notes use another. The effective palette is resolved automatically from the active note.
22
+ - **Command-Palette Theme Picker:** One command per palette (`Theme Studio: Use <Theme Name>`) lets keyboard-only users jump straight to any theme from the Command Palette — no cycling required.
23
+ - **Mobile Density Presets:** A Compact / Default / Large toggle scales the note font size on screens under 768px, improving small-screen readability without touching desktop rendering.
19
24
  - **Third-Party Plugin Panel Synchronization:** Propagates theme variables, background colors, and font styles into webview panels created by third-party plugins (such as *Outline* and *Note Tabs*).
20
25
  - **Configurable Heading Typography Scales:** Choose between balanced, large editorial, compact dense, or custom comma-separated typographic scales for H1 through H6 headings.
21
26
  - **Smart BiDi Locale Detection:** Queries Joplin's interface language on launch. Automatically defaults to LTR with Inter for global locales, and RTL with Vazirmatn for Persian, Arabic, and Hebrew interfaces.
@@ -86,6 +91,22 @@ Theme Studio is a modular palette and typography engine for Joplin. It applies u
86
91
  | **Gruvbox Light** | Light | Retro parchment light palette with warm accents |
87
92
  | **Atom One Dark** | Dark | Traditional Atom editor syntax theme |
88
93
  | **Atom One Light** | Light | High-clarity light theme with crisp editor contrast |
94
+ | **Solarized Dark** | Dark | Iconic warm cyan-teal background with earthy accents |
95
+ | **Solarized Light** | Light | Warm cream background with the Solarized accent palette |
96
+ | **GitHub Dark** | Dark | GitHub's modern dark UI palette with cool grays |
97
+ | **GitHub Light** | Light | GitHub's clean light UI palette |
98
+ | **Tomorrow Night** | Dark | Classic pastel dark theme with soft syntax colors |
99
+ | **Tomorrow** | Light | Classic pastel light theme with soft syntax colors |
100
+ | **Ayu Dark** | Dark | Low-saturation dark palette with crisp cyan accents |
101
+ | **Ayu Light** | Light | Low-saturation paper palette with cyan accents |
102
+ | **Monokai** | Dark | The classic vibrant syntax-highlighting palette |
103
+ | **Synthwave '84** | Dark | Retro neon-pink and cyan synthwave aesthetic |
104
+ | **One Dark Pro** | Dark | VS Code's polished dark palette with violet accents |
105
+ | **Rose Pine** | Dark | Soothing muted dark palette with dusty pink accents |
106
+ | **Rose Pine Dawn** | Light | Warm morning variant of Rose Pine |
107
+ | **Gruvbox Material Dark** | Dark | Material-design take on the retro Gruvbox palette |
108
+ | **Gruvbox Material Light** | Light | Material-design light Gruvbox with warm gold accents |
109
+ | **Nord Night** | Dark | Deeper Nord variant for low-light reading |
89
110
 
90
111
  ---
91
112
 
@@ -113,26 +134,140 @@ Theme Studio is a modular palette and typography engine for Joplin. It applies u
113
134
 
114
135
  ---
115
136
 
137
+ ### Whiteboards (desktop)
138
+
139
+ On Joplin 3.7 and later, the application shell theme also colors the native
140
+ whiteboard canvas, controls, and uncolored cards. Disable **Theme Application
141
+ Shell** to restore Joplin's whiteboard appearance. Explicit card, group, and
142
+ edge colors are kept intact; their shades are chosen by Joplin based on its own
143
+ light/dark setting, so choose a matching Joplin appearance for best contrast.
144
+ Whiteboard theming depends on Joplin's desktop chrome stylesheet API. It does
145
+ not theme third-party drawing plugins or change saved whiteboard data.
146
+
116
147
  ## ⚙️ Configuration Reference
117
148
 
118
- Access the settings panel under **Tools > Options > Theme Studio** (on Mobile: **Configuration > Plugins > Theme Studio**):
149
+ All settings live on a single plugin page under **Tools > Options > Theme Studio** (on Mobile: **Configuration > Plugins > Theme Studio**). The page is organized into five native, collapsible sections — **Theme & Appearance**, **Typography**, **Code & Markdown Elements**, **Export** and **Advanced** — each with its own icon and description, so related settings are visually grouped instead of listed as a flat list.
150
+
151
+ ### Theme & Appearance
119
152
 
120
153
  | Setting Key | Options / Inputs | Default | Description |
121
154
  | :--- | :--- | :--- | :--- |
122
- | **Color Theme** | 12 built-in palettes | `Atom One Dark` | Sets document, editor, and UI chrome color tokens |
155
+ | **Color Theme** | 29 built-in palettes + custom & imported palettes | `Atom One Dark` | Sets document, editor, and UI chrome color tokens |
123
156
  | **Layout Direction** | `LTR`, `Auto-Detect (BiDi)`, `RTL` | Auto-detected | Primary text direction and border alignment |
124
157
  | **Apply Theme to Markdown Editor** | `true` / `false` | `true` | Styles CodeMirror 6/5 and TinyMCE editors |
125
158
  | **Theme Application Shell** | `true` / `false` | `true` | Applies palette to Joplin sidebar, note list, and toolbars (Desktop only) |
159
+ | **Color Scheme Mode** | `Use Selected Theme`, `Follow System (Light / Dark)` | `Use Selected Theme` | Follows the OS light/dark preference; themes without a matching counterpart keep their own look |
160
+ | **Per-Notebook Theme Overrides** | Multiline `id:`/`title:` mappings | *(empty)* | Pins a palette to notebooks (by ID or title) for the active note |
161
+ | **Per-Tag Theme Overrides** | Multiline `id:`/`title:` mappings | *(empty)* | Pins a palette to tags (by ID or title) for the active note |
162
+ | **Note Theme (Resolved)** | Palette key | *(auto)* | Internal: the palette resolved for the active note from the overrides above |
163
+
164
+ ### Typography
165
+
166
+ | Setting Key | Options / Inputs | Default | Description |
167
+ | :--- | :--- | :--- | :--- |
126
168
  | **International Font Preset** | 11 font presets | Auto-detected | On-demand web font loaded via CDN |
127
169
  | **Custom Font Stack** | CSS `font-family` string | System Stack | Active when preset is set to *Custom* |
128
- | **Code Font Preset** | `Fira Code`, `JetBrains Mono`, `System`, `Custom` | `Fira Code` | Monospace font for code blocks and editor |
129
- | **Custom Code Font Stack** | CSS `font-family` string | Cascadia / Consolas | Active when code preset is set to *Custom* |
130
170
  | **Font Size** | Text string (e.g., `16px`, `18px`) | `16px` | Scales base text size across desktop & mobile |
131
171
  | **Line Height** | Numeric string (e.g., `1.6`, `1.75`) | `1.75` | Sets body reading line spacing |
172
+ | **Letter Spacing** | CSS length (e.g., `0.5px`, `0.02em`) | *(empty)* | Opt-in letter-spacing applied to rendered notes |
173
+ | **Paragraph Alignment** | `Left`, `Justify` | `Left` | Justifies body paragraphs for long-form reading |
174
+ | **Hyphenation** | `true` / `false` | `false` | Enables `hyphens: auto` for justified text |
175
+ | **Font Ligatures** | `true` / `false` | `false` | Enables common ligatures and `font-feature-settings` |
176
+ | **Mobile Density** | `Compact`, `Default`, `Large` | `Default` | Font size scale applied on screens under 768px (Compact 0.85×, Default 1×, Large 1.15×) |
132
177
  | **Heading Sizes Preset** | `Balanced`, `Large`, `Compact`, `Custom` | `Balanced` | Typographic scale applied to H1 through H6 headings |
133
178
  | **Custom Heading Sizes** | Comma-separated sizes string | `1.75em, 1.42em, ...` | Custom sizes for H1 to H6 (e.g., `28px, 24px, 20px, ...`) |
134
179
  | **Reading Width (Focus Mode)** | `Full Width`, `Comfortable (920px)`, `Compact (760px)` | `Full Width` | Constrains note container width on wide monitors |
180
+
181
+ ### Code & Markdown Elements
182
+
183
+ | Setting Key | Options / Inputs | Default | Description |
184
+ | :--- | :--- | :--- | :--- |
185
+ | **Code Font Preset** | `Fira Code`, `JetBrains Mono`, `System`, `Custom` | `Fira Code` | Monospace font for code blocks and editor |
186
+ | **Custom Code Font Stack** | CSS `font-family` string | Cascadia / Consolas | Active when code preset is set to *Custom* |
187
+ | **Style Blockquotes** | `true` / `false` | `true` | Apply theme border, background and padding to blockquotes |
188
+ | **Style Tables** | `true` / `false` | `true` | Apply theme borders, stripes and cell padding to tables |
189
+ | **Style Images** | `true` / `false` | `true` | Apply theme shadow, border-radius and max-height to images |
190
+ | **Style Headings** | `true` / `false` | `true` | Apply theme colours and heading accent borders |
191
+ | **Style Links** | `true` / `false` | `true` | Apply theme link colour and underline |
192
+ | **Style Code Blocks** | `true` / `false` | `true` | Apply theme backgrounds and borders to code blocks and inline code |
193
+
194
+ ### Export
195
+
196
+ | Setting Key | Options / Inputs | Default | Description |
197
+ | :--- | :--- | :--- | :--- |
135
198
  | **PDF Export Appearance** | `Exact Match`, `Paper Friendly` | `Exact Match` | Controls background retention in exported PDFs |
199
+ | **PDF Page Size** | `A4`, `US Letter`, `A5`, `A3`, `US Legal`, `Auto` | `A4` | Standard paper dimensions for PDF export |
200
+ | **PDF Page Margins** | `Standard`, `Comfortable`, `Compact`, `None`, `Custom` | `Standard` | Page margin width when exporting to PDF |
201
+ | **Custom PDF Page Margins** | CSS margin string | `15mm 18mm` | Active when margins preset is set to *Custom* |
202
+
203
+ ### Advanced
204
+
205
+ | Setting Key | Options / Inputs | Default | Description |
206
+ | :--- | :--- | :--- | :--- |
207
+ | **Custom CSS for Notes** | CSS string (single line recommended) | *(empty)* | Extra CSS appended after the theme stylesheet (notes and Rich Text editor) |
208
+ | **Custom Palette Name** | Text string | `Custom Palette` | Name of the generated custom palette |
209
+ | **Custom Palette Background** | Hex colour (`#RRGGBB`) | *(empty)* | Base background colour for the custom palette |
210
+ | **Custom Palette Foreground** | Hex colour (`#RRGGBB`) | *(empty)* | Base foreground colour for the custom palette |
211
+ | **Custom Palette Accent** | Hex colour (`#RRGGBB`) | *(empty)* | Base accent colour for the custom palette |
212
+ | **Imported Palettes (JSON)** | JSON array | *(empty)* | Stored palettes imported via the clipboard command |
213
+
214
+ ### Palette Import & Export
215
+
216
+ Two commands manage palette sharing (Command Palette or Keyboard Shortcuts):
217
+
218
+ - **Theme Studio: Export all palettes to clipboard** — serializes every built-in
219
+ and imported palette (name, dark/light flag, full `--od-*` variable set) to
220
+ clipboard JSON.
221
+ - **Theme Studio: Import palettes from clipboard** — parses a JSON payload
222
+ (bare array, single palette object, or `{ "palettes": [...] }` wrapper),
223
+ validates every palette, and merges valid entries into the **Imported
224
+ Palettes** setting. Imported palettes appear in the **Color Theme** selector
225
+ and participate in automatic light/dark switching when they declare a
226
+ `pairWith` counterpart.
227
+
228
+ The **Custom Palette Builder** settings generate a complete palette from three
229
+ base colours: the heading scale is derived from the accent with modest hue
230
+ rotations, surfaces and code backgrounds from luminance mixes, and syntax
231
+ tokens from the derived contrast palette. A valid background, foreground and
232
+ accent are required before the palette is added to the selector.
233
+
234
+ ### Theme Picker Commands
235
+
236
+ Beyond **Theme Studio: Next colour theme** (which cycles through the palettes
237
+ one at a time), the plugin registers one command per palette —
238
+ **Theme Studio: Use <Theme Name>** — for every built-in, custom and imported
239
+ palette. Each command appears directly in the Command Palette and Keyboard
240
+ Shortcuts screen, so keyboard-only users can jump straight to a specific
241
+ theme by name without cycling.
242
+
243
+ ---
244
+
245
+ ## 🌗 Automatic Light / Dark Switching
246
+
247
+ When **Color Scheme Mode** is set to `Follow System (Light / Dark)`, the plugin
248
+ emits `@media (prefers-color-scheme: dark)` and `@media (prefers-color-scheme:
249
+ light)` blocks that swap in a matched light/dark counterpart palette at runtime,
250
+ so the note, editor and application shell follow the OS appearance automatically —
251
+ no restart or note re-render needed.
252
+
253
+ Eight theme families ship as true light/dark pairs and switch seamlessly:
254
+ **Atom One**, **Everforest**, **Catppuccin**, **Gruvbox**, **Solarized**,
255
+ **GitHub**, **Tomorrow** and **Ayu**. The remaining themes (Tokyo Night,
256
+ Tokyo Night Storm, Nord, Dracula, Monokai and Synthwave '84) have no matching
257
+ counterpart, so they keep their own look in both schemes rather than silently
258
+ changing palette. The native `color-scheme` is set alongside each block so
259
+ scrollbars, form controls and other UA chrome follow too.
260
+
261
+ ---
262
+
263
+ ## 👁️ Live Preview Panel
264
+
265
+ The **Theme Studio: Open live preview** command (Command Palette or Keyboard
266
+ Shortcuts) opens a floating panel that renders a sample note using the current
267
+ theme, fonts, direction and scheme settings. Edit any setting under **Tools >
268
+ Options > Theme Studio** and the preview updates automatically, so you can see
269
+ the effect of every change — including per-element style toggles and automatic
270
+ light/dark switching — before applying it to your notes.
136
271
 
137
272
  ---
138
273
 
@@ -168,13 +303,34 @@ When **Layout Direction** is set to `RTL`, left-to-right code explanations, Engl
168
303
  git clone https://github.com/xyasharx/joplin-plugin-theme-studio.git
169
304
  cd joplin-plugin-theme-studio
170
305
 
171
- # 2. Install dependencies
172
- npm install
306
+ # 2. Install locked dependencies
307
+ npm ci
308
+
309
+ # 3. Type-check, build, and run regression tests
310
+ npm test
173
311
 
174
- # 3. Compile TypeScript and build .jpl bundle
312
+ # 4. Build the .jpl bundle
175
313
  npm run dist
176
314
  ```
177
315
 
316
+ The build uses TypeScript 7 for type checking and esbuild-loader for transpilation.
317
+ Both `npm run build` and `npm run dist` run the type check; the loader does
318
+ not type-check by itself.
319
+
320
+ ### Publishing safely
321
+
322
+ Before running the **Build & Release** workflow, update the version in
323
+ `package.json`, `package-lock.json` (including its root package), and
324
+ `src/manifest.json`. The workflow refuses existing release tags, versions not
325
+ newer than the latest published release, mismatched version files, and tags
326
+ that do not match the checked-out commit. A failed GitHub API check also stops
327
+ publishing. Local `npm run build` and `npm run dist` do not publish releases.
328
+
329
+ The check runs in the workflow version at the selected ref: do not manually
330
+ run an older tag whose workflow predates this safeguard. Release workflows are
331
+ serialized, but changes made independently through GitHub's UI or API cannot
332
+ be locked by this workflow.
333
+
178
334
  The compiled archive and hash metadata will be generated in the `publish/` directory:
179
335
  - `publish/org.joplin.plugin.theme-studio.jpl`
180
336
  - `publish/org.joplin.plugin.theme-studio.json`
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={998(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default="undefined"!=typeof joplin?joplin:global.joplin},143(t,n){var o,e;n.SettingItemType=n.ContentScriptType=void 0,function(t){t.MarkdownItPlugin="markdownItPlugin",t.CodeMirrorPlugin="codeMirrorPlugin"}(o||(n.ContentScriptType=o={})),function(t){t[t.Int=1]="Int",t[t.String=2]="String",t[t.Bool=3]="Bool",t[t.Array=4]="Array",t[t.Object=5]="Object",t[t.Button=6]="Button"}(e||(n.SettingItemType=e={}))},156(t,n,o){var e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});const r=e(o(998)),a=o(143),i=o(800),d=o(880);r.default.plugins.register({onStart:async function(){let t="ltr",n="inter",o=null,e="desktop";try{const t="function"==typeof r.default.versionInfo?await r.default.versionInfo():null;!t||"mobile"!==t.platform&&"desktop"!==t.platform||(e=t.platform)}catch(t){console.warn("[Theme Studio] Could not detect platform. Assuming desktop:",t)}const l="mobile"===e;try{let o="";if("function"==typeof r.default.settings.globalValues){const t=await r.default.settings.globalValues(["locale"]);o=t&&t[0]?String(t[0]):""}else"function"==typeof r.default.settings.globalValue&&(o=await r.default.settings.globalValue("locale"));o&&["fa","ar","he","ur","ug","ps","yi"].some(t=>o.toLowerCase().startsWith(t))&&(t="rtl",n="vazirmatn")}catch(o){console.warn("[Theme Studio] Could not detect user locale. Defaulting to LTR / Inter:",o),t="ltr",n="inter"}await r.default.settings.registerSection("themeStudioSection",{label:"Theme Studio",iconName:"fas fa-palette"}),await r.default.settings.registerSettings({theme:{value:"atom-one-dark",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"Color Theme",description:"Choose your desired color scheme.",options:{"atom-one-dark":"Atom One Dark","atom-one-light":"Atom One Light","tokyo-night":"Tokyo Night","tokyo-night-storm":"Tokyo Night Storm","everforest-dark":"Everforest Dark","everforest-light":"Everforest Light","catppuccin-mocha":"Catppuccin Mocha","catppuccin-latte":"Catppuccin Latte",nord:"Nord",dracula:"Dracula","gruvbox-dark":"Gruvbox Dark","gruvbox-light":"Gruvbox Light"}},direction:{value:t,type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"Layout Direction",description:"Primary text orientation. LTR is standard; Auto adjusts per paragraph.",options:{ltr:"Left-to-Right (LTR - English / Latin / CJK / Global)",auto:"Auto-Detect (Per-Paragraph BiDi)",rtl:"Right-to-Left (RTL - Persian / Arabic / Hebrew)"}},enableEditorTheme:{value:!0,type:a.SettingItemType.Bool,section:"themeStudioSection",public:!0,label:"Apply Theme to Markdown Editor",description:"Styles the CodeMirror editor (background, colors, line numbers, headings) to match the viewer."},themeApplicationShell:{value:!0,type:a.SettingItemType.Bool,section:"themeStudioSection",public:!0,label:"Theme Application Shell (Sidebar & Note List)",description:"Applies the active palette to Joplin's desktop sidebar, note list, and header (Desktop only)."},fontPreset:{value:n,type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"International Font Preset",description:"Web fonts loaded on the fly (ideal for Mobile without local font installs).",options:{inter:"Inter (Global English, Latin, European, Cyrillic)",roboto:"Roboto (Modern Clean Sans)",system:"System Default (OS Native, Zero Network Overhead)",vazirmatn:"Vazirmatn (Persian, Arabic, Kurdish, Urdu)","noto-arabic":"Noto Sans Arabic (Modern Arabic)","noto-cjk-sc":"Noto Sans SC (Simplified Chinese)","noto-cjk-jp":"Noto Sans JP (Japanese)",heebo:"Heebo (Hebrew & Latin)","noto-devanagari":"Noto Sans Devanagari (Hindi, Sanskrit)",lora:"Lora (Editorial Serif for Books & Long Articles)",custom:"Custom Font Stack (use field below)"}},fontFamily:{value:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Custom Font Stack",description:'Active only when "Custom Font Stack" is selected above.'},codeFontPreset:{value:"fira-code",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"Code Font Preset",description:"Monospace font for inline code and code blocks.",options:{"fira-code":"Fira Code (Modern Tech Monospace)","jetbrains-mono":"JetBrains Mono (Developer Favorite)","system-mono":"System Monospace (Cascadia/Consolas/Courier)",custom:"Custom Code Font (use field below)"}},codeFont:{value:"'Cascadia Code', 'Fira Code', 'Consolas', monospace",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Custom Code Font Stack",description:'Active only when "Custom Code Font" is selected above.'},fontSize:{value:"16px",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Font Size",description:"Base font size (e.g., 14px, 16px, 18px, 20px). Works across Desktop & Mobile."},lineHeight:{value:"1.75",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Line Height",description:"Reading line spacing (e.g., 1.6, 1.75, 1.9)."},headingSizePreset:{value:"balanced",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"Heading Sizes Preset",description:"Typographic scale applied to H1 through H6 headings.",options:{balanced:"Balanced / Standard (H1: 1.75em, H2: 1.42em, H3: 1.25em...)",large:"Large / Editorial (H1: 2.15em, H2: 1.7em, H3: 1.4em...)",compact:"Compact / Dense (H1: 1.5em, H2: 1.3em, H3: 1.18em...)",custom:"Custom Sizes (Configured below)"}},customHeadingSizes:{value:"1.75em, 1.42em, 1.25em, 1.12em, 1.05em, 1.0em",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Custom Heading Sizes (H1 - H6)",description:'Active only when "Custom Sizes" is selected. Comma-separated sizes from H1 to H6 (e.g., 28px, 24px, 20px, 18px, 16px, 14px or 2.2em, 1.7em, 1.4em, 1.2em, 1.1em, 1.0em).'},contentMaxWidth:{value:"full",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"Reading Width (Focus Mode)",description:"Constrain line length on wide desktop monitors for comfortable reading.",options:{full:"Full Width (100%)",comfortable:"Comfortable Reading (920px Centered)",compact:"Compact Focus (760px Centered)"}},pdfExportStyle:{value:"exact",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"PDF Export Appearance",description:"Controls layout and background fidelity when exporting to PDF.",options:{exact:"Exact Match (100% Identical to Screen Layout & Theme)",paper:"Paper Friendly (White Page Background with Themed Accents)"}},pdfPageSize:{value:"a4",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"PDF Page Size",description:"Standard paper dimensions for PDF export.",options:{a4:"A4 (210 × 297 mm - Global Standard)",letter:"US Letter (8.5 × 11 in - North America)",a5:"A5 (148 × 210 mm - Compact)",a3:"A3 (297 × 420 mm - Large Format)",legal:"US Legal (8.5 × 14 in)",auto:"Auto (Printer / OS Default)"}},pdfPageMargin:{value:"standard",type:a.SettingItemType.String,section:"themeStudioSection",isEnum:!0,public:!0,label:"PDF Page Margins",description:"Page margin width when exporting to PDF.",options:{standard:"Standard Margins (15mm top/bottom, 18mm sides)",comfortable:"Comfortable / Wide Margins (20mm all sides)",compact:"Compact / Narrow Margins (8mm all sides)",none:"Zero Margins / Full Bleed (0mm - Edge to Edge)",custom:"Custom Margins (Configured below)"}},customPdfMargin:{value:"15mm 18mm",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Custom PDF Page Margins",description:'Active only when "Custom Margins" is selected above (e.g., "15mm 18mm", "1in", "10mm 15mm 10mm 15mm").'},customCss:{value:"",type:a.SettingItemType.String,section:"themeStudioSection",public:!0,label:"Custom CSS for notes",description:'Extra CSS appended after the theme stylesheet (notes and Rich Text editor). Keep it on one line, e.g. "#rendered-md h1 { letter-spacing: -0.5px; }".'}});const s=["theme","direction","enableEditorTheme","themeApplicationShell","fontPreset","fontFamily","codeFontPreset","codeFont","fontSize","lineHeight","headingSizePreset","customHeadingSizes","contentMaxWidth","pdfExportStyle","pdfPageSize","pdfPageMargin","customPdfMargin","customCss"];async function m(){var o,e;let a={};if("function"==typeof r.default.settings.values)a=await r.default.settings.values(s);else{const t=await Promise.all(s.map(t=>r.default.settings.value(t)));s.forEach((n,o)=>{a[n]=t[o]})}return{options:{themeKey:a.theme||"atom-one-dark",direction:a.direction||t,fontPreset:a.fontPreset||n,fontFamily:a.fontFamily||"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",codeFontPreset:a.codeFontPreset||"fira-code",codeFont:a.codeFont||"'Cascadia Code', 'Fira Code', 'Consolas', monospace",fontSize:a.fontSize||"16px",lineHeight:a.lineHeight||"1.75",contentMaxWidth:a.contentMaxWidth||"full",pdfExportStyle:a.pdfExportStyle||"exact",headingSizePreset:a.headingSizePreset||"balanced",customHeadingSizes:a.customHeadingSizes||"1.75em, 1.42em, 1.25em, 1.12em, 1.05em, 1.0em",pdfPageSize:a.pdfPageSize||"a4",pdfPageMargin:a.pdfPageMargin||"standard",customPdfMargin:a.customPdfMargin||"15mm 18mm",customCss:a.customCss||""},editorEnabled:null===(o=a.enableEditorTheme)||void 0===o||o,shellEnabled:null===(e=a.themeApplicationShell)||void 0===e||e}}async function p(){let t={};if("function"==typeof r.default.settings.values)t=await r.default.settings.values(s);else{const n=await Promise.all(s.map(t=>r.default.settings.value(t)));s.forEach((o,e)=>{t[o]=n[e]})}const n=s.map(n=>{var o;return`${n}=${String(null!==(o=t[n])&&void 0!==o?o:"")}`}).join("");return`${e}:${n}`}let c=Promise.resolve();async function b(t,n){const e=async()=>{if(!l)try{if(r.default.window&&"function"==typeof r.default.window.loadChromeCssFile){const e=n?(0,i.buildChromeCss)(t):"";if(e===o)return;const a=r.default.require("fs-extra"),d=`${await r.default.plugins.dataDir()}/theme-studio-chrome.css`;await a.writeFile(d,e,"utf8"),await r.default.window.loadChromeCssFile(d),o=e}}catch(t){console.warn("[Theme Studio] Could not synchronize desktop chrome stylesheet:",t)}};return c=c.then(e,e),c}const g=await m();await b(g.options,g.shellEnabled),await r.default.settings.onChange(async t=>{if((null==t?void 0:t.keys)&&!t.keys.some(t=>s.includes(t)))return;const n=await m();await b(n.options,n.shellEnabled)});const h=Object.keys(d.themes),u=async()=>{const t=await m();await b(t.options,t.shellEnabled)};await r.default.commands.register({name:"themeStudio.nextTheme",label:"Theme Studio: Next colour theme",iconName:"fas fa-palette",execute:async()=>{const t=await m(),n=h.indexOf(t.options.themeKey),o=h[(n+1)%h.length];await r.default.settings.setValue("theme",o),await u()}}),await r.default.commands.register({name:"themeStudio.toggleShell",label:"Theme Studio: Toggle application shell theming",iconName:"fas fa-columns",execute:async()=>{const t=await m();await r.default.settings.setValue("themeApplicationShell",!t.shellEnabled),await u()}}),await r.default.commands.register({name:"themeStudio.toggleEditor",label:"Theme Studio: Toggle Markdown editor theming",iconName:"fas fa-code",execute:async()=>{const t=await m();await r.default.settings.setValue("enableEditorTheme",!t.editorEnabled)}}),await r.default.commands.register({name:"themeStudio.copyCss",label:"Theme Studio: Copy generated note CSS to clipboard",iconName:"fas fa-copy",execute:async()=>{const t=await m();try{await r.default.clipboard.writeText((0,i.buildThemeCss)(t.options,"viewer"))}catch(t){console.warn("[Theme Studio] Could not copy the CSS to the clipboard:",t)}}}),await r.default.contentScripts.register(a.ContentScriptType.CodeMirrorPlugin,"themeStudioCodeMirror","./codeMirrorTheme.js"),await r.default.contentScripts.onMessage("themeStudioCodeMirror",async t=>{if(t&&"getStyleVersion"===t.type)return{version:await p()};if(t&&("getAllStyles"===t.type||"getEditorStyles"===t.type)){const t=await m();return await b(t.options,t.shellEnabled),{version:await p(),editorCss:t.editorEnabled?(0,i.buildEditorCss)(t.options):"",viewerCss:(0,i.buildThemeCss)(t.options,"tinymce"),panelCss:!l&&t.shellEnabled?(0,i.buildPanelCss)(t.options):"",platform:e}}return null}),await r.default.contentScripts.register(a.ContentScriptType.MarkdownItPlugin,"themeStudioMarkdownIt","./markdownTheme.js")}})},800(t,n,o){n.buildEditorCss=function(t){const n=c(t),{fontImport:o,resolvedFont:e,resolvedCodeFont:r}=k(t),a=b(n);let i="";return i="rtl"===t.direction?"\n .cm-content, .CodeMirror-lines, body#tinymce {\n direction: rtl !important;\n text-align: right !important;\n }\n ":"auto"===t.direction?"\n .cm-content, .CodeMirror-lines, body#tinymce {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"\n .cm-content, .CodeMirror-lines, body#tinymce {\n direction: ltr !important;\n text-align: left !important;\n }\n ",`\n${o}\n${a}\n\n/* Outer editor container & scroller get the theme background */\nhtml body div.cm-editor,\nhtml body div.cm-editor .cm-scroller,\nhtml body div.CodeMirror,\nhtml body .r-markdown-editor {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n font-family: ${e} !important;\n}\n\n/* Content and lines MUST remain transparent so CodeMirror's selection layer is visible */\n.cm-content,\n.cm-line,\n.CodeMirror-lines,\n.CodeMirror-sizer {\n background-color: transparent !important;\n}\n\n.cm-content, .CodeMirror-lines {\n font-size: ${f(t.fontSize,"16px")} !important;\n line-height: ${v(t.lineHeight,"1.75")} !important;\n caret-color: var(--od-link) !important;\n}\n\n${i}\n\n/* Gutters & Line Numbers */\n.cm-gutters, .CodeMirror-gutters {\n background-color: var(--od-bg-alt) !important;\n color: var(--od-comment) !important;\n border-right: 1px solid var(--od-border) !important;\n}\n.cm-activeLineGutter {\n background-color: var(--od-bg-alt) !important;\n color: var(--od-h2) !important;\n font-weight: bold !important;\n}\n.cm-activeLine, .CodeMirror-activeline-background {\n background-color: rgba(127, 127, 127, 0.08) !important;\n}\n\n/* Cursor & Selection (Fully unmasked for CodeMirror 6 and CodeMirror 5) */\n.CodeMirror-cursor,\n.cm-cursor,\n.cm-dropCursor {\n border-left: 2px solid var(--od-link) !important;\n border-left-color: var(--od-link) !important;\n}\n.cm-lineNumbers .cm-gutterElement {\n color: var(--od-comment) !important;\n}\n.cm-selectionBackground,\n.cm-editor .cm-selectionLayer .cm-selectionBackground,\n.cm-content ::selection,\n.cm-line ::selection,\n.CodeMirror-selected,\n.CodeMirror-focused .CodeMirror-selected,\n::selection {\n background-color: var(--od-selection) !important;\n}\n\n/* Syntax Highlighting in Markdown Editor */\n.cm-header-1, .tok-heading-1 { color: var(--od-h1) !important; font-weight: 700 !important; }\n.cm-header-2, .tok-heading-2 { color: var(--od-h2) !important; font-weight: 700 !important; }\n.cm-header-3, .tok-heading-3 { color: var(--od-h3) !important; font-weight: 600 !important; }\n.cm-header-4, .tok-heading-4 { color: var(--od-h4) !important; font-weight: 600 !important; }\n.cm-header-5, .tok-heading-5 { color: var(--od-h5) !important; }\n.cm-header-6, .tok-heading-6 { color: var(--od-h6) !important; }\n\n.cm-link, .tok-link { color: var(--od-link) !important; text-decoration: underline !important; }\n.cm-url, .tok-url { color: var(--od-link-hover) !important; }\n.cm-strong, .tok-strong { font-weight: bold !important; color: var(--od-fg) !important; }\n.cm-em, .tok-emphasis { font-style: italic !important; }\n.cm-comment, .tok-comment { color: var(--od-comment) !important; }\n.cm-quote, .tok-quote { color: var(--od-comment) !important; font-style: italic !important; }\n\n.tok-monospace, .cm-inline-code, .cm-variable-2 {\n font-family: ${r} !important;\n background-color: var(--od-code-bg) !important;\n color: var(--od-code-fg) !important;\n border-radius: 3px !important;\n}\n\n/* TinyMCE (Rich Text Editor) Shell & Toolbar Theming */\n.tox-tinymce {\n border: 1px solid var(--od-border) !important;\n background-color: var(--od-bg) !important;\n}\n.tox .tox-toolbar,\n.tox .tox-toolbar__primary,\n.tox .tox-toolbar__overflow {\n background-color: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n.tox .tox-tbtn {\n color: var(--od-fg) !important;\n}\n.tox .tox-tbtn:hover {\n background-color: var(--od-selection) !important;\n}\n.tox .tox-tbtn svg {\n fill: var(--od-fg) !important;\n}\n`},n.buildChromeCss=x,n.buildPanelCss=function(t){if(!x(t))return"";const n=e.themes[t.themeKey]||e.themes["atom-one-dark"];return`:root {\n${Object.entries(n.variables).map(([t,n])=>` ${t}: ${n};`).join("\n")}\n --joplin-background-color: var(--od-bg) !important;\n --joplin-background-color-transparent30: var(--od-selection) !important;\n --joplin-background-color-hover3: var(--od-bg-alt) !important;\n --joplin-color: var(--od-fg) !important;\n --joplin-color-hover: var(--od-link) !important;\n --joplin-divider-color: var(--od-border) !important;\n --joplin-scrollbar-thumb-color: var(--od-scrollbar-thumb) !important;\n --joplin-scrollbar-color-hover: var(--od-scrollbar-hover) !important;\n}\nbody {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n}\n::-webkit-scrollbar-thumb {\n background: var(--od-scrollbar-thumb) !important;\n}\n`},n.buildThemeCss=function(t,n="viewer"){const o="tinymce"!==n,e=o?"#rendered-md":"body#tinymce",d=c(t),l=function(t){const n=t.variables,o=n["--od-pre-bg"]||n["--od-bg"],e={"--od-tok-keyword":n["--od-h4"],"--od-tok-string":n["--od-h3"],"--od-tok-number":n["--od-h6"],"--od-tok-function":n["--od-h2"],"--od-tok-type":n["--od-h5"],"--od-tok-tag":n["--od-h1"],"--od-tok-comment":n["--od-comment"],"--od-tok-fg":n["--od-fg"],"--od-tok-accent":n["--od-link"]};let r=":root {\n";for(const[t,n]of Object.entries(e))r+=` ${t}: ${p(n,o)};\n`;return r+="}\n",r}(d),{fontImport:s,resolvedFont:m,resolvedCodeFont:x}=k(t),y=function(t){const n=i.balanced,o=t.headingSizePreset||"balanced";if("large"===o||"compact"===o)return i[o];if("custom"===o&&t.customHeadingSizes){const o=t.customHeadingSizes.split(",").map(t=>t.replace(/h[1-6]:?/gi,"").trim()).filter(t=>g.test(t)||h.test(t)||/^calc\([^;{}<>]+\)$/.test(t));return{h1:o[0]||n.h1,h2:o[1]||n.h2,h3:o[2]||n.h3,h4:o[3]||n.h4,h5:o[4]||n.h5,h6:o[5]||n.h6}}return n}(t),w=b(d,` --mermaid-font-family: ${m} !important;\n`);let S="";if("rtl"===t.direction)S=`\nbody, ${e} { direction: rtl !important; text-align: right !important; }\n${e} h1 { text-align: right !important; }\n${e} h2 {\n border-right: 5px solid var(--od-h2) !important;\n border-left: none !important;\n padding-right: 12px !important;\n padding-left: 0 !important;\n text-align: right !important;\n}\n${e} :is(h3, h4, h5, h6) { text-align: right !important; }\n${e} :is(ul, ol) {\n direction: rtl !important;\n text-align: right !important;\n padding-right: 2.2em !important;\n padding-left: 0 !important;\n}\n${e} li {\n direction: rtl !important;\n text-align: right !important;\n}\n${e} :is(ul, ol) :is(ul, ol) {\n padding-right: 1.6em !important;\n padding-left: 0 !important;\n}\n.md-checkbox input[type="checkbox"] { margin-left: 8px !important; margin-right: 0 !important; }\n\n/* RTL Blockquotes: 1px Right Border & No Left Border */\n${e} blockquote {\n direction: rtl !important;\n text-align: right !important;\n border-right: 1px solid var(--od-comment) !important;\n border-left: 0 !important;\n}\n${e} :is(th, td):not([style*="text-align"]) { text-align: right !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text {\n direction: rtl !important;\n unicode-bidi: plaintext !important;\n}\n\n/* Explicit <div dir="ltr"> islands inside an RTL document */\n${e} [dir="ltr"],\n${e} [dir="ltr"] :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, dt, dd) {\n direction: ltr !important;\n text-align: left !important;\n}\n${e} [dir="ltr"] h2 {\n border-right: none !important;\n border-left: 5px solid var(--od-h2) !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n}\n${e} [dir="ltr"] blockquote {\n border-right: none !important;\n border-left: 1px solid var(--od-comment) !important;\n padding-left: 16px !important;\n padding-right: 12px !important;\n}\n${e} [dir="ltr"] :is(ul, ol) {\n direction: ltr !important;\n text-align: left !important;\n padding-left: 1.6em !important;\n padding-right: 0 !important;\n}\n${e} [dir="ltr"] :is(ul ul, ol ol, ul ol, ol ul) {\n padding-left: 1.4em !important;\n padding-right: 0 !important;\n}\n${e} [dir="ltr"] .md-checkbox input[type="checkbox"] {\n margin-right: 8px !important;\n margin-left: 0 !important;\n}\n${e} [dir="ltr"] table :is(th, td):not([style*="text-align"]) { text-align: left !important; }\n`;else if("auto"===t.direction){const t=':is([dir="rtl"], :dir(rtl))',n=':is([dir="ltr"], :dir(ltr))';S=`\nbody, ${e} { direction: ltr !important; text-align: start !important; }\n${o?`${e} :is(p, h1, h2, h3, h4, h5, h6, li, blockquote, dt, dd) {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n}`:""}\n\n/* =================================================================\n NATIVE BIDI LIST & MARKER ENGINE (RTL / LTR AWARE)\n ================================================================= */\n${e} :is(ul, ol) {\n padding-left: 2em !important;\n padding-right: 0 !important;\n}\n\n/* Explicit RTL lists and items */\n${e} :is(ul, ol)${t} {\n direction: rtl !important;\n text-align: right !important;\n padding-right: 2.2em !important;\n padding-left: 0 !important;\n}\n${e} li${t} {\n direction: rtl !important;\n text-align: right !important;\n}\n${e} :is(ul, ol)[dir="rtl"] :is(ul, ol) {\n padding-right: 1.6em !important;\n padding-left: 0 !important;\n}\n\n/* Explicit LTR lists and items */\n${e} :is(ul, ol)${n} {\n direction: ltr !important;\n text-align: left !important;\n padding-left: 2em !important;\n padding-right: 0 !important;\n}\n${e} li${n} {\n direction: ltr !important;\n text-align: left !important;\n}\n${e} :is(ul, ol)[dir="ltr"] :is(ul, ol) {\n padding-left: 1.6em !important;\n padding-right: 0 !important;\n}\n\n/* BiDi Checkboxes */\n${e} li${t} input[type="checkbox"] {\n margin-left: 8px !important;\n margin-right: 0 !important;\n}\n${e} li${n} input[type="checkbox"] {\n margin-right: 8px !important;\n margin-left: 0 !important;\n}\n\n/* BiDi H2 Headings */\n${e} h2${t} {\n border-right: 5px solid var(--od-h2) !important;\n border-left: none !important;\n padding-right: 12px !important;\n padding-left: 0 !important;\n text-align: right !important;\n}\n${e} h2${n} {\n border-left: 5px solid var(--od-h2) !important;\n border-right: none !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n text-align: left !important;\n}\n\n/* BiDi Blockquotes */\n${e} blockquote${t} {\n border-right: 1px solid var(--od-comment) !important;\n border-left: none !important;\n padding-right: 16px !important;\n padding-left: 10px !important;\n text-align: right !important;\n direction: rtl !important;\n}\n${e} blockquote${n} {\n border-left: 1px solid var(--od-comment) !important;\n border-right: none !important;\n padding-left: 16px !important;\n padding-right: 10px !important;\n text-align: left !important;\n direction: ltr !important;\n}\n\n${e} :is(th, td):not([style*="text-align"]) { text-align: start !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text { unicode-bidi: plaintext !important; }\n`}else S=`\nbody, ${e} { direction: ltr !important; text-align: left !important; }\n${e} h2 {\n border-left: 5px solid var(--od-h2) !important;\n border-right: none !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n}\n${e} :is(ul, ol) { padding-left: 2em !important; }\n.md-checkbox input[type="checkbox"] { margin-right: 8px !important; margin-left: 0 !important; }\n\n/* LTR Blockquotes: 1px Left Border & No Right Border */\n${e} blockquote {\n border-left: 1px solid var(--od-comment) !important;\n border-right: 0 !important;\n}\n${e} :is(th, td):not([style*="text-align"]) { text-align: left !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text { direction: ltr !important; }\n`;let $="";"compact"===t.contentMaxWidth?$="max-width: 760px !important; margin: 0 auto !important;":"comfortable"===t.contentMaxWidth&&($="max-width: 920px !important; margin: 0 auto !important;");const C=`${e} pre:not(.mermaid):not(.joplin-source)`,j=`\n*, *::before, *::after { box-sizing: border-box !important; }\nhtml, body${o?", #rendered-md":""} { max-width: 100% !important; overflow-x: hidden !important; }\n::selection { background-color: var(--od-selection) !important; }\n\nbody, ${e} {\n font-family: ${m} !important;\n line-height: ${v(t.lineHeight,"1.75")} !important;\n font-size: ${f(t.fontSize,"16px")} !important;\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n word-break: break-word !important;\n overflow-wrap: anywhere !important;\n -webkit-font-smoothing: antialiased !important;\n -moz-osx-font-smoothing: grayscale !important;\n}\n${o&&$?`\n#rendered-md { ${$} }\n`:""}\n${e} h1 {\n color: var(--od-h1) !important;\n font-size: ${y.h1} !important;\n font-weight: 800 !important;\n padding: 0 0 8px 0 !important;\n margin: 32px 0 20px 0 !important;\n border-bottom: 2px solid var(--od-h1) !important;\n}\n\n${e} h2 {\n color: var(--od-h2) !important;\n font-size: ${y.h2} !important;\n font-weight: 700 !important;\n margin: 28px 0 18px 0 !important;\n}\n\n${e} h3 { color: var(--od-h3) !important; font-size: ${y.h3} !important; font-weight: 600 !important; margin: 24px 0 14px 0 !important; }\n${e} h4 { color: var(--od-h4) !important; font-size: ${y.h4} !important; font-weight: 600 !important; margin: 20px 0 12px 0 !important; }\n${e} h5 { color: var(--od-h5) !important; font-size: ${y.h5} !important; font-weight: 600 !important; margin: 18px 0 10px 0 !important; }\n${e} h6 { color: var(--od-h6) !important; font-size: ${y.h6} !important; font-weight: 700 !important; margin: 16px 0 10px 0 !important; }\n\n${e} li { margin-bottom: 0.45em !important; line-height: ${v(t.lineHeight,"1.75")} !important; }\n${e} li::marker { color: var(--od-h2) !important; font-weight: bold !important; }\n\n.md-checkbox input[type="checkbox"] { vertical-align: middle !important; cursor: pointer !important; }\n${e} li:has(input[type="checkbox"]:checked) {\n opacity: 0.55 !important;\n text-decoration: line-through !important;\n transition: opacity 0.2s ease !important;\n}\n${e} li:has(input[type="checkbox"]:checked) code { opacity: 0.8 !important; text-decoration: none !important; }\n\n${e} img {\n max-width: 100% !important;\n max-height: 520px !important;\n height: auto !important;\n object-fit: contain !important;\n display: block !important;\n margin: 18px auto !important;\n border-radius: 6px !important;\n box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;\n}\n\n${e} a { color: var(--od-link) !important; text-decoration: none !important; transition: color 0.15s ease !important; }\n${e} a:hover { color: var(--od-link-hover) !important; text-decoration: underline !important; }\n\n${e} a[href^=":/"] {\n font-weight: 600 !important;\n border-bottom: 1.5px dashed var(--od-link) !important;\n text-decoration: none !important;\n}\n${e} a[href^=":/"]:hover { border-bottom-style: solid !important; }\n\n/* =================================================================\n BLOCKQUOTES: CLEAN MINIMAL 1PX STYLE (TRANSPARENT BG, NO RADIUS)\n ================================================================= */\n${e} blockquote {\n padding: 10px 16px !important;\n margin: 18px 0 !important;\n background: transparent !important;\n border-radius: 0 !important;\n color: var(--od-fg) !important;\n}\n\nmark { background-color: var(--od-mark-bg) !important; color: var(--od-fg) !important; padding: 1px 4px !important; border-radius: 3px !important; }\nkbd {\n background-color: var(--od-kbd-bg) !important;\n border: 1px solid var(--od-border) !important;\n color: var(--od-fg) !important;\n padding: 2px 5px !important;\n border-radius: 4px !important;\n font-size: 0.85em !important;\n box-shadow: 0 1px 0 rgba(0,0,0,0.2) !important;\n}\n\n${e} .joplin-source, pre.joplin-source, div.joplin-editable > pre.joplin-source {\n display: none !important; visibility: hidden !important; height: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important;\n}\n\n${e} code {\n font-family: ${x} !important;\n background-color: var(--od-code-bg) !important;\n color: var(--od-code-fg) !important;\n padding: 2px 6px !important;\n border-radius: 4px !important;\n font-size: 0.9em !important;\n}\n\n${C} {\n direction: ltr !important;\n text-align: left !important;\n unicode-bidi: isolate !important;\n background-color: var(--od-pre-bg) !important;\n border: 1px solid var(--od-pre-border) !important;\n border-radius: 6px !important;\n padding: 14px !important;\n margin: 18px 0 !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n white-space: pre !important;\n word-break: normal !important;\n word-wrap: normal !important;\n overflow-wrap: normal !important;\n -webkit-overflow-scrolling: touch !important;\n scrollbar-width: thin !important;\n scrollbar-color: var(--od-scrollbar-thumb) var(--od-scrollbar-track) !important;\n}\n\n${C} code {\n background-color: transparent !important;\n color: var(--od-fg) !important;\n padding: 0 !important;\n white-space: pre !important;\n display: inline-block !important;\n min-width: 100% !important;\n}\n\n/* Syntax highlighting tokens. Joplin renders fenced blocks as\n <pre class="hljs"><code><span class="hljs-keyword"> and colours them with a\n bundled Atom One stylesheet chosen from Joplin's own theme, so without the\n rules below every palette would show Atom One syntax colours. The palette\n roles map onto the standard highlighting semantics. */\n${e} pre.hljs,\n${e} .hljs {\n background-color: var(--od-pre-bg) !important;\n color: var(--od-tok-fg) !important;\n}\n\n${e} .hljs-comment,\n${e} .hljs-quote,\n${e} .hljs-doctag {\n color: var(--od-tok-comment) !important;\n font-style: italic !important;\n}\n\n${e} .hljs-keyword,\n${e} .hljs-class,\n${e} .hljs-selector-tag,\n${e} .hljs-template-tag,\n${e} .hljs-meta .hljs-keyword {\n color: var(--od-tok-keyword) !important;\n}\n\n${e} .hljs-string,\n${e} .hljs-regexp,\n${e} .hljs-addition,\n${e} .hljs-meta .hljs-string {\n color: var(--od-tok-string) !important;\n}\n\n${e} .hljs-number,\n${e} .hljs-literal,\n${e} .hljs-symbol,\n${e} .hljs-bullet,\n${e} .hljs-link {\n color: var(--od-tok-number) !important;\n}\n\n${e} .hljs-title,\n${e} .hljs-section,\n${e} .hljs-name,\n${e} .hljs-function {\n color: var(--od-tok-function) !important;\n}\n\n${e} .hljs-type,\n${e} .hljs-built_in,\n${e} .hljs-constructor,\n${e} .hljs-typing,\n${e} .hljs-module,\n${e} .hljs-module-access,\n${e} .hljs-class .hljs-title,\n${e} .hljs-title.class_ {\n color: var(--od-tok-type) !important;\n}\n\n${e} .hljs-attr,\n${e} .hljs-attribute,\n${e} .hljs-variable,\n${e} .hljs-template-variable,\n${e} .hljs-property {\n color: var(--od-tok-tag) !important;\n}\n\n${e} .hljs-tag,\n${e} .hljs-selector-id,\n${e} .hljs-selector-class,\n${e} .hljs-selector-attr,\n${e} .hljs-selector-pseudo {\n color: var(--od-tok-tag) !important;\n}\n\n${e} .hljs-meta,\n${e} .hljs-params {\n color: var(--od-tok-comment) !important;\n}\n\n${e} .hljs-subst,\n${e} .hljs-operator {\n color: var(--od-tok-fg) !important;\n}\n\n${e} .hljs-pattern-match {\n color: var(--od-tok-number) !important;\n}\n\n${e} .hljs-formula {\n color: var(--od-tok-accent) !important;\n}\n\n${e} .hljs-deletion {\n color: var(--od-tok-tag) !important;\n text-decoration: line-through !important;\n}\n\n${e} .hljs-emphasis {\n font-style: italic !important;\n}\n\n${e} .hljs-strong {\n font-weight: 700 !important;\n}\n\n${e} :is(p, li) code {\n direction: ltr !important;\n display: inline-block !important;\n unicode-bidi: embed !important;\n vertical-align: baseline !important;\n white-space: normal !important;\n max-width: 100% !important;\n overflow-wrap: anywhere !important;\n word-break: break-word !important;\n}\n\n/* Explicit Table Font Inheritance */\n${e} :is(table, th, td) {\n font-family: ${m} !important;\n}\n${e} table :is(th, td) code {\n font-family: ${x} !important;\n}\n\n${e} table {\n border-collapse: collapse !important;\n width: 100% !important;\n max-width: 100% !important;\n margin: 20px 0 !important;\n border: 1px solid var(--od-border) !important;\n display: block !important;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n -webkit-overflow-scrolling: touch !important;\n scrollbar-width: thin !important;\n scrollbar-color: var(--od-scrollbar-thumb) var(--od-scrollbar-track) !important;\n color: var(--od-fg) !important;\n /* Do NOT inherit the document-level overflow-wrap: anywhere /\n word-break: break-word (see the body rule above). Both make the\n intrinsic min-content width of a table cell collapse to one character,\n which lets the automatic table algorithm squeeze a column narrower than\n its longest word - the "text in a 5-character column" bug. break-word\n wraps long URLs when needed but leaves min-content intact. */\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${e} th {\n background-color: var(--od-table-th) !important;\n color: var(--od-link) !important;\n font-weight: bold !important;\n border: 1px solid var(--od-border) !important;\n padding: 8px 12px !important;\n /* Headers wrap instead of forcing the whole table past the right edge of\n the pane (which pushed the last column out of view on wide tables). */\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${e} td {\n border: 1px solid var(--od-border) !important;\n padding: 8px 12px !important;\n color: var(--od-fg) !important;\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${e} tr:nth-child(even) { background-color: var(--od-table-even) !important; }\n${e} tr:nth-child(odd) { background-color: var(--od-table-odd) !important; }\n\n/* Mermaid Diagrams */\n${e} .mermaid, ${e} div.mermaid, ${e} pre.mermaid {\n display: block !important;\n text-align: center !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n margin: 24px 0 !important;\n padding: 20px 14px !important;\n direction: ltr !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n -webkit-overflow-scrolling: touch !important;\n scrollbar-width: thin !important;\n background-color: var(--od-mermaid-bg) !important;\n border: 1px solid var(--od-mermaid-border) !important;\n border-radius: 8px !important;\n}\n${o?"\n#rendered-md .mermaid svg, #rendered-md div.mermaid svg, #rendered-md pre.mermaid svg {\n display: inline-block !important;\n vertical-align: middle !important;\n margin: 0 auto !important;\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n}\n":""}\n.mermaid foreignObject { overflow: visible !important; }\n.mermaid foreignObject div {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n white-space: normal !important;\n word-break: normal !important;\n line-height: 1.4 !important;\n text-align: center !important;\n padding: 3px 6px !important;\n}\n\n.mermaid, .mermaid svg, .mermaid text, .mermaid tspan,\n.mermaid .label, .mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .cluster-label {\n font-family: var(--mermaid-font-family) !important;\n}\n\n.mermaid .node rect, .mermaid .node polygon { rx: 6px !important; ry: 6px !important; }\n.mermaid .labelBkg, .mermaid rect.labelBkg, .mermaid span.labelBkg, .mermaid .edgeLabel rect {\n background-color: transparent !important; fill: transparent !important; opacity: 0 !important; border: none !important;\n}\n.mermaid .edgeLabel {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border-radius: 4px !important;\n padding: 1px 6px !important;\n}\n\n.katex-display {\n max-width: 100% !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n -webkit-overflow-scrolling: touch !important;\n box-sizing: border-box !important;\n padding: 6px 0 !important;\n}\n\n${e} .table-of-contents {\n background-color: var(--od-bg-alt) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 6px !important;\n padding: 12px 18px !important;\n margin: 20px 0 !important;\n display: inline-block !important;\n min-width: min(100%, 300px) !important;\n}\n${o?"#rendered-md .table-of-contents ul { margin: 4px 0 !important; }":""}\n\n${e} .footnotes {\n margin-top: 40px !important;\n padding-top: 16px !important;\n border-top: 1px solid var(--od-border) !important;\n font-size: 0.88em !important;\n color: var(--od-comment) !important;\n}\n\n/* Mobile Responsiveness (< 768px) – only the values that actually differ from the base rules */\n@media screen and (max-width: 768px) {\n ${o&&$?"#rendered-md { max-width: 100% !important; } /* Reading Width is a desktop feature */":""}\n ${e} h1 { font-size: calc(${y.h1} * 0.9) !important; margin: 20px 0 12px 0 !important; }\n ${e} h2 { font-size: calc(${y.h2} * 0.92) !important; margin: 18px 0 10px 0 !important; }\n ${e} h3 { margin: 16px 0 8px 0 !important; }\n ${e} img { max-height: 420px !important; }\n ${C} { font-size: 0.9em !important; padding: 10px 12px !important; }\n ${e} table { font-size: 0.9em !important; }\n ${e} .mermaid { padding: 14px 8px !important; }\n}\n`;let z="";if(o){const n="paper"===t.pdfExportStyle,o=n?"#ffffff":"var(--od-bg)",e=n?"#1e2227":"var(--od-fg)",{pageSize:i,margin:d}=function(t){const n=t.pdfPageSize&&r.has(t.pdfPageSize)?t.pdfPageSize:"a4";let o;return o="custom"===t.pdfPageMargin?function(t,n){const o=(t||"").trim();return u.test(o)&&!/[;{}]/.test(o)?o:n}(t.customPdfMargin,a.standard):a[t.pdfPageMargin||"standard"]||a.standard,{pageSize:n,margin:o}}(t);z=`\n/* =================================================================\n FLAWLESS PDF & PRINT EXPORT ENGINE\n ================================================================= */\n@page {\n size: ${i};\n margin: ${n?d:"0"};\n}\n\n@media print {\n *, *::before, *::after, :root, html, body, .exported-note, #rendered-md {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n :root, html, body, .exported-note {\n background-color: ${o} !important;\n color: ${e} !important;\n }\n\n body, #rendered-md {\n background-color: ${o} !important;\n color: ${e} !important;\n max-width: 100% !important;\n margin: 0 auto !important;\n padding: ${n?"0":d} !important;\n box-sizing: border-box !important;\n font-size: 14px !important;\n line-height: ${v(t.lineHeight,"1.75")} !important;\n }\n\n #rendered-md :is(table, th, td) {\n font-family: ${m} !important;\n }\n\n #rendered-md table :is(th, td) code {\n font-family: ${x} !important;\n }\n\n .exported-note-title {\n color: var(--od-h1) !important;\n font-family: ${m} !important;\n font-size: 1.9em !important;\n font-weight: 800 !important;\n border-bottom: 2px solid var(--od-h1) !important;\n padding-bottom: 8px !important;\n margin-bottom: 24px !important;\n page-break-after: avoid !important;\n break-after: avoid !important;\n }\n\n #rendered-md h1 { color: var(--od-h1) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h2 { color: var(--od-h2) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h3 { color: var(--od-h3) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h4 { color: var(--od-h4) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h5 { color: var(--od-h5) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h6 { color: var(--od-h6) !important; page-break-after: avoid !important; break-after: avoid !important; }\n\n #rendered-md table {\n display: table !important;\n width: 100% !important;\n max-width: 100% !important;\n table-layout: auto !important;\n overflow: visible !important;\n page-break-inside: auto !important;\n break-inside: auto !important;\n margin: 16px 0 !important;\n }\n\n #rendered-md tr { page-break-inside: avoid !important; break-inside: avoid !important; }\n #rendered-md :is(th, td) {\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n padding: 6px 10px !important;\n }\n\n ${C} {\n white-space: pre-wrap !important;\n word-break: break-word !important;\n overflow-wrap: break-word !important;\n overflow: visible !important;\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n background-color: var(--od-pre-bg) !important;\n border: 1px solid var(--od-pre-border) !important;\n padding: 12px !important;\n margin: 14px 0 !important;\n }\n\n ${C} code {\n white-space: pre-wrap !important;\n display: block !important;\n min-width: 100% !important;\n }\n\n #rendered-md .mermaid {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n overflow: visible !important;\n background-color: var(--od-mermaid-bg) !important;\n border: 1px solid var(--od-mermaid-border) !important;\n padding: 16px 10px !important;\n margin: 18px auto !important;\n }\n\n #rendered-md .mermaid svg {\n max-width: 100% !important;\n height: auto !important;\n display: block !important;\n margin: 0 auto !important;\n }\n\n #rendered-md img {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n max-width: 100% !important;\n height: auto !important;\n }\n\n #rendered-md blockquote {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n background-color: transparent !important;\n }\n\n .katex-display {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n overflow: visible !important;\n }\n}\n`}const L=(t.customCss||"").replace(/<\/?style[^>]*>/gi,"").trim(),M=`${s}\n${w}${l}\n${S}\n${j}${z}\n::-webkit-scrollbar { width: 8px !important; height: 8px !important; }\n::-webkit-scrollbar-track { background: var(--od-scrollbar-track) !important; border-radius: 4px !important; }\n::-webkit-scrollbar-thumb { background: var(--od-scrollbar-thumb) !important; border-radius: 4px !important; }\n::-webkit-scrollbar-thumb:hover { background: var(--od-scrollbar-hover) !important; }\n`.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{};,>])\s*/g,"$1").replace(/;}/g,"}").trim();return L?`${M}\n/* User custom CSS */\n${L}`:M};const e=o(880),r=new Set(["a4","letter","a5","a3","legal","auto"]),a={standard:"15mm 18mm",comfortable:"20mm 20mm",compact:"8mm 10mm",none:"0"},i={balanced:{h1:"1.75em",h2:"1.42em",h3:"1.25em",h4:"1.12em",h5:"1.05em",h6:"1.0em"},large:{h1:"2.15em",h2:"1.7em",h3:"1.4em",h4:"1.22em",h5:"1.1em",h6:"1.0em"},compact:{h1:"1.5em",h2:"1.3em",h3:"1.18em",h4:"1.08em",h5:"1.02em",h6:"0.95em"}};function d(t){const n=(t||"").replace("#","");return 6===n.length&&/^[0-9a-fA-F]{6}$/.test(n)?[0,2,4].map(t=>parseInt(n.slice(t,t+2),16)):null}function l(t){const[n,o,e]=t.map(t=>{const n=t/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)});return.2126*n+.7152*o+.0722*e}function s(t,n){const[o,e]=[l(t),l(n)].sort((t,n)=>n-t);return(o+.05)/(e+.05)}function m(t){return"#"+t.map(t=>t.toString(16).padStart(2,"0")).join("")}function p(t,n,o=3){const e=d(t),r=d(n);if(!e||!r||s(e,r)>=o)return t;const a=l(r)<.5?[255,255,255]:[0,0,0];let i=t;for(let t=1;t<=20;t++){const n=e.map((n,o)=>{return e=n,r=a[o],i=.05*t,Math.round(e+(r-e)*i);var e,r,i});if(i=m(n),s(n,r)>=o)break}return i}function c(t){return e.themes[t.themeKey]||e.themes["atom-one-dark"]}function b(t,n=""){let o=":root {\n";for(const[n,e]of Object.entries(t.variables))o+=` ${n}: ${e};\n`;return o+=n,o+="}\n",o}const g=/^-?\d+(?:\.\d+)?(?:px|rem|em|pt|pc|in|cm|mm|%|vh|vw|ch|ex)$/,h=/^\d+(?:\.\d+)?$/,u=/^[^;{}<>]{1,80}$/;function f(t,n){const o=(t||"").trim();return g.test(o)?o:n}function v(t,n){const o=(t||"").trim();return h.test(o)?o:n}function k(t){let n="",o=t.fontFamily;switch(t.fontPreset){case"inter":n+="@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');\n",o="'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";break;case"roboto":n+="@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');\n",o="'Roboto', -apple-system, BlinkMacSystemFont, sans-serif";break;case"vazirmatn":n+="@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');\n",o="'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";break;case"noto-arabic":n+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;600;700&display=swap');\n",o="'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif";break;case"noto-cjk-sc":n+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');\n",o="'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif";break;case"noto-cjk-jp":n+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');\n",o="'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif";break;case"heebo":n+="@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;600;700&display=swap');\n",o="'Heebo', -apple-system, BlinkMacSystemFont, sans-serif";break;case"noto-devanagari":n+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&display=swap');\n",o="'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif";break;case"lora":n+="@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap');\n",o="'Lora', Georgia, serif";break;case"system":o="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";break;default:o=t.fontFamily||"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"}let e=t.codeFont;switch(t.codeFontPreset){case"fira-code":n+="@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');\n",e="'Fira Code', monospace";break;case"jetbrains-mono":n+="@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');\n",e="'JetBrains Mono', monospace";break;case"system-mono":e="'Cascadia Code', 'Consolas', 'Courier New', monospace";break;default:e=t.codeFont||"'Cascadia Code', 'Fira Code', 'Consolas', monospace"}return{fontImport:n,resolvedFont:o,resolvedCodeFont:e}}function x(t){const n=c(t),{fontImport:o,resolvedFont:e}=k(t),r=b(n,` --joplin-font-family: ${e} !important;\n --od-active-accent: inset 0 0 0 0 transparent;\n`);let a="";return a="rtl"===t.direction?"\n /* Title input adheres to RTL */\n input.title-input {\n direction: rtl !important;\n text-align: right !important;\n }\n\n /* Note List item titles align naturally using Unicode BiDi */\n .note-list .title,\n .note-list-item-title,\n .note-list span,\n .note-list div {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n\n /* Active Note Indicator flips to right border in RTL */\n /* Active-note accent. Set as a layer of the row's box-shadow (see the\n note-list rule further down) rather than as a border: a 4px border\n shifted the row's text 4px sideways on every selection. */\n :root { --od-active-accent: inset -4px 0 0 0 var(--od-h2); }\n\n /* Sidebar titles use BiDi without breaking tree indentation or flex order */\n .side-bar .title,\n .side-bar span.title,\n .folders a span:not(.note-count-label):not(.icon),\n .tags a span:not(.note-count-label):not(.icon) {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"auto"===t.direction?"\n input.title-input,\n .note-list .title,\n .note-list-item-title,\n .side-bar .title,\n .side-bar span.title {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"\n input.title-input {\n direction: ltr !important;\n text-align: left !important;\n }\n\n :root { --od-active-accent: inset 4px 0 0 0 var(--od-h2); }\n ",`\n${o}\n${r}\n${a}\n\n/* =================================================================\n UNIFIED DESKTOP SHELL CASCADE (OVERRIDING JOPLIN CORE DARK/LIGHT)\n ================================================================= */\n\n/* --- 1. Resizer Splitters & Root Container --- */\ndiv[style*="col-resize"],\ndiv[style*="row-resize"],\ndiv[style*="cursor: col-resize"],\ndiv[style*="cursor: row-resize"],\n.rli-splitter,\n.splitter,\ndiv[class*="splitter"],\ndiv[class*="resizer"],\ndiv[class*="divider"] {\n background-color: var(--od-border) !important;\n background: var(--od-border) !important;\n border-color: var(--od-border) !important;\n opacity: 0.8 !important;\n}\n\n.rli-root,\n#joplin-plugin-content,\ndiv[class*="rli-"] {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 2. Primary Left Sidebar --- */\n.side-bar,\n.r-sidebar,\n.rli-sideBar,\ndiv[toggleblock="1"] {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n color: var(--od-fg) !important;\n font-family: ${e} !important;\n}\n\n.side-bar *,\n.r-sidebar *,\n.rli-sideBar *,\ndiv[toggleblock="1"] *,\n.folders *,\n.tags *,\na.list-item,\na.list-item *,\n.list-item-container * {\n color: var(--od-fg) !important;\n border-color: var(--od-fg) !important;\n}\n\n.side-bar svg,\n.side-bar path,\n.side-bar i,\n.r-sidebar svg,\n.r-sidebar path,\n.rli-sideBar svg,\n.rli-sideBar path {\n fill: var(--od-fg) !important;\n stroke: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.side-bar .list-item-container:hover,\n.side-bar .list-item:hover,\n.side-bar a:hover {\n background-color: var(--od-selection) !important;\n}\n\n/* Active Selected Notebook Item (Overrides Inline rgb(0, 95, 184)) */\n.side-bar .list-item-container.selected,\n.side-bar .list-item.selected,\n.side-bar a.selected,\n.side-bar .selected,\n.side-bar div[class*="selected"],\n.rli-sideBar .selected,\n.rli-sideBar div[class*="selected"],\n.folders .selected,\n.folders div[class*="selected"],\n.tags .selected {\n background-color: var(--od-selection) !important;\n background: var(--od-selection) !important;\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n.side-bar .selected *,\n.side-bar div[class*="selected"] *,\n.rli-sideBar .selected *,\n.rli-sideBar div[class*="selected"] *,\n.folders .selected * {\n color: var(--od-link) !important;\n}\n\n.side-bar .header,\n.side-bar .header span,\n.side-bar div[style*="font-weight: bold"],\n.side-bar .section-header {\n color: var(--od-comment) !important;\n font-size: 0.85em !important;\n letter-spacing: 0.5px !important;\n opacity: 0.85 !important;\n}\n\n.side-bar .item-count,\n.folders span[style*="opacity"] {\n color: var(--od-comment) !important;\n opacity: 0.8 !important;\n}\n\n/* Ensure clean spacing between folder icons, emojis, and titles without breaking tree indentation */\n.side-bar .icon,\n.side-bar span.icon,\n.side-bar svg.icon,\n.side-bar span[role="img"],\n.folders a span[role="img"] {\n margin-left: 6px !important;\n margin-right: 6px !important;\n display: inline-block !important;\n}\n\n/* --- 2. Bottom Left: Synchronize Panel --- */\n.rli-sideBar > div:last-child,\n.rli-sideBar > div:nth-child(2),\n.rli-sideBar div[style*="border-top"],\n.rli-sideBar div[style*="background-color"],\n.rli-sideBar > div > div:last-child,\n.side-bar > div:last-child,\ndiv:has(> .synchronize-button),\ndiv:has(.synchronize-button),\ndiv:has(> button.synchronize-button),\ndiv:has(button[title*="Sync"]),\ndiv:has(button[title*="Synchronize"]),\n.synchronize-button,\n.sync-status-box,\ndiv.sync-report,\ndiv[class*="sync"],\ndiv[class*="Sync"] {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-top: 1px solid var(--od-border) !important;\n}\n\n.rli-sideBar > div:last-child *,\n.rli-sideBar > div:nth-child(2) *,\ndiv:has(.synchronize-button) *,\n.synchronize-button *,\n.sync-status-box *,\ndiv.sync-report * {\n background-color: transparent !important;\n color: var(--od-comment) !important;\n}\n\n.rli-sideBar > div:last-child button,\n.rli-sideBar > div:nth-child(2) button,\ndiv:has(.synchronize-button) button,\n.synchronize-button button,\n.sync-status-box button,\nbutton.synchronize-button,\nbutton[title*="Sync"],\nbutton[title*="Synchronize"] {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-color: var(--od-border) !important;\n box-shadow: none !important;\n outline: none !important;\n border-radius: 4px !important;\n font-weight: 600 !important;\n padding: 6px 12px !important;\n}\n\n.rli-sideBar > div:last-child button:hover,\n.synchronize-button button:hover,\n.synchronize-button button:focus {\n background-color: var(--od-selection) !important;\n border-color: var(--od-link) !important;\n color: var(--od-link) !important;\n box-shadow: none !important;\n outline: none !important;\n}\n\n.synchronize-button svg,\n.synchronize-button path,\n.synchronize-button i,\ndiv:has(.synchronize-button) svg,\ndiv:has(.synchronize-button) path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 3. Note List Panel & Active Item Selection --- */\n.note-list,\n.r-note-list,\n.item-list,\ndiv.rli-noteList,\ndiv.rli-noteList > div {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n font-family: ${e} !important;\n}\n\n/* A single divider on the list itself. Drawing it on .note-list, on the\n layout wrapper and on its child stacked three 1px lines at the same edge. */\n.note-list {\n border-right: 1px solid var(--od-border) !important;\n border-left: none !important;\n}\n\n/* The font must be set on the text elements, not only on their containers:\n Joplin declares font-family directly on .title, .emptylist and the sidebar\n labels, and a direct declaration always beats an inherited one. */\n.note-list .title,\n.note-list .title span,\n.note-list .emptylist,\n.sidebar .title,\n.sidebar .tag-label,\n.sidebar .all-notes,\n.sidebar-header-container span {\n font-family: ${e} !important;\n}\n\n.note-list .list-item-container,\n.note-list .list-item,\n.note-list-item,\ndiv.rli-noteList .list-item-container {\n background-color: var(--od-bg) !important;\n /* Drawn as an inset shadow, not a border: Joplin sizes the note-list\n scroller from (row count x row height), so a 1px border on every row\n makes the content overflow and produces a second scrollbar. */\n border-bottom: none !important;\n box-shadow: inset 0 -1px 0 var(--od-border) !important;\n}\n\n/* Selected row: the accent is a SECOND shadow layer on top of the separator,\n scoped to the selected row only. Using a border here shifted the row text\n 4px sideways on every selection (measured); a :root-wide accent painted\n every row. */\ndiv.rli-noteList [aria-selected="true"],\ndiv.rli-noteList .selected,\ndiv.rli-noteList div[class*="selected"],\ndiv.rli-noteList .list-item-container.selected,\ndiv.rli-noteList .note-list-item.selected,\ndiv.note-list [aria-selected="true"],\ndiv.note-list .selected,\ndiv.note-list div[class*="selected"],\ndiv.note-list .list-item-container.selected,\ndiv.note-list .note-list-item.selected {\n box-shadow: var(--od-active-accent, inset 0 0 0 0 transparent), inset 0 -1px 0 var(--od-border) !important;\n}\n\n.note-list .list-item-container *,\n.note-list .title,\n.note-list-item-title,\n.note-list span {\n color: var(--od-fg) !important;\n}\n\n.note-list .list-item-container:hover,\n.note-list .list-item:hover,\n.note-list a:hover {\n background-color: var(--od-selection) !important;\n}\n\n/* Active Selected Note (Overrides Inline Dark Styles) */\ndiv.rli-noteList [aria-selected="true"],\ndiv.rli-noteList .selected,\ndiv.rli-noteList div[class*="selected"],\ndiv.rli-noteList .list-item-container.selected,\ndiv.rli-noteList .note-list-item.selected,\ndiv.note-list [aria-selected="true"],\ndiv.note-list .selected,\ndiv.note-list div[class*="selected"],\ndiv.note-list .list-item-container.selected,\ndiv.note-list .note-list-item.selected {\n background-color: var(--od-selection) !important;\n background: var(--od-selection) !important;\n}\n\ndiv.rli-noteList [aria-selected="true"] *,\ndiv.rli-noteList .selected *,\ndiv.note-list [aria-selected="true"] *,\ndiv.note-list .selected * {\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n/* --- 4. Top Left: Note List Header Bar, Buttons & Search (Green Box) --- */\ndiv.rli-noteList > div > div > div:first-child,\ndiv.rli-noteList .note-list-top-bar,\n.note-list-top-bar,\n.note-list > div:first-child,\n.note-list .header,\n.search-bar,\ndiv.new-note-todo-buttons,\ndiv:has(> .new-note-button),\ndiv:has(> button.new-note-button) {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n\n/* New note & New to-do Buttons: Dynamic contrast against --od-link */\nbutton.new-note-button,\nbutton.new-todo-button,\ndiv.rli-noteList button.new-note-button,\ndiv.rli-noteList button.new-todo-button,\ndiv.new-note-todo-buttons button,\ndiv.header a.button,\ndiv.header button,\n.note-list .header button,\n.note-list-top-bar button:not(.sort-order-reverse-button),\na.button[title="New note"],\na.button[title="New to-do"],\na[title="New note"],\na[title="New to-do"] {\n background-color: var(--od-link) !important;\n background: var(--od-link) !important;\n color: var(--od-bg) !important;\n border: none !important;\n border-radius: 4px !important;\n font-weight: 700 !important;\n box-shadow: none !important;\n}\n\nbutton.new-note-button *,\nbutton.new-todo-button *,\ndiv.new-note-todo-buttons button * {\n color: var(--od-bg) !important;\n fill: var(--od-bg) !important;\n}\n\nbutton.new-note-button:hover,\nbutton.new-todo-button:hover,\ndiv.rli-noteList button.new-note-button:hover,\ndiv.rli-noteList button.new-todo-button:hover,\ndiv.new-note-todo-buttons button:hover {\n background-color: var(--od-link-hover) !important;\n background: var(--od-link-hover) !important;\n}\n\n/* Search bar input */\ndiv.rli-noteList input,\ndiv.rli-noteList input[type="search"],\n.note-list-top-bar input,\n.note-list input[type="search"],\n.search-bar input,\ninput[type="search"] {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 4px !important;\n}\n\n/* Sort, Reverse & Calendar Buttons in Search Row */\nbutton.sort-order-reverse-button,\ndiv.rli-noteList button.sort-order-reverse-button,\ndiv.rli-noteList button:not(.new-note-button):not(.new-todo-button),\n.note-list-top-bar button.sort-order-reverse-button {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 4px !important;\n}\n\ndiv.rli-noteList svg,\ndiv.rli-noteList path,\n.note-list-top-bar svg,\n.note-list-top-bar path,\n.search-bar svg,\n.search-bar path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 5. Top Right: Note Header & Unified Navbar (Blue Box) --- */\n.header,\n.r-header,\n.top-bar,\n.note-title-wrapper,\ndiv.note-title-wrapper {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: 1px solid var(--od-border) !important;\n border-top: none !important;\n border-left: none !important;\n border-right: none !important;\n box-sizing: border-box !important;\n min-height: 40px !important;\n}\n\n/* Seamless Title Input (Blends directly into the header bar without boxed borders) */\ninput.title-input {\n background-color: transparent !important;\n background: transparent !important;\n border: none !important;\n border-bottom: none !important;\n color: var(--od-fg) !important;\n font-family: ${e} !important;\n font-size: 1.2em !important;\n font-weight: 700 !important;\n padding: 6px 14px !important;\n outline: none !important;\n box-shadow: none !important;\n}\n\ninput.title-input:focus {\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n}\n\n/* Seamless Info Group (Eliminates disconnected borders and mismatched fills) */\n.note-title-info-group,\ndiv.note-title-info-group {\n background-color: transparent !important;\n background: transparent !important;\n border: none !important;\n border-bottom: none !important;\n border-left: none !important;\n border-right: none !important;\n box-shadow: none !important;\n}\n\n.note-title-info-group *,\n.header span,\n.header div {\n color: var(--od-fg) !important;\n border-bottom: none !important;\n}\n\n.note-title-info-group svg,\n.note-title-info-group path,\n.header svg,\n.header path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.header button,\n.header a,\n.header .button,\nbutton.toolbar-button {\n background-color: transparent !important;\n color: var(--od-fg) !important;\n border: none !important;\n}\n\n.header button:hover,\n.header a:hover,\nbutton.toolbar-button:hover {\n background-color: var(--od-selection) !important;\n border-radius: 4px !important;\n}\n\n/* --- 6. Markdown Editor Formatting Toolbar --- */\n.editor-toolbar,\ndiv.editor-toolbar,\ndiv[class*="editor-toolbar"],\n.r-editor-toolbar {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n\n.editor-toolbar *,\n.editor-toolbar div,\n.editor-toolbar button,\n.editor-toolbar a,\n.editor-toolbar span {\n color: var(--od-fg) !important;\n background-color: transparent !important;\n}\n\n.editor-toolbar svg,\n.editor-toolbar path,\n.editor-toolbar .icon,\n.editor-toolbar [class*="icon"] {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.editor-toolbar button:hover,\n.editor-toolbar a:hover {\n background-color: var(--od-selection) !important;\n border-radius: 4px !important;\n}\n\n/* --- 8. Bottom: Tag Bar & Notification Banners --- */\n.tag-bar,\ndiv.tag-bar,\n.tag-list,\ndiv[class*="tag"],\ndiv[class*="banner"],\ndiv.updated-feature-banner,\ndiv.alert,\ndiv.info-box,\n.rli-editor > div > div > div:has(.tag-bar),\n.rli-editor > div > div > div:has(div[class*="banner"]),\n.rli-editor > div > div > div:last-child {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-top: 1px solid var(--od-border) !important;\n color: var(--od-fg) !important;\n}\n\n.tag-bar *,\ndiv[class*="banner"] *,\ndiv.updated-feature-banner * {\n color: var(--od-fg) !important;\n}\n\n.tag-bar svg,\n.tag-bar path {\n fill: var(--od-fg) !important;\n}\n\n.tag-bar input,\n.tag-bar .tag-input {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n}\n\n.tag-bar span,\n.tag-list span,\n.tag-list .tag-item {\n background-color: var(--od-selection) !important;\n color: var(--od-fg) !important;\n border-radius: 4px !important;\n padding: 2px 6px !important;\n}\n\ndiv[class*="banner"] a,\ndiv[class*="banner"] button,\ndiv.updated-feature-banner a,\ndiv.updated-feature-banner button {\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n/* --- 9. Right: Plugin Panels Outer Shell (Outline, Note Tabs) --- */\n.r-panel,\ndiv.joplin-plugin-view,\ndiv.panel-container,\ndiv[class*="outline"] {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n border-left: 1px solid var(--od-border) !important;\n}\n\n.r-panel *,\ndiv.joplin-plugin-view * {\n color: var(--od-fg) !important;\n}\n\n.r-panel svg,\n.r-panel path {\n fill: var(--od-fg) !important;\n}\n\n.r-panel header,\n.r-panel .header,\n.r-panel > div:first-child {\n background-color: var(--od-bg-alt) !important;\n border-bottom: 1px solid var(--od-border) !important;\n}\n\n.r-panel iframe,\ndiv.joplin-plugin-view iframe {\n background-color: var(--od-bg) !important;\n}\n\n/* --- 10. App-wide Custom Scrollbars --- */\n/* Joplin exposes the user's "Scrollbar size" setting as --scrollbar-size\n (main.scss); a hard-coded width silently overrode that preference. */\n.sidebar::-webkit-scrollbar,\n.note-list::-webkit-scrollbar,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar {\n width: var(--scrollbar-size, 7px) !important;\n}\n\n.sidebar::-webkit-scrollbar-track,\n.note-list::-webkit-scrollbar-track,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar-track {\n background: var(--od-scrollbar-track) !important;\n}\n\n.sidebar::-webkit-scrollbar-thumb,\n.note-list::-webkit-scrollbar-thumb,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar-thumb {\n background: var(--od-scrollbar-thumb) !important;\n border-radius: 3px !important;\n}\n`}},880(t,n){n.themes=void 0,n.themes={"atom-one-dark":{name:"Atom One Dark",isDark:!0,variables:{"--od-bg":"#282c34","--od-fg":"#abb2bf","--od-bg-alt":"#2c313c","--od-border":"#3e4452","--od-comment":"#5c6370","--od-h1":"#e06c75","--od-h2":"#61afef","--od-h3":"#98c379","--od-h4":"#c678dd","--od-h5":"#56b6c2","--od-h6":"#d19a66","--od-link":"#61afef","--od-link-hover":"#56b6c2","--od-code-bg":"#3e4452","--od-code-fg":"#e06c75","--od-pre-bg":"#21252b","--od-pre-border":"#181a1f","--od-table-even":"#21252b","--od-table-odd":"#282c34","--od-table-th":"#2c313c","--od-scrollbar-track":"#1e2227","--od-scrollbar-thumb":"#4b5263","--od-scrollbar-hover":"#5c6370","--od-mermaid-bg":"#21252b","--od-mermaid-border":"#333842","--od-selection":"rgba(97, 175, 239, 0.25)","--od-mark-bg":"#634a17","--od-kbd-bg":"#353b45"}},"atom-one-light":{name:"Atom One Light",isDark:!1,variables:{"--od-bg":"#fafafa","--od-fg":"#383a42","--od-bg-alt":"#f0f0f1","--od-border":"#d0d0d0","--od-comment":"#a0a1a7","--od-h1":"#e45649","--od-h2":"#4078f2","--od-h3":"#50a14f","--od-h4":"#a626a4","--od-h5":"#0184bc","--od-h6":"#986801","--od-link":"#4078f2","--od-link-hover":"#0184bc","--od-code-bg":"#eaeaeb","--od-code-fg":"#e45649","--od-pre-bg":"#f4f4f5","--od-pre-border":"#d8d8d8","--od-table-even":"#f4f4f5","--od-table-odd":"#fafafa","--od-table-th":"#ebebeb","--od-scrollbar-track":"#e4e4e6","--od-scrollbar-thumb":"#b0b0b4","--od-scrollbar-hover":"#8e8e93","--od-mermaid-bg":"#fbfbfb","--od-mermaid-border":"#e4e4e6","--od-selection":"rgba(64, 120, 242, 0.2)","--od-mark-bg":"#ffeaa7","--od-kbd-bg":"#eaeaeb"}},"tokyo-night":{name:"Tokyo Night",isDark:!0,variables:{"--od-bg":"#1a1b26","--od-fg":"#c0caf5","--od-bg-alt":"#16161e","--od-border":"#292e42","--od-comment":"#565f89","--od-h1":"#f7768e","--od-h2":"#7aa2f7","--od-h3":"#9ece6a","--od-h4":"#bb9af7","--od-h5":"#7dcfff","--od-h6":"#e0af68","--od-link":"#7aa2f7","--od-link-hover":"#7dcfff","--od-code-bg":"#24283b","--od-code-fg":"#f7768e","--od-pre-bg":"#1f2335","--od-pre-border":"#292e42","--od-table-even":"#1f2335","--od-table-odd":"#1a1b26","--od-table-th":"#24283b","--od-scrollbar-track":"#16161e","--od-scrollbar-thumb":"#3b4261","--od-scrollbar-hover":"#565f89","--od-mermaid-bg":"#1f2335","--od-mermaid-border":"#292e42","--od-selection":"rgba(122, 162, 247, 0.25)","--od-mark-bg":"#3d3725","--od-kbd-bg":"#24283b"}},"tokyo-night-storm":{name:"Tokyo Night Storm",isDark:!0,variables:{"--od-bg":"#24283b","--od-fg":"#c0caf5","--od-bg-alt":"#1f2335","--od-border":"#3b4261","--od-comment":"#565f89","--od-h1":"#f7768e","--od-h2":"#7aa2f7","--od-h3":"#9ece6a","--od-h4":"#bb9af7","--od-h5":"#7dcfff","--od-h6":"#e0af68","--od-link":"#7aa2f7","--od-link-hover":"#7dcfff","--od-code-bg":"#2f354f","--od-code-fg":"#f7768e","--od-pre-bg":"#1a1b26","--od-pre-border":"#2f354f","--od-table-even":"#1f2335","--od-table-odd":"#24283b","--od-table-th":"#2f354f","--od-scrollbar-track":"#1f2335","--od-scrollbar-thumb":"#414868","--od-scrollbar-hover":"#565f89","--od-mermaid-bg":"#1f2335","--od-mermaid-border":"#3b4261","--od-selection":"rgba(122, 162, 247, 0.25)","--od-mark-bg":"#3d3725","--od-kbd-bg":"#2f354f"}},"everforest-dark":{name:"Everforest Dark",isDark:!0,variables:{"--od-bg":"#2d353b","--od-fg":"#d3c6aa","--od-bg-alt":"#232a2e","--od-border":"#475258","--od-comment":"#859289","--od-h1":"#e67e80","--od-h2":"#7fbbb3","--od-h3":"#a7c080","--od-h4":"#d699b6","--od-h5":"#83c092","--od-h6":"#dbbc7f","--od-link":"#7fbbb3","--od-link-hover":"#83c092","--od-code-bg":"#343f44","--od-code-fg":"#e67e80","--od-pre-bg":"#232a2e","--od-pre-border":"#3d484d","--od-table-even":"#232a2e","--od-table-odd":"#2d353b","--od-table-th":"#343f44","--od-scrollbar-track":"#232a2e","--od-scrollbar-thumb":"#475258","--od-scrollbar-hover":"#56635f","--od-mermaid-bg":"#232a2e","--od-mermaid-border":"#3d484d","--od-selection":"rgba(127, 187, 179, 0.25)","--od-mark-bg":"#494228","--od-kbd-bg":"#343f44"}},"everforest-light":{name:"Everforest Light",isDark:!1,variables:{"--od-bg":"#fdf6e3","--od-fg":"#5c6a72","--od-bg-alt":"#f4f0d9","--od-border":"#e0dcc7","--od-comment":"#939f91","--od-h1":"#f85552","--od-h2":"#3a94c5","--od-h3":"#8da101","--od-h4":"#df69ba","--od-h5":"#35a77c","--od-h6":"#dfa000","--od-link":"#3a94c5","--od-link-hover":"#35a77c","--od-code-bg":"#ece7cf","--od-code-fg":"#f85552","--od-pre-bg":"#f4f0d9","--od-pre-border":"#e0dcc7","--od-table-even":"#f4f0d9","--od-table-odd":"#fdf6e3","--od-table-th":"#ebe5c8","--od-scrollbar-track":"#f4f0d9","--od-scrollbar-thumb":"#cfc8ab","--od-scrollbar-hover":"#a7a083","--od-mermaid-bg":"#faf5e0","--od-mermaid-border":"#e0dcc7","--od-selection":"rgba(58, 148, 197, 0.2)","--od-mark-bg":"#fae3b0","--od-kbd-bg":"#ebe5c8"}},"catppuccin-mocha":{name:"Catppuccin Mocha",isDark:!0,variables:{"--od-bg":"#1e1e2e","--od-fg":"#cdd6f4","--od-bg-alt":"#181825","--od-border":"#45475a","--od-comment":"#6c7086","--od-h1":"#f38ba8","--od-h2":"#89b4fa","--od-h3":"#a6e3a1","--od-h4":"#cba6f7","--od-h5":"#89dceb","--od-h6":"#fab387","--od-link":"#89b4fa","--od-link-hover":"#89dceb","--od-code-bg":"#313244","--od-code-fg":"#f38ba8","--od-pre-bg":"#181825","--od-pre-border":"#313244","--od-table-even":"#181825","--od-table-odd":"#1e1e2e","--od-table-th":"#313244","--od-scrollbar-track":"#181825","--od-scrollbar-thumb":"#45475a","--od-scrollbar-hover":"#585b70","--od-mermaid-bg":"#181825","--od-mermaid-border":"#313244","--od-selection":"rgba(137, 180, 250, 0.25)","--od-mark-bg":"#453c24","--od-kbd-bg":"#313244"}},"catppuccin-latte":{name:"Catppuccin Latte",isDark:!1,variables:{"--od-bg":"#eff1f5","--od-fg":"#4c4f69","--od-bg-alt":"#e6e9ef","--od-border":"#ccd0da","--od-comment":"#8c8fa1","--od-h1":"#d20f39","--od-h2":"#1e66f5","--od-h3":"#40a02b","--od-h4":"#8839ef","--od-h5":"#04a5e5","--od-h6":"#fe640b","--od-link":"#1e66f5","--od-link-hover":"#04a5e5","--od-code-bg":"#e6e9ef","--od-code-fg":"#d20f39","--od-pre-bg":"#e6e9ef","--od-pre-border":"#ccd0da","--od-table-even":"#e6e9ef","--od-table-odd":"#eff1f5","--od-table-th":"#dce0e8","--od-scrollbar-track":"#e6e9ef","--od-scrollbar-thumb":"#bcc0cc","--od-scrollbar-hover":"#9ca0b0","--od-mermaid-bg":"#f2f4f8","--od-mermaid-border":"#ccd0da","--od-selection":"rgba(30, 102, 245, 0.2)","--od-mark-bg":"#feefc3","--od-kbd-bg":"#e6e9ef"}},nord:{name:"Nord",isDark:!0,variables:{"--od-bg":"#2e3440","--od-fg":"#d8dee9","--od-bg-alt":"#242933","--od-border":"#434c5e","--od-comment":"#616e88","--od-h1":"#bf616a","--od-h2":"#88c0d0","--od-h3":"#a3be8c","--od-h4":"#b48ead","--od-h5":"#81a1c1","--od-h6":"#ebcb8b","--od-link":"#88c0d0","--od-link-hover":"#8fbcbb","--od-code-bg":"#3b4252","--od-code-fg":"#bf616a","--od-pre-bg":"#242933","--od-pre-border":"#3b4252","--od-table-even":"#242933","--od-table-odd":"#2e3440","--od-table-th":"#3b4252","--od-scrollbar-track":"#242933","--od-scrollbar-thumb":"#434c5e","--od-scrollbar-hover":"#4c566a","--od-mermaid-bg":"#242933","--od-mermaid-border":"#3b4252","--od-selection":"rgba(136, 192, 208, 0.25)","--od-mark-bg":"#453e28","--od-kbd-bg":"#3b4252"}},dracula:{name:"Dracula",isDark:!0,variables:{"--od-bg":"#282a36","--od-fg":"#f8f8f2","--od-bg-alt":"#21222c","--od-border":"#44475a","--od-comment":"#6272a4","--od-h1":"#ff5555","--od-h2":"#8be9fd","--od-h3":"#50fa7b","--od-h4":"#ff79c6","--od-h5":"#bd93f9","--od-h6":"#f1fa8c","--od-link":"#8be9fd","--od-link-hover":"#ff79c6","--od-code-bg":"#44475a","--od-code-fg":"#ff5555","--od-pre-bg":"#1e1f29","--od-pre-border":"#44475a","--od-table-even":"#21222c","--od-table-odd":"#282a36","--od-table-th":"#44475a","--od-scrollbar-track":"#1e1f29","--od-scrollbar-thumb":"#44475a","--od-scrollbar-hover":"#6272a4","--od-mermaid-bg":"#1e1f29","--od-mermaid-border":"#44475a","--od-selection":"rgba(139, 233, 253, 0.25)","--od-mark-bg":"#4c4a22","--od-kbd-bg":"#44475a"}},"gruvbox-dark":{name:"Gruvbox Dark",isDark:!0,variables:{"--od-bg":"#282828","--od-fg":"#ebdbb2","--od-bg-alt":"#1d2021","--od-border":"#504945","--od-comment":"#928374","--od-h1":"#fb4934","--od-h2":"#83a598","--od-h3":"#b8bb26","--od-h4":"#d3869b","--od-h5":"#8ec07c","--od-h6":"#fabd2f","--od-link":"#83a598","--od-link-hover":"#8ec07c","--od-code-bg":"#3c3836","--od-code-fg":"#fb4934","--od-pre-bg":"#1d2021","--od-pre-border":"#3c3836","--od-table-even":"#1d2021","--od-table-odd":"#282828","--od-table-th":"#3c3836","--od-scrollbar-track":"#1d2021","--od-scrollbar-thumb":"#504945","--od-scrollbar-hover":"#665c54","--od-mermaid-bg":"#1d2021","--od-mermaid-border":"#3c3836","--od-selection":"rgba(131, 165, 152, 0.25)","--od-mark-bg":"#4c421e","--od-kbd-bg":"#3c3836"}},"gruvbox-light":{name:"Gruvbox Light",isDark:!1,variables:{"--od-bg":"#fbf1c7","--od-fg":"#3c3836","--od-bg-alt":"#f2e5bc","--od-border":"#d5c4a1","--od-comment":"#928374","--od-h1":"#cc241d","--od-h2":"#458588","--od-h3":"#98971a","--od-h4":"#b16286","--od-h5":"#689d6a","--od-h6":"#d79921","--od-link":"#458588","--od-link-hover":"#689d6a","--od-code-bg":"#ebdbb2","--od-code-fg":"#cc241d","--od-pre-bg":"#f2e5bc","--od-pre-border":"#d5c4a1","--od-table-even":"#f2e5bc","--od-table-odd":"#fbf1c7","--od-table-th":"#ebdbb2","--od-scrollbar-track":"#f2e5bc","--od-scrollbar-thumb":"#bdae93","--od-scrollbar-hover":"#a89984","--od-mermaid-bg":"#faf3d6","--od-mermaid-border":"#d5c4a1","--od-selection":"rgba(69, 133, 136, 0.2)","--od-mark-bg":"#fedba8","--od-kbd-bg":"#ebdbb2"}}}}};const n={};let o=function o(e){const r=n[e];if(void 0!==r)return r.exports;const a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,o),a.exports}(156);const e=exports;for(var r in o)e[r]=o[r];o.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";let t={};const o="undefined"!=typeof joplin?joplin:global.joplin;var e=(t=>(t.MarkdownItPlugin="markdownItPlugin",t.CodeMirrorPlugin="codeMirrorPlugin",t))(e||{}),n=(t=>(t[t.Int=1]="Int",t[t.String=2]="String",t[t.Bool=3]="Bool",t[t.Array=4]="Array",t[t.Object=5]="Object",t[t.Button=6]="Button",t))(n||{});const r={"atom-one-dark":{name:"Atom One Dark",isDark:!0,variables:{"--od-bg":"#282c34","--od-fg":"#abb2bf","--od-bg-alt":"#2c313c","--od-border":"#3e4452","--od-comment":"#5c6370","--od-h1":"#e06c75","--od-h2":"#61afef","--od-h3":"#98c379","--od-h4":"#c678dd","--od-h5":"#56b6c2","--od-h6":"#d19a66","--od-link":"#61afef","--od-link-hover":"#56b6c2","--od-code-bg":"#3e4452","--od-code-fg":"#e06c75","--od-pre-bg":"#21252b","--od-pre-border":"#181a1f","--od-table-even":"#21252b","--od-table-odd":"#282c34","--od-table-th":"#2c313c","--od-scrollbar-track":"#1e2227","--od-scrollbar-thumb":"#4b5263","--od-scrollbar-hover":"#5c6370","--od-mermaid-bg":"#21252b","--od-mermaid-border":"#333842","--od-selection":"rgba(97, 175, 239, 0.25)","--od-mark-bg":"#634a17","--od-kbd-bg":"#353b45"}},"atom-one-light":{name:"Atom One Light",isDark:!1,variables:{"--od-bg":"#fafafa","--od-fg":"#383a42","--od-bg-alt":"#f0f0f1","--od-border":"#d0d0d0","--od-comment":"#a0a1a7","--od-h1":"#e45649","--od-h2":"#4078f2","--od-h3":"#50a14f","--od-h4":"#a626a4","--od-h5":"#0184bc","--od-h6":"#986801","--od-link":"#4078f2","--od-link-hover":"#0184bc","--od-code-bg":"#eaeaeb","--od-code-fg":"#e45649","--od-pre-bg":"#f4f4f5","--od-pre-border":"#d8d8d8","--od-table-even":"#f4f4f5","--od-table-odd":"#fafafa","--od-table-th":"#ebebeb","--od-scrollbar-track":"#e4e4e6","--od-scrollbar-thumb":"#b0b0b4","--od-scrollbar-hover":"#8e8e93","--od-mermaid-bg":"#fbfbfb","--od-mermaid-border":"#e4e4e6","--od-selection":"rgba(64, 120, 242, 0.2)","--od-mark-bg":"#ffeaa7","--od-kbd-bg":"#eaeaeb"}},"tokyo-night":{name:"Tokyo Night",isDark:!0,variables:{"--od-bg":"#1a1b26","--od-fg":"#c0caf5","--od-bg-alt":"#16161e","--od-border":"#292e42","--od-comment":"#565f89","--od-h1":"#f7768e","--od-h2":"#7aa2f7","--od-h3":"#9ece6a","--od-h4":"#bb9af7","--od-h5":"#7dcfff","--od-h6":"#e0af68","--od-link":"#7aa2f7","--od-link-hover":"#7dcfff","--od-code-bg":"#24283b","--od-code-fg":"#f7768e","--od-pre-bg":"#1f2335","--od-pre-border":"#292e42","--od-table-even":"#1f2335","--od-table-odd":"#1a1b26","--od-table-th":"#24283b","--od-scrollbar-track":"#16161e","--od-scrollbar-thumb":"#3b4261","--od-scrollbar-hover":"#565f89","--od-mermaid-bg":"#1f2335","--od-mermaid-border":"#292e42","--od-selection":"rgba(122, 162, 247, 0.25)","--od-mark-bg":"#3d3725","--od-kbd-bg":"#24283b"}},"tokyo-night-storm":{name:"Tokyo Night Storm",isDark:!0,variables:{"--od-bg":"#24283b","--od-fg":"#c0caf5","--od-bg-alt":"#1f2335","--od-border":"#3b4261","--od-comment":"#565f89","--od-h1":"#f7768e","--od-h2":"#7aa2f7","--od-h3":"#9ece6a","--od-h4":"#bb9af7","--od-h5":"#7dcfff","--od-h6":"#e0af68","--od-link":"#7aa2f7","--od-link-hover":"#7dcfff","--od-code-bg":"#2f354f","--od-code-fg":"#f7768e","--od-pre-bg":"#1a1b26","--od-pre-border":"#2f354f","--od-table-even":"#1f2335","--od-table-odd":"#24283b","--od-table-th":"#2f354f","--od-scrollbar-track":"#1f2335","--od-scrollbar-thumb":"#414868","--od-scrollbar-hover":"#565f89","--od-mermaid-bg":"#1f2335","--od-mermaid-border":"#3b4261","--od-selection":"rgba(122, 162, 247, 0.25)","--od-mark-bg":"#3d3725","--od-kbd-bg":"#2f354f"}},"everforest-dark":{name:"Everforest Dark",isDark:!0,variables:{"--od-bg":"#2d353b","--od-fg":"#d3c6aa","--od-bg-alt":"#232a2e","--od-border":"#475258","--od-comment":"#859289","--od-h1":"#e67e80","--od-h2":"#7fbbb3","--od-h3":"#a7c080","--od-h4":"#d699b6","--od-h5":"#83c092","--od-h6":"#dbbc7f","--od-link":"#7fbbb3","--od-link-hover":"#83c092","--od-code-bg":"#343f44","--od-code-fg":"#e67e80","--od-pre-bg":"#232a2e","--od-pre-border":"#3d484d","--od-table-even":"#232a2e","--od-table-odd":"#2d353b","--od-table-th":"#343f44","--od-scrollbar-track":"#232a2e","--od-scrollbar-thumb":"#475258","--od-scrollbar-hover":"#56635f","--od-mermaid-bg":"#232a2e","--od-mermaid-border":"#3d484d","--od-selection":"rgba(127, 187, 179, 0.25)","--od-mark-bg":"#494228","--od-kbd-bg":"#343f44"}},"everforest-light":{name:"Everforest Light",isDark:!1,variables:{"--od-bg":"#fdf6e3","--od-fg":"#5c6a72","--od-bg-alt":"#f4f0d9","--od-border":"#e0dcc7","--od-comment":"#939f91","--od-h1":"#f85552","--od-h2":"#3a94c5","--od-h3":"#8da101","--od-h4":"#df69ba","--od-h5":"#35a77c","--od-h6":"#dfa000","--od-link":"#3a94c5","--od-link-hover":"#35a77c","--od-code-bg":"#ece7cf","--od-code-fg":"#f85552","--od-pre-bg":"#f4f0d9","--od-pre-border":"#e0dcc7","--od-table-even":"#f4f0d9","--od-table-odd":"#fdf6e3","--od-table-th":"#ebe5c8","--od-scrollbar-track":"#f4f0d9","--od-scrollbar-thumb":"#cfc8ab","--od-scrollbar-hover":"#a7a083","--od-mermaid-bg":"#faf5e0","--od-mermaid-border":"#e0dcc7","--od-selection":"rgba(58, 148, 197, 0.2)","--od-mark-bg":"#fae3b0","--od-kbd-bg":"#ebe5c8"}},"catppuccin-mocha":{name:"Catppuccin Mocha",isDark:!0,variables:{"--od-bg":"#1e1e2e","--od-fg":"#cdd6f4","--od-bg-alt":"#181825","--od-border":"#45475a","--od-comment":"#6c7086","--od-h1":"#f38ba8","--od-h2":"#89b4fa","--od-h3":"#a6e3a1","--od-h4":"#cba6f7","--od-h5":"#89dceb","--od-h6":"#fab387","--od-link":"#89b4fa","--od-link-hover":"#89dceb","--od-code-bg":"#313244","--od-code-fg":"#f38ba8","--od-pre-bg":"#181825","--od-pre-border":"#313244","--od-table-even":"#181825","--od-table-odd":"#1e1e2e","--od-table-th":"#313244","--od-scrollbar-track":"#181825","--od-scrollbar-thumb":"#45475a","--od-scrollbar-hover":"#585b70","--od-mermaid-bg":"#181825","--od-mermaid-border":"#313244","--od-selection":"rgba(137, 180, 250, 0.25)","--od-mark-bg":"#453c24","--od-kbd-bg":"#313244"}},"catppuccin-latte":{name:"Catppuccin Latte",isDark:!1,variables:{"--od-bg":"#eff1f5","--od-fg":"#4c4f69","--od-bg-alt":"#e6e9ef","--od-border":"#ccd0da","--od-comment":"#8c8fa1","--od-h1":"#d20f39","--od-h2":"#1e66f5","--od-h3":"#40a02b","--od-h4":"#8839ef","--od-h5":"#04a5e5","--od-h6":"#fe640b","--od-link":"#1e66f5","--od-link-hover":"#04a5e5","--od-code-bg":"#e6e9ef","--od-code-fg":"#d20f39","--od-pre-bg":"#e6e9ef","--od-pre-border":"#ccd0da","--od-table-even":"#e6e9ef","--od-table-odd":"#eff1f5","--od-table-th":"#dce0e8","--od-scrollbar-track":"#e6e9ef","--od-scrollbar-thumb":"#bcc0cc","--od-scrollbar-hover":"#9ca0b0","--od-mermaid-bg":"#f2f4f8","--od-mermaid-border":"#ccd0da","--od-selection":"rgba(30, 102, 245, 0.2)","--od-mark-bg":"#feefc3","--od-kbd-bg":"#e6e9ef"}},nord:{name:"Nord",isDark:!0,variables:{"--od-bg":"#2e3440","--od-fg":"#d8dee9","--od-bg-alt":"#242933","--od-border":"#434c5e","--od-comment":"#616e88","--od-h1":"#bf616a","--od-h2":"#88c0d0","--od-h3":"#a3be8c","--od-h4":"#b48ead","--od-h5":"#81a1c1","--od-h6":"#ebcb8b","--od-link":"#88c0d0","--od-link-hover":"#8fbcbb","--od-code-bg":"#3b4252","--od-code-fg":"#bf616a","--od-pre-bg":"#242933","--od-pre-border":"#3b4252","--od-table-even":"#242933","--od-table-odd":"#2e3440","--od-table-th":"#3b4252","--od-scrollbar-track":"#242933","--od-scrollbar-thumb":"#434c5e","--od-scrollbar-hover":"#4c566a","--od-mermaid-bg":"#242933","--od-mermaid-border":"#3b4252","--od-selection":"rgba(136, 192, 208, 0.25)","--od-mark-bg":"#453e28","--od-kbd-bg":"#3b4252"}},dracula:{name:"Dracula",isDark:!0,variables:{"--od-bg":"#282a36","--od-fg":"#f8f8f2","--od-bg-alt":"#21222c","--od-border":"#44475a","--od-comment":"#6272a4","--od-h1":"#ff5555","--od-h2":"#8be9fd","--od-h3":"#50fa7b","--od-h4":"#ff79c6","--od-h5":"#bd93f9","--od-h6":"#f1fa8c","--od-link":"#8be9fd","--od-link-hover":"#ff79c6","--od-code-bg":"#44475a","--od-code-fg":"#ff5555","--od-pre-bg":"#1e1f29","--od-pre-border":"#44475a","--od-table-even":"#21222c","--od-table-odd":"#282a36","--od-table-th":"#44475a","--od-scrollbar-track":"#1e1f29","--od-scrollbar-thumb":"#44475a","--od-scrollbar-hover":"#6272a4","--od-mermaid-bg":"#1e1f29","--od-mermaid-border":"#44475a","--od-selection":"rgba(139, 233, 253, 0.25)","--od-mark-bg":"#4c4a22","--od-kbd-bg":"#44475a"}},"gruvbox-dark":{name:"Gruvbox Dark",isDark:!0,variables:{"--od-bg":"#282828","--od-fg":"#ebdbb2","--od-bg-alt":"#1d2021","--od-border":"#504945","--od-comment":"#928374","--od-h1":"#fb4934","--od-h2":"#83a598","--od-h3":"#b8bb26","--od-h4":"#d3869b","--od-h5":"#8ec07c","--od-h6":"#fabd2f","--od-link":"#83a598","--od-link-hover":"#8ec07c","--od-code-bg":"#3c3836","--od-code-fg":"#fb4934","--od-pre-bg":"#1d2021","--od-pre-border":"#3c3836","--od-table-even":"#1d2021","--od-table-odd":"#282828","--od-table-th":"#3c3836","--od-scrollbar-track":"#1d2021","--od-scrollbar-thumb":"#504945","--od-scrollbar-hover":"#665c54","--od-mermaid-bg":"#1d2021","--od-mermaid-border":"#3c3836","--od-selection":"rgba(131, 165, 152, 0.25)","--od-mark-bg":"#4c421e","--od-kbd-bg":"#3c3836"}},"gruvbox-light":{name:"Gruvbox Light",isDark:!1,variables:{"--od-bg":"#fbf1c7","--od-fg":"#3c3836","--od-bg-alt":"#f2e5bc","--od-border":"#d5c4a1","--od-comment":"#928374","--od-h1":"#cc241d","--od-h2":"#458588","--od-h3":"#98971a","--od-h4":"#b16286","--od-h5":"#689d6a","--od-h6":"#d79921","--od-link":"#458588","--od-link-hover":"#689d6a","--od-code-bg":"#ebdbb2","--od-code-fg":"#cc241d","--od-pre-bg":"#f2e5bc","--od-pre-border":"#d5c4a1","--od-table-even":"#f2e5bc","--od-table-odd":"#fbf1c7","--od-table-th":"#ebdbb2","--od-scrollbar-track":"#f2e5bc","--od-scrollbar-thumb":"#bdae93","--od-scrollbar-hover":"#a89984","--od-mermaid-bg":"#faf3d6","--od-mermaid-border":"#d5c4a1","--od-selection":"rgba(69, 133, 136, 0.2)","--od-mark-bg":"#fedba8","--od-kbd-bg":"#ebdbb2"}},"solarized-dark":{name:"Solarized Dark",isDark:!0,variables:{"--od-bg":"#002b36","--od-fg":"#839496","--od-bg-alt":"#073642","--od-border":"#073642","--od-comment":"#586e75","--od-h1":"#dc322f","--od-h2":"#268bd2","--od-h3":"#859900","--od-h4":"#6c71c4","--od-h5":"#2aa198","--od-h6":"#b58900","--od-link":"#268bd2","--od-link-hover":"#2aa198","--od-code-bg":"#073642","--od-code-fg":"#dc322f","--od-pre-bg":"#073642","--od-pre-border":"#073642","--od-table-even":"#073642","--od-table-odd":"#002b36","--od-table-th":"#073642","--od-scrollbar-track":"#073642","--od-scrollbar-thumb":"#586e75","--od-scrollbar-hover":"#657b83","--od-mermaid-bg":"#073642","--od-mermaid-border":"#073642","--od-selection":"rgba(38, 139, 210, 0.25)","--od-mark-bg":"#735a08","--od-kbd-bg":"#073642"}},"solarized-light":{name:"Solarized Light",isDark:!1,variables:{"--od-bg":"#fdf6e3","--od-fg":"#657b83","--od-bg-alt":"#eee8d5","--od-border":"#eee8d5","--od-comment":"#93a1a1","--od-h1":"#cb4b16","--od-h2":"#268bd2","--od-h3":"#859900","--od-h4":"#6c71c4","--od-h5":"#2aa198","--od-h6":"#b58900","--od-link":"#268bd2","--od-link-hover":"#2aa198","--od-code-bg":"#eee8d5","--od-code-fg":"#cb4b16","--od-pre-bg":"#eee8d5","--od-pre-border":"#eee8d5","--od-table-even":"#eee8d5","--od-table-odd":"#fdf6e3","--od-table-th":"#eee8d5","--od-scrollbar-track":"#eee8d5","--od-scrollbar-thumb":"#93a1a1","--od-scrollbar-hover":"#657b83","--od-mermaid-bg":"#f5efdc","--od-mermaid-border":"#eee8d5","--od-selection":"rgba(38, 139, 210, 0.2)","--od-mark-bg":"#faeb8f","--od-kbd-bg":"#eee8d5"}},"github-dark":{name:"GitHub Dark",isDark:!0,variables:{"--od-bg":"#0d1117","--od-fg":"#c9d1d9","--od-bg-alt":"#161b22","--od-border":"#30363d","--od-comment":"#8b949e","--od-h1":"#ff7b72","--od-h2":"#58a6ff","--od-h3":"#7ee787","--od-h4":"#d2a8ff","--od-h5":"#56d4dd","--od-h6":"#e3b341","--od-link":"#58a6ff","--od-link-hover":"#79c0ff","--od-code-bg":"#161b22","--od-code-fg":"#ff7b72","--od-pre-bg":"#161b22","--od-pre-border":"#21262d","--od-table-even":"#161b22","--od-table-odd":"#0d1117","--od-table-th":"#21262d","--od-scrollbar-track":"#161b22","--od-scrollbar-thumb":"#30363d","--od-scrollbar-hover":"#484f58","--od-mermaid-bg":"#161b22","--od-mermaid-border":"#30363d","--od-selection":"rgba(56, 139, 253, 0.25)","--od-mark-bg":"#6e5500","--od-kbd-bg":"#21262d"}},"github-light":{name:"GitHub Light",isDark:!1,variables:{"--od-bg":"#ffffff","--od-fg":"#24292f","--od-bg-alt":"#f6f8fa","--od-border":"#d0d7de","--od-comment":"#6e7781","--od-h1":"#cf222e","--od-h2":"#0969da","--od-h3":"#1a7f37","--od-h4":"#8250df","--od-h5":"#0e84b5","--od-h6":"#9a6700","--od-link":"#0969da","--od-link-hover":"#0550ae","--od-code-bg":"#f6f8fa","--od-code-fg":"#cf222e","--od-pre-bg":"#f6f8fa","--od-pre-border":"#d0d7de","--od-table-even":"#f6f8fa","--od-table-odd":"#ffffff","--od-table-th":"#eaeef2","--od-scrollbar-track":"#f6f8fa","--od-scrollbar-thumb":"#d0d7de","--od-scrollbar-hover":"#afb8c1","--od-mermaid-bg":"#f6f8fa","--od-mermaid-border":"#d0d7de","--od-selection":"rgba(9, 105, 218, 0.2)","--od-mark-bg":"#ffe8b3","--od-kbd-bg":"#eaeef2"}},"tomorrow-night":{name:"Tomorrow Night",isDark:!0,variables:{"--od-bg":"#1d1f21","--od-fg":"#c5c8c6","--od-bg-alt":"#282a2e","--od-border":"#373b41","--od-comment":"#969896","--od-h1":"#cc6666","--od-h2":"#81a2be","--od-h3":"#b5bd68","--od-h4":"#b294bb","--od-h5":"#8abeb7","--od-h6":"#f0c674","--od-link":"#81a2be","--od-link-hover":"#8abeb7","--od-code-bg":"#282a2e","--od-code-fg":"#cc6666","--od-pre-bg":"#282a2e","--od-pre-border":"#373b41","--od-table-even":"#282a2e","--od-table-odd":"#1d1f21","--od-table-th":"#373b41","--od-scrollbar-track":"#282a2e","--od-scrollbar-thumb":"#373b41","--od-scrollbar-hover":"#4d5053","--od-mermaid-bg":"#282a2e","--od-mermaid-border":"#373b41","--od-selection":"rgba(129, 162, 190, 0.25)","--od-mark-bg":"#4a4019","--od-kbd-bg":"#373b41"}},tomorrow:{name:"Tomorrow",isDark:!1,variables:{"--od-bg":"#ffffff","--od-fg":"#4d4d4c","--od-bg-alt":"#efefef","--od-border":"#d6d6d6","--od-comment":"#8e908c","--od-h1":"#c82829","--od-h2":"#4271ae","--od-h3":"#718c00","--od-h4":"#8959a8","--od-h5":"#3e999f","--od-h6":"#eab700","--od-link":"#4271ae","--od-link-hover":"#3e999f","--od-code-bg":"#efefef","--od-code-fg":"#c82829","--od-pre-bg":"#efefef","--od-pre-border":"#d6d6d6","--od-table-even":"#efefef","--od-table-odd":"#ffffff","--od-table-th":"#e4e4e4","--od-scrollbar-track":"#efefef","--od-scrollbar-thumb":"#d6d6d6","--od-scrollbar-hover":"#b3b3b3","--od-mermaid-bg":"#f6f6f6","--od-mermaid-border":"#d6d6d6","--od-selection":"rgba(66, 113, 174, 0.2)","--od-mark-bg":"#ffe8a8","--od-kbd-bg":"#e4e4e4"}},"ayu-dark":{name:"Ayu Dark",isDark:!0,variables:{"--od-bg":"#0f1419","--od-fg":"#bfbdb6","--od-bg-alt":"#1c2128","--od-border":"#2a313c","--od-comment":"#626a73","--od-h1":"#f07178","--od-h2":"#39bae6","--od-h3":"#aad94c","--od-h4":"#d2a6ff","--od-h5":"#95e6cb","--od-h6":"#ffb454","--od-link":"#39bae6","--od-link-hover":"#95e6cb","--od-code-bg":"#1c2128","--od-code-fg":"#f07178","--od-pre-bg":"#161b22","--od-pre-border":"#2a313c","--od-table-even":"#161b22","--od-table-odd":"#0f1419","--od-table-th":"#1c2128","--od-scrollbar-track":"#161b22","--od-scrollbar-thumb":"#2a313c","--od-scrollbar-hover":"#3a4452","--od-mermaid-bg":"#161b22","--od-mermaid-border":"#2a313c","--od-selection":"rgba(57, 186, 230, 0.25)","--od-mark-bg":"#4a4019","--od-kbd-bg":"#1c2128"}},"ayu-light":{name:"Ayu Light",isDark:!1,variables:{"--od-bg":"#fafafa","--od-fg":"#5c6166","--od-bg-alt":"#f0f1f3","--od-border":"#e3e4e6","--od-comment":"#abb0b6","--od-h1":"#f0626b","--od-h2":"#399ee6","--od-h3":"#86b300","--od-h4":"#a37acc","--od-h5":"#4cbf99","--od-h6":"#e6b355","--od-link":"#399ee6","--od-link-hover":"#4cbf99","--od-code-bg":"#f0f1f3","--od-code-fg":"#f0626b","--od-pre-bg":"#f0f1f3","--od-pre-border":"#e3e4e6","--od-table-even":"#f0f1f3","--od-table-odd":"#fafafa","--od-table-th":"#e9eaec","--od-scrollbar-track":"#f0f1f3","--od-scrollbar-thumb":"#d4d6d8","--od-scrollbar-hover":"#abb0b6","--od-mermaid-bg":"#f6f6f7","--od-mermaid-border":"#e3e4e6","--od-selection":"rgba(57, 158, 230, 0.2)","--od-mark-bg":"#fff1b8","--od-kbd-bg":"#e9eaec"}},monokai:{name:"Monokai",isDark:!0,variables:{"--od-bg":"#272822","--od-fg":"#f8f8f2","--od-bg-alt":"#1e1f1c","--od-border":"#3e3d32","--od-comment":"#75715e","--od-h1":"#f92672","--od-h2":"#66d9ef","--od-h3":"#a6e22e","--od-h4":"#ae81ff","--od-h5":"#fd971f","--od-h6":"#e6db74","--od-link":"#66d9ef","--od-link-hover":"#fd971f","--od-code-bg":"#3e3d32","--od-code-fg":"#f92672","--od-pre-bg":"#1e1f1c","--od-pre-border":"#3e3d32","--od-table-even":"#1e1f1c","--od-table-odd":"#272822","--od-table-th":"#3e3d32","--od-scrollbar-track":"#1e1f1c","--od-scrollbar-thumb":"#3e3d32","--od-scrollbar-hover":"#49483e","--od-mermaid-bg":"#1e1f1c","--od-mermaid-border":"#3e3d32","--od-selection":"rgba(102, 217, 239, 0.25)","--od-mark-bg":"#4a4019","--od-kbd-bg":"#3e3d32"}},"synthwave-84":{name:"Synthwave '84",isDark:!0,variables:{"--od-bg":"#262335","--od-fg":"#ffffff","--od-bg-alt":"#1e1a2e","--od-border":"#3b3751","--od-comment":"#766d94","--od-h1":"#fe4450","--od-h2":"#03aeff","--od-h3":"#72f1b8","--od-h4":"#ff7edb","--od-h5":"#03edf9","--od-h6":"#fede5d","--od-link":"#03aeff","--od-link-hover":"#03edf9","--od-code-bg":"#2e2b3f","--od-code-fg":"#fe4450","--od-pre-bg":"#1e1a2e","--od-pre-border":"#3b3751","--od-table-even":"#1e1a2e","--od-table-odd":"#262335","--od-table-th":"#2e2b3f","--od-scrollbar-track":"#1e1a2e","--od-scrollbar-thumb":"#3b3751","--od-scrollbar-hover":"#4a4565","--od-mermaid-bg":"#1e1a2e","--od-mermaid-border":"#3b3751","--od-selection":"rgba(255, 126, 219, 0.25)","--od-mark-bg":"#4a3d19","--od-kbd-bg":"#2e2b3f"}},"one-dark-pro":{name:"One Dark Pro",isDark:!0,variables:{"--od-bg":"#282c34","--od-fg":"#abb2bf","--od-bg-alt":"#21252b","--od-border":"#3b4051","--od-comment":"#7f848e","--od-h1":"#e06c75","--od-h2":"#61afef","--od-h3":"#98c379","--od-h4":"#c678dd","--od-h5":"#56b6c2","--od-h6":"#e5c07b","--od-link":"#61afef","--od-link-hover":"#56b6c2","--od-code-bg":"#21252b","--od-code-fg":"#e06c75","--od-pre-bg":"#21252b","--od-pre-border":"#3e4451","--od-table-even":"#21252b","--od-table-odd":"#282c34","--od-table-th":"#3e4451","--od-scrollbar-track":"#21252b","--od-scrollbar-thumb":"#3e4451","--od-scrollbar-hover":"#4f5666","--od-mermaid-bg":"#21252b","--od-mermaid-border":"#3e4451","--od-selection":"rgba(97, 175, 239, 0.25)","--od-mark-bg":"#4a3a20","--od-kbd-bg":"#3e4451"}},"rose-pine":{name:"Rosé Pine",isDark:!0,variables:{"--od-bg":"#191724","--od-fg":"#e0def4","--od-bg-alt":"#1f1d2e","--od-border":"#26233a","--od-comment":"#6e6a86","--od-h1":"#eb6f92","--od-h2":"#c4a7e7","--od-h3":"#9ccfd8","--od-h4":"#31748f","--od-h5":"#f6c177","--od-h6":"#ebbcba","--od-link":"#c4a7e7","--od-link-hover":"#9ccfd8","--od-code-bg":"#1f1d2e","--od-code-fg":"#eb6f92","--od-pre-bg":"#1f1d2e","--od-pre-border":"#26233a","--od-table-even":"#1f1d2e","--od-table-odd":"#191724","--od-table-th":"#26233a","--od-scrollbar-track":"#1f1d2e","--od-scrollbar-thumb":"#403d52","--od-scrollbar-hover":"#524f67","--od-mermaid-bg":"#1f1d2e","--od-mermaid-border":"#26233a","--od-selection":"rgba(196, 167, 231, 0.25)","--od-mark-bg":"#4a3a44","--od-kbd-bg":"#26233a"}},"rose-pine-dawn":{name:"Rosé Pine Dawn",isDark:!1,variables:{"--od-bg":"#faf4ed","--od-fg":"#575279","--od-bg-alt":"#f2e9e1","--od-border":"#e7d7c9","--od-comment":"#908caa","--od-h1":"#d7827e","--od-h2":"#907aa9","--od-h3":"#56949f","--od-h4":"#286983","--od-h5":"#ea9a3c","--od-h6":"#eb6f92","--od-link":"#907aa9","--od-link-hover":"#56949f","--od-code-bg":"#f2e9e1","--od-code-fg":"#d7827e","--od-pre-bg":"#f2e9e1","--od-pre-border":"#e7d7c9","--od-table-even":"#f2e9e1","--od-table-odd":"#faf4ed","--od-table-th":"#e7d7c9","--od-scrollbar-track":"#f2e9e1","--od-scrollbar-thumb":"#c4ab94","--od-scrollbar-hover":"#a98f77","--od-mermaid-bg":"#f6ede4","--od-mermaid-border":"#e7d7c9","--od-selection":"rgba(144, 122, 169, 0.2)","--od-mark-bg":"#efd9a6","--od-kbd-bg":"#e7d7c9"}},"gruvbox-material-dark":{name:"Gruvbox Material Dark",isDark:!0,variables:{"--od-bg":"#282828","--od-fg":"#bdae93","--od-bg-alt":"#32302f","--od-border":"#3c3836","--od-comment":"#665c54","--od-h1":"#f14668","--od-h2":"#51afef","--od-h3":"#8cc265","--od-h4":"#d3869b","--od-h5":"#e6b325","--od-h6":"#fe640b","--od-link":"#51afef","--od-link-hover":"#8cc265","--od-code-bg":"#32302f","--od-code-fg":"#f14668","--od-pre-bg":"#32302f","--od-pre-border":"#3c3836","--od-table-even":"#32302f","--od-table-odd":"#282828","--od-table-th":"#3c3836","--od-scrollbar-track":"#32302f","--od-scrollbar-thumb":"#504945","--od-scrollbar-hover":"#665c54","--od-mermaid-bg":"#32302f","--od-mermaid-border":"#3c3836","--od-selection":"rgba(81, 175, 239, 0.25)","--od-mark-bg":"#4a3a20","--od-kbd-bg":"#3c3836"}},"gruvbox-material-light":{name:"Gruvbox Material Light",isDark:!1,variables:{"--od-bg":"#fbf1c7","--od-fg":"#504945","--od-bg-alt":"#f5ebd3","--od-border":"#bdae93","--od-comment":"#928374","--od-h1":"#be4678","--od-h2":"#3a94c5","--od-h3":"#8fbc5a","--od-h4":"#d27e99","--od-h5":"#bab862","--od-h6":"#dd7828","--od-link":"#3a94c5","--od-link-hover":"#8fbc5a","--od-code-bg":"#f5ebd3","--od-code-fg":"#be4678","--od-pre-bg":"#f5ebd3","--od-pre-border":"#bdae93","--od-table-even":"#f5ebd3","--od-table-odd":"#fbf1c7","--od-table-th":"#bdae93","--od-scrollbar-track":"#f5ebd3","--od-scrollbar-thumb":"#928374","--od-scrollbar-hover":"#665c54","--od-mermaid-bg":"#f5ebd3","--od-mermaid-border":"#bdae93","--od-selection":"rgba(58, 148, 197, 0.2)","--od-mark-bg":"#f0d9a0","--od-kbd-bg":"#bdae93"}},"nord-night":{name:"Nord Night",isDark:!0,variables:{"--od-bg":"#242933","--od-fg":"#d8dee9","--od-bg-alt":"#2e3440","--od-border":"#3b4252","--od-comment":"#616e88","--od-h1":"#bf616a","--od-h2":"#88c0d0","--od-h3":"#a3be8c","--od-h4":"#b48ead","--od-h5":"#81a1c1","--od-h6":"#ebcb8b","--od-link":"#88c0d0","--od-link-hover":"#8fbcbb","--od-code-bg":"#2e3440","--od-code-fg":"#bf616a","--od-pre-bg":"#2e3440","--od-pre-border":"#3b4252","--od-table-even":"#2e3440","--od-table-odd":"#242933","--od-table-th":"#3b4252","--od-scrollbar-track":"#2e3440","--od-scrollbar-thumb":"#434c5e","--od-scrollbar-hover":"#4c566a","--od-mermaid-bg":"#2e3440","--od-mermaid-border":"#3b4252","--od-selection":"rgba(136, 192, 208, 0.25)","--od-mark-bg":"#453e28","--od-kbd-bg":"#3b4252"}}},a={"atom-one-dark":{dark:"atom-one-dark",light:"atom-one-light"},"atom-one-light":{dark:"atom-one-dark",light:"atom-one-light"},"tokyo-night":{dark:"tokyo-night",light:"tokyo-night"},"tokyo-night-storm":{dark:"tokyo-night-storm",light:"tokyo-night-storm"},"everforest-dark":{dark:"everforest-dark",light:"everforest-light"},"everforest-light":{dark:"everforest-dark",light:"everforest-light"},"catppuccin-mocha":{dark:"catppuccin-mocha",light:"catppuccin-latte"},"catppuccin-latte":{dark:"catppuccin-mocha",light:"catppuccin-latte"},nord:{dark:"nord",light:"nord"},dracula:{dark:"dracula",light:"dracula"},"gruvbox-dark":{dark:"gruvbox-dark",light:"gruvbox-light"},"gruvbox-light":{dark:"gruvbox-dark",light:"gruvbox-light"},"solarized-dark":{dark:"solarized-dark",light:"solarized-light"},"solarized-light":{dark:"solarized-dark",light:"solarized-light"},"github-dark":{dark:"github-dark",light:"github-light"},"github-light":{dark:"github-dark",light:"github-light"},"tomorrow-night":{dark:"tomorrow-night",light:"tomorrow"},tomorrow:{dark:"tomorrow-night",light:"tomorrow"},"ayu-dark":{dark:"ayu-dark",light:"ayu-light"},"ayu-light":{dark:"ayu-dark",light:"ayu-light"},monokai:{dark:"monokai",light:"monokai"},"synthwave-84":{dark:"synthwave-84",light:"synthwave-84"},"one-dark-pro":{dark:"one-dark-pro",light:"one-dark-pro"},"rose-pine":{dark:"rose-pine",light:"rose-pine"},"rose-pine-dawn":{dark:"rose-pine-dawn",light:"rose-pine-dawn"},"gruvbox-material-dark":{dark:"gruvbox-material-dark",light:"gruvbox-material-light"},"gruvbox-material-light":{dark:"gruvbox-material-dark",light:"gruvbox-material-light"},"nord-night":{dark:"nord-night",light:"nord-night"}},i="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",d="'Cascadia Code', 'Fira Code', 'Consolas', monospace",l=new Set(["a4","letter","a5","a3","legal","auto"]),s={standard:"15mm 18mm",comfortable:"20mm 20mm",compact:"8mm 10mm",none:"0"},c={balanced:{h1:"1.75em",h2:"1.42em",h3:"1.25em",h4:"1.12em",h5:"1.05em",h6:"1.0em"},large:{h1:"2.15em",h2:"1.7em",h3:"1.4em",h4:"1.22em",h5:"1.1em",h6:"1.0em"},compact:{h1:"1.5em",h2:"1.3em",h3:"1.18em",h4:"1.08em",h5:"1.02em",h6:"0.95em"}};function m(t){const o=(t||"").replace("#","");return 6===o.length&&/^[0-9a-fA-F]{6}$/.test(o)?[0,2,4].map(t=>parseInt(o.slice(t,t+2),16)):null}function p(t){const[o,e,n]=t.map(t=>{const o=t/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)});return.2126*o+.7152*e+.0722*n}function b(t,o){const[e,n]=[p(t),p(o)].sort((t,o)=>o-t);return(e+.05)/(n+.05)}function h(t){return"#"+t.map(t=>t.toString(16).padStart(2,"0")).join("")}function g(t,o,e=3){const n=m(t),r=m(o);if(!n||!r||b(n,r)>=e)return t;const a=p(r)<.5?[255,255,255]:[0,0,0];let i=t;for(let t=1;t<=20;t++){const o=n.map((o,e)=>{return n=o,r=a[e],i=.05*t,Math.round(n+(r-n)*i);var n,r,i});if(i=h(o),b(o,r)>=e)break}return i}function f(t){const o=t.variables,e=o["--od-pre-bg"]||o["--od-bg"],n={"--od-tok-keyword":o["--od-h4"],"--od-tok-string":o["--od-h3"],"--od-tok-number":o["--od-h6"],"--od-tok-function":o["--od-h2"],"--od-tok-type":o["--od-h5"],"--od-tok-tag":o["--od-h1"],"--od-tok-comment":o["--od-comment"],"--od-tok-fg":o["--od-fg"],"--od-tok-accent":o["--od-link"]};let r=":root {\n";for(const[t,o]of Object.entries(n))r+=` ${t}: ${g(o,e)};\n`;return r+="}\n",r}function u(t,o=r){const e=t.noteThemeEffective&&o[t.noteThemeEffective]?t.noteThemeEffective:t.themeKey;return o[e]||r[e]||r["atom-one-dark"]}function v(t,o,e){const n=o.pairWith;return n&&e[n]?o.isDark?{dark:t,light:n}:{dark:n,light:t}:null}function k(t,o=""){let e=":root {\n";for(const[o,n]of Object.entries(t.variables))e+=` ${o}: ${n};\n`;return e+=o,e+="}\n",e}function y(t,o){return t.noteThemeEffective&&o[t.noteThemeEffective]?t.noteThemeEffective:t.themeKey}function w(t,o="",e=r){const n=u(t,e);let i=k(n,` color-scheme: ${n.isDark?"dark":"light"};\n${o}`);if("system"!==t.colorSchemeMode)return i;const d=y(t,e);let l=null,s=null;const c=v(d,n,e);if(c)l=c.dark,s=c.light;else{const t=a[d];t&&t.dark!==t.light&&(l=t.dark,s=t.light)}if(!l||!s)return i;const m=e[l]||r[l]||n,p=e[s]||r[s]||n;return i+=`\n@media (prefers-color-scheme: dark) {\n${k(m," color-scheme: dark;\n")}\n}\n`,i+=`@media (prefers-color-scheme: light) {\n${k(p," color-scheme: light;\n")}\n}\n`,i}const x=/^-?\d+(?:\.\d+)?(?:px|rem|em|pt|pc|in|cm|mm|%|vh|vw|ch|ex)$/,S=/^\d+(?:\.\d+)?$/,$=/^[^;{}<>]{1,80}$/;function C(t,o){const e=(t||"").trim();return x.test(e)?e:o}function T(t,o){const e=(t||"").trim();return S.test(e)?e:o}function j(t,o){return(t||"").replace(/[;{}<>\\]/g,"").replace(/\s+/g," ").trim()||o}function P(t){let o="",e=j(t.fontFamily,i);switch(t.fontPreset){case"inter":o+="@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');\n",e="'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";break;case"roboto":o+="@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');\n",e="'Roboto', -apple-system, BlinkMacSystemFont, sans-serif";break;case"vazirmatn":o+="@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');\n",e="'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";break;case"noto-arabic":o+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;600;700&display=swap');\n",e="'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif";break;case"noto-cjk-sc":o+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');\n",e="'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif";break;case"noto-cjk-jp":o+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');\n",e="'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif";break;case"heebo":o+="@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;600;700&display=swap');\n",e="'Heebo', -apple-system, BlinkMacSystemFont, sans-serif";break;case"noto-devanagari":o+="@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&display=swap');\n",e="'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif";break;case"lora":o+="@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap');\n",e="'Lora', Georgia, serif";break;case"system":e="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";break;default:e=j(t.fontFamily,i)}let n=j(t.codeFont,d);switch(t.codeFontPreset){case"fira-code":o+="@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');\n",n="'Fira Code', monospace";break;case"jetbrains-mono":o+="@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');\n",n="'JetBrains Mono', monospace";break;case"system-mono":n="'Cascadia Code', 'Consolas', 'Courier New', monospace";break;default:n=j(t.codeFont,d)}return{fontImport:o,resolvedFont:e,resolvedCodeFont:n}}function L(t,o=r){u(t,o);const{fontImport:e,resolvedFont:n,resolvedCodeFont:a}=P(t),i=w(t,"",o);let d="";return d="rtl"===t.direction?"\n .cm-content, .CodeMirror-lines, body#tinymce {\n direction: rtl !important;\n text-align: right !important;\n }\n ":"auto"===t.direction?"\n .cm-content, .CodeMirror-lines, body#tinymce {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"\n .cm-content, .CodeMirror-lines, body#tinymce {\n direction: ltr !important;\n text-align: left !important;\n }\n ",`\n${e}\n${i}\n\n/* Outer editor container & scroller get the theme background */\nhtml body div.cm-editor,\nhtml body div.cm-editor .cm-scroller,\nhtml body div.CodeMirror,\nhtml body .r-markdown-editor {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n font-family: ${n} !important;\n}\n\n/* Content and lines MUST remain transparent so CodeMirror's selection layer is visible */\n.cm-content,\n.cm-line,\n.CodeMirror-lines,\n.CodeMirror-sizer {\n background-color: transparent !important;\n}\n\n.cm-content, .CodeMirror-lines {\n font-size: ${C(t.fontSize,"16px")} !important;\n line-height: ${T(t.lineHeight,"1.75")} !important;\n caret-color: var(--od-link) !important;\n}\n\n${d}\n\n/* Gutters & Line Numbers */\n.cm-gutters, .CodeMirror-gutters {\n background-color: var(--od-bg-alt) !important;\n color: var(--od-comment) !important;\n border-right: 1px solid var(--od-border) !important;\n}\n.cm-activeLineGutter {\n background-color: var(--od-bg-alt) !important;\n color: var(--od-h2) !important;\n font-weight: bold !important;\n}\n.cm-activeLine, .CodeMirror-activeline-background {\n background-color: rgba(127, 127, 127, 0.08) !important;\n}\n\n/* Cursor & Selection (Fully unmasked for CodeMirror 6 and CodeMirror 5) */\n.CodeMirror-cursor,\n.cm-cursor,\n.cm-dropCursor {\n border-left: 2px solid var(--od-link) !important;\n border-left-color: var(--od-link) !important;\n}\n.cm-lineNumbers .cm-gutterElement {\n color: var(--od-comment) !important;\n}\n.cm-selectionBackground,\n.cm-editor .cm-selectionLayer .cm-selectionBackground,\n.cm-content ::selection,\n.cm-line ::selection,\n.CodeMirror-selected,\n.CodeMirror-focused .CodeMirror-selected,\n::selection {\n background-color: var(--od-selection) !important;\n}\n\n/* Syntax Highlighting in Markdown Editor */\n.cm-header-1, .tok-heading-1 { color: var(--od-h1) !important; font-weight: 700 !important; }\n.cm-header-2, .tok-heading-2 { color: var(--od-h2) !important; font-weight: 700 !important; }\n.cm-header-3, .tok-heading-3 { color: var(--od-h3) !important; font-weight: 600 !important; }\n.cm-header-4, .tok-heading-4 { color: var(--od-h4) !important; font-weight: 600 !important; }\n.cm-header-5, .tok-heading-5 { color: var(--od-h5) !important; }\n.cm-header-6, .tok-heading-6 { color: var(--od-h6) !important; }\n\n.cm-link, .tok-link { color: var(--od-link) !important; text-decoration: underline !important; }\n.cm-url, .tok-url { color: var(--od-link-hover) !important; }\n.cm-strong, .tok-strong { font-weight: bold !important; color: var(--od-fg) !important; }\n.cm-em, .tok-emphasis { font-style: italic !important; }\n.cm-comment, .tok-comment { color: var(--od-comment) !important; }\n.cm-quote, .tok-quote { color: var(--od-comment) !important; font-style: italic !important; }\n\n.tok-monospace, .cm-inline-code, .cm-variable-2 {\n font-family: ${a} !important;\n background-color: var(--od-code-bg) !important;\n color: var(--od-code-fg) !important;\n border-radius: 3px !important;\n}\n\n/* TinyMCE (Rich Text Editor) Shell & Toolbar Theming */\n.tox-tinymce {\n border: 1px solid var(--od-border) !important;\n background-color: var(--od-bg) !important;\n}\n.tox .tox-toolbar,\n.tox .tox-toolbar__primary,\n.tox .tox-toolbar__overflow {\n background-color: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n.tox .tox-tbtn {\n color: var(--od-fg) !important;\n}\n.tox .tox-tbtn:hover {\n background-color: var(--od-selection) !important;\n}\n.tox .tox-tbtn svg {\n fill: var(--od-fg) !important;\n}\n`}function z(t,o=r){return`${w(t," --od-active-accent: inset 0 0 0 0 transparent;\n",o)}:root {\n --joplin-background-color: var(--od-bg) !important;\n --joplin-background-color-transparent30: var(--od-selection) !important;\n --joplin-background-color-hover3: var(--od-bg-alt) !important;\n --joplin-color: var(--od-fg) !important;\n --joplin-color-hover: var(--od-link) !important;\n --joplin-divider-color: var(--od-border) !important;\n --joplin-scrollbar-thumb-color: var(--od-scrollbar-thumb) !important;\n --joplin-scrollbar-color-hover: var(--od-scrollbar-hover) !important;\n}\nbody {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n}\n::-webkit-scrollbar-thumb {\n background: var(--od-scrollbar-thumb) !important;\n}\n`}function B(t,o="viewer",e=r){const n="tinymce"!==o,i=n?"#rendered-md":"body#tinymce",d=(u(t,e),function(t,o=r){const e=u(t,o);let n=f(e);if("system"!==t.colorSchemeMode)return n;const i=y(t,o),d=v(i,e,o)||a[i];if(!d||d.dark===d.light)return n;const l=o[d.dark]||r[d.dark]||e,s=o[d.light]||r[d.light]||e;return n+=`\n@media (prefers-color-scheme: dark) {\n${f(l)}\n}\n`,n+=`@media (prefers-color-scheme: light) {\n${f(s)}\n}\n`,n}(t,e)),{fontImport:m,resolvedFont:p,resolvedCodeFont:b}=P(t),h=function(t){const o=c.balanced,e=t.headingSizePreset||"balanced";if("large"===e||"compact"===e)return c[e];if("custom"===e&&t.customHeadingSizes){const e=t.customHeadingSizes.split(",").map(t=>t.replace(/h[1-6]:?/gi,"").trim()).filter(t=>x.test(t)||S.test(t)||/^calc\([^;{}<>]+\)$/.test(t));return{h1:e[0]||o.h1,h2:e[1]||o.h2,h3:e[2]||o.h3,h4:e[3]||o.h4,h5:e[4]||o.h5,h6:e[5]||o.h6}}return o}(t),g=w(t,` --mermaid-font-family: ${p} !important;\n`,e);let k="";if("rtl"===t.direction)k=`\nbody, ${i} { direction: rtl !important; text-align: right !important; }\n${i} h1 { text-align: right !important; }\n${i} h2 {\n border-right: 5px solid var(--od-h2) !important;\n border-left: none !important;\n padding-right: 12px !important;\n padding-left: 0 !important;\n text-align: right !important;\n}\n${i} :is(h3, h4, h5, h6) { text-align: right !important; }\n${i} :is(ul, ol) {\n direction: rtl !important;\n text-align: right !important;\n padding-right: 2.2em !important;\n padding-left: 0 !important;\n}\n${i} li {\n direction: rtl !important;\n text-align: right !important;\n}\n${i} :is(ul, ol) :is(ul, ol) {\n padding-right: 1.6em !important;\n padding-left: 0 !important;\n}\n.md-checkbox input[type="checkbox"] { margin-left: 8px !important; margin-right: 0 !important; }\n\n/* RTL Blockquotes: 1px Right Border & No Left Border */\n${i} blockquote {\n direction: rtl !important;\n text-align: right !important;\n border-right: 1px solid var(--od-comment) !important;\n border-left: 0 !important;\n}\n${i} :is(th, td):not([style*="text-align"]) { text-align: right !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text {\n direction: rtl !important;\n unicode-bidi: plaintext !important;\n}\n\n/* Explicit <div dir="ltr"> islands inside an RTL document */\n${i} [dir="ltr"],\n${i} [dir="ltr"] :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, dt, dd) {\n direction: ltr !important;\n text-align: left !important;\n}\n${i} [dir="ltr"] h2 {\n border-right: none !important;\n border-left: 5px solid var(--od-h2) !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n}\n${i} [dir="ltr"] blockquote {\n border-right: none !important;\n border-left: 1px solid var(--od-comment) !important;\n padding-left: 16px !important;\n padding-right: 12px !important;\n}\n${i} [dir="ltr"] :is(ul, ol) {\n direction: ltr !important;\n text-align: left !important;\n padding-left: 1.6em !important;\n padding-right: 0 !important;\n}\n${i} [dir="ltr"] :is(ul ul, ol ol, ul ol, ol ul) {\n padding-left: 1.4em !important;\n padding-right: 0 !important;\n}\n${i} [dir="ltr"] .md-checkbox input[type="checkbox"] {\n margin-right: 8px !important;\n margin-left: 0 !important;\n}\n${i} [dir="ltr"] table :is(th, td):not([style*="text-align"]) { text-align: left !important; }\n`;else if("auto"===t.direction){const t=':is([dir="rtl"], :dir(rtl))',o=':is([dir="ltr"], :dir(ltr))';k=`\nbody, ${i} { direction: ltr !important; text-align: start !important; }\n${n?`${i} :is(p, h1, h2, h3, h4, h5, h6, li, blockquote, dt, dd, th, td) {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n}`:""}\n\n/* =================================================================\n NATIVE BIDI LIST & MARKER ENGINE (RTL / LTR AWARE)\n ================================================================= */\n${i} :is(ul, ol) {\n padding-left: 2em !important;\n padding-right: 0 !important;\n}\n\n/* Explicit RTL lists and items */\n${i} :is(ul, ol)${t} {\n direction: rtl !important;\n text-align: right !important;\n padding-right: 2.2em !important;\n padding-left: 0 !important;\n}\n${i} li${t} {\n direction: rtl !important;\n text-align: right !important;\n}\n${i} :is(ul, ol)[dir="rtl"] :is(ul, ol) {\n padding-right: 1.6em !important;\n padding-left: 0 !important;\n}\n\n/* Explicit LTR lists and items */\n${i} :is(ul, ol)${o} {\n direction: ltr !important;\n text-align: left !important;\n padding-left: 2em !important;\n padding-right: 0 !important;\n}\n${i} li${o} {\n direction: ltr !important;\n text-align: left !important;\n}\n${i} :is(ul, ol)[dir="ltr"] :is(ul, ol) {\n padding-left: 1.6em !important;\n padding-right: 0 !important;\n}\n\n/* BiDi Checkboxes */\n${i} li${t} input[type="checkbox"] {\n margin-left: 8px !important;\n margin-right: 0 !important;\n}\n${i} li${o} input[type="checkbox"] {\n margin-right: 8px !important;\n margin-left: 0 !important;\n}\n\n/* BiDi H2 Headings */\n${i} h2${t} {\n border-right: 5px solid var(--od-h2) !important;\n border-left: none !important;\n padding-right: 12px !important;\n padding-left: 0 !important;\n text-align: right !important;\n}\n${i} h2${o} {\n border-left: 5px solid var(--od-h2) !important;\n border-right: none !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n text-align: left !important;\n}\n\n/* BiDi Blockquotes */\n${i} blockquote${t} {\n border-right: 1px solid var(--od-comment) !important;\n border-left: none !important;\n padding-right: 16px !important;\n padding-left: 10px !important;\n text-align: right !important;\n direction: rtl !important;\n}\n${i} blockquote${o} {\n border-left: 1px solid var(--od-comment) !important;\n border-right: none !important;\n padding-left: 16px !important;\n padding-right: 10px !important;\n text-align: left !important;\n direction: ltr !important;\n}\n\n${i} :is(th, td):not([style*="text-align"]) { text-align: start !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text { unicode-bidi: plaintext !important; }\n`}else k=`\nbody, ${i} { direction: ltr !important; text-align: left !important; }\n${i} h2 {\n border-left: 5px solid var(--od-h2) !important;\n border-right: none !important;\n padding-left: 12px !important;\n padding-right: 0 !important;\n}\n${i} :is(ul, ol) { padding-left: 2em !important; }\n.md-checkbox input[type="checkbox"] { margin-right: 8px !important; margin-left: 0 !important; }\n\n/* LTR Blockquotes: 1px Left Border & No Right Border */\n${i} blockquote {\n border-left: 1px solid var(--od-comment) !important;\n border-right: 0 !important;\n}\n${i} :is(th, td):not([style*="text-align"]) { text-align: left !important; }\n.mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .label, .mermaid text { direction: ltr !important; }\n`;let j="";"compact"===t.contentMaxWidth?j="max-width: 760px !important; margin: 0 auto !important;":"comfortable"===t.contentMaxWidth&&(j="max-width: 920px !important; margin: 0 auto !important;");const L=`${i} pre:not(.mermaid):not(.joplin-source)`,z={compact:.85,default:1,large:1.15}[t.mobileDensity||"default"]??1,B=[],E=C(t.letterSpacing??"","");E&&B.push(`${i} { letter-spacing: ${E} !important; }`),"justify"===t.textAlign&&B.push(`${i} p { text-align: justify !important; }`),t.hyphenation&&(B.push(`${i} { hyphens: auto !important; -webkit-hyphens: auto !important; }`),B.push(`${i} p { hyphens: auto !important; -webkit-hyphens: auto !important; }`)),t.fontLigatures&&B.push(`${i} { font-variant-ligatures: common-ligatures !important; font-feature-settings: 'liga' 1, 'calt' 1 !important; }`);const M=B.length?`\n${B.join("\n")}\n`:"",A=`\n*, *::before, *::after { box-sizing: border-box !important; }\nhtml, body${n?", #rendered-md":""} { max-width: 100% !important; overflow-x: hidden !important; }\n::selection { background-color: var(--od-selection) !important; }\n\nbody, ${i} {\n font-family: ${p} !important;\n line-height: ${T(t.lineHeight,"1.75")} !important;\n font-size: ${C(t.fontSize,"16px")} !important;\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n /* The deprecated value 'word-break: break-word' behaves exactly like\n 'word-break: normal' + 'overflow-wrap: anywhere', so the non-deprecated\n form is spelled out here. */\n word-break: normal !important;\n overflow-wrap: anywhere !important;\n -webkit-font-smoothing: antialiased !important;\n -moz-osx-font-smoothing: grayscale !important;\n}\n${M}\n${n&&j?`\n#rendered-md { ${j} }\n`:""}\n${i} h1 {\n color: var(--od-h1) !important;\n font-size: ${h.h1} !important;\n font-weight: 800 !important;\n padding: 0 0 8px 0 !important;\n margin: 32px 0 20px 0 !important;\n border-bottom: 2px solid var(--od-h1) !important;\n}\n\n${i} h2 {\n color: var(--od-h2) !important;\n font-size: ${h.h2} !important;\n font-weight: 700 !important;\n margin: 28px 0 18px 0 !important;\n}\n\n${i} h3 { color: var(--od-h3) !important; font-size: ${h.h3} !important; font-weight: 600 !important; margin: 24px 0 14px 0 !important; }\n${i} h4 { color: var(--od-h4) !important; font-size: ${h.h4} !important; font-weight: 600 !important; margin: 20px 0 12px 0 !important; }\n${i} h5 { color: var(--od-h5) !important; font-size: ${h.h5} !important; font-weight: 600 !important; margin: 18px 0 10px 0 !important; }\n${i} h6 { color: var(--od-h6) !important; font-size: ${h.h6} !important; font-weight: 700 !important; margin: 16px 0 10px 0 !important; }\n\n${i} li { margin-bottom: 0.45em !important; line-height: ${T(t.lineHeight,"1.75")} !important; }\n${i} li::marker { color: var(--od-h2) !important; font-weight: bold !important; }\n\n.md-checkbox input[type="checkbox"] { vertical-align: middle !important; cursor: pointer !important; }\n${i} li:has(input[type="checkbox"]:checked) {\n opacity: 0.55 !important;\n text-decoration: line-through !important;\n transition: opacity 0.2s ease !important;\n}\n${i} li:has(input[type="checkbox"]:checked) code { opacity: 0.8 !important; text-decoration: none !important; }\n\n${i} img {\n max-width: 100% !important;\n max-height: 520px !important;\n height: auto !important;\n object-fit: contain !important;\n display: block !important;\n margin: 18px auto !important;\n border-radius: 6px !important;\n box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;\n}\n\n${i} a { color: var(--od-link) !important; text-decoration: none !important; transition: color 0.15s ease !important; }\n${i} a:hover { color: var(--od-link-hover) !important; text-decoration: underline !important; }\n\n${i} a[href^=":/"] {\n font-weight: 600 !important;\n border-bottom: 1.5px dashed var(--od-link) !important;\n text-decoration: none !important;\n}\n${i} a[href^=":/"]:hover { border-bottom-style: solid !important; }\n\n/* =================================================================\n BLOCKQUOTES: CLEAN MINIMAL 1PX STYLE (TRANSPARENT BG, NO RADIUS)\n ================================================================= */\n${i} blockquote {\n padding: 10px 16px !important;\n margin: 18px 0 !important;\n background: transparent !important;\n border-radius: 0 !important;\n color: var(--od-fg) !important;\n}\n\nmark { background-color: var(--od-mark-bg) !important; color: var(--od-fg) !important; padding: 1px 4px !important; border-radius: 3px !important; }\nkbd {\n background-color: var(--od-kbd-bg) !important;\n border: 1px solid var(--od-border) !important;\n color: var(--od-fg) !important;\n padding: 2px 5px !important;\n border-radius: 4px !important;\n font-size: 0.85em !important;\n box-shadow: 0 1px 0 rgba(0,0,0,0.2) !important;\n}\n\n${i} .joplin-source, pre.joplin-source, div.joplin-editable > pre.joplin-source {\n display: none !important; visibility: hidden !important; height: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important;\n}\n\n${i} code {\n font-family: ${b} !important;\n background-color: var(--od-code-bg) !important;\n color: var(--od-code-fg) !important;\n padding: 2px 6px !important;\n border-radius: 4px !important;\n font-size: 0.9em !important;\n}\n\n${L} {\n direction: ltr !important;\n text-align: left !important;\n unicode-bidi: isolate !important;\n background-color: var(--od-pre-bg) !important;\n border: 1px solid var(--od-pre-border) !important;\n border-radius: 6px !important;\n padding: 14px !important;\n margin: 18px 0 !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n white-space: pre !important;\n word-break: normal !important;\n word-wrap: normal !important;\n overflow-wrap: normal !important;\n scrollbar-width: thin !important;\n scrollbar-color: var(--od-scrollbar-thumb) var(--od-scrollbar-track) !important;\n}\n\n${L} code {\n background-color: transparent !important;\n color: var(--od-fg) !important;\n padding: 0 !important;\n white-space: pre !important;\n display: inline-block !important;\n min-width: 100% !important;\n}\n\n/* Syntax highlighting tokens. Joplin renders fenced blocks as\n <pre class="hljs"><code><span class="hljs-keyword"> and colours them with a\n bundled Atom One stylesheet chosen from Joplin's own theme, so without the\n rules below every palette would show Atom One syntax colours. The palette\n roles map onto the standard highlighting semantics. */\n${i} pre.hljs,\n${i} .hljs {\n background-color: var(--od-pre-bg) !important;\n color: var(--od-tok-fg) !important;\n}\n\n${i} .hljs-comment,\n${i} .hljs-quote,\n${i} .hljs-doctag {\n color: var(--od-tok-comment) !important;\n font-style: italic !important;\n}\n\n${i} .hljs-keyword,\n${i} .hljs-class,\n${i} .hljs-selector-tag,\n${i} .hljs-template-tag,\n${i} .hljs-meta .hljs-keyword {\n color: var(--od-tok-keyword) !important;\n}\n\n${i} .hljs-string,\n${i} .hljs-regexp,\n${i} .hljs-addition,\n${i} .hljs-meta .hljs-string {\n color: var(--od-tok-string) !important;\n}\n\n${i} .hljs-number,\n${i} .hljs-literal,\n${i} .hljs-symbol,\n${i} .hljs-bullet,\n${i} .hljs-link {\n color: var(--od-tok-number) !important;\n}\n\n${i} .hljs-title,\n${i} .hljs-section,\n${i} .hljs-name,\n${i} .hljs-function {\n color: var(--od-tok-function) !important;\n}\n\n${i} .hljs-type,\n${i} .hljs-built_in,\n${i} .hljs-constructor,\n${i} .hljs-typing,\n${i} .hljs-module,\n${i} .hljs-module-access,\n${i} .hljs-class .hljs-title,\n${i} .hljs-title.class_ {\n color: var(--od-tok-type) !important;\n}\n\n${i} .hljs-attr,\n${i} .hljs-attribute,\n${i} .hljs-variable,\n${i} .hljs-template-variable,\n${i} .hljs-property {\n color: var(--od-tok-tag) !important;\n}\n\n${i} .hljs-tag,\n${i} .hljs-selector-id,\n${i} .hljs-selector-class,\n${i} .hljs-selector-attr,\n${i} .hljs-selector-pseudo {\n color: var(--od-tok-tag) !important;\n}\n\n${i} .hljs-meta,\n${i} .hljs-params {\n color: var(--od-tok-comment) !important;\n}\n\n${i} .hljs-subst,\n${i} .hljs-operator {\n color: var(--od-tok-fg) !important;\n}\n\n${i} .hljs-pattern-match {\n color: var(--od-tok-number) !important;\n}\n\n${i} .hljs-formula {\n color: var(--od-tok-accent) !important;\n}\n\n${i} .hljs-deletion {\n color: var(--od-tok-tag) !important;\n text-decoration: line-through !important;\n}\n\n${i} .hljs-emphasis {\n font-style: italic !important;\n}\n\n${i} .hljs-strong {\n font-weight: 700 !important;\n}\n\n${i} :is(p, li) code {\n direction: ltr !important;\n display: inline-block !important;\n unicode-bidi: embed !important;\n vertical-align: baseline !important;\n white-space: normal !important;\n max-width: 100% !important;\n overflow-wrap: anywhere !important;\n word-break: normal !important;\n}\n\n/* Explicit Table Font Inheritance */\n${i} :is(table, th, td) {\n font-family: ${p} !important;\n}\n${i} table :is(th, td) code {\n font-family: ${b} !important;\n}\n\n${i} table {\n border-collapse: collapse !important;\n width: 100% !important;\n max-width: 100% !important;\n margin: 20px 0 !important;\n border: 1px solid var(--od-border) !important;\n display: block !important;\n box-sizing: border-box !important;\n overflow-x: auto !important;\n scrollbar-width: thin !important;\n scrollbar-color: var(--od-scrollbar-thumb) var(--od-scrollbar-track) !important;\n color: var(--od-fg) !important;\n /* Do NOT inherit the document-level overflow-wrap: anywhere /\n word-break: normal (see the body rule above). The 'anywhere' value makes\n the intrinsic min-content width of a table cell collapse to one\n character, which lets the automatic table algorithm squeeze a column\n narrower than its longest word - the "text in a 5-character column" bug.\n break-word wraps long URLs when needed but leaves min-content intact. On\n narrow screens the mobile rule below additionally pins the table to its\n max-content width so columns can never be squeezed at all. */\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${i} th {\n background-color: var(--od-table-th) !important;\n color: var(--od-link) !important;\n font-weight: bold !important;\n border: 1px solid var(--od-border) !important;\n padding: 8px 12px !important;\n /* Headers wrap when the table fits its container; on narrow screens the\n table is pinned to its max-content width (see the mobile rule below) and\n scrolls horizontally instead of squeezing columns. */\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${i} td {\n border: 1px solid var(--od-border) !important;\n padding: 8px 12px !important;\n color: var(--od-fg) !important;\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n}\n\n${i} tr:nth-child(even) { background-color: var(--od-table-even) !important; }\n${i} tr:nth-child(odd) { background-color: var(--od-table-odd) !important; }\n\n/* Mermaid Diagrams */\n${i} .mermaid, ${i} div.mermaid, ${i} pre.mermaid {\n display: block !important;\n text-align: center !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n margin: 24px 0 !important;\n padding: 20px 14px !important;\n direction: ltr !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n scrollbar-width: thin !important;\n background-color: var(--od-mermaid-bg) !important;\n border: 1px solid var(--od-mermaid-border) !important;\n border-radius: 8px !important;\n}\n${n?"\n#rendered-md .mermaid svg, #rendered-md div.mermaid svg, #rendered-md pre.mermaid svg {\n display: inline-block !important;\n vertical-align: middle !important;\n margin: 0 auto !important;\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n}\n":""}\n.mermaid foreignObject { overflow: visible !important; }\n.mermaid foreignObject div {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n white-space: normal !important;\n word-break: normal !important;\n line-height: 1.4 !important;\n text-align: center !important;\n padding: 3px 6px !important;\n}\n\n.mermaid, .mermaid svg, .mermaid text, .mermaid tspan,\n.mermaid .label, .mermaid .nodeLabel, .mermaid .edgeLabel, .mermaid .cluster-label {\n font-family: var(--mermaid-font-family) !important;\n}\n\n.mermaid .node rect, .mermaid .node polygon { rx: 6px !important; ry: 6px !important; }\n.mermaid .labelBkg, .mermaid rect.labelBkg, .mermaid span.labelBkg, .mermaid .edgeLabel rect {\n background-color: transparent !important; fill: transparent !important; opacity: 0 !important; border: none !important;\n}\n.mermaid .edgeLabel {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border-radius: 4px !important;\n padding: 1px 6px !important;\n}\n\n.katex-display {\n max-width: 100% !important;\n overflow-x: auto !important;\n overflow-y: hidden !important;\n box-sizing: border-box !important;\n padding: 6px 0 !important;\n}\n\n${i} .table-of-contents {\n background-color: var(--od-bg-alt) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 6px !important;\n padding: 12px 18px !important;\n margin: 20px 0 !important;\n display: inline-block !important;\n min-width: min(100%, 300px) !important;\n}\n${n?"#rendered-md .table-of-contents ul { margin: 4px 0 !important; }":""}\n\n${i} .footnotes {\n margin-top: 40px !important;\n padding-top: 16px !important;\n border-top: 1px solid var(--od-border) !important;\n font-size: 0.88em !important;\n color: var(--od-comment) !important;\n}\n\n/* Mobile Responsiveness (< 768px) – only the values that actually differ from the base rules */\n@media screen and (max-width: 768px) {\n ${n&&j?"#rendered-md { max-width: 100% !important; } /* Reading Width is a desktop feature */":""}\n /* Mobile density preset (P3): scales the base font size on small screens.\n Headings, code blocks and tables use em/relative units, so they cascade\n from this single scale factor. */\n body, ${i} { font-size: calc(${C(t.fontSize,"16px")} * ${z}) !important; }\n ${i} h1 { font-size: calc(${h.h1} * 0.9) !important; margin: 20px 0 12px 0 !important; }\n ${i} h2 { font-size: calc(${h.h2} * 0.92) !important; margin: 18px 0 10px 0 !important; }\n ${i} h3 { margin: 16px 0 8px 0 !important; }\n ${i} img { max-height: 420px !important; }\n ${L} { font-size: 0.9em !important; padding: 10px 12px !important; }\n /* Pin the table to its unwrapped content width: the automatic table\n algorithm may otherwise squeeze columns below their content when long\n text is present, collapsing the table into one narrow, character-wrapped\n column. The base rule's display:block + overflow-x:auto then scrolls it\n horizontally instead. */\n ${i} table { min-width: max-content !important; font-size: 0.9em !important; }\n ${i} .mermaid { padding: 14px 8px !important; }\n}\n`;let D="";if(n){const o="paper"===t.pdfExportStyle,e=o?"#ffffff":"var(--od-bg)",n=o?"#1e2227":"var(--od-fg)",{pageSize:r,margin:a}=function(t){const o=t.pdfPageSize&&l.has(t.pdfPageSize)?t.pdfPageSize:"a4";let e;return e="custom"===t.pdfPageMargin?function(t,o){const e=(t||"").trim();return $.test(e)&&!/[;{}]/.test(e)?e:o}(t.customPdfMargin,s.standard):s[t.pdfPageMargin||"standard"]||s.standard,{pageSize:o,margin:e}}(t);D=`\n/* =================================================================\n FLAWLESS PDF & PRINT EXPORT ENGINE\n ================================================================= */\n@page {\n size: ${r};\n margin: ${o?a:"0"};\n}\n\n@media print {\n *, *::before, *::after, :root, html, body, .exported-note, #rendered-md {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n :root, html, body, .exported-note {\n background-color: ${e} !important;\n color: ${n} !important;\n }\n\n body, #rendered-md {\n background-color: ${e} !important;\n color: ${n} !important;\n max-width: 100% !important;\n margin: 0 auto !important;\n padding: ${o?"0":a} !important;\n box-sizing: border-box !important;\n font-size: 14px !important;\n line-height: ${T(t.lineHeight,"1.75")} !important;\n }\n\n #rendered-md :is(table, th, td) {\n font-family: ${p} !important;\n }\n\n #rendered-md table :is(th, td) code {\n font-family: ${b} !important;\n }\n\n .exported-note-title {\n color: var(--od-h1) !important;\n font-family: ${p} !important;\n font-size: 1.9em !important;\n font-weight: 800 !important;\n border-bottom: 2px solid var(--od-h1) !important;\n padding-bottom: 8px !important;\n margin-bottom: 24px !important;\n page-break-after: avoid !important;\n break-after: avoid !important;\n }\n\n #rendered-md h1 { color: var(--od-h1) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h2 { color: var(--od-h2) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h3 { color: var(--od-h3) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h4 { color: var(--od-h4) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h5 { color: var(--od-h5) !important; page-break-after: avoid !important; break-after: avoid !important; }\n #rendered-md h6 { color: var(--od-h6) !important; page-break-after: avoid !important; break-after: avoid !important; }\n\n #rendered-md table {\n display: table !important;\n width: 100% !important;\n max-width: 100% !important;\n table-layout: auto !important;\n overflow: visible !important;\n page-break-inside: auto !important;\n break-inside: auto !important;\n margin: 16px 0 !important;\n }\n\n #rendered-md tr { page-break-inside: avoid !important; break-inside: avoid !important; }\n #rendered-md :is(th, td) {\n white-space: normal !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n padding: 6px 10px !important;\n }\n\n ${L} {\n white-space: pre-wrap !important;\n word-break: normal !important;\n overflow-wrap: break-word !important;\n overflow: visible !important;\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n background-color: var(--od-pre-bg) !important;\n border: 1px solid var(--od-pre-border) !important;\n padding: 12px !important;\n margin: 14px 0 !important;\n }\n\n ${L} code {\n white-space: pre-wrap !important;\n display: block !important;\n min-width: 100% !important;\n }\n\n #rendered-md .mermaid {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n overflow: visible !important;\n background-color: var(--od-mermaid-bg) !important;\n border: 1px solid var(--od-mermaid-border) !important;\n padding: 16px 10px !important;\n margin: 18px auto !important;\n }\n\n #rendered-md .mermaid svg {\n max-width: 100% !important;\n height: auto !important;\n display: block !important;\n margin: 0 auto !important;\n }\n\n #rendered-md img {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n max-width: 100% !important;\n height: auto !important;\n }\n\n #rendered-md blockquote {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n background-color: transparent !important;\n }\n\n .katex-display {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n overflow: visible !important;\n }\n}\n`}const N=(t.customCss||"").replace(/<\/?style[^>]*>/gi,"").trim(),F=function(t,o){const e=[];return!1===t.styleBlockquotes&&e.push(`${o} blockquote { border: 0 !important; background-color: transparent !important; }`),!1===t.styleTables&&(e.push(`${o} table, ${o} th, ${o} td { border: 0 !important; }`),e.push(`${o} tr:nth-child(even), ${o} tr:nth-child(odd) { background-color: transparent !important; }`)),!1===t.styleImages&&e.push(`${o} img { box-shadow: none !important; border-radius: 0 !important; max-height: none !important; }`),!1===t.styleHeadings&&(e.push(`${o} :is(h1, h2, h3, h4, h5, h6) { color: var(--od-fg) !important; }`),e.push(`${o} h1 { border-bottom: 0 !important; }`),e.push(`${o} h2 { border-left: 0 !important; border-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }`)),!1===t.styleLinks&&e.push(`${o} a, ${o} a:hover, ${o} a[href^=":/"], ${o} a[href^=":/"]:hover { color: var(--od-fg) !important; text-decoration: none !important; }`),!1===t.styleCodeBlocks&&e.push(`${o} pre:not(.mermaid):not(.joplin-source), ${o} code { background-color: transparent !important; border: 0 !important; }`),e.length?`\n/* Element style toggles */\n${e.join("\n")}\n`:""}(t,i),I=`${m}\n${g}${d}\n${k}\n${A}${D}\n::-webkit-scrollbar { width: 8px !important; height: 8px !important; }\n::-webkit-scrollbar-track { background: var(--od-scrollbar-track) !important; border-radius: 4px !important; }\n::-webkit-scrollbar-thumb { background: var(--od-scrollbar-thumb) !important; border-radius: 4px !important; }\n::-webkit-scrollbar-thumb:hover { background: var(--od-scrollbar-hover) !important; }\n${F}`.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{};,>])\s*/g,"$1").replace(/;}/g,"}").trim();return N?`${I}\n/* User custom CSS */\n${N}`:I}const E=["--od-bg","--od-fg","--od-bg-alt","--od-border","--od-comment","--od-h1","--od-h2","--od-h3","--od-h4","--od-h5","--od-h6","--od-link","--od-link-hover","--od-code-bg","--od-code-fg","--od-pre-bg","--od-pre-border","--od-table-even","--od-table-odd","--od-table-th","--od-scrollbar-track","--od-scrollbar-thumb","--od-scrollbar-hover","--od-mermaid-bg","--od-mermaid-border","--od-selection","--od-mark-bg","--od-kbd-bg"];function M(t){const o=(t||"").replace("#","").trim();return 6===o.length&&/^[0-9a-fA-F]{6}$/.test(o)?[0,2,4].map(t=>parseInt(o.slice(t,t+2),16)):null}function A(t,o,e){const n=M(t),r=M(o);return n&&r?"#"+[0,1,2].map(t=>{return(o=n[t],a=r[t],Math.round(o+(a-o)*e)).toString(16).padStart(2,"0");var o,a}).join(""):t}function D(t,o){const e=M(t);if(!e)return t;const[n,r,a]=function(t){const[o,e,n]=t.map(t=>t/255),r=Math.max(o,e,n),a=Math.min(o,e,n),i=(r+a)/2;let d=0,l=0;if(r!==a){const t=r-a;switch(l=i>.5?t/(2-r-a):t/(r+a),r){case o:d=(e-n)/t+(e<n?6:0);break;case e:d=(n-o)/t+2;break;default:d=(o-e)/t+4}d/=6}return[360*d,l,i]}(e);return function(t,o,e){const[n,r,a]=function(t,o,e){const n=(t%360+360)%360/360;if(0===o){const t=Math.round(255*e);return[t,t,t]}const r=e<.5?e*(1+o):e+o-e*o,a=2*e-r,i=t=>{let o=t;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?a+6*(r-a)*o:o<.5?r:o<2/3?a+(r-a)*(2/3-o)*6:a};return[Math.round(255*i(n+1/3)),Math.round(255*i(n)),Math.round(255*i(n-1/3))]}(t,o,e);return"#"+[n,r,a].map(t=>t.toString(16).padStart(2,"0")).join("")}(n+o,r,a)}function N(t,o){const e=M(t);return e?`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${o})`:t}function F(t){const[o,e,n]=t.map(t=>{const o=t/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)});return.2126*o+.7152*e+.0722*n}function I(t,o){const e=M(t),n=M(o);if(!e||!n)return 1;const[r,a]=[F(e),F(n)].sort((t,o)=>o-t);return(r+.05)/(a+.05)}function R(t){const o=M(t);return!o||F(o)<.5}function H(t,o){const e=o.bg,n=o.fg,r=o.accent,a=R(e),i=A(e,n,a?.08:.06),d=A(n,e,a?.45:.4),l=r,s=D(r,-28),c=D(r,36),m=D(r,-52),p=D(r,64),b=D(r,96),h=i,g=function(t,o,e=3){const n=M(t),r=M(o);if(!n||!r||I(t,o)>=e)return t;const a=F(r)<.5?1:-1;for(let t=0;t<255;t++){const r="#"+[Math.max(0,Math.min(255,n[0]+a*t)),Math.max(0,Math.min(255,n[1]+a*t)),Math.max(0,Math.min(255,n[2]+a*t))].map(t=>t.toString(16).padStart(2,"0")).join("");if(I(r,o)>=e)return r}return t}(l,h),f=A(e,n,a?.15:.12),u=A(n,e,a?.55:.5),v=A(n,e,a?.45:.4),k=A(r,e,a?.78:.72);return{name:t,isDark:a,variables:{"--od-bg":e,"--od-fg":n,"--od-bg-alt":i,"--od-border":i,"--od-comment":d,"--od-h1":l,"--od-h2":s,"--od-h3":c,"--od-h4":m,"--od-h5":p,"--od-h6":b,"--od-link":r,"--od-link-hover":D(r,24),"--od-code-bg":h,"--od-code-fg":g,"--od-pre-bg":i,"--od-pre-border":i,"--od-table-even":i,"--od-table-odd":e,"--od-table-th":f,"--od-scrollbar-track":i,"--od-scrollbar-thumb":u,"--od-scrollbar-hover":v,"--od-mermaid-bg":i,"--od-mermaid-border":i,"--od-selection":N(r,.25),"--od-mark-bg":k,"--od-kbd-bg":i}}}const O=/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]*\))$/;function q(t){const o=[],e=[];let n,r;try{n=JSON.parse(t)}catch(t){return{palettes:e,errors:[`Invalid JSON: ${t.message}`]}}return r=Array.isArray(n)?n:n&&Array.isArray(n.palettes)?n.palettes:[n],0===r.length?{palettes:e,errors:["The JSON payload is an empty array"]}:(r.forEach((t,n)=>{const r=`palette ${n+1}`;if(!t||"object"!=typeof t)return void o.push(`${r}: expected an object`);let a;if(t.base&&"object"==typeof t.base){const e=t.base,n=[];for(const t of["bg","fg","accent"])"string"==typeof e[t]&&/^#[0-9a-fA-F]{6}$/.test(e[t])||n.push(`${r}: base.${t} must be a #RRGGBB colour`);if(n.length)return void o.push(...n);const i="boolean"==typeof t.isDark?t.isDark:R(e.bg);a=H(String(t.name||"Imported"),{bg:e.bg,fg:e.fg,accent:e.accent}),a.isDark=i}else{const e=function(t,o="palette"){const e=[];if(!t||"object"!=typeof t||Array.isArray(t))return{ok:!1,errors:[`${o}: expected an object`]};if("string"==typeof t.name&&t.name.trim()||e.push(`${o}: "name" must be a non-empty string`),"boolean"!=typeof t.isDark&&e.push(`${o}: "isDark" must be a boolean`),!t.variables||"object"!=typeof t.variables||Array.isArray(t.variables))return e.push(`${o}: "variables" must be an object`),{ok:!1,errors:e};for(const n of E){const r=t.variables[n];"string"==typeof r&&O.test(r)||e.push(`${o}: missing or invalid "${n}"`)}return{ok:0===e.length,errors:e}}(t,r);if(!e.ok)return void o.push(...e.errors);a={name:String(t.name),isDark:t.isDark,variables:{...t.variables}}}e.push(a)}),{palettes:e,errors:o})}function G(t){return String(t||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}const J=/^[a-z0-9][a-z0-9._:-]*$/i;function K(t,o){const e=[],n=[];return String(t||"").split(/\r?\n/).forEach((t,r)=>{const a=t.trim();if(!a||a.startsWith("#"))return;const i=r+1,d=a.indexOf("=");if(d<=0||d===a.length-1)return void n.push(`Line ${i}: expected format "id:<value>=<themeKey>" or "title:<value>=<themeKey>"`);const l=a.slice(0,d).trim(),s=a.slice(d+1).trim(),c=l.indexOf(":");if(c<=0)return void n.push(`Line ${i}: missing "id:" or "title:" prefix`);const m=l.slice(0,c).toLowerCase(),p=l.slice(c+1).trim();"id"===m||"title"===m?p?J.test(s)?e.push({match:m,value:p,themeKey:s,line:i}):n.push(`Line ${i}: invalid theme key "${s}"`):n.push(`Line ${i}: empty ${o} value after the prefix`):n.push(`Line ${i}: unknown prefix "${m}:"; use "id:" or "title:"`)}),{overrides:e,errors:n}}function U(t,o,e){for(const e of t)if("id"===e.match&&o.includes(e.value))return e;for(const o of t)if("title"===o.match&&e.some(t=>t.trim().toLowerCase()===o.value.toLowerCase()))return o;return null}o.plugins.register({onStart:async function(){let t="ltr",a="inter",i=null,d=null,l=null,s="desktop";try{const t="function"==typeof o.versionInfo?await o.versionInfo():null;!t||"mobile"!==t.platform&&"desktop"!==t.platform||(s=t.platform)}catch(t){console.warn("[Theme Studio] Could not detect platform. Assuming desktop:",t)}const c="mobile"===s;try{let e="";if("function"==typeof o.settings.globalValues){const t=await o.settings.globalValues(["locale"]);e=t&&t[0]?String(t[0]):""}else"function"==typeof o.settings.globalValue&&(e=await o.settings.globalValue("locale"));e&&["fa","ar","he","ur","ug","ps","yi"].some(t=>e.toLowerCase().startsWith(t))&&(t="rtl",a="vazirmatn")}catch(o){console.warn("[Theme Studio] Could not detect user locale. Defaulting to LTR / Inter:",o),t="ltr",a="inter"}const m=[{id:"appearance",section:"themeStudioAppearanceSection",title:"Theme & Appearance",summary:"Colors, direction and where the theme is applied.",iconName:"fas fa-palette"},{id:"typography",section:"themeStudioTypographySection",title:"Typography",summary:"Fonts, sizes, line spacing and reading width.",iconName:"fas fa-font"},{id:"elements",section:"themeStudioElementsSection",title:"Code & Markdown Elements",summary:"Code fonts and per-element styling toggles.",iconName:"fas fa-code"},{id:"export",section:"themeStudioExportSection",title:"Export",summary:"PDF appearance, page size and margins.",iconName:"fas fa-file-pdf"},{id:"advanced",section:"themeStudioAdvancedSection",title:"Advanced",summary:"Custom CSS and palette data for fine-grained control.",iconName:"fas fa-sliders-h"}];for(const t of m)await o.settings.registerSection(t.section,{label:t.title,iconName:t.iconName,description:t.summary});const p=/^#[0-9a-fA-F]{6}$/;function b(t){const o=String(t.customPaletteBg||""),e=String(t.customPaletteFg||""),n=String(t.customPaletteAccent||"");return p.test(o)&&p.test(e)&&p.test(n)?H(String(t.customPaletteName||"Custom Palette").trim()||"Custom Palette",{bg:o,fg:e,accent:n}):null}let h={...r};function g(t){const o={...r},e=[],n=[];if(t&&t.trim()){const r=q(t);n.push(...r.errors);for(const t of r.palettes)o[`imported:${G(t.name)||"palette"}`]=t,e.push(t)}return h=o,{imported:e,errors:n}}await o.settings.registerSettings({theme:{value:"atom-one-dark",type:n.String,section:"themeStudioAppearanceSection",isEnum:!0,public:!0,label:"Color Theme",description:'Choose your desired color scheme. The "custom" palette is generated from the base colours below; imported palettes appear after the built-in ones.',options:Object.fromEntries(Object.entries(r).map(([t,o])=>[t,o.name]))},colorSchemeMode:{value:"theme",type:n.String,section:"themeStudioAppearanceSection",isEnum:!0,public:!0,label:"Color Scheme Mode",description:"Follow the operating system light/dark preference. Themes without a matching light/dark counterpart keep their own look in both schemes.",options:{theme:"Use Selected Theme",system:"Follow System (Light / Dark)"}},direction:{value:t,type:n.String,section:"themeStudioAppearanceSection",isEnum:!0,public:!0,label:"Layout Direction",description:"Primary text orientation. LTR is standard; Auto adjusts per paragraph.",options:{ltr:"Left-to-Right (LTR - English / Latin / CJK / Global)",auto:"Auto-Detect (Per-Paragraph BiDi)",rtl:"Right-to-Left (RTL - Persian / Arabic / Hebrew)"}},enableEditorTheme:{value:!0,type:n.Bool,section:"themeStudioAppearanceSection",public:!0,label:"Apply Theme to Markdown Editor",description:"Styles the CodeMirror editor (background, colors, line numbers, headings) to match the viewer."},themeApplicationShell:{value:!0,type:n.Bool,section:"themeStudioAppearanceSection",public:!0,label:"Theme Application Shell (Sidebar & Note List)",description:"Applies the active palette to Joplin's desktop sidebar, note list, and header (Desktop only)."},themeByNotebook:{value:"",type:n.String,section:"themeStudioAppearanceSection",public:!0,label:"Per-Notebook Theme Overrides",description:'One mapping per line: "id:<notebookId>=<themeKey>" or "title:<Notebook Title>=<themeKey>". The active note uses the first matching notebook in its chain; otherwise the default theme applies.'},themeByTag:{value:"",type:n.String,section:"themeStudioAppearanceSection",public:!0,label:"Per-Tag Theme Overrides",description:'One mapping per line: "id:<tagId>=<themeKey>" or "title:<Tag Title>=<themeKey>". Applied when the active note matches a tag and no notebook override matched.'},noteThemeEffective:{value:"",type:n.String,section:"themeStudioAppearanceSection",public:!0,advanced:!0,label:"Active Note Theme (auto-managed)",description:"Internal: the theme resolved for the currently selected note from the per-notebook/per-tag overrides. Updated automatically; leave empty to use the selected theme."},fontPreset:{value:a,type:n.String,section:"themeStudioTypographySection",isEnum:!0,public:!0,label:"International Font Preset",description:"Web fonts loaded on the fly (ideal for Mobile without local font installs).",options:{inter:"Inter (Global English, Latin, European, Cyrillic)",roboto:"Roboto (Modern Clean Sans)",system:"System Default (OS Native, Zero Network Overhead)",vazirmatn:"Vazirmatn (Persian, Arabic, Kurdish, Urdu)","noto-arabic":"Noto Sans Arabic (Modern Arabic)","noto-cjk-sc":"Noto Sans SC (Simplified Chinese)","noto-cjk-jp":"Noto Sans JP (Japanese)",heebo:"Heebo (Hebrew & Latin)","noto-devanagari":"Noto Sans Devanagari (Hindi, Sanskrit)",lora:"Lora (Editorial Serif for Books & Long Articles)",custom:"Custom Font Stack (use field below)"}},fontFamily:{value:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",type:n.String,section:"themeStudioTypographySection",public:!0,label:"Custom Font Stack",description:'Active only when "Custom Font Stack" is selected above.'},fontSize:{value:"16px",type:n.String,section:"themeStudioTypographySection",public:!0,label:"Font Size",description:"Base font size (e.g., 14px, 16px, 18px, 20px). Works across Desktop & Mobile."},lineHeight:{value:"1.75",type:n.String,section:"themeStudioTypographySection",public:!0,label:"Line Height",description:"Reading line spacing (e.g., 1.6, 1.75, 1.9)."},letterSpacing:{value:"",type:n.String,section:"themeStudioTypographySection",public:!0,label:"Letter Spacing",description:"Tracking applied to note text (e.g. 0.5px, 0.02em). Empty keeps the default spacing."},textAlign:{value:"left",type:n.String,section:"themeStudioTypographySection",isEnum:!0,public:!0,label:"Paragraph Alignment",description:"Paragraph text alignment for notes.",options:{left:"Left (Default)",justify:"Justify"}},hyphenation:{value:!1,type:n.Bool,section:"themeStudioTypographySection",public:!0,label:"Hyphenation",description:"Enables automatic hyphenation of note paragraphs (requires a browser with hyphenation support and a matching note language)."},fontLigatures:{value:!1,type:n.Bool,section:"themeStudioTypographySection",public:!0,label:"Font Ligatures",description:"Enables common typographic ligatures (fi, fl, ffi) in note text via font-variant-ligatures."},mobileDensity:{value:"default",type:n.String,section:"themeStudioTypographySection",isEnum:!0,public:!0,label:"Mobile Density",description:"Font size scale applied on screens under 768px. Compact fits more content per screen; Large improves readability on small displays.",options:{compact:"Compact",default:"Default",large:"Large"}},headingSizePreset:{value:"balanced",type:n.String,section:"themeStudioTypographySection",isEnum:!0,public:!0,label:"Heading Sizes Preset",description:"Typographic scale applied to H1 through H6 headings.",options:{balanced:"Balanced / Standard (H1: 1.75em, H2: 1.42em, H3: 1.25em...)",large:"Large / Editorial (H1: 2.15em, H2: 1.7em, H3: 1.4em...)",compact:"Compact / Dense (H1: 1.5em, H2: 1.3em, H3: 1.18em...)",custom:"Custom Sizes (Configured below)"}},customHeadingSizes:{value:"1.75em, 1.42em, 1.25em, 1.12em, 1.05em, 1.0em",type:n.String,section:"themeStudioTypographySection",public:!0,label:"Custom Heading Sizes (H1 - H6)",description:'Active only when "Custom Sizes" is selected. Comma-separated sizes from H1 to H6 (e.g., 28px, 24px, 20px, 18px, 16px, 14px or 2.2em, 1.7em, 1.4em, 1.2em, 1.1em, 1.0em).'},contentMaxWidth:{value:"full",type:n.String,section:"themeStudioTypographySection",isEnum:!0,public:!0,label:"Reading Width (Focus Mode)",description:"Constrain line length on wide desktop monitors for comfortable reading.",options:{full:"Full Width (100%)",comfortable:"Comfortable Reading (920px Centered)",compact:"Compact Focus (760px Centered)"}},codeFontPreset:{value:"fira-code",type:n.String,section:"themeStudioElementsSection",isEnum:!0,public:!0,label:"Code Font Preset",description:"Monospace font for inline code and code blocks.",options:{"fira-code":"Fira Code (Modern Tech Monospace)","jetbrains-mono":"JetBrains Mono (Developer Favorite)","system-mono":"System Monospace (Cascadia/Consolas/Courier)",custom:"Custom Code Font (use field below)"}},codeFont:{value:"'Cascadia Code', 'Fira Code', 'Consolas', monospace",type:n.String,section:"themeStudioElementsSection",public:!0,label:"Custom Code Font Stack",description:'Active only when "Custom Code Font" is selected above.'},styleBlockquotes:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Blockquotes",description:"Apply the theme border, background and padding to blockquotes. Disable to render them as plain text."},styleTables:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Tables",description:"Apply theme borders, stripes and cell padding to tables. Disable to render them without any table styling."},styleImages:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Images",description:"Apply the theme shadow, border-radius and max-height to images. Disable to render them without decoration."},styleHeadings:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Headings",description:"Apply theme colours and the heading accent borders. Disable to render headings in the body colour without borders."},styleLinks:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Links",description:"Apply the theme link colour and underline. Disable to render links like plain body text."},styleCodeBlocks:{value:!0,type:n.Bool,section:"themeStudioElementsSection",public:!0,label:"Style Code Blocks",description:"Apply theme backgrounds and borders to code blocks and inline code. Disable to render them without backgrounds."},pdfExportStyle:{value:"exact",type:n.String,section:"themeStudioExportSection",isEnum:!0,public:!0,label:"PDF Export Appearance",description:"Controls layout and background fidelity when exporting to PDF.",options:{exact:"Exact Match (100% Identical to Screen Layout & Theme)",paper:"Paper Friendly (White Page Background with Themed Accents)"}},pdfPageSize:{value:"a4",type:n.String,section:"themeStudioExportSection",isEnum:!0,public:!0,label:"PDF Page Size",description:"Standard paper dimensions for PDF export.",options:{a4:"A4 (210 × 297 mm - Global Standard)",letter:"US Letter (8.5 × 11 in - North America)",a5:"A5 (148 × 210 mm - Compact)",a3:"A3 (297 × 420 mm - Large Format)",legal:"US Legal (8.5 × 14 in)",auto:"Auto (Printer / OS Default)"}},pdfPageMargin:{value:"standard",type:n.String,section:"themeStudioExportSection",isEnum:!0,public:!0,label:"PDF Page Margins",description:"Page margin width when exporting to PDF.",options:{standard:"Standard Margins (15mm top/bottom, 18mm sides)",comfortable:"Comfortable / Wide Margins (20mm all sides)",compact:"Compact / Narrow Margins (8mm all sides)",none:"Zero Margins / Full Bleed (0mm - Edge to Edge)",custom:"Custom Margins (Configured below)"}},customPdfMargin:{value:"15mm 18mm",type:n.String,section:"themeStudioExportSection",public:!0,label:"Custom PDF Page Margins",description:'Active only when "Custom Margins" is selected above (e.g., "15mm 18mm", "1in", "10mm 15mm 10mm 15mm").'},customCss:{value:"",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Custom CSS for notes",description:'Extra CSS appended after the theme stylesheet (notes and Rich Text editor). Keep it on one line, e.g. "#rendered-md h1 { letter-spacing: -0.5px; }".'},customPalettes:{value:"",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Imported Palettes (JSON)",description:'Palettes imported via the "Import palettes from clipboard" command, stored as JSON. Each entry is { "name", "isDark", "variables": { ... } } or { "name", "base": { "bg", "fg", "accent" } }.'},customPaletteName:{value:"Custom Palette",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Custom Palette Name",description:"Display name of the generated custom palette."},customPaletteBg:{value:"#1e1e2e",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Custom Palette Background",description:"Base background colour (#RRGGBB) for the generated custom palette."},customPaletteFg:{value:"#cdd6f4",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Custom Palette Foreground",description:"Base text colour (#RRGGBB) for the generated custom palette."},customPaletteAccent:{value:"#89b4fa",type:n.String,section:"themeStudioAdvancedSection",public:!0,label:"Custom Palette Accent",description:"Base accent colour (#RRGGBB); the heading scale and links are derived from it."}});const f="function"==typeof o.settings.values?await o.settings.values(["customPalettes"]):{},v=g(String(f.customPalettes||""));v.errors.length&&console.warn("[Theme Studio] Could not load some imported palettes:",v.errors.join("; "));const k=b("function"==typeof o.settings.values?await o.settings.values(["customPaletteName","customPaletteBg","customPaletteFg","customPaletteAccent"]):{});k&&(h.custom=k);const y={};for(const[t,o]of Object.entries(h))y[t]=o.name;await o.settings.registerSettings({theme:{value:"atom-one-dark",type:n.String,section:"themeStudioAppearanceSection",isEnum:!0,public:!0,label:"Color Theme",description:'Choose your desired color scheme. The "custom" palette is generated from the base colours below; imported palettes appear after the built-in ones.',options:y}});const x=["theme","direction","enableEditorTheme","themeApplicationShell","colorSchemeMode","themeByNotebook","themeByTag","noteThemeEffective","fontPreset","fontFamily","fontSize","lineHeight","letterSpacing","textAlign","hyphenation","fontLigatures","mobileDensity","headingSizePreset","customHeadingSizes","contentMaxWidth","codeFontPreset","codeFont","styleBlockquotes","styleTables","styleImages","styleHeadings","styleLinks","styleCodeBlocks","pdfExportStyle","pdfPageSize","pdfPageMargin","customPdfMargin","customCss","customPalettes","customPaletteName","customPaletteBg","customPaletteFg","customPaletteAccent"];async function S(){if("function"==typeof o.settings.values)return o.settings.values(x);const t=await Promise.all(x.map(t=>o.settings.value(t))),e={};return x.forEach((o,n)=>{e[o]=t[n]}),e}async function $(){const o=await S();return{options:{themeKey:o.theme||"atom-one-dark",direction:o.direction||t,fontPreset:o.fontPreset||a,fontFamily:o.fontFamily||"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",codeFontPreset:o.codeFontPreset||"fira-code",codeFont:o.codeFont||"'Cascadia Code', 'Fira Code', 'Consolas', monospace",fontSize:o.fontSize||"16px",lineHeight:o.lineHeight||"1.75",contentMaxWidth:o.contentMaxWidth||"full",pdfExportStyle:o.pdfExportStyle||"exact",headingSizePreset:o.headingSizePreset||"balanced",customHeadingSizes:o.customHeadingSizes||"1.75em, 1.42em, 1.25em, 1.12em, 1.05em, 1.0em",pdfPageSize:o.pdfPageSize||"a4",pdfPageMargin:o.pdfPageMargin||"standard",customPdfMargin:o.customPdfMargin||"15mm 18mm",customCss:o.customCss||"",colorSchemeMode:o.colorSchemeMode||"theme",styleBlockquotes:o.styleBlockquotes??!0,styleTables:o.styleTables??!0,styleImages:o.styleImages??!0,styleHeadings:o.styleHeadings??!0,styleLinks:o.styleLinks??!0,styleCodeBlocks:o.styleCodeBlocks??!0,letterSpacing:o.letterSpacing||"",textAlign:o.textAlign||"left",hyphenation:o.hyphenation??!1,fontLigatures:o.fontLigatures??!1,mobileDensity:o.mobileDensity||"default",noteThemeEffective:o.noteThemeEffective||"",themeByNotebook:o.themeByNotebook||"",themeByTag:o.themeByTag||""},version:C(o),editorEnabled:o.enableEditorTheme??!0,shellEnabled:o.themeApplicationShell??!0}}function C(t){return JSON.stringify([s,...x.map(o=>t[o]??null)])}async function T(){return C(await S())}let j=Promise.resolve();async function E(t,e){const n=async()=>{if(!c)try{if(o.window&&"function"==typeof o.window.loadChromeCssFile){const n=e?function(t,o=r){u(t,o);const{fontImport:e,resolvedFont:n}=P(t),a=w(t,` --joplin-font-family: ${n} !important;\n --od-active-accent: inset 0 0 0 0 transparent;\n`);let i="";return i="rtl"===t.direction?"\n /* Title input adheres to RTL */\n input.title-input {\n direction: rtl !important;\n text-align: right !important;\n }\n\n /* Note List item titles align naturally using Unicode BiDi */\n .note-list .title,\n .note-list-item-title,\n .note-list span,\n .note-list div {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n\n /* Active Note Indicator flips to right border in RTL */\n /* Active-note accent. Set as a layer of the row's box-shadow (see the\n note-list rule further down) rather than as a border: a 4px border\n shifted the row's text 4px sideways on every selection. */\n :root { --od-active-accent: inset -4px 0 0 0 var(--od-h2); }\n\n /* Sidebar titles use BiDi without breaking tree indentation or flex order */\n .side-bar .title,\n .side-bar span.title,\n .folders a span:not(.note-count-label):not(.icon),\n .tags a span:not(.note-count-label):not(.icon) {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"auto"===t.direction?"\n input.title-input,\n .note-list .title,\n .note-list-item-title,\n .side-bar .title,\n .side-bar span.title {\n unicode-bidi: plaintext !important;\n text-align: start !important;\n }\n ":"\n input.title-input {\n direction: ltr !important;\n text-align: left !important;\n }\n\n :root { --od-active-accent: inset 4px 0 0 0 var(--od-h2); }\n ",`\n${e}\n${a}\n${i}\n\n/* =================================================================\n UNIFIED DESKTOP SHELL CASCADE (OVERRIDING JOPLIN CORE DARK/LIGHT)\n ================================================================= */\n\n/* --- 1. Resizer Splitters & Root Container --- */\ndiv[style*="col-resize"],\ndiv[style*="row-resize"],\ndiv[style*="cursor: col-resize"],\ndiv[style*="cursor: row-resize"],\n.rli-splitter,\n.splitter,\ndiv[class*="splitter"],\ndiv[class*="resizer"],\ndiv[class*="divider"] {\n background-color: var(--od-border) !important;\n background: var(--od-border) !important;\n border-color: var(--od-border) !important;\n opacity: 0.8 !important;\n}\n\n.rli-root,\n#joplin-plugin-content,\ndiv[class*="rli-"] {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 2. Primary Left Sidebar --- */\n.side-bar,\n.r-sidebar,\n.rli-sideBar,\ndiv[toggleblock="1"] {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n color: var(--od-fg) !important;\n font-family: ${n} !important;\n}\n\n.side-bar *,\n.r-sidebar *,\n.rli-sideBar *,\ndiv[toggleblock="1"] *,\n.folders *,\n.tags *,\na.list-item,\na.list-item *,\n.list-item-container * {\n color: var(--od-fg) !important;\n border-color: var(--od-fg) !important;\n}\n\n.side-bar svg,\n.side-bar path,\n.side-bar i,\n.r-sidebar svg,\n.r-sidebar path,\n.rli-sideBar svg,\n.rli-sideBar path {\n fill: var(--od-fg) !important;\n stroke: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.side-bar .list-item-container:hover,\n.side-bar .list-item:hover,\n.side-bar a:hover {\n background-color: var(--od-selection) !important;\n}\n\n/* Active Selected Notebook Item (Overrides Inline rgb(0, 95, 184)) */\n.side-bar .list-item-container.selected,\n.side-bar .list-item.selected,\n.side-bar a.selected,\n.side-bar .selected,\n.side-bar div[class*="selected"],\n.rli-sideBar .selected,\n.rli-sideBar div[class*="selected"],\n.folders .selected,\n.folders div[class*="selected"],\n.tags .selected {\n background-color: var(--od-selection) !important;\n background: var(--od-selection) !important;\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n.side-bar .selected *,\n.side-bar div[class*="selected"] *,\n.rli-sideBar .selected *,\n.rli-sideBar div[class*="selected"] *,\n.folders .selected * {\n color: var(--od-link) !important;\n}\n\n.side-bar .header,\n.side-bar .header span,\n.side-bar div[style*="font-weight: bold"],\n.side-bar .section-header {\n color: var(--od-comment) !important;\n font-size: 0.85em !important;\n letter-spacing: 0.5px !important;\n opacity: 0.85 !important;\n}\n\n.side-bar .item-count,\n.folders span[style*="opacity"] {\n color: var(--od-comment) !important;\n opacity: 0.8 !important;\n}\n\n/* Ensure clean spacing between folder icons, emojis, and titles without breaking tree indentation */\n.side-bar .icon,\n.side-bar span.icon,\n.side-bar svg.icon,\n.side-bar span[role="img"],\n.folders a span[role="img"] {\n margin-left: 6px !important;\n margin-right: 6px !important;\n display: inline-block !important;\n}\n\n/* --- 2. Bottom Left: Synchronize Panel --- */\n.rli-sideBar > div:last-child,\n.rli-sideBar > div:nth-child(2),\n.rli-sideBar div[style*="border-top"],\n.rli-sideBar div[style*="background-color"],\n.rli-sideBar > div > div:last-child,\n.side-bar > div:last-child,\ndiv:has(> .synchronize-button),\ndiv:has(.synchronize-button),\ndiv:has(> button.synchronize-button),\ndiv:has(button[title*="Sync"]),\ndiv:has(button[title*="Synchronize"]),\n.synchronize-button,\n.sync-status-box,\ndiv.sync-report,\ndiv[class*="sync"],\ndiv[class*="Sync"] {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-top: 1px solid var(--od-border) !important;\n}\n\n.rli-sideBar > div:last-child *,\n.rli-sideBar > div:nth-child(2) *,\ndiv:has(.synchronize-button) *,\n.synchronize-button *,\n.sync-status-box *,\ndiv.sync-report * {\n background-color: transparent !important;\n color: var(--od-comment) !important;\n}\n\n.rli-sideBar > div:last-child button,\n.rli-sideBar > div:nth-child(2) button,\ndiv:has(.synchronize-button) button,\n.synchronize-button button,\n.sync-status-box button,\nbutton.synchronize-button,\nbutton[title*="Sync"],\nbutton[title*="Synchronize"] {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-color: var(--od-border) !important;\n box-shadow: none !important;\n outline: none !important;\n border-radius: 4px !important;\n font-weight: 600 !important;\n padding: 6px 12px !important;\n}\n\n.rli-sideBar > div:last-child button:hover,\n.synchronize-button button:hover,\n.synchronize-button button:focus {\n background-color: var(--od-selection) !important;\n border-color: var(--od-link) !important;\n color: var(--od-link) !important;\n box-shadow: none !important;\n outline: none !important;\n}\n\n.synchronize-button svg,\n.synchronize-button path,\n.synchronize-button i,\ndiv:has(.synchronize-button) svg,\ndiv:has(.synchronize-button) path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 3. Note List Panel & Active Item Selection --- */\n.note-list,\n.r-note-list,\n.item-list,\ndiv.rli-noteList,\ndiv.rli-noteList > div {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n font-family: ${n} !important;\n}\n\n/* A single divider on the list itself. Drawing it on .note-list, on the\n layout wrapper and on its child stacked three 1px lines at the same edge. */\n.note-list {\n border-right: 1px solid var(--od-border) !important;\n border-left: none !important;\n}\n\n/* The font must be set on the text elements, not only on their containers:\n Joplin declares font-family directly on .title, .emptylist and the sidebar\n labels, and a direct declaration always beats an inherited one. */\n.note-list .title,\n.note-list .title span,\n.note-list .emptylist,\n.sidebar .title,\n.sidebar .tag-label,\n.sidebar .all-notes,\n.sidebar-header-container span {\n font-family: ${n} !important;\n}\n\n.note-list .list-item-container,\n.note-list .list-item,\n.note-list-item,\ndiv.rli-noteList .list-item-container {\n background-color: var(--od-bg) !important;\n /* Drawn as an inset shadow, not a border: Joplin sizes the note-list\n scroller from (row count x row height), so a 1px border on every row\n makes the content overflow and produces a second scrollbar. */\n border-bottom: none !important;\n box-shadow: inset 0 -1px 0 var(--od-border) !important;\n}\n\n/* Selected row: the accent is a SECOND shadow layer on top of the separator,\n scoped to the selected row only. Using a border here shifted the row text\n 4px sideways on every selection (measured); a :root-wide accent painted\n every row. */\ndiv.rli-noteList [aria-selected="true"],\ndiv.rli-noteList .selected,\ndiv.rli-noteList div[class*="selected"],\ndiv.rli-noteList .list-item-container.selected,\ndiv.rli-noteList .note-list-item.selected,\ndiv.note-list [aria-selected="true"],\ndiv.note-list .selected,\ndiv.note-list div[class*="selected"],\ndiv.note-list .list-item-container.selected,\ndiv.note-list .note-list-item.selected {\n box-shadow: var(--od-active-accent, inset 0 0 0 0 transparent), inset 0 -1px 0 var(--od-border) !important;\n}\n\n.note-list .list-item-container *,\n.note-list .title,\n.note-list-item-title,\n.note-list span {\n color: var(--od-fg) !important;\n}\n\n.note-list .list-item-container:hover,\n.note-list .list-item:hover,\n.note-list a:hover {\n background-color: var(--od-selection) !important;\n}\n\n/* Active Selected Note (Overrides Inline Dark Styles) */\ndiv.rli-noteList [aria-selected="true"],\ndiv.rli-noteList .selected,\ndiv.rli-noteList div[class*="selected"],\ndiv.rli-noteList .list-item-container.selected,\ndiv.rli-noteList .note-list-item.selected,\ndiv.note-list [aria-selected="true"],\ndiv.note-list .selected,\ndiv.note-list div[class*="selected"],\ndiv.note-list .list-item-container.selected,\ndiv.note-list .note-list-item.selected {\n background-color: var(--od-selection) !important;\n background: var(--od-selection) !important;\n}\n\ndiv.rli-noteList [aria-selected="true"] *,\ndiv.rli-noteList .selected *,\ndiv.note-list [aria-selected="true"] *,\ndiv.note-list .selected * {\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n/* --- 4. Top Left: Note List Header Bar, Buttons & Search (Green Box) --- */\ndiv.rli-noteList > div > div > div:first-child,\ndiv.rli-noteList .note-list-top-bar,\n.note-list-top-bar,\n.note-list > div:first-child,\n.note-list .header,\n.search-bar,\ndiv.new-note-todo-buttons,\ndiv:has(> .new-note-button),\ndiv:has(> button.new-note-button) {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n\n/* New note & New to-do Buttons: Dynamic contrast against --od-link */\nbutton.new-note-button,\nbutton.new-todo-button,\ndiv.rli-noteList button.new-note-button,\ndiv.rli-noteList button.new-todo-button,\ndiv.new-note-todo-buttons button,\ndiv.header a.button,\ndiv.header button,\n.note-list .header button,\n.note-list-top-bar button:not(.sort-order-reverse-button),\na.button[title="New note"],\na.button[title="New to-do"],\na[title="New note"],\na[title="New to-do"] {\n background-color: var(--od-link) !important;\n background: var(--od-link) !important;\n color: var(--od-bg) !important;\n border: none !important;\n border-radius: 4px !important;\n font-weight: 700 !important;\n box-shadow: none !important;\n}\n\nbutton.new-note-button *,\nbutton.new-todo-button *,\ndiv.new-note-todo-buttons button * {\n color: var(--od-bg) !important;\n fill: var(--od-bg) !important;\n}\n\nbutton.new-note-button:hover,\nbutton.new-todo-button:hover,\ndiv.rli-noteList button.new-note-button:hover,\ndiv.rli-noteList button.new-todo-button:hover,\ndiv.new-note-todo-buttons button:hover {\n background-color: var(--od-link-hover) !important;\n background: var(--od-link-hover) !important;\n}\n\n/* Search bar input */\ndiv.rli-noteList input,\ndiv.rli-noteList input[type="search"],\n.note-list-top-bar input,\n.note-list input[type="search"],\n.search-bar input,\ninput[type="search"] {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 4px !important;\n}\n\n/* Sort, Reverse & Calendar Buttons in Search Row */\nbutton.sort-order-reverse-button,\ndiv.rli-noteList button.sort-order-reverse-button,\ndiv.rli-noteList button:not(.new-note-button):not(.new-todo-button),\n.note-list-top-bar button.sort-order-reverse-button {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n border-radius: 4px !important;\n}\n\ndiv.rli-noteList svg,\ndiv.rli-noteList path,\n.note-list-top-bar svg,\n.note-list-top-bar path,\n.search-bar svg,\n.search-bar path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n/* --- 5. Top Right: Note Header & Unified Navbar (Blue Box) --- */\n.header,\n.r-header,\n.top-bar,\n.note-title-wrapper,\ndiv.note-title-wrapper {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: 1px solid var(--od-border) !important;\n border-top: none !important;\n border-left: none !important;\n border-right: none !important;\n box-sizing: border-box !important;\n min-height: 40px !important;\n}\n\n/* Seamless Title Input (Blends directly into the header bar without boxed borders) */\ninput.title-input {\n background-color: transparent !important;\n background: transparent !important;\n border: none !important;\n border-bottom: none !important;\n color: var(--od-fg) !important;\n font-family: ${n} !important;\n font-size: 1.2em !important;\n font-weight: 700 !important;\n padding: 6px 14px !important;\n outline: none !important;\n box-shadow: none !important;\n}\n\ninput.title-input:focus {\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n}\n\n/* Seamless Info Group (Eliminates disconnected borders and mismatched fills) */\n.note-title-info-group,\ndiv.note-title-info-group {\n background-color: transparent !important;\n background: transparent !important;\n border: none !important;\n border-bottom: none !important;\n border-left: none !important;\n border-right: none !important;\n box-shadow: none !important;\n}\n\n.note-title-info-group *,\n.header span,\n.header div {\n color: var(--od-fg) !important;\n border-bottom: none !important;\n}\n\n.note-title-info-group svg,\n.note-title-info-group path,\n.header svg,\n.header path {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.header button,\n.header a,\n.header .button,\nbutton.toolbar-button {\n background-color: transparent !important;\n color: var(--od-fg) !important;\n border: none !important;\n}\n\n.header button:hover,\n.header a:hover,\nbutton.toolbar-button:hover {\n background-color: var(--od-selection) !important;\n border-radius: 4px !important;\n}\n\n/* --- 6. Markdown Editor Formatting Toolbar --- */\n.editor-toolbar,\ndiv.editor-toolbar,\ndiv[class*="editor-toolbar"],\n.r-editor-toolbar {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-bottom: none !important;\n}\n\n.editor-toolbar *,\n.editor-toolbar div,\n.editor-toolbar button,\n.editor-toolbar a,\n.editor-toolbar span {\n color: var(--od-fg) !important;\n background-color: transparent !important;\n}\n\n.editor-toolbar svg,\n.editor-toolbar path,\n.editor-toolbar .icon,\n.editor-toolbar [class*="icon"] {\n fill: var(--od-fg) !important;\n color: var(--od-fg) !important;\n}\n\n.editor-toolbar button:hover,\n.editor-toolbar a:hover {\n background-color: var(--od-selection) !important;\n border-radius: 4px !important;\n}\n\n/* --- 7. Bottom: Tag Bar & Notification Banners --- */\n.tag-bar,\ndiv.tag-bar,\n.tag-list,\ndiv[class*="tag"],\ndiv[class*="banner"],\ndiv.updated-feature-banner,\ndiv.alert,\ndiv.info-box,\n.rli-editor > div > div > div:has(.tag-bar),\n.rli-editor > div > div > div:has(div[class*="banner"]),\n.rli-editor > div > div > div:last-child {\n background-color: var(--od-bg-alt) !important;\n background: var(--od-bg-alt) !important;\n border-top: 1px solid var(--od-border) !important;\n color: var(--od-fg) !important;\n}\n\n.tag-bar *,\ndiv[class*="banner"] *,\ndiv.updated-feature-banner * {\n color: var(--od-fg) !important;\n}\n\n.tag-bar svg,\n.tag-bar path {\n fill: var(--od-fg) !important;\n}\n\n.tag-bar input,\n.tag-bar .tag-input {\n background-color: var(--od-bg) !important;\n color: var(--od-fg) !important;\n border: 1px solid var(--od-border) !important;\n}\n\n.tag-bar span,\n.tag-list span,\n.tag-list .tag-item {\n background-color: var(--od-selection) !important;\n color: var(--od-fg) !important;\n border-radius: 4px !important;\n padding: 2px 6px !important;\n}\n\ndiv[class*="banner"] a,\ndiv[class*="banner"] button,\ndiv.updated-feature-banner a,\ndiv.updated-feature-banner button {\n color: var(--od-link) !important;\n font-weight: 700 !important;\n}\n\n/* --- 9. Right: Plugin Panels Outer Shell (Outline, Note Tabs) --- */\n.r-panel,\ndiv.joplin-plugin-view,\ndiv.panel-container,\ndiv[class*="outline"] {\n background-color: var(--od-bg) !important;\n background: var(--od-bg) !important;\n border-left: 1px solid var(--od-border) !important;\n}\n\n.r-panel *,\ndiv.joplin-plugin-view * {\n color: var(--od-fg) !important;\n}\n\n.r-panel svg,\n.r-panel path {\n fill: var(--od-fg) !important;\n}\n\n.r-panel header,\n.r-panel .header,\n.r-panel > div:first-child {\n background-color: var(--od-bg-alt) !important;\n border-bottom: 1px solid var(--od-border) !important;\n}\n\n.r-panel iframe,\ndiv.joplin-plugin-view iframe {\n background-color: var(--od-bg) !important;\n}\n\n/* Joplin 3.7 whiteboards use these variables for the canvas, cards,\n controls and rendered Markdown. Scope them to the editor: user-selected\n card and edge colours are inline and must remain untouched.\n Roles follow Joplin's own definitions: --joplin-color-faded is a muted\n secondary text colour (distinct from --joplin-color) and\n --joplin-background-color-hover3 is a distinct hover tint, so map them\n to the palette's comment and selection tokens instead of reusing the\n primary background/foreground values. */\n.whiteboard-editor {\n --joplin-background-color: var(--od-bg);\n --joplin-background-color3: var(--od-bg-alt);\n --joplin-background-color-hover3: var(--od-selection);\n --joplin-color: var(--od-fg);\n --joplin-color-faded: var(--od-comment);\n --joplin-divider-color: var(--od-border);\n --joplin-code-background-color: var(--od-code-bg);\n --joplin-code-border-color: var(--od-border);\n --joplin-code-color: var(--od-fg);\n --joplin-url-color: var(--od-link);\n --joplin-search-marker-background-color: var(--od-mark-bg);\n --joplin-search-marker-color: var(--od-fg);\n}\n\n/* --- 10. App-wide Custom Scrollbars --- */\n/* Joplin exposes the user's "Scrollbar size" setting as --scrollbar-size\n (main.scss); a hard-coded width silently overrode that preference. */\n.sidebar::-webkit-scrollbar,\n.note-list::-webkit-scrollbar,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar {\n width: var(--scrollbar-size, 7px) !important;\n}\n\n.sidebar::-webkit-scrollbar-track,\n.note-list::-webkit-scrollbar-track,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar-track {\n background: var(--od-scrollbar-track) !important;\n}\n\n.sidebar::-webkit-scrollbar-thumb,\n.note-list::-webkit-scrollbar-thumb,\n.resizableLayoutItem[class*="rli-plugin-view-"]::-webkit-scrollbar-thumb {\n background: var(--od-scrollbar-thumb) !important;\n border-radius: 3px !important;\n}\n`}(t,h):"";if(n===i)return;const a=o.require("fs-extra"),d=`${await o.plugins.dataDir()}/theme-studio-chrome.css`;await a.writeFile(d,n,"utf8"),await o.window.loadChromeCssFile(d),i=n}}catch(t){console.warn("[Theme Studio] Could not synchronize desktop chrome stylesheet:",t)}};return j=j.then(n,n),j}const M=new Map;async function A(){try{const t=await S();if(!`${t.themeByNotebook||""}\n${t.themeByTag||""}`.trim())return void(t.noteThemeEffective&&await o.settings.setValue("noteThemeEffective",""));const e=await o.workspace.selectedNote();if(!e||!e.id)return void(t.noteThemeEffective&&await o.settings.setValue("noteThemeEffective",""));const n=await async function(t){const e=M.get(t);if(e&&Date.now()-e.ts<3e5)return e.context;try{const e=await o.data.get(["notes",t],{fields:["id","parent_id"]});if(!e||!e.id)return null;const n=[];let r=e.parent_id;const a=new Set;for(;r&&!a.has(r);){a.add(r);const t=await o.data.get(["folders",r],{fields:["id","parent_id","title"]});if(!t||!t.id)break;if(n.push({id:t.id,title:t.title||""}),r=t.parent_id,n.length>=20)break}const i=await o.data.get(["notes",t,"tags"],{fields:["id","title"]}),d={notebooks:n,tags:Array.isArray(i)?i.filter(t=>t&&t.id).map(t=>({id:t.id,title:t.title||""})):[]};if(M.set(t,{context:d,ts:Date.now()}),M.size>100){const t=M.keys().next().value;void 0!==t&&M.delete(t)}return d}catch(t){return console.warn("[Theme Studio] Could not resolve note context for overrides:",t),null}}(e.id);if(!n)return;const r=K(t.themeByNotebook||"","notebook"),a=K(t.themeByTag||"","tag");(r.errors.length||a.errors.length)&&console.warn("[Theme Studio] Invalid override settings:",[...r.errors,...a.errors].join("; "));const i=function(t,o,e){const n=t.notebooks.map(t=>t.id),r=t.notebooks.map(t=>t.title),a=t.tags.map(t=>t.id),i=t.tags.map(t=>t.title),d=U(o.notebook,n,r);if(d)return{themeKey:d.themeKey,source:"notebook",matched:`notebook ${d.value}`};const l=U(o.tag,a,i);return l?{themeKey:l.themeKey,source:"tag",matched:`tag ${l.value}`}:{themeKey:e,source:"default",matched:"default theme"}}(n,{notebook:r.overrides,tag:a.overrides},t.theme||"atom-one-dark");i.themeKey!==(t.noteThemeEffective||"")&&await o.settings.setValue("noteThemeEffective",i.themeKey)}catch(t){console.warn("[Theme Studio] Could not refresh the active note theme:",t)}}try{await o.workspace.onNoteSelectionChange(()=>{A()}),await o.workspace.onNoteChange(()=>{A()})}catch(t){console.warn("[Theme Studio] Could not subscribe to workspace events:",t)}const D=await $();async function N(){if(d)try{const t=await $();await o.views.panels.setHtml(d,function(t,o=r){return`<!DOCTYPE html>\n<html>\n<head>\n<meta charset="utf-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n<title>Theme Studio Preview</title>\n<style>\n${B(t,"viewer",o)}\n</style>\n<style>\nhtml, body { margin: 0; padding: 0; }\nbody { background-color: var(--od-bg); }\n.preview-header {\n position: sticky; top: 0; z-index: 10;\n display: flex; justify-content: space-between; align-items: center;\n gap: 12px; flex-wrap: wrap;\n padding: 10px 18px;\n background: var(--od-bg-alt);\n border-bottom: 1px solid var(--od-border);\n font-size: 13px; color: var(--od-comment);\n}\n.preview-header strong { color: var(--od-fg); font-size: 14px; }\n#rendered-md { padding: 22px 18px; }\n</style>\n</head>\n<body>\n<div class="preview-header">\n <strong>Theme Studio — Live Preview</strong>\n <span>${(o[t.noteThemeEffective&&o[t.noteThemeEffective]?t.noteThemeEffective:t.themeKey]||o["atom-one-dark"]||r["atom-one-dark"]).name} · ${"rtl"===t.direction?"RTL":"auto"===t.direction?"Auto BiDi":"LTR"} · ${"system"===t.colorSchemeMode?"System":"Theme"}</span>\n</div>\n<div id="rendered-md">\n\n<h1>Theme Studio Preview</h1>\n<p>This panel renders a sample note with the <strong>current</strong> theme,\nfonts and direction. <em>Edit any setting</em> in Tools &gt; Options and the\npreview updates automatically.</p>\n\n<h2>Headings and text</h2>\n<p>Body text with an <a href="#">inline link</a> and <code>inline code</code>.\nA longer paragraph demonstrates line wrapping, reading width and the theme\ncolour palette applied to normal prose.</p>\n\n<h3>Lists</h3>\n<ul>\n <li>Unordered item one</li>\n <li>Unordered item two</li>\n</ul>\n<ol>\n <li>Ordered item one</li>\n <li>Ordered item two</li>\n</ol>\n\n<blockquote>Blockquotes use the theme accent border and background.</blockquote>\n\n<h3>Table</h3>\n<table>\n <thead>\n <tr><th>Feature</th><th>Status</th></tr>\n </thead>\n <tbody>\n <tr><td>Light / dark palettes</td><td>Supported</td></tr>\n <tr><td>BiDi typography</td><td>Supported</td></tr>\n </tbody>\n</table>\n\n<h3>Code</h3>\n<pre><code>function greet(name) {\n return 'Hello, ' + name + '!';\n}</code></pre>\n\n<h3>Image</h3>\n<p><img src="data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='90'%3E%3Crect width='320' height='90' rx='8' fill='%2361afef'/%3E%3Ctext x='160' y='50' font-family='sans-serif' font-size='16' fill='white' text-anchor='middle'%3ETheme Studio%3C/text%3E%3C/svg%3E" alt="Sample image"></p>\n\n</div>\n</body>\n</html>\n`}(t.options,h))}catch(t){console.warn("[Theme Studio] Could not refresh the live preview panel:",t)}}await E(D.options,D.shellEnabled),await A();try{d=await o.views.panels.create("themeStudioPreview"),await o.views.panels.show(d,!1),await N()}catch(t){console.warn("[Theme Studio] Could not create the live preview panel:",t),d=null}await o.settings.onChange(async t=>{const e=t?.keys||[];if(t?.keys&&!t.keys.some(t=>x.includes(t)))return;if(e.some(t=>t.startsWith("customPalette"))){const t=b(await o.settings.values(["customPaletteName","customPaletteBg","customPaletteFg","customPaletteAccent"]));t?h.custom=t:delete h.custom}e.some(t=>"theme"===t||"themeByNotebook"===t||"themeByTag"===t)&&await A();const n=await $();await E(n.options,n.shellEnabled),d&&(l&&clearTimeout(l),l=setTimeout(()=>{l=null,N()},250))});const F=Object.keys(h),I=async()=>{const t=await $();await E(t.options,t.shellEnabled)};await o.commands.register({name:"themeStudio.nextTheme",label:"Theme Studio: Next colour theme",iconName:"fas fa-palette",execute:async()=>{const t=await $(),e=F.indexOf(t.options.themeKey),n=F[(e+1)%F.length];await o.settings.setValue("theme",n),await I()}});for(const[t,e]of Object.entries(h))await o.commands.register({name:`themeStudio.useTheme.${t}`,label:`Theme Studio: Use ${e.name}`,iconName:"fas fa-paint-brush",execute:async()=>{await o.settings.setValue("theme",t),await I()}});await o.commands.register({name:"themeStudio.toggleShell",label:"Theme Studio: Toggle application shell theming",iconName:"fas fa-columns",execute:async()=>{const t=await $();await o.settings.setValue("themeApplicationShell",!t.shellEnabled),await I()}}),await o.commands.register({name:"themeStudio.toggleEditor",label:"Theme Studio: Toggle Markdown editor theming",iconName:"fas fa-code",execute:async()=>{const t=await $();await o.settings.setValue("enableEditorTheme",!t.editorEnabled)}}),await o.commands.register({name:"themeStudio.copyCss",label:"Theme Studio: Copy generated note CSS to clipboard",iconName:"fas fa-copy",execute:async()=>{const t=await $();try{await o.clipboard.writeText(B(t.options,"viewer",h))}catch(t){console.warn("[Theme Studio] Could not copy the CSS to the clipboard:",t)}}}),await o.commands.register({name:"themeStudio.exportPalettes",label:"Theme Studio: Export all palettes to clipboard",iconName:"fas fa-download",execute:async()=>{try{const t=function(t){const o=t.map(t=>({name:t.name,isDark:t.isDark,variables:{...t.variables}}));return JSON.stringify(o,null,2)}(Object.values(h));await o.clipboard.writeText(t)}catch(t){console.warn("[Theme Studio] Could not export the palettes to the clipboard:",t)}}}),await o.commands.register({name:"themeStudio.importPalettes",label:"Theme Studio: Import palettes from clipboard",iconName:"fas fa-upload",execute:async()=>{try{const t=await o.clipboard.readText();if(!t||!t.trim())return void console.warn("[Theme Studio] The clipboard is empty; nothing to import.");const{palettes:e,errors:n}=q(t);if(n.length&&console.warn("[Theme Studio] Could not import some palettes:",n.join("; ")),!e.length)return;const r=await o.settings.value("customPalettes"),a=q(String(r||"")).palettes,i=new Map(a.map(t=>[t.name,t]));for(const t of e)i.set(t.name,t);await o.settings.setValue("customPalettes",JSON.stringify(Array.from(i.values())));const d=g(JSON.stringify(Array.from(i.values())));d.errors.length&&console.warn("[Theme Studio] Imported palettes failed validation:",d.errors.join("; ")),await A()}catch(t){console.warn("[Theme Studio] Could not import the palettes from the clipboard:",t)}}}),await o.commands.register({name:"themeStudio.openPreview",label:"Theme Studio: Open live preview",iconName:"fas fa-eye",execute:async()=>{if(!d)try{d=await o.views.panels.create("themeStudioPreview")}catch(t){return void console.warn("[Theme Studio] Could not create the live preview panel:",t)}await N(),await o.views.panels.show(d,!0)}}),await o.contentScripts.register(e.CodeMirrorPlugin,"themeStudioCodeMirror","./codeMirrorTheme.js"),await o.contentScripts.onMessage("themeStudioCodeMirror",async t=>{if(t&&"getStyleVersion"===t.type)return{version:await T()};if(t&&("getAllStyles"===t.type||"getEditorStyles"===t.type)){const t=await $();return await E(t.options,t.shellEnabled),{version:t.version,editorCss:t.editorEnabled?L(t.options,h):"",viewerCss:B(t.options,"tinymce",h),panelCss:!c&&t.shellEnabled?z(t.options,h):"",platform:s}}return null}),await o.contentScripts.register(e.MarkdownItPlugin,"themeStudioMarkdownIt","./markdownTheme.js")}});const W=exports;for(var V in t)W[V]=t[V];t.__esModule&&Object.defineProperty(W,"__esModule",{value:!0})})();
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "joplin-plugin-theme-studio",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "All-in-one multi-palette engine with native RTL/LTR typography for Joplin",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "publish"
8
8
  ],
9
9
  "scripts": {
10
- "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
11
- "build": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts"
10
+ "dist": "npm run build && webpack --env joplin-plugin-config=createArchive",
11
+ "build": "npm run typecheck && webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts",
12
+ "test": "npm run build && node --test test/*.test.cjs",
13
+ "typecheck": "tsc --noEmit"
12
14
  },
13
15
  "keywords": [
14
16
  "joplin-plugin",
@@ -35,11 +37,13 @@
35
37
  "devDependencies": {
36
38
  "@types/node": "^26.6.6",
37
39
  "copy-webpack-plugin": "^14.0.0",
40
+ "esbuild": "^0.28.2",
41
+ "esbuild-loader": "^4.5.0",
38
42
  "fs-extra": "^11.4.1",
39
- "tar": "^7.5.22",
40
- "ts-loader": "^9.6.2",
41
- "typescript": "^6.0.3",
42
- "webpack": "^5.112.2",
43
+ "semver": "^7.8.6",
44
+ "tar": "^7.5.23",
45
+ "typescript": "^7.0.2",
46
+ "webpack": "^5.113.0",
43
47
  "webpack-cli": "^7.3.1"
44
48
  }
45
49
  }
@@ -3,7 +3,7 @@
3
3
  "id": "org.joplin.plugin.theme-studio",
4
4
  "app_min_version": "3.0.0",
5
5
  "name": "Theme Studio",
6
- "version": "1.5.2",
6
+ "version": "1.6.0",
7
7
  "description": "All-in-one multi-palette engine (Tokyo Night, Everforest, Catppuccin, Nord, Dracula, Gruvbox, Atom One) with native RTL/LTR typography & mobile support.",
8
8
  "author": "Yashar",
9
9
  "homepage_url": "https://github.com/xyasharx/joplin-plugin-theme-studio",
@@ -66,6 +66,6 @@
66
66
  "mobile",
67
67
  "mermaid"
68
68
  ],
69
- "_publish_hash": "sha256:28bd55844386840cce44ff67713ee5c5186d227001b041ddc8d280c04d650f07",
70
- "_publish_commit": "d622ead4827b806baf98465e21e63dcd1ed154a8"
69
+ "_publish_hash": "sha256:8250f123cf6b4fcb4408fa5c43a14906ce38302bed328a76fa9535a3da21bb09",
70
+ "_publish_commit": "307318c09182f90e2c0425591923aa5f73ef707b"
71
71
  }