domma-cms 1.49.1 → 1.49.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.49.2] - 2026-11-09
4
+
5
+ - **The menu marks the right item when several point at one page with different queries.** A navbar or footer with "Find a job" (`/jobs`), "Contract roles" (`/jobs?type=contract`) and "Remote roles" (`/jobs?remote=remote`) used to show all three as the current page on `/jobs`. Now an item counts only when its own query is in the address, and the most specific one wins: `/jobs` marks "Find a job", `/jobs?type=contract` marks "Contract roles". A lone item with a query of its own (`/about?ref=nav`) is still current on `/about`. `currentItems()` in `public/js/menu-decor.mjs` does this for the navbar, the footer and `[menu]`.
6
+
3
7
  ## [1.49.1] - 2026-11-09
4
8
 
5
9
  - Plugin shortcodes are told who is viewing: the context passed to a `registerShortcode` handler now carries `user` (the signed-in viewer, or `null` for an anonymous render). Job Board's preview shortcodes use it so a super admin sees them on a page only super admins can open. Each page is rendered for the viewer's own roles and cached under those roles, so one viewer's output is never served to another.
@@ -1,4 +1,4 @@
1
- import{syncThemeAwareLogos as qe}from"./theme-aware-logo.js";import{api as b,getUser as w,isAuthenticated as Ce}from"../api.js";import{createRequestQueue as Ae}from"./background-requests.js";import{requestSidebarCounts as Fe}from"./sidebar-counts.js";import{beginSidebarCounts as Le,publishSidebarCount as Ee}from"./sidebar-count-cache.js";import{isConfined as je,isPathAllowed as Oe}from"./admin-scope.js";import{cleanNotify as Me,noticeFromCount as Te}from"./sidebar-notify.js";import{colourToCss as ne,applyFloat as Be,applyHighlight as He,itemHighlightAttrs as Ne}from"/public/js/menu-decor.mjs?v=20261014-menu-entrance";import{arrangeSidebar as Re,sidebarStateKey as se,canAny as W,confinedTree as Ie}from"./sidebar-grouping.js";import{arrangeButtonMarkup as Pe,canArrange as _e,startArrange as Ue}from"./sidebar-arrange.js";import{collapseButtonMarkup as ze,wireSidebarSize as De,COLLAPSED_WIDTH as We}from"./sidebar-size.js";import{FREQUENT_MAX as oe,addFrequent as Ke,frequentFolder as Ve,moveFrequent as ie,readFrequent as Z,readFrequentHidden as Xe,removeFrequent as Ze,saveFrequent as Je,syncFrequent as Ye,writeFrequent as Ge,writeFrequentHidden as ae}from"./sidebar-frequent.js";import{hotkeyFor as re,hotkeyTitle as Qe,setHotkeyTree as et}from"./hotkeys-ui.js";import{hotkeyLabel as tt}from"./hotkeys.js";function m(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const nt=[{text:"Dashboard",url:"#/",icon:"home"},{text:"Site menus",url:"#/menus",icon:"menu",permission:"menus"}];async function st(e){if(!W(e,"projects"))return[];let n=[];try{n=await b.projects.listWithCounts()}catch{return[]}if(!Array.isArray(n))return[];const t=[{key:"pages",text:"Pages",icon:"file-text",path:"/pages"},{key:"collections",text:"Collections",icon:"database",path:"/collections"},{key:"forms",text:"Forms",icon:"layout",path:"/forms"},{key:"actions",text:"Actions",icon:"zap",path:"/actions"},{key:"menus",text:"Site menus",icon:"menu",path:"/menus"},{key:"blocks",text:"Blocks",icon:"box",path:"/blocks"},{key:"components",text:"Components",icon:"component",path:"/components"},{key:"views",text:"Views",icon:"eye",path:"/views"},{key:"roles",text:"Roles",icon:"shield",path:"/roles"},{key:"users",text:"Users",icon:"users",path:"/users"},{key:"apis",text:"APIs",icon:"code",path:"/apis"}];return n.map(o=>{const r="#/projects/"+encodeURIComponent(o.slug),u=o.counts||{},i=[{text:"Overview",url:r,icon:o.icon||"folder"}];for(const d of t){const l=Number(u[d.key])||0;l<=0||i.push({text:`${d.text} (${l})`,url:r+d.path,icon:d.icon})}i.push({text:"Settings",url:r+"/settings",icon:"settings"});const c=o.enabled===!1;return{text:o.name||o.slug,key:`project.${o.slug}`,icon:o.icon||"folder",items:i,...c&&{colour:"neutral",badge:{text:"off"}}}})}function ot(e,n){for(const t of e)if(!t.hidden&&(t.key==="projects"||!t.key&&(t.text||"").toLowerCase()==="projects")){t.items=Array.isArray(t.items)?t.items.slice():[],t.items.push(...n);return}}function le(e,n){const t=de.includes(n.tone)?n.tone:"info",o=n.label||String(n.count);n.details?R.set(e,n.details):R.delete(e);const s=!n.inventory&&j.some(r=>r.url===e&&!r.inventory)?" data-live":"";return`<span class="sidebar-badge sidebar-badge--${t}" data-count-for="${m(e)}"${s} data-badge-label="${m(o)}" aria-label="${m(o)}">${m(String(n.count))}</span>`}function ce(e){for(const n of e.querySelectorAll("details")){const t=n.querySelector(":scope > summary");if(!t)continue;let o=0,s=!1;const r=[];for(const l of n.querySelectorAll(":scope > .sidebar-children .sidebar-badge[data-live]")){const f=Number(l.textContent)||0;f&&(o+=f,s||(s=l.classList.contains("sidebar-badge--danger")),r.push({text:l.closest("a")?.querySelector(".sidebar-text")?.textContent.trim()??"",meta:l.dataset.badgeLabel,tone:l.classList.contains("sidebar-badge--danger")?"danger":void 0}))}const u=`folder:${n.dataset.stateKey||t.textContent.trim()}`;let i=t.querySelector(":scope > .sidebar-badge--sum");if(!o){i?.remove(),R.delete(u);continue}i||(i=document.createElement("span"),t.querySelector(".sidebar-text")?.after(i));const c=t.querySelector(".sidebar-text")?.textContent.trim()||"This folder",d=r.map(l=>`${l.text}: ${l.meta}`).join(" \xB7 ");i.className=`sidebar-badge sidebar-badge--sum sidebar-badge--${s?"danger":"info"}`,i.dataset.countFor=u,i.dataset.badgeLabel=d,i.setAttribute("aria-label",d),i.textContent=String(o),R.set(u,{title:c,items:r})}}const R=new Map;function it(e,n){if(!e.url||!n)return"";const t=n[e.url];return!t||!(t.count>0)&&!t.showZero?"":le(e.url,t)}const de=["info","attention","danger","live"],at={"#/pages":["page","pages"],"#/media":["file in the media library","files in the media library"],"#/menus":["menu","menus"],"#/context-menus":["context menu","context menus"],"#/theme":["element override in the theme","element overrides in the theme"],"#/collections":["collection","collections"],"#/forms":["form","forms"],"#/views":["view","views"],"#/actions":["action","actions"],"#/blocks":["block","blocks"],"#/components":["component","components"],"#/users":["user","users"],"#/plugins":["plugin installed","plugins installed"],"#/system/notifications":["unread notification","unread notifications"]};function K(e,{fallbackLabel:n="",tone:t="info"}={}){const o=Number(typeof e=="object"&&e!==null?e.count:e);if(!Number.isFinite(o)||o<0)return null;const s=typeof e?.label=="string"&&e.label||(n?`${o} - ${n}`:String(o)),r={count:Math.round(o),label:s,tone:de.includes(e?.tone)?e.tone:t};e?.details&&typeof e.details=="object"&&(r.details=e.details),e?.inventory===!0&&(r.inventory=!0),e?.showZero===!0&&(r.showZero=!0);const u=Me(e?.notify);return u&&(r.notify=u),r}function ue(e,n,t=null,{inFrequent:o=!1}={}){if(e&&e.type==="separator")return'<hr class="sidebar-divider">';if(e&&e.type==="theme-switcher")return"";if(e&&e.type==="spacer"){const y=["xs","sm","md","lg","xl","flex"].includes(e.size)?e.size:"md";return`<div class="sidebar-spacer sidebar-spacer--${m(y)}" aria-hidden="true"></div>`}const s=String(e.text||"?").trim().charAt(0).toUpperCase()||"?",r=e.icon?`<span data-icon="${m(e.icon)}"></span>`:`<span class="sidebar-initial" aria-hidden="true">${m(s)}</span>`,u=m(e.text||""),i=e.url?m(e.url):"",c=Array.isArray(e.items)&&e.items.length>0,d=e.colour?ne(e.colour):"",l=Ne(e),f=[l.hover&&` data-menu-item-hover="${m(l.hover)}"`,l.active&&` data-menu-item-active="${m(l.active)}"`].filter(Boolean).join(""),h=[d&&`color:${m(d)}`,l.accent&&`--dm-menu-highlight:${m(l.accent)}`].filter(Boolean).join(";"),v=h?` style="${h}"`:"",k=e.url?Qe(e.url,e.text||"",{inFrequent:o}):"",q=k?` title="${m(k)}"`:"";let A="";if(e.badge&&e.badge.text!=null&&e.badge.text!==""){const y=e.badge.variant?ne(e.badge.variant):"";A=`<span class="dm-menu-badge"${y?` style="background:${m(y)};color:var(--dm-text-inverse,#fff)"`:""}>${m(String(e.badge.text))}</span>`}if(e.frequent&&e.empty){const y=se(e,t),F=S.get(y)!==!1;return`<details data-state-key="${m(y)}"${F?" open":""} data-frequent data-frequent-empty>
1
+ import{syncThemeAwareLogos as qe}from"./theme-aware-logo.js";import{api as b,getUser as w,isAuthenticated as Ce}from"../api.js";import{createRequestQueue as Ae}from"./background-requests.js";import{requestSidebarCounts as Fe}from"./sidebar-counts.js";import{beginSidebarCounts as Le,publishSidebarCount as Ee}from"./sidebar-count-cache.js";import{isConfined as je,isPathAllowed as Oe}from"./admin-scope.js";import{cleanNotify as Me,noticeFromCount as Te}from"./sidebar-notify.js";import{colourToCss as ne,applyFloat as Be,applyHighlight as He,itemHighlightAttrs as Ne}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{arrangeSidebar as Re,sidebarStateKey as se,canAny as W,confinedTree as Ie}from"./sidebar-grouping.js";import{arrangeButtonMarkup as Pe,canArrange as _e,startArrange as Ue}from"./sidebar-arrange.js";import{collapseButtonMarkup as ze,wireSidebarSize as De,COLLAPSED_WIDTH as We}from"./sidebar-size.js";import{FREQUENT_MAX as oe,addFrequent as Ke,frequentFolder as Ve,moveFrequent as ie,readFrequent as Z,readFrequentHidden as Xe,removeFrequent as Ze,saveFrequent as Je,syncFrequent as Ye,writeFrequent as Ge,writeFrequentHidden as ae}from"./sidebar-frequent.js";import{hotkeyFor as re,hotkeyTitle as Qe,setHotkeyTree as et}from"./hotkeys-ui.js";import{hotkeyLabel as tt}from"./hotkeys.js";function m(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const nt=[{text:"Dashboard",url:"#/",icon:"home"},{text:"Site menus",url:"#/menus",icon:"menu",permission:"menus"}];async function st(e){if(!W(e,"projects"))return[];let n=[];try{n=await b.projects.listWithCounts()}catch{return[]}if(!Array.isArray(n))return[];const t=[{key:"pages",text:"Pages",icon:"file-text",path:"/pages"},{key:"collections",text:"Collections",icon:"database",path:"/collections"},{key:"forms",text:"Forms",icon:"layout",path:"/forms"},{key:"actions",text:"Actions",icon:"zap",path:"/actions"},{key:"menus",text:"Site menus",icon:"menu",path:"/menus"},{key:"blocks",text:"Blocks",icon:"box",path:"/blocks"},{key:"components",text:"Components",icon:"component",path:"/components"},{key:"views",text:"Views",icon:"eye",path:"/views"},{key:"roles",text:"Roles",icon:"shield",path:"/roles"},{key:"users",text:"Users",icon:"users",path:"/users"},{key:"apis",text:"APIs",icon:"code",path:"/apis"}];return n.map(o=>{const r="#/projects/"+encodeURIComponent(o.slug),u=o.counts||{},i=[{text:"Overview",url:r,icon:o.icon||"folder"}];for(const d of t){const l=Number(u[d.key])||0;l<=0||i.push({text:`${d.text} (${l})`,url:r+d.path,icon:d.icon})}i.push({text:"Settings",url:r+"/settings",icon:"settings"});const c=o.enabled===!1;return{text:o.name||o.slug,key:`project.${o.slug}`,icon:o.icon||"folder",items:i,...c&&{colour:"neutral",badge:{text:"off"}}}})}function ot(e,n){for(const t of e)if(!t.hidden&&(t.key==="projects"||!t.key&&(t.text||"").toLowerCase()==="projects")){t.items=Array.isArray(t.items)?t.items.slice():[],t.items.push(...n);return}}function le(e,n){const t=de.includes(n.tone)?n.tone:"info",o=n.label||String(n.count);n.details?R.set(e,n.details):R.delete(e);const s=!n.inventory&&j.some(r=>r.url===e&&!r.inventory)?" data-live":"";return`<span class="sidebar-badge sidebar-badge--${t}" data-count-for="${m(e)}"${s} data-badge-label="${m(o)}" aria-label="${m(o)}">${m(String(n.count))}</span>`}function ce(e){for(const n of e.querySelectorAll("details")){const t=n.querySelector(":scope > summary");if(!t)continue;let o=0,s=!1;const r=[];for(const l of n.querySelectorAll(":scope > .sidebar-children .sidebar-badge[data-live]")){const f=Number(l.textContent)||0;f&&(o+=f,s||(s=l.classList.contains("sidebar-badge--danger")),r.push({text:l.closest("a")?.querySelector(".sidebar-text")?.textContent.trim()??"",meta:l.dataset.badgeLabel,tone:l.classList.contains("sidebar-badge--danger")?"danger":void 0}))}const u=`folder:${n.dataset.stateKey||t.textContent.trim()}`;let i=t.querySelector(":scope > .sidebar-badge--sum");if(!o){i?.remove(),R.delete(u);continue}i||(i=document.createElement("span"),t.querySelector(".sidebar-text")?.after(i));const c=t.querySelector(".sidebar-text")?.textContent.trim()||"This folder",d=r.map(l=>`${l.text}: ${l.meta}`).join(" \xB7 ");i.className=`sidebar-badge sidebar-badge--sum sidebar-badge--${s?"danger":"info"}`,i.dataset.countFor=u,i.dataset.badgeLabel=d,i.setAttribute("aria-label",d),i.textContent=String(o),R.set(u,{title:c,items:r})}}const R=new Map;function it(e,n){if(!e.url||!n)return"";const t=n[e.url];return!t||!(t.count>0)&&!t.showZero?"":le(e.url,t)}const de=["info","attention","danger","live"],at={"#/pages":["page","pages"],"#/media":["file in the media library","files in the media library"],"#/menus":["menu","menus"],"#/context-menus":["context menu","context menus"],"#/theme":["element override in the theme","element overrides in the theme"],"#/collections":["collection","collections"],"#/forms":["form","forms"],"#/views":["view","views"],"#/actions":["action","actions"],"#/blocks":["block","blocks"],"#/components":["component","components"],"#/users":["user","users"],"#/plugins":["plugin installed","plugins installed"],"#/system/notifications":["unread notification","unread notifications"]};function K(e,{fallbackLabel:n="",tone:t="info"}={}){const o=Number(typeof e=="object"&&e!==null?e.count:e);if(!Number.isFinite(o)||o<0)return null;const s=typeof e?.label=="string"&&e.label||(n?`${o} - ${n}`:String(o)),r={count:Math.round(o),label:s,tone:de.includes(e?.tone)?e.tone:t};e?.details&&typeof e.details=="object"&&(r.details=e.details),e?.inventory===!0&&(r.inventory=!0),e?.showZero===!0&&(r.showZero=!0);const u=Me(e?.notify);return u&&(r.notify=u),r}function ue(e,n,t=null,{inFrequent:o=!1}={}){if(e&&e.type==="separator")return'<hr class="sidebar-divider">';if(e&&e.type==="theme-switcher")return"";if(e&&e.type==="spacer"){const y=["xs","sm","md","lg","xl","flex"].includes(e.size)?e.size:"md";return`<div class="sidebar-spacer sidebar-spacer--${m(y)}" aria-hidden="true"></div>`}const s=String(e.text||"?").trim().charAt(0).toUpperCase()||"?",r=e.icon?`<span data-icon="${m(e.icon)}"></span>`:`<span class="sidebar-initial" aria-hidden="true">${m(s)}</span>`,u=m(e.text||""),i=e.url?m(e.url):"",c=Array.isArray(e.items)&&e.items.length>0,d=e.colour?ne(e.colour):"",l=Ne(e),f=[l.hover&&` data-menu-item-hover="${m(l.hover)}"`,l.active&&` data-menu-item-active="${m(l.active)}"`].filter(Boolean).join(""),h=[d&&`color:${m(d)}`,l.accent&&`--dm-menu-highlight:${m(l.accent)}`].filter(Boolean).join(";"),v=h?` style="${h}"`:"",k=e.url?Qe(e.url,e.text||"",{inFrequent:o}):"",q=k?` title="${m(k)}"`:"";let A="";if(e.badge&&e.badge.text!=null&&e.badge.text!==""){const y=e.badge.variant?ne(e.badge.variant):"";A=`<span class="dm-menu-badge"${y?` style="background:${m(y)};color:var(--dm-text-inverse,#fff)"`:""}>${m(String(e.badge.text))}</span>`}if(e.frequent&&e.empty){const y=se(e,t),F=S.get(y)!==!1;return`<details data-state-key="${m(y)}"${F?" open":""} data-frequent data-frequent-empty>
2
2
  <summary${v}>${r} <span class="sidebar-text">${u}</span></summary>
3
3
  <div class="sidebar-children"><p class="sidebar-frequent-empty">Right-click any Tool and choose <strong>Add to Frequent</strong> to keep it here.</p></div>
4
4
  </details>`}if(c){const y=se(e,t),F=S.get(y)!==!1,L=e.items.map(O=>ue(O,n,y,{inFrequent:!!e.frequent})).join(""),P=e.frequent?' data-frequent title="Your Frequent Tools - right-click any Tool to add or remove it"':"";return`<details data-state-key="${m(y)}"${F?" open":""}${P}>
@@ -1,4 +1,4 @@
1
- import{api as O,apiRequest as Qe}from"../api.js";import{HIGHLIGHT_HOVER as Xe,HIGHLIGHT_ACTIVE as Ze,HIGHLIGHT_HOVER_LABELS as et,HIGHLIGHT_ACTIVE_LABELS as tt}from"/public/js/menu-decor.mjs?v=20261014-menu-entrance";import{addBannerAction as at}from"../lib/plugin-chrome.js";import{helpPopovers as Me}from"../lib/help-popover.js";import{onceClosed as Te,openMenuAt as He,sidebarCount as lt}from"../lib/tool-kit.js";import{FILTERS as st,WIDTHS as ot,WIDTH_HINTS as nt,WIDTH_LABELS as it,WIDTH_SHARE as $e,arrangeLayouts as ct,checkLayout as rt,checkOptions as dt,formFromPreset as ut}from"../lib/layouts-arrange.js";const ae=/^\/layouts\/?(\?.*)?$/,Le="#/layouts",le="layouts.draft",z="layouts.options.draft",se="layouts.filter",Oe=(l="")=>`
1
+ import{api as O,apiRequest as Qe}from"../api.js";import{HIGHLIGHT_HOVER as Xe,HIGHLIGHT_ACTIVE as Ze,HIGHLIGHT_HOVER_LABELS as et,HIGHLIGHT_ACTIVE_LABELS as tt}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{addBannerAction as at}from"../lib/plugin-chrome.js";import{helpPopovers as Me}from"../lib/help-popover.js";import{onceClosed as Te,openMenuAt as He,sidebarCount as lt}from"../lib/tool-kit.js";import{FILTERS as st,WIDTHS as ot,WIDTH_HINTS as nt,WIDTH_LABELS as it,WIDTH_SHARE as $e,arrangeLayouts as ct,checkLayout as rt,checkOptions as dt,formFromPreset as ut}from"../lib/layouts-arrange.js";const ae=/^\/layouts\/?(\?.*)?$/,Le="#/layouts",le="layouts.draft",z="layouts.options.draft",se="layouts.filter",Oe=(l="")=>`
2
2
  <span class="lyx-shape" aria-hidden="true" data-bind-style-background-color="bg${l}">
3
3
  <span class="lyx-shape-nav" data-bind-hidden="!hasNav${l}"></span>
4
4
  <span class="lyx-shape-body"><span class="lyx-shape-col" data-bind-style-width="share${l}"></span><span class="lyx-shape-side" data-bind-hidden="!hasSide${l}" data-bind-class="sideRight${l} && 'is-right'"></span></span>
@@ -1,4 +1,4 @@
1
- import{api as j,apiRequest as Lt}from"../api.js";import{launcherHref as Ct}from"../../../public/js/launcher-settings.mjs";import{colourToCss as $t,HIGHLIGHT_HOVER as pt,HIGHLIGHT_ACTIVE as ht,HIGHLIGHT_HOVER_LABELS as ft,HIGHLIGHT_ACTIVE_LABELS as vt,cssClassProblems as gt,normaliseCssClasses as Tt,ENTRANCE_ANIMATIONS as st,ENTRANCE_ANIMATION_LABELS as Ht}from"/public/js/menu-decor.mjs?v=20261014-menu-entrance";import{openIconPicker as _t}from"../lib/card-builder.js";import{normalisePanel as It,DESCRIPTION_MAX as Nt}from"/public/js/menu-look.mjs?v=20261029-footer-bars";import{sortableMenuRows as Ot}from"../lib/menu-drag.js";import{placeTools as Rt,ensureLockedTools as Bt,isLockedUrl as Pt,groupKeyFor as Dt,slugify as jt,GROUP_ICON as Ft,TOOLS_FOLDER_KEY as Mt}from"../lib/sidebar-grouping.js";import{flatten as bt,nest as zt,uid as Xe}from"../lib/menu-rows.js";import{addBannerAction as lt}from"../lib/plugin-chrome.js";import{helpPopovers as it}from"../lib/help-popover.js";import{enhanceFontSelect as Ut}from"../lib/font-picker.js";import{MENU_ITEM_HELP as Wt}from"../lib/menu-item-help.js";import{onceClosed as Kt,openMenuAt as rt,sidebarCount as qt}from"../lib/tool-kit.js";import{addChild as Gt,bindingFrom as Vt,duplicateRow as Yt,indentRow as Xt,insertBelow as Jt,isStructural as ke,menuFromForm as Qt,menuProblems as Zt,moveRow as yt,outdentRow as en,siblingsOf as tn,snapshot as Je}from"../lib/menu-editor-arrange.js";import{fmtDateTime as nn}from"../lib/dates.js";const on=760,an="admin-sidebar",sn=/^\/menus\/(new|edit\/[^?#]+)(\?.*)?$/;function L(n){return String(n||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}const Fe=n=>String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function ln(n,p){let i=0,c=p.find(l=>l.id===n);for(;c&&c.parentId;)i++,c=p.find(l=>l.id===c.parentId);return i}function kt(n){const p=new Set,i=new Set,c=l=>{for(const b of n.filter(_=>_.parentId===l))!b.type&&Pt(b.url)&&!i.has(b.url)&&(i.add(b.url),p.add(b.id)),c(b.id)};return c(null),p}const Qe='<button type="button" class="btn btn-sm btn-ghost mex-kebab" aria-label="Actions" title="Actions (right-click, or Shift+F10)">\u22EE</button>';function rn(n,p,i=!1){const c=i?kt(p):new Set,l=[];function b(_){for(const u of p.filter(Y=>Y.parentId===_)){const A=`style="margin-left:${ln(u.id,p)*28}px"`;if(u.type==="separator"){l.push(`
1
+ import{api as j,apiRequest as Lt}from"../api.js";import{launcherHref as Ct}from"../../../public/js/launcher-settings.mjs";import{colourToCss as $t,HIGHLIGHT_HOVER as pt,HIGHLIGHT_ACTIVE as ht,HIGHLIGHT_HOVER_LABELS as ft,HIGHLIGHT_ACTIVE_LABELS as vt,cssClassProblems as gt,normaliseCssClasses as Tt,ENTRANCE_ANIMATIONS as st,ENTRANCE_ANIMATION_LABELS as Ht}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{openIconPicker as _t}from"../lib/card-builder.js";import{normalisePanel as It,DESCRIPTION_MAX as Nt}from"/public/js/menu-look.mjs?v=20261029-footer-bars";import{sortableMenuRows as Ot}from"../lib/menu-drag.js";import{placeTools as Rt,ensureLockedTools as Bt,isLockedUrl as Pt,groupKeyFor as Dt,slugify as jt,GROUP_ICON as Ft,TOOLS_FOLDER_KEY as Mt}from"../lib/sidebar-grouping.js";import{flatten as bt,nest as zt,uid as Xe}from"../lib/menu-rows.js";import{addBannerAction as lt}from"../lib/plugin-chrome.js";import{helpPopovers as it}from"../lib/help-popover.js";import{enhanceFontSelect as Ut}from"../lib/font-picker.js";import{MENU_ITEM_HELP as Wt}from"../lib/menu-item-help.js";import{onceClosed as Kt,openMenuAt as rt,sidebarCount as qt}from"../lib/tool-kit.js";import{addChild as Gt,bindingFrom as Vt,duplicateRow as Yt,indentRow as Xt,insertBelow as Jt,isStructural as ke,menuFromForm as Qt,menuProblems as Zt,moveRow as yt,outdentRow as en,siblingsOf as tn,snapshot as Je}from"../lib/menu-editor-arrange.js";import{fmtDateTime as nn}from"../lib/dates.js";const on=760,an="admin-sidebar",sn=/^\/menus\/(new|edit\/[^?#]+)(\?.*)?$/;function L(n){return String(n||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}const Fe=n=>String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function ln(n,p){let i=0,c=p.find(l=>l.id===n);for(;c&&c.parentId;)i++,c=p.find(l=>l.id===c.parentId);return i}function kt(n){const p=new Set,i=new Set,c=l=>{for(const b of n.filter(_=>_.parentId===l))!b.type&&Pt(b.url)&&!i.has(b.url)&&(i.add(b.url),p.add(b.id)),c(b.id)};return c(null),p}const Qe='<button type="button" class="btn btn-sm btn-ghost mex-kebab" aria-label="Actions" title="Actions (right-click, or Shift+F10)">\u22EE</button>';function rn(n,p,i=!1){const c=i?kt(p):new Set,l=[];function b(_){for(const u of p.filter(Y=>Y.parentId===_)){const A=`style="margin-left:${ln(u.id,p)*28}px"`;if(u.type==="separator"){l.push(`
2
2
  <div class="menu-tree-row menu-tree-row--separator" data-id="${u.id}" tabindex="0" ${A}>
3
3
  <span class="menu-tree-grip" data-icon="grip-vertical" data-icon-size="18" title="Drag to move"></span>
4
4
  <span class="me-sep-line"><span class="me-sep-label">Separator</span></span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.49.1",
3
+ "version": "1.49.2",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -1,4 +1,4 @@
1
- import{colourToCss as w}from"/public/js/menu-decor.mjs?v=20261014-menu-entrance";import{normaliseLook as B,normalisePanel as E,cardColumns as $,floatsWithoutStrip as O,TRAY_BARS as _,TILE_RAINBOW as y,LOOK_ICONS as N}from"/public/js/menu-look.mjs?v=20261029-footer-bars";const v="(min-width: 993px)",z=`
1
+ import{colourToCss as w}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{normaliseLook as B,normalisePanel as E,cardColumns as $,floatsWithoutStrip as O,TRAY_BARS as _,TILE_RAINBOW as y,LOOK_ICONS as N}from"/public/js/menu-look.mjs?v=20261029-footer-bars";const v="(min-width: 993px)",z=`
2
2
  <span class="dm-nc-eyebrow" data-bind-text="heading.value"></span>
3
3
  <a class="dm-nc-more" data-bind-href="linkUrl.value" data-bind-hidden="!linkUrl.value"><span data-bind-text="linkText.value"></span><span class="dm-nc-arrow" data-icon="arrow-right" data-size="14" aria-hidden="true"></span></a>`,I=`
4
4
  <div class="dm-nc-feature-box">
@@ -1 +1 @@
1
- export const PRESET_COLOUR_VARS={primary:"--dm-primary",success:"--dm-success",danger:"--dm-danger",warning:"--dm-warning",info:"--dm-info",neutral:"--dm-text-muted"},PRESET_COLOUR_FALLBACKS={primary:"#0d6efd",success:"#198754",danger:"#dc3545",warning:"#ffc107",info:"#0dcaf0",neutral:"#6c757d"};const c=/^#[0-9a-fA-F]{6}$/;export function colourToCss(t){return typeof t!="string"?"":PRESET_COLOUR_VARS[t]?`var(${PRESET_COLOUR_VARS[t]}, ${PRESET_COLOUR_FALLBACKS[t]})`:c.test(t)?t:""}export const FLOAT_ANCHORS=["TL","TR","BL","BR","L","R"],FLOAT_DEFAULTS={anchor:"TL",offsetX:16,offsetY:16,zIndex:150},FLOAT_SHADOWS={none:"none",sm:"var(--dm-shadow-sm)",md:"var(--dm-shadow-md)",lg:"var(--dm-shadow-lg)",xl:"var(--dm-shadow-xl)"};function i(t,e,o,n){const r=Number(t);return Number.isFinite(r)?Math.min(n,Math.max(o,Math.round(r))):e}function d(t){const e=[];if(t.radius!=null&&t.radius!==""&&e.push(`border-radius:${i(t.radius,8,0,48)}px`),t.shadow!=null&&t.shadow!==""&&Object.prototype.hasOwnProperty.call(FLOAT_SHADOWS,t.shadow)&&e.push(`box-shadow:${FLOAT_SHADOWS[t.shadow]}`),t.accent&&colourToCss(t.accent)){const o=colourToCss(t.accent);e.push(`--dm-menu-accent:${o}`,`border-color:${o}`)}return t.opacity!=null&&t.opacity!==""&&e.push(`--dm-menu-panel-opacity:${i(t.opacity,100,20,100)/100}`),e}export function floatToCss(t){if(!t||t.position!=="floating")return"";const e=t.float&&typeof t.float=="object"&&!Array.isArray(t.float)?t.float:{},o=FLOAT_ANCHORS.includes(e.anchor)?e.anchor:FLOAT_DEFAULTS.anchor,n=i(e.offsetX,FLOAT_DEFAULTS.offsetX,0,4e3),r=i(e.offsetY,FLOAT_DEFAULTS.offsetY,0,4e3),a=["position:fixed",`z-index:${i(e.zIndex,FLOAT_DEFAULTS.zIndex,0,2147483647)}`];return o==="L"||o==="R"?(a.push("top:50%","transform:translateY(-50%)"),a.push(o==="L"?`left:${n}px`:`right:${n}px`)):(a.push(o[0]==="T"?`top:${r}px`:`bottom:${r}px`),a.push(o[1]==="L"?`left:${n}px`:`right:${n}px`)),e.width!=null&&e.width!==""&&a.push(`width:${i(e.width,260,120,600)}px`),a.push(`max-height:calc(100vh - ${o==="L"||o==="R"?32:r*2}px)`),a.push(...d(e)),a.join(";")}export const FLOAT_FLAGS=["collapsible","collapsed","movable","resizable"];export function floatBehaviour(t){const e={collapsible:!1,collapsed:!1,movable:!1,resizable:!1,chrome:!1,title:""};if(!t||t.position!=="floating")return e;const o=t.float&&typeof t.float=="object"&&!Array.isArray(t.float)?t.float:{},n={collapsible:!!o.collapsible,collapsed:!!o.collapsible&&!!o.collapsed,movable:!!o.movable,resizable:!!o.resizable},r=n.collapsible||n.movable,s=typeof o.title=="string"&&o.title!==""?o.title:t.name||"";return{...n,chrome:r,title:r?s:""}}export function applyFloat(t,e){const o=floatToCss(e);if(!t||!o)return!1;t.style.cssText+=";"+o,t.classList.add("dm-menu-floating"),e.slug&&!t.hasAttribute("data-menu")&&t.setAttribute("data-menu",e.slug),e.float?.anchor&&t.setAttribute("data-float-anchor",e.float.anchor);const n=floatBehaviour(e);for(const r of FLOAT_FLAGS)r!=="collapsed"&&n[r]&&t.setAttribute(`data-float-${r}`,"1");return n.collapsed&&t.setAttribute("data-float-collapsed","1"),n.title&&t.setAttribute("data-float-title",n.title),!0}export function makeBadgeEl(t){if(!t||t.text==null||t.text==="")return null;const e=document.createElement("span");e.className="dm-menu-badge",e.textContent=String(t.text);const o=t.variant?colourToCss(t.variant):"";return o&&(e.style.background=o,e.style.color="var(--dm-text-inverse, #fff)"),e}export function applyColour(t,e){const o=colourToCss(e);o&&(t.style.color=o)}export function applyPill(t,e){if(!e)return;t.classList.add("dm-nav-pill");const o=e.variant?colourToCss(e.variant):"";e.style==="outline"?(t.classList.add("dm-nav-pill--outline"),o&&(t.style.borderColor=o,t.style.color=o)):o&&(t.style.background=o,t.style.color="#fff")}export const MENU_ALIGN=["left","centre","right","spread"];export function menuAlign(t){const e=t&&t.align;return MENU_ALIGN.includes(e)?e:""}export const HIGHLIGHT_HOVER=["none","colour","underline","overline","background","darken","uppercase","grow","breathe","glow"],HIGHLIGHT_ACTIVE=["none","bold","underline","overline","background","darken","pill"],HIGHLIGHT_HOVER_LABELS={none:"None - no change on hover",colour:"Colour change",underline:"Underline",overline:"Overline",background:"Background tint",darken:"Darkened",uppercase:"Uppercase",grow:"Grow",breathe:"Breathe",glow:"Glow"},HIGHLIGHT_ACTIVE_LABELS={none:"None - not marked at all",bold:"Bold",underline:"Underline",overline:"Overline",background:"Background tint",darken:"Darkened",pill:"Filled pill"},LEGACY_STYLE_HOVER={none:"none",underline:"underline",overline:"overline",transform:"uppercase","text-transform":"uppercase",breathe:"breathe"},LEGACY_STYLE_ACTIVE={none:"none",darken:"darken",background:"background","background-color":"background",underline:"underline",overline:"overline"};export function legacyStyleHighlight(t){const e=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return{hover:LEGACY_STYLE_HOVER[e.hover]||"",active:LEGACY_STYLE_ACTIVE[e.active]||""}}export function highlightAttrs(t){const e=t&&t.highlight&&typeof t.highlight=="object"&&!Array.isArray(t.highlight)?t.highlight:{},o=legacyStyleHighlight(t&&t.style);return{hover:HIGHLIGHT_HOVER.includes(e.hover)?e.hover:o.hover,active:HIGHLIGHT_ACTIVE.includes(e.active)?e.active:o.active,accent:e.accent?colourToCss(e.accent):""}}export function applyHighlight(t,e){if(!t)return!1;const{hover:o,active:n,accent:r}=highlightAttrs(e);return o&&t.setAttribute("data-menu-hover",o),n&&t.setAttribute("data-menu-active",n),r&&t.style.setProperty("--dm-menu-highlight",r),!!(o||n||r)}export function itemHighlightAttrs(t){const e=t&&t.highlight&&typeof t.highlight=="object"&&!Array.isArray(t.highlight)?t.highlight:{};return{hover:HIGHLIGHT_HOVER.includes(e.hover)?e.hover:"",active:HIGHLIGHT_ACTIVE.includes(e.active)?e.active:"",accent:e.accent?colourToCss(e.accent):""}}export function applyItemHighlight(t,e){if(!t)return!1;const{hover:o,active:n,accent:r}=itemHighlightAttrs(e);return o&&t.setAttribute("data-menu-item-hover",o),n&&t.setAttribute("data-menu-item-active",n),r&&t.style.setProperty("--dm-menu-highlight",r),!!(o||n||r)}function l(t){if(typeof t!="string"||!t)return"";const e=t.split("#")[0].split("?")[0];return e.startsWith("/")?e.length>1&&e.endsWith("/")?e.slice(0,-1):e:""}export function isCurrentItem(t,e){const o=l(t),n=l(e);return!!o&&!!n&&o===n}export const ENTRANCE_ANIMATIONS=["fade","slide-up","slide-down","slide-left","slide-right","zoom","pop","flip","blur"],ENTRANCE_ANIMATION_LABELS={fade:"Fade in","slide-up":"Slide up","slide-down":"Slide down","slide-left":"Slide in from the right","slide-right":"Slide in from the left",zoom:"Zoom in",pop:"Pop (zoom with a bounce)",flip:"Flip down",blur:"Blur into focus"},ENTRANCE_DEFAULTS={animation:"fade",stagger:60,duration:400},ENTRANCE_LIMITS={stagger:[0,1e3],duration:[50,3e3]};export function entranceAttrs(t){const e=t&&t.entrance;if(!e||typeof e!="object"||Array.isArray(e)||e.enabled!==!0)return null;const o=n=>{const r=Number(e[n]),[s,a]=ENTRANCE_LIMITS[n];return e[n]!==""&&e[n]!=null&&Number.isFinite(r)&&r>=s&&r<=a?Math.round(r):ENTRANCE_DEFAULTS[n]};return{animation:ENTRANCE_ANIMATIONS.includes(e.animation)?e.animation:ENTRANCE_DEFAULTS.animation,stagger:o("stagger"),duration:o("duration")}}export function entranceStyle(t){return t?`--dm-menu-entrance-step:${t.stagger}ms;--dm-menu-entrance-duration:${t.duration}ms`:""}export function applyEntrance(t,e){if(!t)return!1;const o=entranceAttrs(e);return o?(t.style.setProperty("--dm-menu-entrance-step",`${o.stagger}ms`),t.style.setProperty("--dm-menu-entrance-duration",`${o.duration}ms`),t.setAttribute("data-menu-entrance",o.animation),!0):!1}export{CSS_CLASS_RE,CSS_CLASS_MAX,CSS_CLASS_MAX_LEN,cssClasses,cssClassProblems,normaliseCssClasses,applyClasses}from"./css-classes.mjs";
1
+ export const PRESET_COLOUR_VARS={primary:"--dm-primary",success:"--dm-success",danger:"--dm-danger",warning:"--dm-warning",info:"--dm-info",neutral:"--dm-text-muted"},PRESET_COLOUR_FALLBACKS={primary:"#0d6efd",success:"#198754",danger:"#dc3545",warning:"#ffc107",info:"#0dcaf0",neutral:"#6c757d"};const g=/^#[0-9a-fA-F]{6}$/;export function colourToCss(t){return typeof t!="string"?"":PRESET_COLOUR_VARS[t]?`var(${PRESET_COLOUR_VARS[t]}, ${PRESET_COLOUR_FALLBACKS[t]})`:g.test(t)?t:""}export const FLOAT_ANCHORS=["TL","TR","BL","BR","L","R"],FLOAT_DEFAULTS={anchor:"TL",offsetX:16,offsetY:16,zIndex:150},FLOAT_SHADOWS={none:"none",sm:"var(--dm-shadow-sm)",md:"var(--dm-shadow-md)",lg:"var(--dm-shadow-lg)",xl:"var(--dm-shadow-xl)"};function c(t,e,n,r){const o=Number(t);return Number.isFinite(o)?Math.min(r,Math.max(n,Math.round(o))):e}function m(t){const e=[];if(t.radius!=null&&t.radius!==""&&e.push(`border-radius:${c(t.radius,8,0,48)}px`),t.shadow!=null&&t.shadow!==""&&Object.prototype.hasOwnProperty.call(FLOAT_SHADOWS,t.shadow)&&e.push(`box-shadow:${FLOAT_SHADOWS[t.shadow]}`),t.accent&&colourToCss(t.accent)){const n=colourToCss(t.accent);e.push(`--dm-menu-accent:${n}`,`border-color:${n}`)}return t.opacity!=null&&t.opacity!==""&&e.push(`--dm-menu-panel-opacity:${c(t.opacity,100,20,100)/100}`),e}export function floatToCss(t){if(!t||t.position!=="floating")return"";const e=t.float&&typeof t.float=="object"&&!Array.isArray(t.float)?t.float:{},n=FLOAT_ANCHORS.includes(e.anchor)?e.anchor:FLOAT_DEFAULTS.anchor,r=c(e.offsetX,FLOAT_DEFAULTS.offsetX,0,4e3),o=c(e.offsetY,FLOAT_DEFAULTS.offsetY,0,4e3),i=["position:fixed",`z-index:${c(e.zIndex,FLOAT_DEFAULTS.zIndex,0,2147483647)}`];return n==="L"||n==="R"?(i.push("top:50%","transform:translateY(-50%)"),i.push(n==="L"?`left:${r}px`:`right:${r}px`)):(i.push(n[0]==="T"?`top:${o}px`:`bottom:${o}px`),i.push(n[1]==="L"?`left:${r}px`:`right:${r}px`)),e.width!=null&&e.width!==""&&i.push(`width:${c(e.width,260,120,600)}px`),i.push(`max-height:calc(100vh - ${n==="L"||n==="R"?32:o*2}px)`),i.push(...m(e)),i.join(";")}export const FLOAT_FLAGS=["collapsible","collapsed","movable","resizable"];export function floatBehaviour(t){const e={collapsible:!1,collapsed:!1,movable:!1,resizable:!1,chrome:!1,title:""};if(!t||t.position!=="floating")return e;const n=t.float&&typeof t.float=="object"&&!Array.isArray(t.float)?t.float:{},r={collapsible:!!n.collapsible,collapsed:!!n.collapsible&&!!n.collapsed,movable:!!n.movable,resizable:!!n.resizable},o=r.collapsible||r.movable,l=typeof n.title=="string"&&n.title!==""?n.title:t.name||"";return{...r,chrome:o,title:o?l:""}}export function applyFloat(t,e){const n=floatToCss(e);if(!t||!n)return!1;t.style.cssText+=";"+n,t.classList.add("dm-menu-floating"),e.slug&&!t.hasAttribute("data-menu")&&t.setAttribute("data-menu",e.slug),e.float?.anchor&&t.setAttribute("data-float-anchor",e.float.anchor);const r=floatBehaviour(e);for(const o of FLOAT_FLAGS)o!=="collapsed"&&r[o]&&t.setAttribute(`data-float-${o}`,"1");return r.collapsed&&t.setAttribute("data-float-collapsed","1"),r.title&&t.setAttribute("data-float-title",r.title),!0}export function makeBadgeEl(t){if(!t||t.text==null||t.text==="")return null;const e=document.createElement("span");e.className="dm-menu-badge",e.textContent=String(t.text);const n=t.variant?colourToCss(t.variant):"";return n&&(e.style.background=n,e.style.color="var(--dm-text-inverse, #fff)"),e}export function applyColour(t,e){const n=colourToCss(e);n&&(t.style.color=n)}export function applyPill(t,e){if(!e)return;t.classList.add("dm-nav-pill");const n=e.variant?colourToCss(e.variant):"";e.style==="outline"?(t.classList.add("dm-nav-pill--outline"),n&&(t.style.borderColor=n,t.style.color=n)):n&&(t.style.background=n,t.style.color="#fff")}export const MENU_ALIGN=["left","centre","right","spread"];export function menuAlign(t){const e=t&&t.align;return MENU_ALIGN.includes(e)?e:""}export const HIGHLIGHT_HOVER=["none","colour","underline","overline","background","darken","uppercase","grow","breathe","glow"],HIGHLIGHT_ACTIVE=["none","bold","underline","overline","background","darken","pill"],HIGHLIGHT_HOVER_LABELS={none:"None - no change on hover",colour:"Colour change",underline:"Underline",overline:"Overline",background:"Background tint",darken:"Darkened",uppercase:"Uppercase",grow:"Grow",breathe:"Breathe",glow:"Glow"},HIGHLIGHT_ACTIVE_LABELS={none:"None - not marked at all",bold:"Bold",underline:"Underline",overline:"Overline",background:"Background tint",darken:"Darkened",pill:"Filled pill"},LEGACY_STYLE_HOVER={none:"none",underline:"underline",overline:"overline",transform:"uppercase","text-transform":"uppercase",breathe:"breathe"},LEGACY_STYLE_ACTIVE={none:"none",darken:"darken",background:"background","background-color":"background",underline:"underline",overline:"overline"};export function legacyStyleHighlight(t){const e=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return{hover:LEGACY_STYLE_HOVER[e.hover]||"",active:LEGACY_STYLE_ACTIVE[e.active]||""}}export function highlightAttrs(t){const e=t&&t.highlight&&typeof t.highlight=="object"&&!Array.isArray(t.highlight)?t.highlight:{},n=legacyStyleHighlight(t&&t.style);return{hover:HIGHLIGHT_HOVER.includes(e.hover)?e.hover:n.hover,active:HIGHLIGHT_ACTIVE.includes(e.active)?e.active:n.active,accent:e.accent?colourToCss(e.accent):""}}export function applyHighlight(t,e){if(!t)return!1;const{hover:n,active:r,accent:o}=highlightAttrs(e);return n&&t.setAttribute("data-menu-hover",n),r&&t.setAttribute("data-menu-active",r),o&&t.style.setProperty("--dm-menu-highlight",o),!!(n||r||o)}export function itemHighlightAttrs(t){const e=t&&t.highlight&&typeof t.highlight=="object"&&!Array.isArray(t.highlight)?t.highlight:{};return{hover:HIGHLIGHT_HOVER.includes(e.hover)?e.hover:"",active:HIGHLIGHT_ACTIVE.includes(e.active)?e.active:"",accent:e.accent?colourToCss(e.accent):""}}export function applyItemHighlight(t,e){if(!t)return!1;const{hover:n,active:r,accent:o}=itemHighlightAttrs(e);return n&&t.setAttribute("data-menu-item-hover",n),r&&t.setAttribute("data-menu-item-active",r),o&&t.style.setProperty("--dm-menu-highlight",o),!!(n||r||o)}function d(t){if(typeof t!="string"||!t)return"";const e=t.split("#")[0].split("?")[0];return e.startsWith("/")?e.length>1&&e.endsWith("/")?e.slice(0,-1):e:""}export function isCurrentItem(t,e){const n=d(t),r=d(e);return!!n&&!!r&&n===r}function f(t){const e=String(t||"").split("#")[0].split("?")[1];return new URLSearchParams(e||"")}export function currentItems(t,e){const n=d(e);if(!n)return new Set;const r=f(e),o=[];if((function a(u){for(const s of Array.isArray(u)?u:[])!s||typeof s!="object"||(typeof s.url=="string"&&d(s.url)===n&&o.push(s),Array.isArray(s.items)&&a(s.items))})(t),!o.length)return new Set;const i=o.map(a=>{const u=[...f(a.url)];return{it:a,n:u.length,fits:u.every(([s,h])=>r.getAll(s).includes(h))}}).filter(a=>a.fits);if(!i.length)return new Set(o);const p=Math.max(...i.map(a=>a.n));return new Set(i.filter(a=>a.n===p).map(a=>a.it))}export const ENTRANCE_ANIMATIONS=["fade","slide-up","slide-down","slide-left","slide-right","zoom","pop","flip","blur"],ENTRANCE_ANIMATION_LABELS={fade:"Fade in","slide-up":"Slide up","slide-down":"Slide down","slide-left":"Slide in from the right","slide-right":"Slide in from the left",zoom:"Zoom in",pop:"Pop (zoom with a bounce)",flip:"Flip down",blur:"Blur into focus"},ENTRANCE_DEFAULTS={animation:"fade",stagger:60,duration:400},ENTRANCE_LIMITS={stagger:[0,1e3],duration:[50,3e3]};export function entranceAttrs(t){const e=t&&t.entrance;if(!e||typeof e!="object"||Array.isArray(e)||e.enabled!==!0)return null;const n=r=>{const o=Number(e[r]),[l,i]=ENTRANCE_LIMITS[r];return e[r]!==""&&e[r]!=null&&Number.isFinite(o)&&o>=l&&o<=i?Math.round(o):ENTRANCE_DEFAULTS[r]};return{animation:ENTRANCE_ANIMATIONS.includes(e.animation)?e.animation:ENTRANCE_DEFAULTS.animation,stagger:n("stagger"),duration:n("duration")}}export function entranceStyle(t){return t?`--dm-menu-entrance-step:${t.stagger}ms;--dm-menu-entrance-duration:${t.duration}ms`:""}export function applyEntrance(t,e){if(!t)return!1;const n=entranceAttrs(e);return n?(t.style.setProperty("--dm-menu-entrance-step",`${n.stagger}ms`),t.style.setProperty("--dm-menu-entrance-duration",`${n.duration}ms`),t.setAttribute("data-menu-entrance",n.animation),!0):!1}export{CSS_CLASS_RE,CSS_CLASS_MAX,CSS_CLASS_MAX_LEN,cssClasses,cssClassProblems,normaliseCssClasses,applyClasses}from"./css-classes.mjs";
package/public/js/site.js CHANGED
@@ -1 +1 @@
1
- import{applyMobileMenu as ae,initCarouselPopup as ie}from"/public/js/mobile-ui.mjs?v=20261016-mobile-options";import{installSmoothCarets as re}from"/public/js/smooth-caret.js";import{decodeBase64Json as V}from"/public/js/utf8-base64.mjs";import{makeBadgeEl as U,applyColour as G,applyPill as ce,applyFloat as le,applyHighlight as Y,applyItemHighlight as de,itemHighlightAttrs as me,isCurrentItem as K,menuAlign as ue,applyClasses as P,cssClasses as X,applyEntrance as J}from"/public/js/menu-decor.mjs?v=20261014-menu-entrance";import{applyMenuLook as pe,applyFooterLook as fe}from"/public/js/menu-cards.mjs?v=20261029-footer-bars";import{initPageMotion as he}from"/public/js/page-motion.mjs?v=20261029-page-motion";import{applyFooterShowcase as ge}from"/public/js/footer-showcase.mjs?v=20261029-footer-showcase";import{initFloatingMenus as ye}from"/public/js/menu-float.js?v=20260829-float-panel";import{enhancePickerFields as Q,markInvalidFields as Z,showValidationPopup as ee}from"/public/js/forms.js?v=20261109-form-embed";import{buildWizardSteps as ve}from"/public/js/form-steps.mjs";import{mountMotionControl as be}from"/public/js/motion-control.mjs?v=20261031-launchers";import{applyFormClasses as te,applyFormEntrance as oe,applySubmitButtons as we,applyWizardButtons as Ce}from"/public/js/form-submit.mjs";import{captureFileFields as ne,destroyDropzones as Se,fileBlueprint as xe,restoreFileFields as ke,setFileLimits as Le,splitFiles as $e,submitBody as Ee,totalTooLarge as Ae,wireFileFields as Te}from"/public/js/form-files.mjs";document.addEventListener("click",l=>{const i=l.target?.closest?.(".dm-banner__dismiss");i&&(l.preventDefault(),i.closest(".dm-banner")?.remove())}),$(()=>{re(document);const l=window.__CMS_NAV__||{},i=window.__CMS_SITE__||{},D=i.brandingEnabled!==!1&&l.brand?.enabled!==!1;if(i.autoTheme?.enabled){let o=function(r){const m=(r||"07:00").split(":");return+m[0]*60+(+m[1]||0)},e=function(){const r=new Date,m=r.getHours()*60+r.getMinutes();return m>=o(a.dayStart)&&m<o(a.nightStart)?a.dayTheme:a.nightTheme},t=function(r){const m=a.apply&&a.apply[r]||{theme:r,custom:""};Domma.theme.set(m.theme);for(const n of[...document.body.classList])n.startsWith("dm-custom-")&&document.body.classList.remove(n);m.custom&&document.body.classList.add(m.custom)};const a=i.autoTheme;t(e()),setInterval(()=>t(e()),6e4)}const L=$("#site-navbar");if(L.length&&l.brand){let e=function(u,f=0){return Array.isArray(u)?u.filter(h=>!(h&&(h.type==="spacer"||h.type==="theme-switcher"))).filter(h=>!(h&&h.type==="separator"&&f===0)).map(h=>h&&h.type==="separator"?{divider:!0}:Array.isArray(h?.items)?{...h,items:e(h.items,f+1)}:h):u};const a={...l.brand},o=a.size&&a.size!=="md"?` navbar-brand-${a.size}`:"";if(a.logo||a.icon||a.tagline){let u="";a.logo?u+=`<img src="${a.logo}" class="navbar-brand-logo" alt="${a.text||""}">`:a.icon&&(u+=`<span data-icon="${a.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`),a.text&&(u+=`<span class="navbar-brand-text${o}">${a.text}</span>`),a.tagline&&(u+=`<small class="navbar-brand-tagline">${a.tagline}</small>`),a.html=u}else o&&a.text&&(a.html=`<span class="navbar-brand-text${o}">${a.text}</span>`);const t=e(l.items||[]),r=l.position==="floating",m=l.orientation==="vertical";L.get(0).querySelector(":scope > .cms-nojs-links")?.remove(),Domma.elements.navbar("#site-navbar",{brand:D?a:null,items:t,variant:l.variant||"dark",position:r?"static":l.position||"sticky",collapsible:!0,appearOnHover:!!l.appearOnHover}),Domma.icons.scan("#site-navbar");const n=L.get(0);ae(n,l.mobile);const y=()=>{if(!m)return;const f=n.querySelector('a[aria-current="page"]')?.closest(".navbar-dropdown");f&&!f.classList.contains("open")&&f.querySelector(":scope > .navbar-dropdown-toggle")?.click()};n.classList.add(`dm-nav-align-${ue(l)||"centre"}`),m&&L.get(0).classList.add("dm-nav-vertical",l.side==="right"?"dm-nav-vertical-right":"dm-nav-vertical-left");const g=l.dock||{};m&&!r&&qe(n,l.side==="right"),!m&&g.hideOnScroll&&Me(n),Y(n,l),J(n,l),P(n,l.class),r&&(le(L.get(0),l),ye(L.get(0).parentNode||document));const d=n.querySelector(".navbar-toggle"),b=n.querySelector(".navbar-collapse");if(d&&b){let u=null;const f=()=>{b.classList.contains("show")&&d.click()},h=()=>{u&&(u.remove(),u=null),document.body.classList.remove("dm-drawer-open")},p=()=>{u||(u=document.createElement("div"),u.className="dm-navbar-backdrop",u.addEventListener("click",f),document.body.appendChild(u),document.body.classList.add("dm-drawer-open"))};d.addEventListener("click",()=>{requestAnimationFrame(()=>{b.classList.contains("show")?(y(),p()):h()})}),b.addEventListener("click",x=>{x.target.closest("a")&&requestAnimationFrame(h)}),document.addEventListener("keydown",x=>{x.key==="Escape"&&b.classList.contains("show")&&f()})}const w=n.querySelector(".navbar-nav");if(w){const u=Array.from(w.children);let f=0;for(const h of l.items||[])if(!(h&&h.type==="separator")){if(h&&h.type==="spacer"){const p=document.createElement("li"),x=["xs","sm","md","lg","xl","flex"].includes(h.size)?h.size:"md";p.className=`dm-menu-spacer dm-menu-spacer--${x}`,p.setAttribute("aria-hidden","true"),w.insertBefore(p,u[f]||null);continue}if(h&&h.type==="theme-switcher"){const p=document.createElement("li");p.className="dm-menu-theme-switcher";const x=document.createElement("span");x.dataset.themeSwitcher="menu",x.dataset.position="inline",p.appendChild(x),w.insertBefore(p,u[f]||null);continue}f++}window.CMSThemeSwitcher?.scan(w)}n.querySelectorAll("[data-path]").forEach(u=>{const f=u.dataset.path.split(".").map(Number),h=f.length>1,p=f.reduce((M,I)=>M?.items?.[I],{items:t});if(!p)return;p.colour&&G(u,p.colour),p.pill&&!h&&ce(u,p.pill),de(u,p),P(u.closest("li"),p.class);const x=U(p.badge);x&&u.appendChild(x),K(p.url,location.pathname)&&(u.classList.add("active"),u.setAttribute("aria-current","page"))}),pe(n,l,t),y()}let z=null;const C=$("#site-footer");if(C.length){let r=function(c){return String(c??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},m=function(c){return r(c).replace(/'/g,"&#39;")},n=function(c){if(c&&c.type==="separator")return'<li class="footer-sep"><hr></li>';if(c&&c.type==="spacer")return`<li class="dm-menu-spacer dm-menu-spacer--${["xs","sm","md","lg","xl","flex"].includes(c.size)?c.size:"md"}" aria-hidden="true"></li>`;if(c&&c.type==="theme-switcher")return'<li class="dm-menu-theme-switcher"><span data-theme-switcher="menu" data-position="inline"></span></li>';const v=m(c.url||"#"),k=r(c.text||""),q=Array.isArray(c.items)&&c.items.length?`<ul>${c.items.map(n).join("")}</ul>`:"",N=me(c),j=[N.hover&&` data-menu-item-hover="${m(N.hover)}"`,N.active&&` data-menu-item-active="${m(N.active)}"`].filter(Boolean).join(""),W=N.accent?` style="--dm-menu-highlight:${m(N.accent)}"`:"",B=X(c.class).join(" ");return`<li${B?` class="${m(B)}"`:""}><a href="${v}"${j}${W}>${k}</a>${q}</li>`},g=function(){if(!i.footer)return"";const c=Object.keys(o).filter(k=>a[k]);if(!c.length)return"";const v=X(i.footer.socialClass).join(" ");return`<div class="footer-social">${c.map(k=>{const{label:q,svg:N}=o[k];return`<a href="${a[k]}" target="_blank" rel="noopener noreferrer" aria-label="${q}" class="footer-social-link${v?` ${m(v)}`:""}">${N}</a>`}).join("")}</div>`},u=function(c){if(!c||c.type==="separator"||c.type==="spacer")return"";if(c.type==="theme-switcher")return`<li class="cms-footer-col">${n(c).replace(/^<li[^>]*>|<\/li>$/g,"")}</li>`;const v=Array.isArray(c.items)&&c.items.length?`<ul>${c.items.map(n).join("")}</ul>`:"",k=w(c)?`<span class="cms-footer-col-title">${r(c.text||"")}</span>`:`<a class="cms-footer-col-title" href="${m(c.url||"#")}">${r(c.text||"")}</a>`,q=["cms-footer-col",...X(c.class)].join(" ");return`<li class="${m(q)}">${k}${v}</li>`},p=function(c,v,k=!1){return(c||[]).forEach(q=>{q&&(q.type==="separator"||q.type==="spacer"||q.type==="theme-switcher")||(k&&w(q)||v.push(q),Array.isArray(q.items)&&q.items.length&&p(q.items,v))}),v};const a=i.social||{},o={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let e='<div class="footer-inner container">';const t=window.__CMS_FOOTER__||{primary:[],legal:[],copyright:""},y=(()=>{const c=i.cookieConsent;if(!c||c.showSettingsLink===!1)return"";const v=k=>(k||[]).some(q=>q&&(q.url==="#cookie-settings"||v(q.items)));return v(t.primary)||v(t.legal)?"":`<li class="cms-cookie-settings"><a href="#cookie-settings">${r(c.settingsLinkText||"Cookie settings")}</a></li>`})(),d=["columns","row"].includes(i.footer?.layout)?i.footer.layout:"auto",b=i.footer?.look==="showcase"||d==="columns"||d==="auto"&&t.primary.some(c=>Array.isArray(c?.items)&&c.items.length),w=c=>b&&!c.url&&Array.isArray(c.items)&&c.items.length>0;if(b){const c=l.brand||{},v=D&&(c.text||i.title)||"",k=D?c.logo?`<img src="${m(c.logo)}" class="cms-footer-brand-logo" alt="">`:c.icon?'<span class="cms-footer-brand-icon"></span>':"":"",q=String(i.footer?.blurb||"").trim();e='<div class="footer-inner footer-inner--columns container"><div class="cms-footer-top">',e+=`<div class="cms-footer-brand">${v||k?`<a class="cms-footer-brand-name" href="${m(c.url||"/")}">${k}<span>${r(v)}</span></a>`:""}${q?`<p class="cms-footer-blurb">${r(q)}</p>`:""}${g()}</div>`,t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary footer-nav--columns" aria-label="Footer"><ul>${t.primary.map(u).join("")}</ul></nav>`),e+='</div><div class="cms-footer-bottom">',t.copyright&&(e+=`<p class="cms-footer-copyright">${r(t.copyright)}</p>`),(t.legal.length||y)&&(e+=`<nav class="footer-nav footer-nav--legal" aria-label="Legal"><ul>${t.legal.map(n).join("")}${y}</ul></nav>`),e+="</div>"}else t.copyright&&(e+=`<p>${r(t.copyright)}</p>`),t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary"><ul>${t.primary.map(n).join("")}</ul></nav>`),(t.legal.length||y)&&(e+=`<nav class="footer-nav footer-nav--legal"><ul>${t.legal.map(n).join("")}${y}</ul></nav>`),e+=g();e+="</div>",C.get(0).querySelector(":scope > .cms-nojs-links")?.remove();const f=C.get(0).querySelector(":scope > .cms-footer-blocks");f?.remove(),C.html(e),f&&C.get(0).prepend(f),window.CMSThemeSwitcher?.scan(C.get(0));const h=C.get(0).querySelector(".cms-footer-brand-icon");h&&l.brand?.icon&&h.setAttribute("data-icon",l.brand.icon),P(C.get(0),i.footer?.class),b&&ge(C.get(0),i);const x=[...p(t.primary,[],!0),...p(t.legal,[])],M=C.get(0).querySelectorAll(".footer-nav a"),I=[];M.forEach((c,v)=>{const k=x[v];if(!k)return;if(I.push({a:c,item:k}),k.icon){const N=document.createElement("span");N.className="cms-footer-ic",N.setAttribute("data-icon",String(k.icon)),N.setAttribute("data-icon-size","15"),N.setAttribute("aria-hidden","true"),c.prepend(N)}k.colour&&G(c,k.colour);const q=U(k.badge);q&&c.appendChild(q),K(k.url,location.pathname)&&(c.classList.add("is-active"),c.setAttribute("aria-current","page"))}),Y(C.get(0).querySelector(".footer-nav--primary"),{highlight:t.primaryHighlight}),Y(C.get(0).querySelector(".footer-nav--legal"),{highlight:t.legalHighlight}),J(C.get(0).querySelector(".footer-nav--primary"),{entrance:t.primaryEntrance}),J(C.get(0).querySelector(".footer-nav--legal"),{entrance:t.legalEntrance}),P(C.get(0).querySelector(".footer-nav--primary"),t.primaryClass),P(C.get(0).querySelector(".footer-nav--legal"),t.legalClass),fe(C.get(0),t,I),z=C.get(0).querySelector(".cms-footer-bottom")||C.get(0).querySelector(".footer-inner")}be(i.motion||{enabled:i.footer?.showMotionToggle!==!1,default:i.footer?.motionDefault,placement:"footer",control:i.footer?.motionControl,label:"Reduce motion"},{footer:z,navbar:document.querySelector("#site-navbar .navbar-container")?.closest("#site-navbar")||null});const A=document.getElementById("site-sidebar");A&&De(A),Domma.icons.scan(),Domma.syntax?.scan&&Domma.syntax.scan();const s=$(".page-body");if(s.length){s.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),s.find(".tabs").each(function(){Domma.elements.tabs(this)}),s.find(".carousel").each(function(){const o={primary:"--dm-primary",secondary:"--dm-secondary",accent:"--dm-primary",text:"--dm-text",surface:"--dm-surface",background:"--dm-background",success:"--dm-success",warning:"--dm-warning",danger:"--dm-danger",info:"--dm-info"},e=g=>{const d=String(g||"").trim();return d?o[d.toLowerCase()]?`var(${o[d.toLowerCase()]})`:CSS.supports("color",d)?d:"":""},t=e(this.dataset.background),r=e(this.dataset.arrowBackground),m=e(this.dataset.arrowColor);t&&(this.style.setProperty("--dm-carousel-background",t),this.classList.add("dm-carousel-custom-background")),r&&this.style.setProperty("--dm-carousel-arrow-background",r),m&&this.style.setProperty("--dm-carousel-arrow-color",m);const n=["top","middle","bottom"].includes(this.dataset.arrowPosition)?this.dataset.arrowPosition:"middle";this.classList.add(`dm-carousel-arrows-${n}`);const y={autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide",heightMode:this.dataset.heightMode==="average"?"average":"crop"};if(this.dataset.height){const g=Number(this.dataset.height);Number.isFinite(g)&&g>0&&(y.height=g)}if(this.dataset.animationDuration){const g=parseInt(this.dataset.animationDuration,10);Number.isFinite(g)&&(y.animationDuration=g)}this.dataset.animationEasing&&(y.animationEasing=this.dataset.animationEasing),this.dataset.ctx&&(this._dmCtxSlides=Array.from(this.querySelectorAll(".carousel-slide")).map(g=>g.cloneNode(!0)),this._dmCarouselOpts=y),this._dmCarousel=Domma.elements.carousel(this,y),ie(this)}),s.find(".dm-countdown").each(function(){const o={autoStart:!0},e=String(this.dataset.format||"").trim(),t=String(this.dataset.to||"").trim(),r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),m=r?new Date(+r[1],+r[2]-1,+r[3]).getTime():t?new Date(t).getTime():NaN;Number.isFinite(m)?o.duration=Math.max(0,m-Date.now()):this.dataset.duration&&(o.duration=(parseInt(this.dataset.duration,10)||0)*1e3);const n=/^dd:/i.test(e);o.format=n?"hh:mm:ss":e||(o.duration>=36e5?"hh:mm:ss":"mm:ss");const y=this,g=b=>String(b).padStart(2,"0"),d=b=>{const w=Math.max(0,Math.floor(b/1e3)),u=y.querySelector(".dm-timer-time");u&&(u.textContent=`${g(Math.floor(w/86400))}:${g(Math.floor(w%86400/3600))}:${g(Math.floor(w%3600/60))}:${g(w%60)}`)};n&&(o.onTick=d),Domma.elements.timer(this,o),n&&d(o.duration||0)}),s.find("[data-tooltip]:not(.dm-range-slider)").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),s.find(".dm-progression").each(function(){const o=Array.from(this.querySelectorAll(".dm-progression-item")).map(r=>{const m={title:r.querySelector(".dm-progression-item-title")?.textContent?.trim()||"",description:r.querySelector(".dm-progression-item-body")?.innerHTML?.trim()||""};return r.dataset.date&&(m.date=r.dataset.date),r.dataset.status&&(m.status=r.dataset.status),r.dataset.eventIcon&&(m.icon=r.dataset.eventIcon),r.dataset.entryId&&(m._entryId=r.dataset.entryId),m}),e=this.dataset.layout==="centred"?"centered":this.dataset.layout||"vertical",t=Domma.elements.progression(this,{layout:e,theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0,allowHtml:!0,...o.length?{items:o}:{}});if((this.dataset.mode||"timeline")==="timeline"){const r={completed:{label:"Completed",icon:"check-circle",tone:"success"},planned:{label:"Planned",icon:"circle",tone:"secondary"},"in-progress":{label:"In progress",icon:"clock",tone:"primary"},blocked:{label:"Blocked",icon:"alert-circle",tone:"danger"}};this.querySelectorAll(".dm-progression-item").forEach((m,n)=>{const y=o[n];if(!y)return;const g=m.querySelector(".dm-progression-title");if(y.icon&&g){const b=document.createElement("span");b.dataset.icon=y.icon,b.style.cssText="display:inline-flex;vertical-align:middle;margin-right:.4em",b.setAttribute("aria-hidden","true"),g.prepend(b)}const d=r[y.status];if(d&&g){const b=document.createElement("span");b.className=`badge badge-${d.tone} cms-timeline-status`,b.style.cssText="display:inline-flex;align-items:center;gap:.35em;margin:.4rem 0";const w=document.createElement("span");w.dataset.icon=d.icon,w.dataset.iconSize="14",w.setAttribute("aria-hidden","true"),b.append(w,document.createTextNode(d.label)),g.after(b)}})}Domma.icons.scan(this),o.length&&(this._dmCtx={instance:t,items:o})});try{Domma.effects.reveal(".page-body .hero",{animation:"slide-up",duration:480,threshold:.06,stagger:60,once:!1})}catch{}const a=matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.classList.contains("dm-reduced-motion");document.querySelectorAll(".page-body .row[data-reveal]").forEach(o=>{const e=o.dataset.revealMode||"stagger",t=o.dataset.revealAnimation||"slide-up",r=parseInt(o.dataset.revealDuration,10)||(t.startsWith("swoosh")?700:400),m=parseInt(o.dataset.revealStagger,10)||(t.startsWith("swoosh")?90:60),n=parseInt(o.dataset.revealDelay,10)||0,y=o.dataset.revealDirection==="rtl",g=o.dataset.revealReplay==="true",d=Array.from(o.children);if(a&&t.startsWith("swoosh"))return;const b={"slide-up":"translateY(30px)","slide-down":"translateY(-30px)","slide-left":"translateX(30px)","slide-right":"translateX(-30px)",zoom:"scale(0.85)",flip:"perspective(600px) rotateX(15deg)",swoosh:"translateY(36px) scale(0.96)"},w=p=>t!=="swoosh-sides"?b[t]||"":d.length>1&&p===0?"translateX(-64px) rotate(-1.5deg)":d.length>1&&p===d.length-1?"translateX(64px) rotate(1.5deg)":"translateY(40px) scale(0.94)",u=t.startsWith("swoosh"),f=u?"cubic-bezier(.2,.8,.2,1)":"ease",h=(p,x)=>{p.style.opacity="0",p.style.transform=w(x),u&&(p.style.filter="blur(10px)")};d.forEach((p,x)=>{p.style.transition="none",h(p,x)}),o.offsetWidth,d.forEach((p,x)=>{p.style.transition=`opacity ${r}ms ${f}, transform ${r}ms ${f}`+(u?`, filter ${r}ms ${f}`:"");const M=y?d.length-1-x:x;p.style.transitionDelay=e==="stagger"?`${n+M*m}ms`:`${n}ms`}),requestAnimationFrame(()=>requestAnimationFrame(()=>{const p=new IntersectionObserver(x=>{x.forEach(M=>{if(M.isIntersecting){if(M.target.offsetWidth,M.target.style.opacity="1",M.target.style.transform="",u&&(M.target.style.filter=""),!g){p.unobserve(M.target);const I=M.target;I.addEventListener("transitionend",function c(v){v.target!==I||v.propertyName!=="opacity"||(I.removeEventListener("transitionend",c),I.style.transition="",I.style.transitionDelay="")})}}else g&&M.boundingClientRect.top>0&&h(M.target,d.indexOf(M.target))})},{threshold:.1,rootMargin:"100000px 0px 0px 0px"});d.forEach(x=>p.observe(x))}))}),he(document.querySelector(".page-body")||document),s.find(".card[data-collapsible]").each(function(){const o=this.querySelector(".card-header");o&&o.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),s.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const o=this.dataset.soTarget,e=document.getElementById(o);if(!e)return;const t=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",t.setContent(e),t.open()})})}if(typeof $.setup=="function"){const a=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(o=>{try{const e=V(o.dataset.config);Object.assign(a,e)}catch{}}),Object.keys(a).length>0){const o={};for(const[e,t]of Object.entries(a)){const r=t?.events?.click,{confirm:m,toast:n,alert:y,prompt:g,...d}=r||{};if(m||n||y||g){$(e).on("click",async function(W){if(W.preventDefault(),m&&!await E.confirm(m))return;let B=null;if(!(g&&(B=await E.prompt(g,{inputPlaceholder:d.promptPlaceholder||"",inputValue:d.promptDefault||""}),B===null))){{const O=$(d.target||this);d.toggleClass&&O.toggleClass(d.toggleClass),d.addClass&&O.addClass(d.addClass),d.removeClass&&O.removeClass(d.removeClass),B!==null&&(d.setText&&O.text(B),d.setVal&&O.val(B),d.setAttr&&O.attr(d.setAttr,B))}d.href&&se(d.href),n&&E.toast(n,{type:d.toastType||"success"}),y&&E.alert(y)}});const{target:w,toggleClass:u,addClass:f,removeClass:h,setText:p,setVal:x,setAttr:M,href:I,toastType:c,promptPlaceholder:v,promptDefault:k,...q}=d,N={...t.events};Object.keys(q).length?N.click=w?{target:w,...q}:q:delete N.click;const j={...t,events:N};Object.keys(N).length||delete j.events,Object.keys(j).length&&(o[e]=j)}else o[e]=t}$.setup(o)}}s.length&&R(s.get(0))}),window.wireCTAButtons=R;function se(l){if(!_e(l)){console.warn("[site] refused to go to",String(l).slice(0,60));return}const i=document.body?.classList.contains("dm-launcher-embed")&&window.top!==window;(i?window.top:window).location.href=l}function _e(l){const i=String(l??"").replace(/[\u0000-\u0020\u007f-\u00a0\u200b-\u200f\ufeff]/g,"").toLowerCase();return!i||i.includes("\\")||i.startsWith("//")?!1:/^(\/|#|\?|\.\.?\/)/.test(i)||/^(https?:\/\/|mailto:|tel:)/.test(i)?!0:!/^[a-z][a-z0-9+.-]*:/.test(i)}function R(l){l.querySelectorAll(".dm-cta-trigger").forEach(i=>{i.__ctaWired||(i.__ctaWired=!0,i.addEventListener("click",async()=>{const D=i.dataset.action,L=i.dataset.entry,z=i.dataset.confirm;let C=S.get("auth_token");if(!C){E.toast("Please log in to perform this action.",{type:"warning"});return}if(z&&!await E.confirm(z))return;const A=Array.from(i.childNodes).map(a=>a.cloneNode(!0));i.disabled=!0,i.textContent="Running\u2026";const s=a=>fetch(`/api/actions/${D}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(i.dataset.scope?{entryId:L,scope:i.dataset.scope}:{entryId:L})});try{let a=await s(C);if(a.status===401){const e=S.get("auth_refresh_token");if(e){const t=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(t.ok){const{token:r}=await t.json();S.set("auth_token",r),C=r,a=await s(C)}}}const o=await a.json().catch(()=>({}));if(!a.ok||o.success===!1)throw new Error(o.error||o.message||`Error ${a.status}`);E.toast(o.message||"Action completed.",{type:"success"})}catch(a){E.toast(a.message||"Action failed.",{type:"error"})}finally{i.disabled=!1,i.textContent="",A.forEach(a=>i.appendChild(a)),Domma.icons.scan(i)}}))})}(function(){const i=document.querySelectorAll('.dm-collection-hydrate[data-collection-scope="mine"]');if(!i.length)return;const D=S.get("auth_token");function L(C,A){const s=document.createElement("div");s.className="dm-collection-display dm-collection-empty";const a=document.createElement("p");if(A){a.appendChild(document.createTextNode("Please "));const o=document.createElement("a");o.href="/login",o.textContent="sign in",a.appendChild(o),a.appendChild(document.createTextNode(" to view your entries."))}else a.textContent=C;return s.appendChild(a),s}function z(C,A){const s=document.createElement("template");s.innerHTML=A||"",C.replaceWith(s.content)}i.forEach(async C=>{const A=C.dataset.collectionAttrs;if(!A)return;if(!D){C.replaceChildren(L("",!0));return}const s=a=>fetch("/api/collections/render-scope",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({attrs:A})});try{let a=D,o=await s(a);if(o.status===401){const t=S.get("auth_refresh_token");if(t){const r=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const{token:m}=await r.json();S.set("auth_token",m),a=m,o=await s(a)}}}if(!o.ok){const{error:t}=await o.json().catch(()=>({}));C.replaceChildren(L(t||"Unable to load entries.",!1));return}const{html:e}=await o.json();z(C,e),window.DommaCollectionBrowser?.hydrate&&window.DommaCollectionBrowser.hydrate(document)}catch{C.replaceChildren(L("Unable to load entries.",!1))}}),setTimeout(()=>{typeof Domma<"u"&&Domma.icons?.scan&&Domma.icons.scan(),typeof Domma<"u"&&Domma.syntax?.scan&&Domma.syntax.scan(),R(document.body)},100)})(),(function(){const i=document.querySelectorAll("[data-collection-table]");!i.length||typeof T>"u"||!T.create||i.forEach(D=>{let L;try{L=V(D.dataset.payload)}catch{return}const{columns:z,rows:C,search:A,sortable:s,exportable:a,pageSize:o,empty:e,ctaConfig:t,slug:r,exportCfg:m}=L;if(!z?.length)return;if(t){const g=z.findIndex(d=>d.key==="_cta");g!==-1&&(z[g]={key:"_cta",title:"",render:(d,b)=>{const w=document.createElement("button");if(w.className=`btn btn-${t.style||"primary"} dm-cta-trigger`,w.dataset.action=t.action||"",t.scope&&(w.dataset.scope=t.scope),w.dataset.entry=b._entryId||"",t.confirm&&(w.dataset.confirm=t.confirm),t.icon){const u=document.createElement("span");u.dataset.icon=t.icon,w.appendChild(u),w.appendChild(document.createTextNode(" "))}return w.appendChild(document.createTextNode(t.label||"Run")),w}})}const n="col-table-"+Math.random().toString(36).slice(2,7),y=document.createElement("div");y.id=n,D.replaceChildren(y),T.create("#"+n,{data:C,columns:z,search:A,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(y),D._dmTable={columns:z,rows:C,slug:r,exportCfg:m,render(g){T.create("#"+n,{data:g,columns:z,search:A,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(y)}}})})(),(function(){const i=document.querySelectorAll("[data-form-inline]");if(!i.length||typeof F>"u")return;function D(s){const a=s&&s.logic;return!!(a&&(a.visibility||a.requirement))}function L(s,a){const o={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const t=e.type==="chooser"||!!(e.variant&&["select","radio","checkbox-group"].includes(e.type)),r=e.type==="checkbox"?"boolean":e.type==="date"||e.type==="icon"||e.type==="image"?"string":t?"chooser":e.type,m={...e.formConfig||{}};m.span==="full"&&a&&(m.span=a);const n={type:r,required:D(e)?!1:e.required,label:e.label,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...e.tooltip&&{tooltip:e.tooltip},...m}};e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.min!==void 0&&(n.min=e.min),e.max!==void 0&&(n.max=e.max),t&&(e.variant&&(n.variant=e.variant),(e.multiple||e.type==="checkbox-group")&&(n.multiple=!0),e.density&&(n.density=e.density),e.columns&&(n.columns=e.columns),e.accent&&(n.accent=e.accent),e.accentStyle&&(n.accentStyle=e.accentStyle),e.glow&&(n.glow=!0),e.glowColour&&(n.glowColour=e.glowColour),e.shadow&&(n.shadow=e.shadow),e.shadowColour&&(n.shadowColour=e.shadowColour)),o[e.name]=e.type==="file"?xe(e,n):n}),o}function z(s){const a={};return(s||[]).forEach(o=>{if(!(!o.name||o.type==="page-break"||o.type==="spacer")&&(o.type==="select"||o.type==="multiselect")&&o.required){const e=(o.options||[])[0];e&&(a[o.name]=typeof e=="object"?e.value:e)}}),a}function C(s,a){(a||[]).forEach(o=>{if(o.type!=="date"||!o.name)return;const e=s.querySelector(`[name="${o.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function A(s,a,o){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=a,e.style.cssText=o?"color:var(--dm-danger);margin-top:.75rem;":"color:var(--dm-success);margin-top:.75rem;"}i.forEach(s=>{let a;try{a=V(s.dataset.formInline)}catch{return}s.querySelector(":scope > .cms-form-embed-summary")?.remove();const o=a.fields||[],e=a.settings||{},t=Number(e.columns)===3?3:2,r=e.layout||"grid",m=o.some(u=>u.type==="page-break"),n=new Map;Le(s,a.fileLimits,n),Te(s,o);const y=async u=>{if(s.dataset.triggerBlocked==="true"){const f=s._formLogicRuntime,h=f&&f.submitBlock?f.submitBlock().reasons:[];A(s,h.join(" ")||"This form cannot be submitted yet.",!0);const p=new Error("Blocked by a form trigger");throw p.formSubmitFailed=!0,p}try{const f=s.querySelector(".fb-form-honeypot"),h=f?.querySelector('input[type="text"]')||null,p=f?.querySelector('[name="_t"]')||null,x=Object.assign({},u);delete x._t,f?.dataset.hpName&&delete x[f.dataset.hpName],h!==null&&(x._hp=h.value),p!==null&&(x._t=p.value);const M=new Map(n);ne(s,M);const I=$e(x,o,M),c=Ae(s,I.files);if(c){A(s,c,!0);const k=new Error(c);throw k.formSubmitFailed=!0,k}const v=await H.post(`/api/forms/submit/${a.slug}`,I.files.size?Ee(I.values,I.files).body:I.values);if(v&&v.error){A(s,v.error,!0);const k=new Error(v.error);throw k.formSubmitFailed=!0,k}if(v?.redirect){se(v.redirect);return}for(Se(s);s.firstChild;)s.removeChild(s.firstChild);A(s,v?.message||e.successMessage||"Thank you for your submission.",!1)}catch(f){throw f.formSubmitFailed||A(s,f.message||"Submission failed. Please try again.",!0),f}},g=Date.now();function d(u){const f=u.querySelector("form");if(!f||f.querySelector(".fb-form-honeypot"))return;const h=document.createElement("div");h.className="fb-form-honeypot",h.setAttribute("aria-hidden","true");const p=document.createElement("input");p.name=f.querySelector('[name="website"]')?"_website":"website",h.dataset.hpName=p.name,p.type="text",p.tabIndex=-1,p.autocomplete="url",p.placeholder="https://",h.appendChild(p);const x=document.createElement("input");x.name="_t",x.type="hidden",x.value=g,h.appendChild(x),f.appendChild(h)}function b(u){if(!window.FormLogicEngine||!o.some(h=>h.logic||Array.isArray(h.triggers)&&h.triggers.length))return null;const f=new window.FormLogicEngine.FormLogicRuntime(a,s,u?{baseValues:u}:void 0);if(f.init(),s._formLogicRuntime=f,s._formLogicObserved)return f;if(s._formLogicObserved=!0,s.parentNode&&typeof MutationObserver<"u"){const h=new MutationObserver(function(p){for(const x of p)for(const M of x.removedNodes)if(M===s||M.nodeType===1&&M.contains&&M.contains(s)){s._formLogicRuntime&&s._formLogicRuntime.destroy(),h.disconnect();return}});h.observe(s.parentNode,{childList:!0,subtree:!1}),s._formLogicObserver=h}return f}let w=!1;if(s.addEventListener("dm-form-end",u=>{const f=u.detail?.validation;if(f&&!f.valid){Z(s,f.missing),ee(f);return}w||(w=!0,y(u.detail?.values||{}).catch(()=>{}).finally(()=>{w=!1}))}),m&&F.wizard){const u=ve(o,a.title),f=u.map(v=>({title:v.title,description:v.description,fields:L(v.fields,t)})),h=u.map(v=>v.fields);let p=0,x=null,M=null;const I=v=>{const k=window.FormLogicEngine;if(!k||!k.validateFields)return;const q=k.validateFields(s,h[p]||[]);q.valid||(v.preventDefault(),v.stopImmediatePropagation(),Z(s,q.missing),ee(q))},c=()=>{const v=h[p]||o;Ce(s,e),te(s,e,v),oe(s,e),C(s,v),Q(s,v),ke(s,n),e.honeypot!==!1&&d(s),x&&x.destroy(),x=b(M?.getStepData?M.getStepData():void 0),s.querySelectorAll(".wizard-next, .wizard-submit").forEach(k=>k.addEventListener("click",I,!0))};M=F.wizard(s,{schema:{steps:f},layout:r,columns:t,finishText:e.submitText||"Finish",onSubmit:y,onStepChange:v=>{ne(s,n),p=v,setTimeout(c,0)}}),s.addEventListener("dm-form-trigger",v=>{if(v.detail?.type!=="goto-step"||!M?.goToStep)return;const k=Number(v.detail.action.step);!Number.isFinite(k)||k<0||k>=f.length||k!==p&&M.goToStep(k)}),Promise.resolve(M).then(c)}else if(F.render){const u=F.render(s,L(o,t),z(o),{submitText:e.submitText||"Submit",layout:r,columns:t,onSubmit:y});Promise.resolve(u).then(function(){we(s,e,r),te(s,e,o),oe(s,e),C(s,o),Q(s,o),e.honeypot!==!1&&d(s),b()})}})})();function qe(l,i){const D=document.body,L=D.classList,z=new Set((D.dataset.railSite||"").split(" ").filter(Boolean)),C=()=>window.matchMedia("(min-width: 993px)").matches;l.querySelectorAll(".navbar-link, .navbar-dropdown-toggle").forEach(t=>{const r=t.textContent.trim();r&&(t.setAttribute("title",r),t.querySelector("svg, [data-icon]")||(t.dataset.initial=r.charAt(0).toUpperCase()))});const A=document.createElement("button");A.type="button",A.className="dm-nav-collapse-toggle";const s=()=>{const t=L.contains("dm-vnav-collapsed");A.setAttribute("aria-pressed",String(t)),A.setAttribute("aria-label",t?"Expand menu":"Collapse menu"),A.title=A.getAttribute("aria-label");const r=i?"chevrons-left":"chevrons-right",m=i?"chevrons-right":"chevrons-left";A.innerHTML=`<span data-icon="${t?r:m}"></span>`,window.Domma&&Domma.icons&&Domma.icons.scan(A)},a=t=>{L.toggle("dm-vnav-collapsed",t),S.set("nav_collapsed",t),s()};A.addEventListener("click",()=>a(!L.contains("dm-vnav-collapsed"))),s();const o=l.querySelector(".navbar-container")||l;o.insertBefore(A,o.firstChild?.nextSibling||null);const e=t=>{L.toggle("dm-vnav-autohide",t),L.toggle("dm-vnav-collapsible",!t&&z.has("collapsible")),t?L.remove("dm-vnav-collapsed"):z.has("collapsible")&&S.get("nav_collapsed")===!0&&L.add("dm-vnav-collapsed"),l.classList.remove("dm-nav-revealed"),s()};l.addEventListener("pointerdown",t=>{L.contains("dm-vnav-autohide")&&t.pointerType!=="mouse"&&!l.classList.contains("dm-nav-revealed")&&(l.classList.add("dm-nav-revealed"),t.preventDefault())}),document.addEventListener("pointerdown",t=>{l.contains(t.target)||l.classList.remove("dm-nav-revealed")}),window.E&&typeof E.contextMenu=="function"&&E.contextMenu(l,{items:()=>{const t=L.contains("dm-vnav-autohide"),r=L.contains("dm-vnav-collapsed"),m=S.has("nav_autohide")||S.has("nav_collapsed");return[{header:"Menu"},{label:r?"Expand menu":"Collapse to icons",icon:r?"maximize":"minimize",disabled:!C()||t||!z.has("collapsible"),action:()=>a(!r)},{label:t?"Keep on screen":"Hide when not in use",icon:t?"eye":"eye-off",disabled:!C(),action:()=>{S.set("nav_autohide",!t),e(!t)}},{type:"divider"},{label:"Reset to the site's setting",icon:"refresh",disabled:!m,action:()=>{S.remove("nav_autohide"),S.remove("nav_collapsed"),e(z.has("autohide")),L.toggle("dm-vnav-collapsed",!z.has("autohide")&&z.has("start-collapsed")),s()}}]}})}function Me(l){l.classList.add("dm-nav-scroll-hide");let i=window.scrollY,D=!1;window.addEventListener("scroll",()=>{D||(D=!0,requestAnimationFrame(()=>{D=!1;const L=window.scrollY,z=l.matches(":focus-within")||l.querySelector(".navbar-dropdown.open, .navbar-collapse.show");L>i&&L>l.offsetHeight&&!z?l.classList.add("dm-nav-scrolled-away"):L<i&&l.classList.remove("dm-nav-scrolled-away"),i=L}))},{passive:!0})}function De(l){let i={};try{i=JSON.parse(l.dataset.contents||"{}")}catch{}const D=l.closest(".site-main"),L=document.querySelector(".site-content"),z=new Set(String(i.exclude||"").split(",").map(n=>n.trim().toLowerCase()).filter(Boolean)),C=n=>!n.closest(".hero, .card, .accordion, .tabs, figure, #site-sidebar"),A=n=>(L?[...L.querySelectorAll(n)]:[]).filter(C).filter(y=>!z.has(y.textContent.trim().toLowerCase())),s=i.headings==="h2"?A("h2"):i.headings==="h3"?A("h3"):i.headings==="h2h3"?A("h2, h3"):A("h2").length?A("h2"):A("h3");if(!s.length){D?.classList.add("no-sidebar-items");return}const a=new Set([...document.querySelectorAll("[id]")].map(n=>n.id)),o=document.createElement("nav");o.className="dm-contents",o.setAttribute("aria-label",i.title||"Page contents"),i.hover&&(o.dataset.menuHover=i.hover),i.selected&&(o.dataset.menuActive=i.selected),i.accent&&o.style.setProperty("--dm-menu-highlight",i.accent.startsWith("#")?i.accent:`var(--dm-${i.accent})`),i.font&&(o.style.fontFamily=i.font),i.fontSize&&(o.style.fontSize=i.fontSize),i.fontWeight&&(o.style.fontWeight=i.fontWeight);const e=document.createElement("div");e.className="dm-contents-head";const t=document.createElement("p");t.className="dm-contents-title",t.textContent=i.title||"",e.appendChild(t),o.appendChild(e);const r=document.createElement("ol");r.className="dm-contents-list"+(i.numbered?" is-numbered":"");const m=[];for(const n of s){if(!n.id){const d=(n.textContent||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"section";let b=d;for(let w=2;a.has(b);w++)b=`${d}-${w}`;a.add(b),n.id=b}const y=document.createElement("li");y.className=`dm-contents-item dm-contents-${n.tagName.toLowerCase()}`;const g=document.createElement("a");g.href=`#${n.id}`,g.textContent=n.textContent.trim(),y.appendChild(g),r.appendChild(y),m.push([n,g])}if(o.appendChild(r),l.replaceChildren(o),i.scrollSpy!==!1&&"IntersectionObserver"in window){const n=new Map,y=()=>{const d=m.find(([b])=>n.get(b))||null;m.forEach(([,b])=>{const w=d&&b===d[1];b.classList.toggle("is-active",!!w),w?b.setAttribute("aria-current","location"):b.removeAttribute("aria-current")})},g=new IntersectionObserver(d=>{d.forEach(b=>n.set(b.target,b.isIntersecting)),y()},{rootMargin:"-80px 0px -60% 0px"});m.forEach(([d])=>g.observe(d))}if(D?.classList.contains("contents-collapsible")){const n=document.createElement("button");n.type="button",n.className="dm-contents-toggle";const y=()=>{const g=D.classList.contains("contents-collapsed");n.setAttribute("aria-expanded",String(!g)),n.setAttribute("aria-label",g?"Show the contents":"Hide the contents"),n.title=n.getAttribute("aria-label"),n.innerHTML=`<span data-icon="${g?"list":"x"}"></span>`,window.Domma?.icons&&Domma.icons.scan(n)};n.addEventListener("click",()=>{S.set("contents_collapsed",D.classList.toggle("contents-collapsed")),y()}),y(),e.insertBefore(n,e.firstChild)}if(D?.classList.contains("contents-floating")&&i.movable){o.classList.add("is-movable");const n=S.get("contents_position");n&&Number.isFinite(n.x)&&Object.assign(l.style,{left:`${n.x}px`,top:`${n.y}px`,right:"auto",bottom:"auto"}),e.addEventListener("pointerdown",y=>{if(y.target.closest("button"))return;const g=l.getBoundingClientRect(),d=y.clientX-g.left,b=y.clientY-g.top,w=f=>{const h=Math.max(0,Math.min(window.innerWidth-g.width,f.clientX-d)),p=Math.max(0,Math.min(window.innerHeight-40,f.clientY-b));Object.assign(l.style,{left:`${h}px`,top:`${p}px`,right:"auto",bottom:"auto"})},u=()=>{document.removeEventListener("pointermove",w),S.set("contents_position",{x:parseInt(l.style.left,10),y:parseInt(l.style.top,10)})};document.addEventListener("pointermove",w),document.addEventListener("pointerup",u,{once:!0})})}window.E&&typeof E.contextMenu=="function"&&E.contextMenu(l,{items:()=>{const n=D?.classList.contains("contents-collapsible"),y=D?.classList.contains("contents-collapsed"),g=m.find(([,d])=>d.classList.contains("is-active"));return[{header:"Contents"},...n?[{label:y?"Show the contents":"Collapse to a button",icon:y?"list":"minimize",action:()=>l.querySelector(".dm-contents-toggle")?.click()}]:[],{label:"Copy a link to this section",icon:"link",disabled:!g,action:async()=>{const d=`${location.origin}${location.pathname}#${g[0].id}`;try{await _.copyToClipboard(d),E.toast("Link copied.",{type:"success"})}catch{E.toast("Could not copy the link.",{type:"error"})}}},{label:"Back to the top",icon:"arrow-up",action:()=>window.scrollTo({top:0,behavior:"smooth"})}]}}),D?.classList.contains("contents-autohide")&&(l.addEventListener("pointerdown",n=>{n.pointerType!=="mouse"&&!l.classList.contains("is-revealed")&&(l.classList.add("is-revealed"),n.preventDefault())}),document.addEventListener("pointerdown",n=>{l.contains(n.target)||l.classList.remove("is-revealed")}))}
1
+ import{applyMobileMenu as ae,initCarouselPopup as ie}from"/public/js/mobile-ui.mjs?v=20261016-mobile-options";import{installSmoothCarets as re}from"/public/js/smooth-caret.js";import{decodeBase64Json as V}from"/public/js/utf8-base64.mjs";import{makeBadgeEl as U,applyColour as G,applyPill as ce,applyFloat as le,applyHighlight as Y,applyItemHighlight as de,itemHighlightAttrs as me,currentItems as K,menuAlign as ue,applyClasses as P,cssClasses as X,applyEntrance as J}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{applyMenuLook as pe,applyFooterLook as fe}from"/public/js/menu-cards.mjs?v=20261109-current-query";import{initPageMotion as he}from"/public/js/page-motion.mjs?v=20261029-page-motion";import{applyFooterShowcase as ge}from"/public/js/footer-showcase.mjs?v=20261029-footer-showcase";import{initFloatingMenus as ye}from"/public/js/menu-float.js?v=20260829-float-panel";import{enhancePickerFields as Q,markInvalidFields as Z,showValidationPopup as ee}from"/public/js/forms.js?v=20261109-form-embed";import{buildWizardSteps as ve}from"/public/js/form-steps.mjs";import{mountMotionControl as be}from"/public/js/motion-control.mjs?v=20261031-launchers";import{applyFormClasses as te,applyFormEntrance as oe,applySubmitButtons as we,applyWizardButtons as Ce}from"/public/js/form-submit.mjs";import{captureFileFields as ne,destroyDropzones as Se,fileBlueprint as xe,restoreFileFields as ke,setFileLimits as Le,splitFiles as $e,submitBody as Ee,totalTooLarge as Ae,wireFileFields as Te}from"/public/js/form-files.mjs";document.addEventListener("click",d=>{const r=d.target?.closest?.(".dm-banner__dismiss");r&&(d.preventDefault(),r.closest(".dm-banner")?.remove())}),$(()=>{re(document);const d=window.__CMS_NAV__||{},r=window.__CMS_SITE__||{},M=r.brandingEnabled!==!1&&d.brand?.enabled!==!1;if(r.autoTheme?.enabled){let o=function(c){const p=(c||"07:00").split(":");return+p[0]*60+(+p[1]||0)},e=function(){const c=new Date,p=c.getHours()*60+c.getMinutes();return p>=o(a.dayStart)&&p<o(a.nightStart)?a.dayTheme:a.nightTheme},t=function(c){const p=a.apply&&a.apply[c]||{theme:c,custom:""};Domma.theme.set(p.theme);for(const n of[...document.body.classList])n.startsWith("dm-custom-")&&document.body.classList.remove(n);p.custom&&document.body.classList.add(p.custom)};const a=r.autoTheme;t(e()),setInterval(()=>t(e()),6e4)}const x=$("#site-navbar");if(x.length&&d.brand){let e=function(l,v=0){return Array.isArray(l)?l.filter(m=>!(m&&(m.type==="spacer"||m.type==="theme-switcher"))).filter(m=>!(m&&m.type==="separator"&&v===0)).map(m=>m&&m.type==="separator"?{divider:!0}:Array.isArray(m?.items)?{...m,items:e(m.items,v+1)}:m):l};const a={...d.brand},o=a.size&&a.size!=="md"?` navbar-brand-${a.size}`:"";if(a.logo||a.icon||a.tagline){let l="";a.logo?l+=`<img src="${a.logo}" class="navbar-brand-logo" alt="${a.text||""}">`:a.icon&&(l+=`<span data-icon="${a.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`),a.text&&(l+=`<span class="navbar-brand-text${o}">${a.text}</span>`),a.tagline&&(l+=`<small class="navbar-brand-tagline">${a.tagline}</small>`),a.html=l}else o&&a.text&&(a.html=`<span class="navbar-brand-text${o}">${a.text}</span>`);const t=e(d.items||[]),c=d.position==="floating",p=d.orientation==="vertical";x.get(0).querySelector(":scope > .cms-nojs-links")?.remove(),Domma.elements.navbar("#site-navbar",{brand:M?a:null,items:t,variant:d.variant||"dark",position:c?"static":d.position||"sticky",collapsible:!0,appearOnHover:!!d.appearOnHover}),Domma.icons.scan("#site-navbar");const n=x.get(0);ae(n,d.mobile);const h=()=>{if(!p)return;const v=n.querySelector('a[aria-current="page"]')?.closest(".navbar-dropdown");v&&!v.classList.contains("open")&&v.querySelector(":scope > .navbar-dropdown-toggle")?.click()};n.classList.add(`dm-nav-align-${ue(d)||"centre"}`),p&&x.get(0).classList.add("dm-nav-vertical",d.side==="right"?"dm-nav-vertical-right":"dm-nav-vertical-left");const f=d.dock||{};p&&!c&&qe(n,d.side==="right"),!p&&f.hideOnScroll&&Me(n),Y(n,d),J(n,d),P(n,d.class),c&&(le(x.get(0),d),ye(x.get(0).parentNode||document));const u=n.querySelector(".navbar-toggle"),y=n.querySelector(".navbar-collapse");if(u&&y){let l=null;const v=()=>{y.classList.contains("show")&&u.click()},m=()=>{l&&(l.remove(),l=null),document.body.classList.remove("dm-drawer-open")},g=()=>{l||(l=document.createElement("div"),l.className="dm-navbar-backdrop",l.addEventListener("click",v),document.body.appendChild(l),document.body.classList.add("dm-drawer-open"))};u.addEventListener("click",()=>{requestAnimationFrame(()=>{y.classList.contains("show")?(h(),g()):m()})}),y.addEventListener("click",C=>{C.target.closest("a")&&requestAnimationFrame(m)}),document.addEventListener("keydown",C=>{C.key==="Escape"&&y.classList.contains("show")&&v()})}const b=n.querySelector(".navbar-nav");if(b){const l=Array.from(b.children);let v=0;for(const m of d.items||[])if(!(m&&m.type==="separator")){if(m&&m.type==="spacer"){const g=document.createElement("li"),C=["xs","sm","md","lg","xl","flex"].includes(m.size)?m.size:"md";g.className=`dm-menu-spacer dm-menu-spacer--${C}`,g.setAttribute("aria-hidden","true"),b.insertBefore(g,l[v]||null);continue}if(m&&m.type==="theme-switcher"){const g=document.createElement("li");g.className="dm-menu-theme-switcher";const C=document.createElement("span");C.dataset.themeSwitcher="menu",C.dataset.position="inline",g.appendChild(C),b.insertBefore(g,l[v]||null);continue}v++}window.CMSThemeSwitcher?.scan(b)}const A=K(t,location.pathname+location.search);n.querySelectorAll("[data-path]").forEach(l=>{const v=l.dataset.path.split(".").map(Number),m=v.length>1,g=v.reduce((I,B)=>I?.items?.[B],{items:t});if(!g)return;g.colour&&G(l,g.colour),g.pill&&!m&&ce(l,g.pill),de(l,g),P(l.closest("li"),g.class);const C=U(g.badge);C&&l.appendChild(C),A.has(g)&&(l.classList.add("active"),l.setAttribute("aria-current","page"))}),pe(n,d,t),h()}let z=null;const w=$("#site-footer");if(w.length){let c=function(i){return String(i??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},p=function(i){return c(i).replace(/'/g,"&#39;")},n=function(i){if(i&&i.type==="separator")return'<li class="footer-sep"><hr></li>';if(i&&i.type==="spacer")return`<li class="dm-menu-spacer dm-menu-spacer--${["xs","sm","md","lg","xl","flex"].includes(i.size)?i.size:"md"}" aria-hidden="true"></li>`;if(i&&i.type==="theme-switcher")return'<li class="dm-menu-theme-switcher"><span data-theme-switcher="menu" data-position="inline"></span></li>';const L=p(i.url||"#"),q=c(i.text||""),D=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",N=me(i),W=[N.hover&&` data-menu-item-hover="${p(N.hover)}"`,N.active&&` data-menu-item-active="${p(N.active)}"`].filter(Boolean).join(""),j=N.accent?` style="--dm-menu-highlight:${p(N.accent)}"`:"",O=X(i.class).join(" ");return`<li${O?` class="${p(O)}"`:""}><a href="${L}"${W}${j}>${q}</a>${D}</li>`},f=function(){if(!r.footer)return"";const i=Object.keys(o).filter(q=>a[q]);if(!i.length)return"";const L=X(r.footer.socialClass).join(" ");return`<div class="footer-social">${i.map(q=>{const{label:D,svg:N}=o[q];return`<a href="${a[q]}" target="_blank" rel="noopener noreferrer" aria-label="${D}" class="footer-social-link${L?` ${p(L)}`:""}">${N}</a>`}).join("")}</div>`},A=function(i){if(!i||i.type==="separator"||i.type==="spacer")return"";if(i.type==="theme-switcher")return`<li class="cms-footer-col">${n(i).replace(/^<li[^>]*>|<\/li>$/g,"")}</li>`;const L=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",q=b(i)?`<span class="cms-footer-col-title">${c(i.text||"")}</span>`:`<a class="cms-footer-col-title" href="${p(i.url||"#")}">${c(i.text||"")}</a>`,D=["cms-footer-col",...X(i.class)].join(" ");return`<li class="${p(D)}">${q}${L}</li>`},m=function(i,L,q=!1){return(i||[]).forEach(D=>{D&&(D.type==="separator"||D.type==="spacer"||D.type==="theme-switcher")||(q&&b(D)||L.push(D),Array.isArray(D.items)&&D.items.length&&m(D.items,L))}),L};const a=r.social||{},o={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let e='<div class="footer-inner container">';const t=window.__CMS_FOOTER__||{primary:[],legal:[],copyright:""},h=(()=>{const i=r.cookieConsent;if(!i||i.showSettingsLink===!1)return"";const L=q=>(q||[]).some(D=>D&&(D.url==="#cookie-settings"||L(D.items)));return L(t.primary)||L(t.legal)?"":`<li class="cms-cookie-settings"><a href="#cookie-settings">${c(i.settingsLinkText||"Cookie settings")}</a></li>`})(),u=["columns","row"].includes(r.footer?.layout)?r.footer.layout:"auto",y=r.footer?.look==="showcase"||u==="columns"||u==="auto"&&t.primary.some(i=>Array.isArray(i?.items)&&i.items.length),b=i=>y&&!i.url&&Array.isArray(i.items)&&i.items.length>0;if(y){const i=d.brand||{},L=M&&(i.text||r.title)||"",q=M?i.logo?`<img src="${p(i.logo)}" class="cms-footer-brand-logo" alt="">`:i.icon?'<span class="cms-footer-brand-icon"></span>':"":"",D=String(r.footer?.blurb||"").trim();e='<div class="footer-inner footer-inner--columns container"><div class="cms-footer-top">',e+=`<div class="cms-footer-brand">${L||q?`<a class="cms-footer-brand-name" href="${p(i.url||"/")}">${q}<span>${c(L)}</span></a>`:""}${D?`<p class="cms-footer-blurb">${c(D)}</p>`:""}${f()}</div>`,t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary footer-nav--columns" aria-label="Footer"><ul>${t.primary.map(A).join("")}</ul></nav>`),e+='</div><div class="cms-footer-bottom">',t.copyright&&(e+=`<p class="cms-footer-copyright">${c(t.copyright)}</p>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal" aria-label="Legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+="</div>"}else t.copyright&&(e+=`<p>${c(t.copyright)}</p>`),t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary"><ul>${t.primary.map(n).join("")}</ul></nav>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+=f();e+="</div>",w.get(0).querySelector(":scope > .cms-nojs-links")?.remove();const l=w.get(0).querySelector(":scope > .cms-footer-blocks");l?.remove(),w.html(e),l&&w.get(0).prepend(l),window.CMSThemeSwitcher?.scan(w.get(0));const v=w.get(0).querySelector(".cms-footer-brand-icon");v&&d.brand?.icon&&v.setAttribute("data-icon",d.brand.icon),P(w.get(0),r.footer?.class),y&&ge(w.get(0),r);const g=[...m(t.primary,[],!0),...m(t.legal,[])],C=K([...t.primary||[],...t.legal||[]],location.pathname+location.search),I=w.get(0).querySelectorAll(".footer-nav a"),B=[];I.forEach((i,L)=>{const q=g[L];if(!q)return;if(B.push({a:i,item:q}),q.icon){const N=document.createElement("span");N.className="cms-footer-ic",N.setAttribute("data-icon",String(q.icon)),N.setAttribute("data-icon-size","15"),N.setAttribute("aria-hidden","true"),i.prepend(N)}q.colour&&G(i,q.colour);const D=U(q.badge);D&&i.appendChild(D),C.has(q)&&(i.classList.add("is-active"),i.setAttribute("aria-current","page"))}),Y(w.get(0).querySelector(".footer-nav--primary"),{highlight:t.primaryHighlight}),Y(w.get(0).querySelector(".footer-nav--legal"),{highlight:t.legalHighlight}),J(w.get(0).querySelector(".footer-nav--primary"),{entrance:t.primaryEntrance}),J(w.get(0).querySelector(".footer-nav--legal"),{entrance:t.legalEntrance}),P(w.get(0).querySelector(".footer-nav--primary"),t.primaryClass),P(w.get(0).querySelector(".footer-nav--legal"),t.legalClass),fe(w.get(0),t,B),z=w.get(0).querySelector(".cms-footer-bottom")||w.get(0).querySelector(".footer-inner")}be(r.motion||{enabled:r.footer?.showMotionToggle!==!1,default:r.footer?.motionDefault,placement:"footer",control:r.footer?.motionControl,label:"Reduce motion"},{footer:z,navbar:document.querySelector("#site-navbar .navbar-container")?.closest("#site-navbar")||null});const k=document.getElementById("site-sidebar");k&&De(k),Domma.icons.scan(),Domma.syntax?.scan&&Domma.syntax.scan();const s=$(".page-body");if(s.length){s.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),s.find(".tabs").each(function(){Domma.elements.tabs(this)}),s.find(".carousel").each(function(){const o={primary:"--dm-primary",secondary:"--dm-secondary",accent:"--dm-primary",text:"--dm-text",surface:"--dm-surface",background:"--dm-background",success:"--dm-success",warning:"--dm-warning",danger:"--dm-danger",info:"--dm-info"},e=f=>{const u=String(f||"").trim();return u?o[u.toLowerCase()]?`var(${o[u.toLowerCase()]})`:CSS.supports("color",u)?u:"":""},t=e(this.dataset.background),c=e(this.dataset.arrowBackground),p=e(this.dataset.arrowColor);t&&(this.style.setProperty("--dm-carousel-background",t),this.classList.add("dm-carousel-custom-background")),c&&this.style.setProperty("--dm-carousel-arrow-background",c),p&&this.style.setProperty("--dm-carousel-arrow-color",p);const n=["top","middle","bottom"].includes(this.dataset.arrowPosition)?this.dataset.arrowPosition:"middle";this.classList.add(`dm-carousel-arrows-${n}`);const h={autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide",heightMode:this.dataset.heightMode==="average"?"average":"crop"};if(this.dataset.height){const f=Number(this.dataset.height);Number.isFinite(f)&&f>0&&(h.height=f)}if(this.dataset.animationDuration){const f=parseInt(this.dataset.animationDuration,10);Number.isFinite(f)&&(h.animationDuration=f)}this.dataset.animationEasing&&(h.animationEasing=this.dataset.animationEasing),this.dataset.ctx&&(this._dmCtxSlides=Array.from(this.querySelectorAll(".carousel-slide")).map(f=>f.cloneNode(!0)),this._dmCarouselOpts=h),this._dmCarousel=Domma.elements.carousel(this,h),ie(this)}),s.find(".dm-countdown").each(function(){const o={autoStart:!0},e=String(this.dataset.format||"").trim(),t=String(this.dataset.to||"").trim(),c=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),p=c?new Date(+c[1],+c[2]-1,+c[3]).getTime():t?new Date(t).getTime():NaN;Number.isFinite(p)?o.duration=Math.max(0,p-Date.now()):this.dataset.duration&&(o.duration=(parseInt(this.dataset.duration,10)||0)*1e3);const n=/^dd:/i.test(e);o.format=n?"hh:mm:ss":e||(o.duration>=36e5?"hh:mm:ss":"mm:ss");const h=this,f=y=>String(y).padStart(2,"0"),u=y=>{const b=Math.max(0,Math.floor(y/1e3)),A=h.querySelector(".dm-timer-time");A&&(A.textContent=`${f(Math.floor(b/86400))}:${f(Math.floor(b%86400/3600))}:${f(Math.floor(b%3600/60))}:${f(b%60)}`)};n&&(o.onTick=u),Domma.elements.timer(this,o),n&&u(o.duration||0)}),s.find("[data-tooltip]:not(.dm-range-slider)").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),s.find(".dm-progression").each(function(){const o=Array.from(this.querySelectorAll(".dm-progression-item")).map(c=>{const p={title:c.querySelector(".dm-progression-item-title")?.textContent?.trim()||"",description:c.querySelector(".dm-progression-item-body")?.innerHTML?.trim()||""};return c.dataset.date&&(p.date=c.dataset.date),c.dataset.status&&(p.status=c.dataset.status),c.dataset.eventIcon&&(p.icon=c.dataset.eventIcon),c.dataset.entryId&&(p._entryId=c.dataset.entryId),p}),e=this.dataset.layout==="centred"?"centered":this.dataset.layout||"vertical",t=Domma.elements.progression(this,{layout:e,theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0,allowHtml:!0,...o.length?{items:o}:{}});if((this.dataset.mode||"timeline")==="timeline"){const c={completed:{label:"Completed",icon:"check-circle",tone:"success"},planned:{label:"Planned",icon:"circle",tone:"secondary"},"in-progress":{label:"In progress",icon:"clock",tone:"primary"},blocked:{label:"Blocked",icon:"alert-circle",tone:"danger"}};this.querySelectorAll(".dm-progression-item").forEach((p,n)=>{const h=o[n];if(!h)return;const f=p.querySelector(".dm-progression-title");if(h.icon&&f){const y=document.createElement("span");y.dataset.icon=h.icon,y.style.cssText="display:inline-flex;vertical-align:middle;margin-right:.4em",y.setAttribute("aria-hidden","true"),f.prepend(y)}const u=c[h.status];if(u&&f){const y=document.createElement("span");y.className=`badge badge-${u.tone} cms-timeline-status`,y.style.cssText="display:inline-flex;align-items:center;gap:.35em;margin:.4rem 0";const b=document.createElement("span");b.dataset.icon=u.icon,b.dataset.iconSize="14",b.setAttribute("aria-hidden","true"),y.append(b,document.createTextNode(u.label)),f.after(y)}})}Domma.icons.scan(this),o.length&&(this._dmCtx={instance:t,items:o})});try{Domma.effects.reveal(".page-body .hero",{animation:"slide-up",duration:480,threshold:.06,stagger:60,once:!1})}catch{}const a=matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.classList.contains("dm-reduced-motion");document.querySelectorAll(".page-body .row[data-reveal]").forEach(o=>{const e=o.dataset.revealMode||"stagger",t=o.dataset.revealAnimation||"slide-up",c=parseInt(o.dataset.revealDuration,10)||(t.startsWith("swoosh")?700:400),p=parseInt(o.dataset.revealStagger,10)||(t.startsWith("swoosh")?90:60),n=parseInt(o.dataset.revealDelay,10)||0,h=o.dataset.revealDirection==="rtl",f=o.dataset.revealReplay==="true",u=Array.from(o.children);if(a&&t.startsWith("swoosh"))return;const y={"slide-up":"translateY(30px)","slide-down":"translateY(-30px)","slide-left":"translateX(30px)","slide-right":"translateX(-30px)",zoom:"scale(0.85)",flip:"perspective(600px) rotateX(15deg)",swoosh:"translateY(36px) scale(0.96)"},b=m=>t!=="swoosh-sides"?y[t]||"":u.length>1&&m===0?"translateX(-64px) rotate(-1.5deg)":u.length>1&&m===u.length-1?"translateX(64px) rotate(1.5deg)":"translateY(40px) scale(0.94)",A=t.startsWith("swoosh"),l=A?"cubic-bezier(.2,.8,.2,1)":"ease",v=(m,g)=>{m.style.opacity="0",m.style.transform=b(g),A&&(m.style.filter="blur(10px)")};u.forEach((m,g)=>{m.style.transition="none",v(m,g)}),o.offsetWidth,u.forEach((m,g)=>{m.style.transition=`opacity ${c}ms ${l}, transform ${c}ms ${l}`+(A?`, filter ${c}ms ${l}`:"");const C=h?u.length-1-g:g;m.style.transitionDelay=e==="stagger"?`${n+C*p}ms`:`${n}ms`}),requestAnimationFrame(()=>requestAnimationFrame(()=>{const m=new IntersectionObserver(g=>{g.forEach(C=>{if(C.isIntersecting){if(C.target.offsetWidth,C.target.style.opacity="1",C.target.style.transform="",A&&(C.target.style.filter=""),!f){m.unobserve(C.target);const I=C.target;I.addEventListener("transitionend",function B(i){i.target!==I||i.propertyName!=="opacity"||(I.removeEventListener("transitionend",B),I.style.transition="",I.style.transitionDelay="")})}}else f&&C.boundingClientRect.top>0&&v(C.target,u.indexOf(C.target))})},{threshold:.1,rootMargin:"100000px 0px 0px 0px"});u.forEach(g=>m.observe(g))}))}),he(document.querySelector(".page-body")||document),s.find(".card[data-collapsible]").each(function(){const o=this.querySelector(".card-header");o&&o.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),s.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const o=this.dataset.soTarget,e=document.getElementById(o);if(!e)return;const t=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",t.setContent(e),t.open()})})}if(typeof $.setup=="function"){const a=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(o=>{try{const e=V(o.dataset.config);Object.assign(a,e)}catch{}}),Object.keys(a).length>0){const o={};for(const[e,t]of Object.entries(a)){const c=t?.events?.click,{confirm:p,toast:n,alert:h,prompt:f,...u}=c||{};if(p||n||h||f){$(e).on("click",async function(W){if(W.preventDefault(),p&&!await E.confirm(p))return;let j=null;if(!(f&&(j=await E.prompt(f,{inputPlaceholder:u.promptPlaceholder||"",inputValue:u.promptDefault||""}),j===null))){{const O=$(u.target||this);u.toggleClass&&O.toggleClass(u.toggleClass),u.addClass&&O.addClass(u.addClass),u.removeClass&&O.removeClass(u.removeClass),j!==null&&(u.setText&&O.text(j),u.setVal&&O.val(j),u.setAttr&&O.attr(u.setAttr,j))}u.href&&se(u.href),n&&E.toast(n,{type:u.toastType||"success"}),h&&E.alert(h)}});const{target:b,toggleClass:A,addClass:l,removeClass:v,setText:m,setVal:g,setAttr:C,href:I,toastType:B,promptPlaceholder:i,promptDefault:L,...q}=u,D={...t.events};Object.keys(q).length?D.click=b?{target:b,...q}:q:delete D.click;const N={...t,events:D};Object.keys(D).length||delete N.events,Object.keys(N).length&&(o[e]=N)}else o[e]=t}$.setup(o)}}s.length&&R(s.get(0))}),window.wireCTAButtons=R;function se(d){if(!_e(d)){console.warn("[site] refused to go to",String(d).slice(0,60));return}const r=document.body?.classList.contains("dm-launcher-embed")&&window.top!==window;(r?window.top:window).location.href=d}function _e(d){const r=String(d??"").replace(/[\u0000-\u0020\u007f-\u00a0\u200b-\u200f\ufeff]/g,"").toLowerCase();return!r||r.includes("\\")||r.startsWith("//")?!1:/^(\/|#|\?|\.\.?\/)/.test(r)||/^(https?:\/\/|mailto:|tel:)/.test(r)?!0:!/^[a-z][a-z0-9+.-]*:/.test(r)}function R(d){d.querySelectorAll(".dm-cta-trigger").forEach(r=>{r.__ctaWired||(r.__ctaWired=!0,r.addEventListener("click",async()=>{const M=r.dataset.action,x=r.dataset.entry,z=r.dataset.confirm;let w=S.get("auth_token");if(!w){E.toast("Please log in to perform this action.",{type:"warning"});return}if(z&&!await E.confirm(z))return;const k=Array.from(r.childNodes).map(a=>a.cloneNode(!0));r.disabled=!0,r.textContent="Running\u2026";const s=a=>fetch(`/api/actions/${M}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r.dataset.scope?{entryId:x,scope:r.dataset.scope}:{entryId:x})});try{let a=await s(w);if(a.status===401){const e=S.get("auth_refresh_token");if(e){const t=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(t.ok){const{token:c}=await t.json();S.set("auth_token",c),w=c,a=await s(w)}}}const o=await a.json().catch(()=>({}));if(!a.ok||o.success===!1)throw new Error(o.error||o.message||`Error ${a.status}`);E.toast(o.message||"Action completed.",{type:"success"})}catch(a){E.toast(a.message||"Action failed.",{type:"error"})}finally{r.disabled=!1,r.textContent="",k.forEach(a=>r.appendChild(a)),Domma.icons.scan(r)}}))})}(function(){const r=document.querySelectorAll('.dm-collection-hydrate[data-collection-scope="mine"]');if(!r.length)return;const M=S.get("auth_token");function x(w,k){const s=document.createElement("div");s.className="dm-collection-display dm-collection-empty";const a=document.createElement("p");if(k){a.appendChild(document.createTextNode("Please "));const o=document.createElement("a");o.href="/login",o.textContent="sign in",a.appendChild(o),a.appendChild(document.createTextNode(" to view your entries."))}else a.textContent=w;return s.appendChild(a),s}function z(w,k){const s=document.createElement("template");s.innerHTML=k||"",w.replaceWith(s.content)}r.forEach(async w=>{const k=w.dataset.collectionAttrs;if(!k)return;if(!M){w.replaceChildren(x("",!0));return}const s=a=>fetch("/api/collections/render-scope",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({attrs:k})});try{let a=M,o=await s(a);if(o.status===401){const t=S.get("auth_refresh_token");if(t){const c=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(c.ok){const{token:p}=await c.json();S.set("auth_token",p),a=p,o=await s(a)}}}if(!o.ok){const{error:t}=await o.json().catch(()=>({}));w.replaceChildren(x(t||"Unable to load entries.",!1));return}const{html:e}=await o.json();z(w,e),window.DommaCollectionBrowser?.hydrate&&window.DommaCollectionBrowser.hydrate(document)}catch{w.replaceChildren(x("Unable to load entries.",!1))}}),setTimeout(()=>{typeof Domma<"u"&&Domma.icons?.scan&&Domma.icons.scan(),typeof Domma<"u"&&Domma.syntax?.scan&&Domma.syntax.scan(),R(document.body)},100)})(),(function(){const r=document.querySelectorAll("[data-collection-table]");!r.length||typeof T>"u"||!T.create||r.forEach(M=>{let x;try{x=V(M.dataset.payload)}catch{return}const{columns:z,rows:w,search:k,sortable:s,exportable:a,pageSize:o,empty:e,ctaConfig:t,slug:c,exportCfg:p}=x;if(!z?.length)return;if(t){const f=z.findIndex(u=>u.key==="_cta");f!==-1&&(z[f]={key:"_cta",title:"",render:(u,y)=>{const b=document.createElement("button");if(b.className=`btn btn-${t.style||"primary"} dm-cta-trigger`,b.dataset.action=t.action||"",t.scope&&(b.dataset.scope=t.scope),b.dataset.entry=y._entryId||"",t.confirm&&(b.dataset.confirm=t.confirm),t.icon){const A=document.createElement("span");A.dataset.icon=t.icon,b.appendChild(A),b.appendChild(document.createTextNode(" "))}return b.appendChild(document.createTextNode(t.label||"Run")),b}})}const n="col-table-"+Math.random().toString(36).slice(2,7),h=document.createElement("div");h.id=n,M.replaceChildren(h),T.create("#"+n,{data:w,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h),M._dmTable={columns:z,rows:w,slug:c,exportCfg:p,render(f){T.create("#"+n,{data:f,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h)}}})})(),(function(){const r=document.querySelectorAll("[data-form-inline]");if(!r.length||typeof F>"u")return;function M(s){const a=s&&s.logic;return!!(a&&(a.visibility||a.requirement))}function x(s,a){const o={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const t=e.type==="chooser"||!!(e.variant&&["select","radio","checkbox-group"].includes(e.type)),c=e.type==="checkbox"?"boolean":e.type==="date"||e.type==="icon"||e.type==="image"?"string":t?"chooser":e.type,p={...e.formConfig||{}};p.span==="full"&&a&&(p.span=a);const n={type:c,required:M(e)?!1:e.required,label:e.label,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...e.tooltip&&{tooltip:e.tooltip},...p}};e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.min!==void 0&&(n.min=e.min),e.max!==void 0&&(n.max=e.max),t&&(e.variant&&(n.variant=e.variant),(e.multiple||e.type==="checkbox-group")&&(n.multiple=!0),e.density&&(n.density=e.density),e.columns&&(n.columns=e.columns),e.accent&&(n.accent=e.accent),e.accentStyle&&(n.accentStyle=e.accentStyle),e.glow&&(n.glow=!0),e.glowColour&&(n.glowColour=e.glowColour),e.shadow&&(n.shadow=e.shadow),e.shadowColour&&(n.shadowColour=e.shadowColour)),o[e.name]=e.type==="file"?xe(e,n):n}),o}function z(s){const a={};return(s||[]).forEach(o=>{if(!(!o.name||o.type==="page-break"||o.type==="spacer")&&(o.type==="select"||o.type==="multiselect")&&o.required){const e=(o.options||[])[0];e&&(a[o.name]=typeof e=="object"?e.value:e)}}),a}function w(s,a){(a||[]).forEach(o=>{if(o.type!=="date"||!o.name)return;const e=s.querySelector(`[name="${o.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function k(s,a,o){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=a,e.style.cssText=o?"color:var(--dm-danger);margin-top:.75rem;":"color:var(--dm-success);margin-top:.75rem;"}r.forEach(s=>{let a;try{a=V(s.dataset.formInline)}catch{return}s.querySelector(":scope > .cms-form-embed-summary")?.remove();const o=a.fields||[],e=a.settings||{},t=Number(e.columns)===3?3:2,c=e.layout||"grid",p=o.some(A=>A.type==="page-break"),n=new Map;Le(s,a.fileLimits,n),Te(s,o);const h=async A=>{if(s.dataset.triggerBlocked==="true"){const l=s._formLogicRuntime,v=l&&l.submitBlock?l.submitBlock().reasons:[];k(s,v.join(" ")||"This form cannot be submitted yet.",!0);const m=new Error("Blocked by a form trigger");throw m.formSubmitFailed=!0,m}try{const l=s.querySelector(".fb-form-honeypot"),v=l?.querySelector('input[type="text"]')||null,m=l?.querySelector('[name="_t"]')||null,g=Object.assign({},A);delete g._t,l?.dataset.hpName&&delete g[l.dataset.hpName],v!==null&&(g._hp=v.value),m!==null&&(g._t=m.value);const C=new Map(n);ne(s,C);const I=$e(g,o,C),B=Ae(s,I.files);if(B){k(s,B,!0);const L=new Error(B);throw L.formSubmitFailed=!0,L}const i=await H.post(`/api/forms/submit/${a.slug}`,I.files.size?Ee(I.values,I.files).body:I.values);if(i&&i.error){k(s,i.error,!0);const L=new Error(i.error);throw L.formSubmitFailed=!0,L}if(i?.redirect){se(i.redirect);return}for(Se(s);s.firstChild;)s.removeChild(s.firstChild);k(s,i?.message||e.successMessage||"Thank you for your submission.",!1)}catch(l){throw l.formSubmitFailed||k(s,l.message||"Submission failed. Please try again.",!0),l}},f=Date.now();function u(A){const l=A.querySelector("form");if(!l||l.querySelector(".fb-form-honeypot"))return;const v=document.createElement("div");v.className="fb-form-honeypot",v.setAttribute("aria-hidden","true");const m=document.createElement("input");m.name=l.querySelector('[name="website"]')?"_website":"website",v.dataset.hpName=m.name,m.type="text",m.tabIndex=-1,m.autocomplete="url",m.placeholder="https://",v.appendChild(m);const g=document.createElement("input");g.name="_t",g.type="hidden",g.value=f,v.appendChild(g),l.appendChild(v)}function y(A){if(!window.FormLogicEngine||!o.some(v=>v.logic||Array.isArray(v.triggers)&&v.triggers.length))return null;const l=new window.FormLogicEngine.FormLogicRuntime(a,s,A?{baseValues:A}:void 0);if(l.init(),s._formLogicRuntime=l,s._formLogicObserved)return l;if(s._formLogicObserved=!0,s.parentNode&&typeof MutationObserver<"u"){const v=new MutationObserver(function(m){for(const g of m)for(const C of g.removedNodes)if(C===s||C.nodeType===1&&C.contains&&C.contains(s)){s._formLogicRuntime&&s._formLogicRuntime.destroy(),v.disconnect();return}});v.observe(s.parentNode,{childList:!0,subtree:!1}),s._formLogicObserver=v}return l}let b=!1;if(s.addEventListener("dm-form-end",A=>{const l=A.detail?.validation;if(l&&!l.valid){Z(s,l.missing),ee(l);return}b||(b=!0,h(A.detail?.values||{}).catch(()=>{}).finally(()=>{b=!1}))}),p&&F.wizard){const A=ve(o,a.title),l=A.map(i=>({title:i.title,description:i.description,fields:x(i.fields,t)})),v=A.map(i=>i.fields);let m=0,g=null,C=null;const I=i=>{const L=window.FormLogicEngine;if(!L||!L.validateFields)return;const q=L.validateFields(s,v[m]||[]);q.valid||(i.preventDefault(),i.stopImmediatePropagation(),Z(s,q.missing),ee(q))},B=()=>{const i=v[m]||o;Ce(s,e),te(s,e,i),oe(s,e),w(s,i),Q(s,i),ke(s,n),e.honeypot!==!1&&u(s),g&&g.destroy(),g=y(C?.getStepData?C.getStepData():void 0),s.querySelectorAll(".wizard-next, .wizard-submit").forEach(L=>L.addEventListener("click",I,!0))};C=F.wizard(s,{schema:{steps:l},layout:c,columns:t,finishText:e.submitText||"Finish",onSubmit:h,onStepChange:i=>{ne(s,n),m=i,setTimeout(B,0)}}),s.addEventListener("dm-form-trigger",i=>{if(i.detail?.type!=="goto-step"||!C?.goToStep)return;const L=Number(i.detail.action.step);!Number.isFinite(L)||L<0||L>=l.length||L!==m&&C.goToStep(L)}),Promise.resolve(C).then(B)}else if(F.render){const A=F.render(s,x(o,t),z(o),{submitText:e.submitText||"Submit",layout:c,columns:t,onSubmit:h});Promise.resolve(A).then(function(){we(s,e,c),te(s,e,o),oe(s,e),w(s,o),Q(s,o),e.honeypot!==!1&&u(s),y()})}})})();function qe(d,r){const M=document.body,x=M.classList,z=new Set((M.dataset.railSite||"").split(" ").filter(Boolean)),w=()=>window.matchMedia("(min-width: 993px)").matches;d.querySelectorAll(".navbar-link, .navbar-dropdown-toggle").forEach(t=>{const c=t.textContent.trim();c&&(t.setAttribute("title",c),t.querySelector("svg, [data-icon]")||(t.dataset.initial=c.charAt(0).toUpperCase()))});const k=document.createElement("button");k.type="button",k.className="dm-nav-collapse-toggle";const s=()=>{const t=x.contains("dm-vnav-collapsed");k.setAttribute("aria-pressed",String(t)),k.setAttribute("aria-label",t?"Expand menu":"Collapse menu"),k.title=k.getAttribute("aria-label");const c=r?"chevrons-left":"chevrons-right",p=r?"chevrons-right":"chevrons-left";k.innerHTML=`<span data-icon="${t?c:p}"></span>`,window.Domma&&Domma.icons&&Domma.icons.scan(k)},a=t=>{x.toggle("dm-vnav-collapsed",t),S.set("nav_collapsed",t),s()};k.addEventListener("click",()=>a(!x.contains("dm-vnav-collapsed"))),s();const o=d.querySelector(".navbar-container")||d;o.insertBefore(k,o.firstChild?.nextSibling||null);const e=t=>{x.toggle("dm-vnav-autohide",t),x.toggle("dm-vnav-collapsible",!t&&z.has("collapsible")),t?x.remove("dm-vnav-collapsed"):z.has("collapsible")&&S.get("nav_collapsed")===!0&&x.add("dm-vnav-collapsed"),d.classList.remove("dm-nav-revealed"),s()};d.addEventListener("pointerdown",t=>{x.contains("dm-vnav-autohide")&&t.pointerType!=="mouse"&&!d.classList.contains("dm-nav-revealed")&&(d.classList.add("dm-nav-revealed"),t.preventDefault())}),document.addEventListener("pointerdown",t=>{d.contains(t.target)||d.classList.remove("dm-nav-revealed")}),window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const t=x.contains("dm-vnav-autohide"),c=x.contains("dm-vnav-collapsed"),p=S.has("nav_autohide")||S.has("nav_collapsed");return[{header:"Menu"},{label:c?"Expand menu":"Collapse to icons",icon:c?"maximize":"minimize",disabled:!w()||t||!z.has("collapsible"),action:()=>a(!c)},{label:t?"Keep on screen":"Hide when not in use",icon:t?"eye":"eye-off",disabled:!w(),action:()=>{S.set("nav_autohide",!t),e(!t)}},{type:"divider"},{label:"Reset to the site's setting",icon:"refresh",disabled:!p,action:()=>{S.remove("nav_autohide"),S.remove("nav_collapsed"),e(z.has("autohide")),x.toggle("dm-vnav-collapsed",!z.has("autohide")&&z.has("start-collapsed")),s()}}]}})}function Me(d){d.classList.add("dm-nav-scroll-hide");let r=window.scrollY,M=!1;window.addEventListener("scroll",()=>{M||(M=!0,requestAnimationFrame(()=>{M=!1;const x=window.scrollY,z=d.matches(":focus-within")||d.querySelector(".navbar-dropdown.open, .navbar-collapse.show");x>r&&x>d.offsetHeight&&!z?d.classList.add("dm-nav-scrolled-away"):x<r&&d.classList.remove("dm-nav-scrolled-away"),r=x}))},{passive:!0})}function De(d){let r={};try{r=JSON.parse(d.dataset.contents||"{}")}catch{}const M=d.closest(".site-main"),x=document.querySelector(".site-content"),z=new Set(String(r.exclude||"").split(",").map(n=>n.trim().toLowerCase()).filter(Boolean)),w=n=>!n.closest(".hero, .card, .accordion, .tabs, figure, #site-sidebar"),k=n=>(x?[...x.querySelectorAll(n)]:[]).filter(w).filter(h=>!z.has(h.textContent.trim().toLowerCase())),s=r.headings==="h2"?k("h2"):r.headings==="h3"?k("h3"):r.headings==="h2h3"?k("h2, h3"):k("h2").length?k("h2"):k("h3");if(!s.length){M?.classList.add("no-sidebar-items");return}const a=new Set([...document.querySelectorAll("[id]")].map(n=>n.id)),o=document.createElement("nav");o.className="dm-contents",o.setAttribute("aria-label",r.title||"Page contents"),r.hover&&(o.dataset.menuHover=r.hover),r.selected&&(o.dataset.menuActive=r.selected),r.accent&&o.style.setProperty("--dm-menu-highlight",r.accent.startsWith("#")?r.accent:`var(--dm-${r.accent})`),r.font&&(o.style.fontFamily=r.font),r.fontSize&&(o.style.fontSize=r.fontSize),r.fontWeight&&(o.style.fontWeight=r.fontWeight);const e=document.createElement("div");e.className="dm-contents-head";const t=document.createElement("p");t.className="dm-contents-title",t.textContent=r.title||"",e.appendChild(t),o.appendChild(e);const c=document.createElement("ol");c.className="dm-contents-list"+(r.numbered?" is-numbered":"");const p=[];for(const n of s){if(!n.id){const u=(n.textContent||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"section";let y=u;for(let b=2;a.has(y);b++)y=`${u}-${b}`;a.add(y),n.id=y}const h=document.createElement("li");h.className=`dm-contents-item dm-contents-${n.tagName.toLowerCase()}`;const f=document.createElement("a");f.href=`#${n.id}`,f.textContent=n.textContent.trim(),h.appendChild(f),c.appendChild(h),p.push([n,f])}if(o.appendChild(c),d.replaceChildren(o),r.scrollSpy!==!1&&"IntersectionObserver"in window){const n=new Map,h=()=>{const u=p.find(([y])=>n.get(y))||null;p.forEach(([,y])=>{const b=u&&y===u[1];y.classList.toggle("is-active",!!b),b?y.setAttribute("aria-current","location"):y.removeAttribute("aria-current")})},f=new IntersectionObserver(u=>{u.forEach(y=>n.set(y.target,y.isIntersecting)),h()},{rootMargin:"-80px 0px -60% 0px"});p.forEach(([u])=>f.observe(u))}if(M?.classList.contains("contents-collapsible")){const n=document.createElement("button");n.type="button",n.className="dm-contents-toggle";const h=()=>{const f=M.classList.contains("contents-collapsed");n.setAttribute("aria-expanded",String(!f)),n.setAttribute("aria-label",f?"Show the contents":"Hide the contents"),n.title=n.getAttribute("aria-label"),n.innerHTML=`<span data-icon="${f?"list":"x"}"></span>`,window.Domma?.icons&&Domma.icons.scan(n)};n.addEventListener("click",()=>{S.set("contents_collapsed",M.classList.toggle("contents-collapsed")),h()}),h(),e.insertBefore(n,e.firstChild)}if(M?.classList.contains("contents-floating")&&r.movable){o.classList.add("is-movable");const n=S.get("contents_position");n&&Number.isFinite(n.x)&&Object.assign(d.style,{left:`${n.x}px`,top:`${n.y}px`,right:"auto",bottom:"auto"}),e.addEventListener("pointerdown",h=>{if(h.target.closest("button"))return;const f=d.getBoundingClientRect(),u=h.clientX-f.left,y=h.clientY-f.top,b=l=>{const v=Math.max(0,Math.min(window.innerWidth-f.width,l.clientX-u)),m=Math.max(0,Math.min(window.innerHeight-40,l.clientY-y));Object.assign(d.style,{left:`${v}px`,top:`${m}px`,right:"auto",bottom:"auto"})},A=()=>{document.removeEventListener("pointermove",b),S.set("contents_position",{x:parseInt(d.style.left,10),y:parseInt(d.style.top,10)})};document.addEventListener("pointermove",b),document.addEventListener("pointerup",A,{once:!0})})}window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const n=M?.classList.contains("contents-collapsible"),h=M?.classList.contains("contents-collapsed"),f=p.find(([,u])=>u.classList.contains("is-active"));return[{header:"Contents"},...n?[{label:h?"Show the contents":"Collapse to a button",icon:h?"list":"minimize",action:()=>d.querySelector(".dm-contents-toggle")?.click()}]:[],{label:"Copy a link to this section",icon:"link",disabled:!f,action:async()=>{const u=`${location.origin}${location.pathname}#${f[0].id}`;try{await _.copyToClipboard(u),E.toast("Link copied.",{type:"success"})}catch{E.toast("Could not copy the link.",{type:"error"})}}},{label:"Back to the top",icon:"arrow-up",action:()=>window.scrollTo({top:0,behavior:"smooth"})}]}}),M?.classList.contains("contents-autohide")&&(d.addEventListener("pointerdown",n=>{n.pointerType!=="mouse"&&!d.classList.contains("is-revealed")&&(d.classList.add("is-revealed"),n.preventDefault())}),document.addEventListener("pointerdown",n=>{d.contains(n.target)||d.classList.remove("is-revealed")}))}
@@ -14,7 +14,7 @@ import {colourToCss, floatToCss, floatBehaviour, spacerSize} from './menus.js';
14
14
  // Highlight helpers live once, in the browser module, and are imported here -
15
15
  // the same shared-module arrangement collection-export.mjs has with
16
16
  // collections.js. Nothing in them touches the DOM.
17
- import {highlightAttrs, itemHighlightAttrs, isCurrentItem, menuAlign, cssClasses, entranceAttrs, entranceStyle} from '../../public/js/menu-decor.mjs';
17
+ import {highlightAttrs, itemHighlightAttrs, currentItems, menuAlign, cssClasses, entranceAttrs, entranceStyle} from '../../public/js/menu-decor.mjs';
18
18
 
19
19
  /** Attribute-safe escaping - mirrors escapeAttr in markdown.js. */
20
20
  function esc(str) {
@@ -36,9 +36,11 @@ function esc(str) {
36
36
  * @param {string} [currentPath] The URL path being rendered. Items pointing at
37
37
  * it are marked `is-active` + `aria-current` so a `highlight.active` effect
38
38
  * has something to style. Omitted (the default) marks nothing.
39
+ * @param {Set<object>} [current] The current items (currentItems()), worked out
40
+ * once over the whole menu so a nested call agrees with its parent.
39
41
  * @returns {string}
40
42
  */
41
- export function renderMenuItemsAsUl(items, currentPath = '') {
43
+ export function renderMenuItemsAsUl(items, currentPath = '', current = currentItems(items, currentPath)) {
42
44
  if (!items || !items.length) return '';
43
45
  const lis = items.map(it => {
44
46
  if (it && it.type === 'separator') return '<li class="dm-menu-sep" role="separator"><hr></li>';
@@ -53,13 +55,12 @@ export function renderMenuItemsAsUl(items, currentPath = '') {
53
55
  }
54
56
  const href = esc(it.url || '#');
55
57
  const text = esc(it.text || '');
56
- const child = Array.isArray(it.items) && it.items.length ? renderMenuItemsAsUl(it.items, currentPath) : '';
58
+ const child = Array.isArray(it.items) && it.items.length ? renderMenuItemsAsUl(it.items, currentPath, current) : '';
57
59
 
58
60
  // The item for the page we are on. Both markers are emitted because
59
61
  // sanitize-html keeps the class on every path while the aria attribute
60
62
  // needs an explicit allowlist entry.
61
- const current = isCurrentItem(it.url, currentPath);
62
- const classAttr = current ? ' class="is-active" aria-current="page"' : '';
63
+ const classAttr = current.has(it) ? ' class="is-active" aria-current="page"' : '';
63
64
  // The designer's own classes go on the <li>, so they can lay the item
64
65
  // out (push it right, size it) as well as style its link.
65
66
  const liClasses = cssClasses(it.class);
@@ -188,7 +188,7 @@
188
188
  <script src="/public/js/form-logic-engine.js?v=20261031-forms-reduce-motion" defer></script>
189
189
 
190
190
  <!-- Site initialisation -->
191
- <script src="/public/js/site.js?v=20261109-form-embed" type="module"></script>
191
+ <script src="/public/js/site.js?v=20261109-current-query" type="module"></script>
192
192
  <script src="/public/js/collection-context.js?v=20261010-utf8-payloads" type="module"></script>
193
193
  {{ctxMenusModule}}
194
194
  <!-- [image zoom] pictures' full-size view - only on a page that has one -->