contour-ds 1.7.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +244 -326
  2. package/dist/agent-cookbook.json +960 -0
  3. package/dist/agent-examples.json +65 -0
  4. package/dist/agent-map-wiring.json +152 -0
  5. package/dist/agent-rules.json +16 -0
  6. package/dist/build-manifest.json +344 -126
  7. package/dist/contour-wc-content.esm.js +1939 -0
  8. package/dist/contour-wc-content.esm.min.js +1 -0
  9. package/dist/contour-wc-core.esm.js +3724 -0
  10. package/dist/contour-wc-core.esm.min.js +1 -0
  11. package/dist/contour-wc-dashboard.esm.js +6986 -0
  12. package/dist/contour-wc-dashboard.esm.min.js +1 -0
  13. package/dist/contour-wc-data.esm.js +6572 -0
  14. package/dist/contour-wc-data.esm.min.js +1 -0
  15. package/dist/contour-wc-docs.esm.js +976 -0
  16. package/dist/contour-wc-docs.esm.min.js +1 -0
  17. package/dist/contour-wc-feedback.esm.js +1742 -0
  18. package/dist/contour-wc-feedback.esm.min.js +1 -0
  19. package/dist/contour-wc-forms.esm.js +2437 -0
  20. package/dist/contour-wc-forms.esm.min.js +1 -0
  21. package/dist/contour-wc-interaction.esm.js +1343 -0
  22. package/dist/contour-wc-interaction.esm.min.js +1 -0
  23. package/dist/contour-wc-layout.esm.js +845 -0
  24. package/dist/contour-wc-layout.esm.min.js +1 -0
  25. package/dist/contour-wc-map.esm.js +2411 -0
  26. package/dist/contour-wc-map.esm.min.js +1 -0
  27. package/dist/contour-wc-misc.esm.js +945 -0
  28. package/dist/contour-wc-misc.esm.min.js +1 -0
  29. package/dist/contour-wc-navigation.esm.js +2842 -0
  30. package/dist/contour-wc-navigation.esm.min.js +1 -0
  31. package/dist/contour-wc-ui.esm.js +6519 -0
  32. package/dist/contour-wc-ui.esm.min.js +1 -0
  33. package/dist/contour-wc.esm.js +14435 -5723
  34. package/dist/contour-wc.esm.min.js +1 -1
  35. package/dist/contour-wc.js +14436 -5725
  36. package/dist/contour-wc.min.js +1 -1
  37. package/dist/contour.a11y.json +402 -0
  38. package/dist/contour.code-snippets +4534 -0
  39. package/dist/contour.components.json +4870 -1222
  40. package/dist/contour.css +6672 -4711
  41. package/dist/contour.d.ts +753 -1085
  42. package/dist/contour.esm.js +440 -18
  43. package/dist/contour.esm.min.js +1 -1
  44. package/dist/contour.html-data.json +11343 -0
  45. package/dist/contour.js +440 -18
  46. package/dist/contour.min.css +1 -1
  47. package/dist/contour.min.js +1 -1
  48. package/dist/contour.react.d.ts +422 -0
  49. package/dist/contour.single.html +17 -0
  50. package/dist/contour.single.min.css +1 -0
  51. package/dist/contour.themes.json +56 -12
  52. package/dist/contour.tokens.json +1318 -1053
  53. package/dist/contour.vue.d.ts +420 -0
  54. package/dist/contour.web-types.json +11703 -0
  55. package/dist/custom-elements.json +36120 -0
  56. package/dist/docs/actions.md +16 -6
  57. package/dist/docs/affordances.md +21 -85
  58. package/dist/docs/apireference.md +9 -5
  59. package/dist/docs/colour.md +10 -4
  60. package/dist/docs/componentindex.md +9 -22
  61. package/dist/docs/data.md +39 -58
  62. package/dist/docs/docs.md +12 -7
  63. package/dist/docs/feedback.md +30 -12
  64. package/dist/docs/field.md +28 -13
  65. package/dist/docs/forms.md +35 -19
  66. package/dist/docs/index.json +70 -61
  67. package/dist/docs/install.md +12 -7
  68. package/dist/docs/landing.md +7 -4
  69. package/dist/docs/mapengine.md +30 -8
  70. package/dist/docs/motion.md +12 -6
  71. package/dist/docs/navigation.md +31 -7
  72. package/dist/docs/overlays.md +32 -25
  73. package/dist/docs/overview.md +3 -2
  74. package/dist/docs/patterns.md +20 -10
  75. package/dist/docs/playground.md +11 -4
  76. package/dist/docs/principles.md +8 -6
  77. package/dist/docs/recipes.md +117 -13
  78. package/dist/docs/space.md +10 -6
  79. package/dist/docs/status.md +13 -14
  80. package/dist/docs/surfaces.md +17 -22
  81. package/dist/docs/theming.md +18 -32
  82. package/dist/docs/type.md +12 -5
  83. package/dist/docs/webcomponents.md +75 -33
  84. package/dist/hljs.css +1 -20
  85. package/dist/map-chrome.mapbox.css +68 -92
  86. package/dist/map-chrome.maplibre.css +68 -92
  87. package/dist/registry/items/contour-core.json +2 -2
  88. package/dist/registry/items/contour-data.json +2 -2
  89. package/dist/registry/items/contour-docs.json +2 -2
  90. package/dist/registry/items/contour-landing.json +2 -2
  91. package/dist/registry/registry.json +8 -8
  92. package/dist/surfaces/contour-core.min.css +1 -1
  93. package/dist/surfaces/contour-data.min.css +1 -1
  94. package/dist/surfaces/contour-docs.min.css +1 -1
  95. package/dist/surfaces/contour-landing.min.css +1 -1
  96. package/dist/svg/icons.svg +367 -0
  97. package/dist/wc/behaviours.mjs +222 -192
  98. package/dist/wc/content.mjs +486 -142
  99. package/dist/wc/core.mjs +917 -395
  100. package/dist/wc/dashboard.mjs +252 -25
  101. package/dist/wc/data-chart.mjs +1333 -0
  102. package/dist/wc/data-export.mjs +391 -0
  103. package/dist/wc/data-gauge.mjs +779 -0
  104. package/dist/wc/data-geo.mjs +696 -0
  105. package/dist/wc/data-glyphs.mjs +133 -0
  106. package/dist/wc/data-legend.mjs +431 -0
  107. package/dist/wc/data-readout.mjs +227 -0
  108. package/dist/wc/data-series.mjs +1004 -0
  109. package/dist/wc/data-table.mjs +751 -0
  110. package/dist/wc/data.mjs +15 -3707
  111. package/dist/wc/docs.mjs +113 -19
  112. package/dist/wc/feedback.mjs +320 -116
  113. package/dist/wc/forms-controls.mjs +635 -0
  114. package/dist/wc/forms-field.mjs +547 -0
  115. package/dist/wc/forms-groups.mjs +347 -0
  116. package/dist/wc/forms-input.mjs +292 -0
  117. package/dist/wc/forms.mjs +10 -1122
  118. package/dist/wc/glyph.mjs +204 -0
  119. package/dist/wc/index.mjs +16 -7
  120. package/dist/wc/interaction.mjs +322 -75
  121. package/dist/wc/layout.mjs +100 -29
  122. package/dist/wc/map.mjs +888 -285
  123. package/dist/wc/misc.mjs +137 -26
  124. package/dist/wc/navigation-menu.mjs +735 -0
  125. package/dist/wc/navigation-shell.mjs +495 -0
  126. package/dist/wc/navigation-tree.mjs +995 -0
  127. package/dist/wc/navigation.mjs +9 -1636
  128. package/dist/wc/registration.mjs +1 -8
  129. package/dist/wc/shadow.mjs +285 -113
  130. package/dist/wc/states.mjs +75 -78
  131. package/dist/wc/svg.mjs +209 -34
  132. package/dist/wc/ui-atoms.mjs +608 -0
  133. package/dist/wc/ui-data.mjs +1404 -0
  134. package/dist/wc/ui-feedback.mjs +419 -0
  135. package/dist/wc/ui-inputs.mjs +1570 -0
  136. package/dist/wc/ui-menus.mjs +307 -0
  137. package/dist/wc/ui-overlays.mjs +1605 -0
  138. package/integrations/README.md +25 -5
  139. package/integrations/ai/CLAUDE.md +6 -3
  140. package/integrations/ai/COPILOT.md +14 -0
  141. package/integrations/ai/GEMINI.md +14 -0
  142. package/integrations/ai/WINDSURF.md +14 -0
  143. package/integrations/ai/v0-prompt.md +13 -1
  144. package/integrations/frameworks/README.md +235 -0
  145. package/integrations/native/README.md +0 -3
  146. package/integrations/native/style-dictionary.config.json +1 -1
  147. package/integrations/tailwind/contour-theme.css +71 -13
  148. package/integrations/validate-markup.mjs +172 -0
  149. package/package.json +103 -39
  150. package/dist/wc/ui.mjs +0 -3560
@@ -0,0 +1 @@
1
+ import{CLASS_ONLY,CONTOUR_EVENTS,ContourBase,MERCATOR_MAX_LAT,MODS,OBSERVED,REGISTERED,applyLabel,bearing,clampLat,contourId,cssLength,define,flagOn,flagOnValue,formatValue,haversine,headingTag,iconMarkup,isRtl,labelText,levelFromAttributes,mercatorResolution,navKey,normaliseLng,onDispose,safeColor,safeHref,sanitizeHtml,setHTML,simple,statusIcon,supportsUntilFound,unwrapBounds,warnBadJson,wcEmitOverlay,withBrownout,MARKER_SHAPES,arcPath,assignMarkers,barRects,compassNeedle,contourPaths,donutSlices,isMissing,marchingSquares,markerStyles,niceTicks,polylinePoints,scaleBarTicks,smoothPath,modalContain,wcReset,wireCombobox,wireCopy,wireMenu,wirePagination,wireRemovable,wireSegmented,wireTabs,wireTree,STATE_FALLBACK,loadRemote,parseArrayAttr,remoteData,remoteInvalidate,remoteRefresh,remoteVisible,renderEmpty,renderStates,stateLabel,watchViewport,wireStates}from"./contour-wc-core.esm.js";define("contour-box",simple(["c-box"])),define("contour-cluster",simple(["c-cluster"])),define("contour-container",simple(["c-container"])),define("contour-row",simple(["c-row"])),define("contour-scrim",simple(["c-scrim"])),define("contour-stack",simple(["c-stack"]));const assignedText=t=>{const e=t.querySelector("slot");return(e?e.assignedElements({flatten:!0}):[]).map(t=>(t.textContent||"").trim()).join(" ").trim()||(t.textContent||"").trim()};let ADOPTED=null,ADOPTED_KEY="";const _hashCss=t=>{let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return(e>>>0).toString(36)};export const adoptedSheets=()=>{let t=document.styleSheets.length+":";for(const e of document.styleSheets){let s="-1";try{const t=e.cssRules;let a="";for(let e=0;e<t.length;e++)a+=t[e].cssText+"\n";s=t.length+":"+_hashCss(a)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let a;try{a=t.cssRules}catch(t){return}if(a)for(const t of a)if(t instanceof CSSImportRule)t.styleSheet&&e(t.styleSheet,s);else try{s.push(t.cssText)}catch(t){}};for(const t of document.styleSheets)try{if(!t.href||new URL(t.href).origin===location.origin){const s=[];e(t,s);const a=new CSSStyleSheet;s.length&&a.replaceSync(s.join("\n")),ADOPTED.push(a)}}catch(t){}return ADOPTED};const _ShadowParent="undefined"!=typeof HTMLElement?HTMLElement:Object;class ContourShadow extends _ShadowParent{static get observedAttributes(){return MODS.concat("labels")}constructor(){super();let t=this.shadowRoot;t||(t=this.attachShadow({mode:"open"}),this.constructor.contourTemplate&&t.appendChild(this.constructor.contourTemplate.content.cloneNode(!0)));const e=adoptedSheets();if(e.length)try{t.adoptedStyleSheets=e}catch(t){}this._shadowBase=t.firstElementChild?t.firstElementChild.className:""}enhance(t){t||(t=this.shadowRoot),t&&(t.querySelectorAll("details").forEach(t=>{const e=t.querySelector("summary");e&&!e.hasAttribute("aria-expanded")&&(e.setAttribute("aria-expanded",String(t.open)),t.addEventListener("toggle",()=>{e.setAttribute("aria-expanded",String(t.open))}))}),t.querySelectorAll("[data-live]").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-spinner").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-toast, .c-toast-host").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite"),t.hasAttribute("aria-atomic")||t.setAttribute("aria-atomic","true")}),t.querySelectorAll("[role='tab']").forEach(e=>{const s=e.getAttribute("aria-controls");if(s){const a=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);a&&!a.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),a.setAttribute("aria-labelledby",e.id))}}),t.querySelectorAll("input, textarea, select").forEach(t=>{if(t.hasAttribute("aria-describedby"))return;const e=t.closest(".c-field");if(e){const s=e.querySelector(".c-field__hint");s&&(s.id||(s.id=contourId("hint")),t.setAttribute("aria-describedby",s.id));const a=e.querySelector(".c-field__error");if(a){a.id||(a.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+a.id).trim())}}}),t.querySelectorAll(".c-alert").forEach(t=>{const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}),t.querySelectorAll("input[required], textarea[required], select[required]").forEach(t=>{t.hasAttribute("aria-required")||t.setAttribute("aria-required","true")}),this._wireLabels(t),this._wireClose(t))}_wireClose(t){if(!t||this._wiredShadowClose)return;const e=t.querySelectorAll(".c-callout__close, .c-alert__close, .c-tag__remove, .c-filter-pill__remove");if(e.length){this._wiredShadowClose=!0;for(const t of e)t.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))})}}_wireLabels(t){t&&t.querySelectorAll("label").forEach(t=>{const e=t.querySelector("slot"),s=t.closest(".c-field")||t.parentElement,a=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&a.push(t);if(!a.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&a.push(e)}for(const e of a){if(e.id||(e.id=contourId("shadow-input")),t.hasAttribute("for")||t.setAttribute("for",e.id),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){const s=assignedText(t);s&&e.setAttribute("aria-label",s)}if(e._contourLabelWired||(e._contourLabelWired=!0,t.addEventListener("click",t=>{if(!t.target.closest("a, button, input, textarea, select"))try{e.click()}catch(t){}})),s&&!e.hasAttribute("aria-describedby")){const t=s.querySelector(".c-field__hint"),a=s.querySelector(".c-field__error"),o=[];t&&(t.id||(t.id=contourId("hint")),o.push(t.id)),a&&(a.id||(a.id=contourId("err")),o.push(a.id)),o.length&&e.setAttribute("aria-describedby",o.join(" "))}}})}connectedCallback(){this.applyMods();try{this.enhance(this.shadowRoot)}catch(t){}this._applyLabels();try{wcReset(this),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}this.shadowRoot&&!this._wiredSlotchange&&(this._wiredSlotchange=!0,this.shadowRoot.addEventListener("slotchange",()=>{try{this.enhance(this.shadowRoot),this._applyLabels(),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}}))}attributeChangedCallback(){this.applyMods(),this._applyLabels()}_applyLabels(){const t=this.shadowRoot;if(!t)return;const e=(e,s,a)=>{const o=t.querySelector(e);o&&o.setAttribute("aria-label",labelText(this,s,a))};e(".c-callout__close","close","Close"),e(".c-alert__close","close","Close"),e(".c-tag__remove","remove","Remove"),e(".c-filter-pill__remove","remove-filter","Remove filter"),e(".c-breadcrumb","breadcrumb","Breadcrumb"),e(".c-spinner","loading","Loading"),e(".c-install__copy","copy-command","Copy command");const s=t.querySelector(".c-install__copy, .c-code__copy");s&&"Copy"===s.textContent.trim()&&(s.textContent=labelText(this,"copy","Copy"))}applyMods(){const t=this.shadowRoot.firstElementChild;if(!t||!this._shadowBase)return;const e=[];for(const t of MODS){const s=this.getAttribute(t);if(s)for(const t of this._shadowBase.split(/\s+/))t&&e.push("c-"+t.replace(/^c-/,"")+"--"+s)}if(t.className=(this._shadowBase+" "+e.join(" ")).trim(),t.classList.contains("c-alert")){const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}}}const SHADOW_PARTS_PUBLIC={},SHADOW_MARKUP={},recordParts=(t,e)=>{SHADOW_PARTS_PUBLIC[t]=[...e.matchAll(/part="([^"]+)"/g)].flatMap(t=>t[1].split(/\s+/)).filter(Boolean)},shadow=(t,e)=>{if(SHADOW_MARKUP[t]=e,recordParts(t,e),"undefined"==typeof document)return;const s=document.createElement("template");setHTML(s,e);const a=class extends ContourShadow{};a.contourTemplate=s,define(t,a)},slotWrapper=(t,e,s)=>"<"+t+' class="c-'+e+'" part="'+(s||e)+'"'+("button"===t?' type="button"':"")+"><slot></slot></"+t+">",SHADOW_SLOTS={div:["accordion","activity","advanced","affordance","affordances","anchor","app","app-body","box","btn-group","chart-grid","catchment","cluster","command","compare","comparison","compass","contour-plot","cta","dash-freshness","dash-kpi-row","dash-shell","dash-toolbar","datamark","delta","draggable","drag-handle","drop-indicator","drop-zone","destructive-hint","docs-shell","drawer","elevation","filter-bar","flow-map","heatmap","hexbin","icon-badge","input-group","instrument","range-scale","resizable","table-wrap","time-range","toast-host","scroll-area","isochrone","landing-features","landing-hero","layer-panel","layer-switch","legend","logos","map-area","map-footer","map-panel","map-slot","measure","metrics","minimap","pager","pagination","panel","plate","price","pricing","progress","prose","pullquote","radio-list","range","readout","recipe","reserved","resize-handle","row","row-action","scale-bar","scrim","segmented","sheet","shortcut-list","shortcut-overlay","shortcut-panel","shortcut-row","showcase","sidebar","skeleton","sparkline","stack","steps","streaming-chart","survey","theme-scope","time-slider","timeline","toast","toolbar","tooltip","tree","version","version-banner"],button:["btn","pressable"],span:["avatar","badge","chip","dot","flag","live-badge","mark","pill"],a:["link","linkish"],kbd:["kbd"],label:["check","radio","switch"],nav:["docs-nav"]},SHADOW_PARTS={"version-banner":"banner","contour-plot":"plot"};for(const[t,e]of Object.entries(SHADOW_SLOTS))for(const s of e){shadow("contour-shadow-"+s,slotWrapper(t,s,SHADOW_PARTS[s]||s))}shadow("contour-shadow-callout",'<div class="c-callout" part="callout"><div class="c-callout__title" part="title"><slot name="title"></slot></div><div class="c-callout__body" part="body"><slot></slot></div><button class="c-callout__close" part="close" type="button" aria-label="Close">×</button></div>'),shadow("contour-shadow-empty",'<div class="c-empty" part="empty"><div class="c-empty__illustration" part="illustration"><slot name="illustration"></slot></div><div class="c-empty__title" part="title"><slot name="title"></slot></div><div class="c-empty__text" part="body"><slot></slot></div><div><slot name="action"></slot></div></div>'),shadow("contour-shadow-feature",'<div class="c-feature" part="feature"><span class="c-feature__index" part="index"><slot name="index"></slot></span><div class="c-feature__title" part="title"><slot name="title"></slot></div><div class="c-feature__body" part="body"><slot></slot></div></div>'),shadow("contour-shadow-kpi",'<div class="c-kpi" part="kpi"><div class="c-kpi__value" part="value"><slot name="value"></slot></div><div class="c-kpi__label" part="label"><slot name="label"></slot></div><div class="c-kpi__foot" part="foot"><slot name="delta"></slot><slot name="note"></slot></div></div>'),shadow("contour-shadow-stat",'<div class="c-stat" part="stat"><div class="c-stat__value" part="value"><slot name="value"></slot></div><div class="c-stat__label" part="label"><slot name="label"></slot></div><div class="c-stat__delta" part="delta"><slot name="delta"></slot></div></div>'),shadow("contour-shadow-meter",'<div class="c-meter" part="meter"><span class="c-meter__core" part="core"><span class="c-meter__value" part="value"><slot name="value"></slot></span><span class="c-meter__label" part="label"><slot name="label"></slot></span></span></div>'),shadow("contour-shadow-brownout",'<div class="c-brownout" part="brownout" data-level="0"><slot></slot></div>'),shadow("contour-shadow-widget-state",'<div class="c-widget-state" part="widget-state"><slot></slot></div>'),shadow("contour-shadow-donut",'<div class="c-donut" part="donut"><svg class="c-donut__ring" part="ring" viewBox="0 0 32 32"></svg><div class="c-donut__center" part="center"><slot name="value"></slot></div><div class="c-donut__list" part="list"><slot></slot></div></div>'),shadow("contour-shadow-axis",'<div class="c-axis" part="axis"><slot></slot></div>'),shadow("contour-shadow-brush",'<div class="c-brush" part="brush"><div class="c-brush__selection" part="selection"></div></div>'),shadow("contour-shadow-stacked-bar",'<div class="c-stacked-bar" part="bar"><slot></slot></div>'),shadow("contour-shadow-category",'<div class="c-category" part="category" role="listbox"><slot></slot></div>'),shadow("contour-shadow-gauge",'<div class="c-gauge" part="gauge"><svg class="c-gauge__dial" part="dial" aria-hidden="true" viewBox="0 0 100 100"><path class="c-gauge__track" part="track" d="M 10 90 A 40 40 0 0 1 90 90"></path><g class="c-gauge__zones"></g><line class="c-gauge__needle" part="needle" x1="50" y1="50" x2="50" y2="15"></line><circle class="c-gauge__hub" part="hub" cx="50" cy="50" r="4"></circle></svg><div class="c-gauge__value" part="value"><slot name="value"></slot></div><div class="c-gauge__band" part="band"><slot name="band"></slot></div></div>'),shadow("contour-shadow-diff",'<div class="c-diff" part="diff"><div class="c-diff__line c-diff__line--del" part="before"><span class="c-diff__sign">−</span><span><slot name="before"></slot></span></div><div class="c-diff__line c-diff__line--add" part="after"><span class="c-diff__sign">+</span><span><slot name="after"></slot></span></div></div>'),shadow("contour-shadow-do-dont",'<div class="c-do-dont" part="do-dont"><div class="c-do-dont__item c-do-dont__item--do" part="do"><slot name="do"></slot></div><div class="c-do-dont__item c-do-dont__item--dont" part="dont"><slot name="dont"></slot></div></div>'),shadow("contour-shadow-threshold",'<div class="c-threshold" part="threshold"><span class="c-threshold__fill" part="value"></span><span class="c-threshold__target" part="target"></span></div>'),shadow("contour-shadow-coordinate",'<div class="c-coordinate" part="coordinate"><span class="c-coordinate__value" part="value"><slot name="value"></slot></span></div>'),shadow("contour-shadow-install",'<div class="c-install" part="install"><span class="c-install__prompt" part="prompt"><slot name="prompt"></slot></span><span class="c-install__command" part="command"><slot name="command"></slot></span><button class="c-btn c-btn--ghost c-btn--sm c-install__copy" part="copy" type="button" aria-label="Copy command">Copy</button></div>'),shadow("contour-shadow-toc",'<div class="c-toc" part="toc"><div class="c-toc__title" part="title"><slot name="title"></slot></div><nav class="c-toc__list" part="list"><slot></slot></nav></div>'),shadow("contour-shadow-testimonial",'<div class="c-testimonial" part="testimonial"><blockquote class="c-testimonial__quote" part="quote"><slot name="quote"></slot></blockquote><div class="c-testimonial__byline" part="byline"><span class="c-testimonial__name" part="name"><slot name="name"></slot></span><span class="c-testimonial__role" part="role"><slot name="role"></slot></span></div></div>'),shadow("contour-shadow-search-trigger",'<button class="c-search-trigger" part="trigger"><span><slot name="label"></slot></span><kbd class="c-search-trigger__kbd"><slot name="shortcut"></slot></kbd></button>'),shadow("contour-shadow-brand",'<a class="c-brand" part="brand"><span class="c-mark" part="mark"><slot name="mark"></slot></span><span class="c-brand__name" part="name"><slot name="name"></slot></span></a>'),shadow("contour-shadow-section-head",'<div class="c-section-head" part="head"><h2 class="c-section-head__title" part="title"><slot name="title"></slot></h2><p class="c-section-head__desc" part="desc"><slot name="desc"></slot></p></div>'),shadow("contour-shadow-loading",'<div class="c-loading" part="loading"><span class="c-spinner" part="spinner"></span><slot></slot></div>'),shadow("contour-shadow-tabs",'<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>'),shadow("contour-shadow-breadcrumb",'<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>'),shadow("contour-shadow-menu",'<div class="c-menu" part="menu" role="menu"><slot></slot></div>'),shadow("contour-shadow-combobox",'<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>'),shadow("contour-shadow-chart",'<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>'),shadow("contour-shadow-bivariate",'<div class="c-bivariate" part="bivariate"><div class="c-bivariate__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-bivariate-legend",'<div class="c-bivariate-legend" part="legend"><div class="c-bivariate-legend__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-expandable",'<details class="c-expandable" part="expandable"><summary class="c-expandable__summary"><slot name="summary"></slot></summary><div class="c-expandable__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-disclosure",'<details class="c-disclosure" part="disclosure"><summary><slot name="summary"></slot></summary><div class="c-disclosure__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-faq",'<div class="c-faq" part="faq"><div class="c-faq__question" part="question"><slot name="question"></slot></div><div class="c-faq__answer" part="answer"><slot name="answer"></slot></div></div>'),shadow("contour-shadow-code-tabs",'<div class="c-code-tabs" part="code-tabs"><div class="c-code-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-code-tabs__panels"><slot></slot></div></div>'),shadow("contour-shadow-header",'<header class="c-header" part="header"><div class="container c-header__inner" part="inner"><a class="c-brand" part="brand"><slot name="brand"></slot></a><nav class="c-header__nav" part="nav"><slot name="nav"></slot></nav><div class="c-header__actions" part="actions"><slot name="actions"></slot></div></div></header>'),shadow("contour-shadow-footer",'<footer class="c-footer" part="footer"><div class="container c-footer__grid" part="grid"><div class="c-footer__brand" part="brand"><slot name="brand"></slot></div><div class="c-footer__links" part="links"><slot name="links"></slot></div></div></footer>'),shadow("contour-shadow-container",'<div class="container" part="container"><slot></slot></div>'),shadow("contour-shadow-spinner",'<span class="c-spinner" part="spinner" aria-label="Loading"></span>'),shadow("contour-shadow-code",'<pre class="c-code" part="code"><code><slot></slot></code><button class="c-code__copy" part="copy" type="button">Copy</button></pre>'),shadow("contour-shadow-card",'<div class="c-card" part="card"> <div class="c-card__title" part="head"><slot name="title">Untitled</slot></div> <div class="c-card__body" part="body"><slot></slot></div> <div class="c-card__foot" part="foot"><slot name="foot"></slot></div> </div>'),shadow("contour-shadow-field",'<div class="c-field" part="field"> <label class="c-field__label" part="label"><slot name="label">Label</slot></label> <slot name="input"></slot> <span class="c-field__hint" part="hint"><slot name="hint"></slot></span> </div>'),shadow("contour-shadow-alert",'<div class="c-alert" part="alert"> <div class="c-alert__title" part="title"><slot name="title"></slot></div> <div class="c-alert__body" part="body"><slot></slot></div> <div class="c-alert__actions" part="actions"><slot name="action"></slot></div> <button class="c-alert__close" part="close" type="button" aria-label="Close">×</button> </div>'),shadow("contour-shadow-tag",'<span class="c-tag" part="tag"><slot></slot><button class="c-tag__remove" part="remove" type="button" aria-label="Remove">×</button></span>'),shadow("contour-shadow-filter-pill",'<span class="c-filter-pill" part="filter-pill"><slot></slot><button class="c-filter-pill__remove" part="remove" type="button" aria-label="Remove filter">×</button></span>');const DIALOG_MARKUP='<dialog class="c-dialog" part="dialog"> <div class="c-dialog__head" part="head"> <slot name="title"></slot> <button class="c-btn c-btn--icon c-btn--ghost" part="close" type="button" aria-label="Close"> <svg aria-hidden="true" viewBox="0 0 24 24"><path d="m18 6-12 12M6 6l12 12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg> </button> </div> <div class="c-dialog__body" part="body"><slot></slot></div> <div class="c-dialog__foot" part="foot"><slot name="foot"></slot></div> </dialog>';SHADOW_MARKUP["contour-shadow-dialog"]=DIALOG_MARKUP,recordParts("contour-shadow-dialog",DIALOG_MARKUP);class ContourShadowDialog extends ContourShadow{static contourTemplate="undefined"!=typeof document?(()=>{const t=document.createElement("template");return setHTML(t,DIALOG_MARKUP),t})():null;enhance(t){if(super.enhance(t),this._wiredShadowDialog)return;this._wiredShadowDialog=!0;const e=t.querySelector("dialog"),s=t.querySelector('[part="close"]');if(s&&s.addEventListener("click",()=>e?.close()),e){let t=null;e.addEventListener("beforetoggle",s=>{if("open"===s.newState){t=document.activeElement,this._syncingOpenAttr=!0,this.hasAttribute("open")||this.setAttribute("open",""),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}));const a=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(a)try{a.focus()}catch(s){}}else if("closed"===s.newState&&(this._syncingOpenAttr=!0,this.hasAttribute("open")&&this.removeAttribute("open"),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),t&&"function"==typeof t.focus))try{t.focus()}catch(s){}});const s=()=>{const t="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",s=Array.from(e.querySelectorAll(t));for(const a of e.querySelectorAll("slot"))for(const e of a.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const a of e.querySelectorAll(t))s.push(a)}return s},a=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const o=e[0],i=e[e.length-1];t.shiftKey&&a()===o?(t.preventDefault(),i.focus()):t.shiftKey||a()!==i||(t.preventDefault(),o.focus())})}}static get observedAttributes(){return[...super.observedAttributes,"open"]}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"open"===t&&this.shadowRoot&&!this._syncingOpenAttr){const t=this.shadowRoot.querySelector("dialog");t&&(null===s||t.open?null===s&&t.open&&this.close():this.show())}}connectedCallback(){super.connectedCallback(),this.hasAttribute("open")&&this.show()}show(){if(!this.isConnected)return void(this.hasAttribute("open")||this.setAttribute("open",""));const t=this.shadowRoot?.querySelector("dialog");t&&!t.open&&t.showModal()}close(){const t=this.shadowRoot?.querySelector("dialog");t&&t.open&&t.close()}showModal(){this.show()}get open(){return!!this.shadowRoot?.querySelector("dialog")?.open}set open(t){t?this.show():this.close()}get returnValue(){return this.shadowRoot?.querySelector("dialog")?.returnValue??""}set returnValue(t){const e=this.shadowRoot?.querySelector("dialog");e&&(e.returnValue=String(t))}}define("contour-shadow-dialog",ContourShadowDialog);const renderShadowDSD=(t,e="",s="")=>{const a=SHADOW_MARKUP[t];if("string"!=typeof a)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${a}</template>${s}</${t}>`},FROZEN_SHADOW_MARKUP=Object.freeze({...SHADOW_MARKUP});if("undefined"!=typeof globalThis&&(globalThis.ContourShadowTemplates=FROZEN_SHADOW_MARKUP),"undefined"!=typeof window){window.ContourShadowParts=Object.freeze(Object.fromEntries(Object.entries(SHADOW_PARTS_PUBLIC).map(([t,e])=>[t,Object.freeze([...new Set(e)])]))),window.Contour||(window.Contour={});try{window.Contour.shadowTemplates=FROZEN_SHADOW_MARKUP}catch{}}export{SHADOW_MARKUP,renderShadowDSD};function engageInitialModal(t){if(!t.hasAttribute("open")||t._modalEngaged)return;t._modalEngaged=!0,t.setAttribute("aria-modal","true"),modalContain(t,!0);const e=t.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}}function syncDeclarativeOpen(t,e,s,a){if("open"===e&&a&&!t._declarativeOpen){t._declarativeOpen=!0;try{null===s||t.hasAttribute("aria-modal")?null===s&&t.hasAttribute("aria-modal")&&t.close():(t.removeAttribute("open"),t.show())}finally{t._declarativeOpen=!1}}}class ContourDialog extends ContourBase{static get observed(){return["title","size","heading","open"]}static get properties(){return{title:{attribute:"title"},size:{attribute:"size"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDialog)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-dialog"),Array.from(this.classList).forEach(t=>{t.startsWith("c-dialog--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-dialog--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-dialog__head");if(e){if(!s){s=document.createElement("div"),s.className="c-dialog__head";const t=document.createElement(headingTag(this,"h2"));t.className="c-dialog__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-dialog__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-dialog__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-dialog-title")),this.setAttribute("aria-labelledby",t.id))}s&&s.parentNode!==this&&this.prepend(s);const a=this.ensure(".c-dialog__body",()=>{const t=document.createElement("div");return t.className="c-dialog__body",t});Array.from(this.childNodes).forEach(t=>{t!==a&&t!==s&&(1===t.nodeType&&t.classList&&t.classList.contains("c-dialog__head")||a.appendChild(t))}),s&&s.parentNode===this?(a.parentNode!==this||s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)&&this.insertBefore(a,s.nextSibling):a.parentNode!==this&&this.appendChild(a)}enhance(){this._wiredDialog||(this._wiredDialog=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this.show=()=>{if(this.hasAttribute("open"))return;this._dialogLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.setAttribute("aria-modal","true");const t=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);if(t&&"function"==typeof t.showModal)try{t.showModal()}catch(t){}modalContain(this,!0);const e=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{const t=this.hasAttribute("open")||this.hasAttribute("aria-modal"),e=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);e&&"function"==typeof e.close&&e.close(),this._declarativeOpen=!0;try{this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._declarativeOpen=!1}if(this.removeAttribute("aria-modal"),t){modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._dialogLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}}},this.focus=()=>{const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}else try{HTMLElement.prototype.focus.call(this)}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-dialog__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&this.close()}),engageInitialModal(this))}}define("contour-dialog",ContourDialog);class ContourAlert extends ContourBase{static get observed(){return["title","body","variant","icon","closable","action","actions","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},variant:{attribute:"variant"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean},action:{attribute:"action"},actions:{attribute:"actions"}}}render(){this.classList.add("c-alert");const t=/^(warning|danger)$/.test(this.getAttribute("variant")||""),e=t?"alert":"status",s=t?"assertive":"polite";if(this.hasAttribute("role")&&this.getAttribute("role")!==this._autoRole||(this.setAttribute("role",e),this._autoRole=e),this.hasAttribute("aria-live")&&this.getAttribute("aria-live")!==this._autoLive||(this.setAttribute("aria-live",s),this._autoLive=s),wireStates(this),loadRemote(this,"title"),renderStates(this,"alert"))return;const a=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-alert--")&&this.classList.remove(t)}),a&&this.classList.add("c-alert--"+a);const o=this.getAttribute("icon"),i="none"===o?"":o||statusIcon(a);if(i){const t=this.ensure(".c-alert__icon",()=>{const t=document.createElement("span");return t.className="c-alert__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(i).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-alert__icon");t&&t.remove()}const r=this.getAttribute("title")||this._remoteData&&this._remoteData.title;if(r){const t=this.ensure(".c-alert__title",()=>{const t=document.createElement("div");return t.className="c-alert__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=r}else{const t=this.querySelector(".c-alert__title");t&&t.remove()}const n=this.getAttribute("body"),c=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!(t.classList.contains("c-alert__icon")||t.classList.contains("c-alert__title")||t.classList.contains("c-alert__body")))&&!(3===t.nodeType&&!t.textContent.trim()));if(c.length){const t=this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t});t.textContent="";for(const e of c)t.appendChild(e)}else if(n){this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t}).textContent=n}else{const t=this.querySelector(".c-alert__body");t&&t.remove()}Array.from(this.querySelectorAll(".c-alert__action")).forEach(t=>t.remove());const l=this.getAttribute("actions");let d=[];if(l)try{const t=JSON.parse(l);Array.isArray(t)&&(d=t.map(t=>String(t)))}catch(t){d=[l]}else{const t=this.getAttribute("action");t&&(d=[t])}if(d.forEach(t=>{const e=document.createElement("button");e.className="c-btn c-btn--sm c-alert__action",e.type="button",e.setAttribute("data-alert-action",""),e.textContent=t,this.appendChild(e)}),flagOn(this,"closable"))this.ensure(".c-alert__close",()=>{const t=document.createElement("button");return t.className="c-alert__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-alert__close");t&&t.remove()}r||n||i||c.length||renderEmpty(this,"alert")}}ContourAlert.prototype.enhance=function(){this._wiredAlert||(this._wiredAlert=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-alert__action"):null;if(e&&this.contains(e))return t.preventDefault(),void this.dispatchEvent(new CustomEvent("contour:action",{bubbles:!0,composed:!0,detail:{label:e.textContent.trim()}}));const s=t.target&&t.target.closest?t.target.closest(".c-alert__close"):null;s&&this.contains(s)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())}))},define("contour-alert",ContourAlert);class ContourDisclosure extends ContourBase{static get observed(){return["summary","icon"]}static get properties(){return{summary:{attribute:"summary"},icon:{attribute:"icon"}}}disconnectedCallback(){this._disclosureContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._disclosureContent&&(this._disclosureContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const a=this.querySelector("details");if(a){const t=a.querySelector(".c-disclosure__body");t&&(this._disclosureContent=t.innerHTML)}else this.innerHTML.trim()&&(this._disclosureContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-disclosure");const t=this.getAttribute("summary"),e=this.getAttribute("icon");if(t){let s=this.innerHTML.trim()?this.innerHTML:this._disclosureContent||"";s.trim()&&(this._disclosureContent=s);const a=this.ensure("details",()=>{const a=document.createElement("details"),o=document.createElement("summary");if(o.className="c-disclosure__summary",e){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),o.appendChild(t)}o.appendChild(document.createTextNode(t)),a.appendChild(o);const i=document.createElement("div");return i.className="c-disclosure__body",setHTML(i,s),a.appendChild(i),a}),o=a.querySelector("summary");if(o){const s=o.querySelector(".c-disclosure__icon");if(e&&!s){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),o.insertBefore(t,o.firstChild)}else!e&&s&&s.remove();Array.from(o.childNodes).filter(t=>3===t.nodeType).forEach(t=>t.remove()),o.appendChild(document.createTextNode(t))}const i=a.querySelector(".c-disclosure__body");i&&setHTML(i,s),a.parentNode!==this&&(setHTML(this,""),this.appendChild(a))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredDisclosure||(this._wiredDisclosure=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-disclosure",ContourDisclosure);class ContourCallout extends ContourBase{static get observed(){return["variant","title","icon","closable"]}static get properties(){return{variant:{attribute:"variant"},title:{attribute:"title"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean}}}render(){this.classList.add("c-callout"),this.hasAttribute("role")||this.setAttribute("role","note"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("title")||"Callout"),Array.from(this.classList).forEach(t=>{t.startsWith("c-callout--")&&this.classList.remove(t)});const t=this.getAttribute("variant");t&&this.classList.add("c-callout--"+t);const e=this.getAttribute("icon"),s="none"===e?"":e||statusIcon(t);if(s){const t=this.ensure(".c-callout__icon",()=>{const t=document.createElement("span");return t.className="c-callout__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(s).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-callout__icon");t&&t.remove()}const a=this.getAttribute("title");if(a){const t=this.ensure(".c-callout__title",()=>{const t=document.createElement("div");return t.className="c-callout__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=a}else{const t=this.querySelector(".c-callout__title");t&&t.remove()}if(flagOn(this,"closable"))this.ensure(".c-callout__close",()=>{const t=document.createElement("button");return t.className="c-callout__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-callout__close");t&&t.remove()}}}ContourCallout.prototype.enhance=function(){this._wiredCallout||(this._wiredCallout=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-callout__close"):null;e&&this.contains(e)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())}))},define("contour-callout",ContourCallout);class ContourEmpty extends ContourBase{static get observed(){return["state","title","body","action","icon","illustration","heading"]}static get properties(){return{state:{attribute:"state"},title:{attribute:"title"},body:{attribute:"body"},action:{attribute:"action"},icon:{attribute:"icon"},illustration:{attribute:"illustration"}}}render(){this.classList.add("c-empty"),this.hasAttribute("role")||this.setAttribute("role","status");const t=this.getAttribute("state")||"empty",e=this.getAttribute("title")||("filtered"===t?"Nothing matches":"error"===t?"Could not load":"No data yet"),s=this.getAttribute("body")||("filtered"===t?"Try clearing some filters.":"error"===t?"Check your connection and try again.":"There is nothing to show here yet."),a=this.getAttribute("action")||("filtered"===t?"Clear filters":"error"===t?"Retry":""),o=this.getAttribute("icon");if(o){const t=this.ensure(".c-empty__icon",()=>{const t=document.createElement("span");return t.className="c-empty__icon",t});setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(o).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-empty__icon");t&&t.remove()}const i=this.getAttribute("illustration");if(i){const t=this.ensure(".c-empty__illustration",()=>{const t=document.createElement("div");return t.className="c-empty__illustration",t});setHTML(t,sanitizeHtml(i))}else{const t=this.querySelector(".c-empty__illustration");t&&t.remove()}if(e){this.ensure(".c-empty__title",()=>{const t=document.createElement(headingTag(this,"h3"));return t.className="c-empty__title",t}).textContent=e}else{const t=this.querySelector(".c-empty__title");t&&t.remove()}if(s){this.ensure(".c-empty__text",()=>{const t=document.createElement("p");return t.className="c-empty__text",t}).textContent=s}else{const t=this.querySelector(".c-empty__text");t&&t.remove()}if(a){this.ensure("button.c-btn[data-empty-action]",()=>{const t=document.createElement("button");return t.className="c-btn c-btn--primary",t.type="button",t.setAttribute("data-empty-action",""),t}).textContent=a}else{const t=this.querySelector("[data-empty-action]");t&&t.remove()}}enhance(){wireRemovable(this)}}define("contour-empty",ContourEmpty);class ContourFaq extends ContourBase{static get observed(){return["question","answer","items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{question:{attribute:"question"},answer:{attribute:"answer"},items:{attribute:"items"},src:{attribute:"src"}}}render(){if(this.classList.add("c-faq"),wireStates(this),loadRemote(this,"items"),renderStates(this,"faq"))return;const t=remoteData(this,"items"),e=this.getAttribute("question"),s=this.getAttribute("answer"),a=Array.from(this.children).filter(t=>t.classList&&t.classList.contains("c-faq__item"));if(t&&!a.length)try{const e=JSON.parse(t);Array.from(this.querySelectorAll(".c-faq__item")).forEach(t=>t.remove()),e.forEach((t,e)=>{const s=document.createElement("details");s.className="c-faq__item",0===e&&s.setAttribute("open","");const a=document.createElement("summary");a.className="c-faq__question",a.textContent="string"==typeof t?t:t.question||t.q||"";const o=document.createElement("span");o.className="c-faq__sign",o.setAttribute("aria-hidden","true"),setHTML(o,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>'),a.appendChild(o),s.appendChild(a);const i=document.createElement("div");i.className="c-faq__answer",i.textContent="string"==typeof t?"":t.answer||t.a||"",s.appendChild(i),this.appendChild(s)})}catch(t){warnBadJson(this,"attribute",t)}else if(!t)if(e||s){const t=this.ensure("details.c-faq__item",()=>{const t=document.createElement("details");return t.className="c-faq__item",t});t.hasAttribute("open")||t.setAttribute("open","");const a=this.ensure("summary.c-faq__question",()=>{const t=document.createElement("summary");return t.className="c-faq__question",t},t);a.textContent=e||"";const o=this.ensure(".c-faq__sign",()=>{const t=document.createElement("span");return t.className="c-faq__sign",t},a);o.setAttribute("aria-hidden","true"),setHTML(o,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>');this.ensure(".c-faq__answer",()=>{const t=document.createElement("div");return t.className="c-faq__answer",t},t).textContent=s||""}else renderEmpty(this,"faq")}}define("contour-faq",ContourFaq);class ContourAccordion extends ContourBase{static get observed(){return["items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","persist","exclusive","cache-key","no-cache"]}static get properties(){return{items:{attribute:"items"},exclusive:{attribute:"exclusive",type:Boolean},src:{attribute:"src"}}}render(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"accordion","Accordion"));const t=Array.from(this.children).filter(t=>"DETAILS"===t.tagName);if(wireStates(this),loadRemote(this,"items"),renderStates(this,"accordion"))return;const e=remoteData(this,"items");if(e&&!t.length){Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>t.remove());try{JSON.parse(e).forEach(t=>{const e=document.createElement("details");e.className="c-disclosure";const s=document.createElement("summary");s.className="c-disclosure__summary",s.textContent=t.title||t.question||t.q||t.label||"",e.appendChild(s);const a=document.createElement("div");a.className="c-disclosure__body",a.textContent=t.body||t.answer||t.a||t.content||"",e.appendChild(a),this.appendChild(e)})}catch(t){warnBadJson(this,"attribute",t)}}else e||t.length||renderEmpty(this,"accordion");const s=this.getAttribute("persist");if(s){let t=null;if("storage"===s&&this.id)try{t=localStorage.getItem("contour-accordion:"+this.id)}catch(t){}else if("url"===s)try{t=new URLSearchParams(window.location.search).get("c-accordion")}catch(t){}if(null!==t)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=new Set(e.map(t=>String(t)));Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{const s=e.querySelector("summary"),a=(s?s.textContent:"").trim().slice(0,120);t.has(a)&&(e.open=!0)})}}catch(t){}}}enhance(){this._wiredAccordion||(this._wiredAccordion=!0,this.addEventListener("toggle",t=>{const e=t.target;if(e&&"DETAILS"===e.tagName){e.open&&this.hasAttribute("exclusive")&&Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>{t!==e&&(t.open=!1)}),this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}));const s=this.getAttribute("persist");if("storage"===s&&this.id)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}}),localStorage.setItem("contour-accordion:"+this.id,JSON.stringify(t))}catch(t){}else if("url"===s)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}});const e=new URL(window.location.href);e.searchParams.set("c-accordion",JSON.stringify(t)),window.history.replaceState(null,"",e.toString())}catch(t){}}},!0))}}define("contour-accordion",ContourAccordion);class ContourDrawer extends ContourBase{static get observed(){return["title","body","size","open"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDrawer)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-drawer"),Array.from(this.classList).forEach(t=>{t.startsWith("c-drawer--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-drawer--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-drawer__head");if(e){if(!s){s=document.createElement("div"),s.className="c-drawer__head";const t=document.createElement("div");t.className="c-drawer__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-drawer__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-drawer__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-drawer-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-drawer__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const a=this.getAttribute("body"),o=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-drawer__head")&&!t.classList.contains("c-drawer__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(o.length){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});for(const e of o)t.appendChild(e)}else if(a){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});setHTML(t,sanitizeHtml(a))}else{const t=this.querySelector(".c-drawer__body");t&&t.remove()}}enhance(){if(this._wiredDrawer)return;this._wiredDrawer=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._drawerLastFocus=null,this.show=()=>{if(this.hasAttribute("open"))return;this._drawerLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.setAttribute("aria-modal","true"),this.classList.add("is-open"),modalContain(this,!0);const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this.hasAttribute("aria-modal"))return;this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.removeAttribute("aria-modal"),this.classList.remove("is-open"),modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._drawerLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-drawer__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&this.close()});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const a=s.touches&&s.touches[0];a&&(t=a.clientX,e=a.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const a=s.changedTouches&&s.changedTouches[0];if(!a)return;const o=a.clientX-t,i=a.clientY-e;Math.abs(o)>60&&Math.abs(o)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-drawer",ContourDrawer);class ContourSheet extends ContourBase{static get observed(){return["title","body","size","open"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredSheet)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-sheet"),Array.from(this.classList).forEach(t=>{t.startsWith("c-sheet--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-sheet--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-sheet__head");if(e){if(!s){s=document.createElement("div"),s.className="c-sheet__head";const t=document.createElement("div");t.className="c-sheet__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-sheet__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-sheet__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-sheet-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-sheet__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const a=this.getAttribute("body"),o=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-sheet__head")&&!t.classList.contains("c-sheet__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(o.length){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});for(const e of o)t.appendChild(e)}else if(a){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});setHTML(t,sanitizeHtml(a))}else{const t=this.querySelector(".c-sheet__body");t&&t.remove()}}enhance(){if(this._wiredSheet)return;this._wiredSheet=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._sheetLastFocus=null,this.show=()=>{if(this.hasAttribute("open"))return;this._sheetLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.setAttribute("aria-modal","true"),this.classList.add("is-open"),modalContain(this,!0);const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this.hasAttribute("aria-modal"))return;this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.removeAttribute("aria-modal"),this.classList.remove("is-open"),modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._sheetLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-sheet__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&this.close()});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const a=s.touches&&s.touches[0];a&&(e=a.clientX,t=a.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const a=s.changedTouches&&s.changedTouches[0];if(!a)return;const o=a.clientY-t,i=a.clientX-e;o>60&&Math.abs(o)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-sheet",ContourSheet);class ContourToast extends ContourBase{static get observed(){return["message","variant","duration","action","icon"]}static get properties(){return{message:{attribute:"message"},variant:{attribute:"variant"},duration:{attribute:"duration",type:Number},action:{attribute:"action"}}}render(){this.classList.add("c-toast"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true");const t=this.getAttribute("message");t&&!this.hasChildNodes()&&(this.textContent=t);const e=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),e&&this.classList.add("c-toast--"+e);const s=this.getAttribute("icon"),a="none"===s?"":s||statusIcon(e);let o=this.querySelector(".c-toast__icon");a?(o||(o=document.createElement("span"),o.className="c-toast__icon"),setHTML(o,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(a).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),this.firstChild!==o&&this.prepend(o)):o&&o.remove();const i=this.getAttribute("action");let r=this.querySelector(".c-toast__action");i?(r||(r=document.createElement("button"),r.className="c-toast__action",r.type="button",this.appendChild(r)),r.textContent=i):r&&r.remove();let n=this.querySelector(".c-toast__close");n||(n=document.createElement("button"),n.className="c-toast__close",n.type="button",n.setAttribute("aria-label",labelText(this,"close","Close")),n.textContent="×",this.appendChild(n))}enhance(){if(this._wiredToast)return;this._wiredToast=!0,this.addEventListener("click",t=>{(t.target&&t.target.closest?t.target.closest(".c-toast__close"):null)&&(t.preventDefault(),this._dismiss())});const t=()=>{clearTimeout(this._toastTimer),this._toastTimer=null};this.addEventListener("mouseenter",t),this.addEventListener("focusin",t),this.addEventListener("mouseleave",()=>this._arm()),this.addEventListener("focusout",()=>this._arm()),this._arm(),onDispose(this,()=>clearTimeout(this._toastTimer))}_durationMs(){const t=null!=this._toastDuration?Number(this._toastDuration):Number(this.duration);return 0===t?0:t>0?t:4e3}_arm(){clearTimeout(this._toastTimer),this._toastTimer=null;const t=this._durationMs();t>0&&(this._toastTimer=setTimeout(()=>this._dismiss(),t))}_dismiss(){clearTimeout(this._toastTimer),this._toastTimer=null,this.setAttribute("hidden",""),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))}show(t,e){const s=null!=t?String(t):this.getAttribute("message"),a=e&&e.variant||this.getAttribute("variant"),o=e&&e.action||this.getAttribute("action");s&&!this.hasChildNodes()&&(this.textContent=s),Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),a&&this.classList.add("c-toast--"+a);let i=this.querySelector(".c-toast__action");o?(i||(i=document.createElement("button"),i.className="c-toast__action",i.type="button",this.appendChild(i)),i.textContent=o):i&&i.remove(),e&&null!=e.duration&&(this._toastDuration=Number(e.duration)),this.removeAttribute("hidden"),this._arm()}}define("contour-toast",ContourToast);class ContourExpandable extends ContourBase{static get observed(){return["summary"]}static get properties(){return{summary:{attribute:"summary"}}}disconnectedCallback(){this._expandableContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._expandableContent&&(this._expandableContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const a=this.querySelector("details");if(a){const t=a.querySelector(".c-expandable__body");t&&(this._expandableContent=t.innerHTML)}else this.innerHTML.trim()&&(this._expandableContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-expandable"),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("summary")||"Expandable");const t=this.getAttribute("summary");if(t){let e=this.innerHTML.trim()?this.innerHTML:this._expandableContent||"";e.trim()&&(this._expandableContent=e);const s=this.ensure("details",()=>{const s=document.createElement("details"),a=document.createElement("summary");a.className="c-expandable__summary",a.textContent=t,s.appendChild(a);const o=document.createElement("div");return o.className="c-expandable__body",setHTML(o,e),s.appendChild(o),s}),a=s.querySelector("summary");a&&(a.textContent=t);const o=s.querySelector(".c-expandable__body");o&&setHTML(o,e),s.parentNode!==this&&(setHTML(this,""),this.appendChild(s))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredExpandable||(this._wiredExpandable=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-expandable",ContourExpandable);class ContourToastHost extends ContourBase{static get observed(){return[]}render(){this.classList.add("c-toast-host"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"toast-host","Toast host")),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true")}enhance(){if(this._wiredToastHost)return;this._wiredToastHost=!0,this._toastQueue=[],this._toastActive=null;const t=(t,s)=>{s=s||{};const a=document.createElement("div");a.className="c-toast",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-atomic","true"),s.variant&&a.classList.add("c-toast--"+s.variant);const o=statusIcon(s.variant);if(o){const t=document.createElement("span");t.className="c-toast__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+o+'" /></svg>'),a.appendChild(t)}a.dataset.message=null==t?"":String(t);const i=document.createElement("span");if(i.className="c-toast__text",i.textContent=null==t?"":String(t),a.appendChild(i),s.action&&("string"==typeof s.action||s.action.label)){const t="string"==typeof s.action?s.action:s.action.label,o=document.createElement("button");o.type="button",o.className="c-btn c-btn--ghost c-toast__action",o.textContent=t,o.addEventListener("click",t=>{if(t.stopPropagation(),"object"==typeof s.action&&"function"==typeof s.action.onClick)try{s.action.onClick()}catch(t){}e(a)}),a.appendChild(o)}const r=document.createElement("button");return r.type="button",r.className="c-toast__close",r.setAttribute("aria-label",labelText(this,"close","Close")),r.textContent="×",a.appendChild(r),r.addEventListener("click",t=>{t.stopPropagation(),e(a)}),a._arm=()=>{clearTimeout(a._timer);const t=s.duration,o=0===t?0:t>0?t:4e3;o>0&&(a._timer=setTimeout(()=>e(a),o))},a.addEventListener("mouseenter",()=>clearTimeout(a._timer)),a.addEventListener("focusin",()=>clearTimeout(a._timer)),a.addEventListener("mouseleave",a._arm),a.addEventListener("focusout",a._arm),a},e=t=>{t&&t.parentNode&&(t._timer&&(clearTimeout(t._timer),t._timer=null),t.parentNode.removeChild(t),this._toastActive===t&&(this._toastActive=null),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0,detail:{message:t.textContent}})),s())},s=()=>{for(;this._toastQueue.length;){const e=this._toastQueue.shift();if(e._deduped)continue;const s=t(e.message,e.opts);this._toastActive=s,this.appendChild(s),s._arm()}};this.show=(t,a)=>{a=a||{};const o=String(null==t?"":t),i=this._toastActive;if(i&&i.dataset&&i.dataset.message===o&&""!==o){i._timer&&clearTimeout(i._timer);const t=a.duration&&a.duration>0?a.duration:4e3;return i._timer=setTimeout(()=>e(i),t),i}const r=this._toastQueue.find(t=>String(t.message)===o&&""!==o);if(r)return r.opts=Object.assign({},r.opts,a),null;const n={message:t,opts:a,_deduped:!1};return this._toastQueue.push(n),s(),this._toastActive},this.hide=()=>{this._toastActive&&e(this._toastActive),this._toastQueue.length=0,Array.from(this.querySelectorAll(".c-toast")).forEach(t=>{t._timer&&clearTimeout(t._timer),t.parentNode&&t.parentNode.removeChild(t)}),this._toastActive=null}}}define("contour-toast-host",ContourToastHost);