@sparkvault/sdk-js 18.0.0 → 18.0.1

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/dist/index.mjs CHANGED
@@ -18845,7 +18845,657 @@ class HelpDeskClient {
18845
18845
  }
18846
18846
  }
18847
18847
 
18848
- /** Scoped styles for the optional inline help desk form. */
18848
+ /**
18849
+ * A tenant's brand color and the WCAG contrast rules that decide how it may be
18850
+ * used: the one hex rule the server stores, the console checks and the portal
18851
+ * paints, the one contrast reading the console's readouts, the portal's
18852
+ * accent and the portal's reading of a help center's ground share, and the
18853
+ * one way a readout writes that reading.
18854
+ *
18855
+ * A brand color is tenant-controlled, so it is used only when it is a
18856
+ * six-digit hex color, read case-insensitively and held in lowercase; anything
18857
+ * else (a color name, a CSS function, a value that runs on into more CSS) is
18858
+ * no color at all.
18859
+ *
18860
+ * A brand color can be any lightness, so whatever shows it picks what goes
18861
+ * with it, in one pairing per scheme that every surface painting the color
18862
+ * shares (the customer portal, the SDK's support journey, the desk's email,
18863
+ * the console's sample):
18864
+ *
18865
+ * light (lightAccent) the fill, moved in lightness away from its label
18866
+ * only where neither white nor ink reads on it at
18867
+ * 4.5:1; white or ink on it, whichever reads more
18868
+ * strongly; the color itself as text only where it
18869
+ * reaches 4.5:1 on both grounds accent text stands on,
18870
+ * the white surface and the canvas tone, ink otherwise
18871
+ * dark (darkAccent) a color with a hue a reader sees, lifted in
18872
+ * lightness at its own hue and the saturation it shows
18873
+ * where it would not read: as text until it reads at
18874
+ * 4.5:1 on every dark ground accent text stands on
18875
+ * (darkAccentInk), as a fill until it stands at 3:1 on
18876
+ * the dark page and its cards under a label at 4.5:1,
18877
+ * its hover too (darkAccentFill); a grey or black, the
18878
+ * dark scheme's ink, as fill and as text, under ink
18879
+ *
18880
+ * A hue is the one a reader sees (shownChroma): a black whose OKLCH chroma
18881
+ * names a hue no reader sees there, such as #000001, pairs as black in both
18882
+ * schemes. Under the pointer each fill moves a step a reader sees, away from
18883
+ * its label wherever there is room, and on dark grounds wherever that step
18884
+ * still stands there (hoverOf). schemePairings gives both pairings at once,
18885
+ * DEFAULT_PAIRINGS the ones a desk with no brand color paints, and
18886
+ * accentProperties says either as the accent custom properties the customer
18887
+ * portal paints with.
18888
+ *
18889
+ * BROWSER-SAFE: data only, no imports.
18890
+ */
18891
+
18892
+ const HEX_COLOR = /^#[0-9a-f]{6}$/;
18893
+
18894
+ /** WCAG AA's floor for normal-size text. */
18895
+ const AA_TEXT_CONTRAST = 4.5;
18896
+
18897
+ /**
18898
+ * The canvas tone, the design system's `--canvas` (`--color-slate-50`): the
18899
+ * page ground the customer portal (its pages and a customer's own messages)
18900
+ * and the knowledge base's default theme set accent text on, beside the white
18901
+ * surface. The design system publishes its tokens only as CSS, which this
18902
+ * import-free module cannot read, so the value is mirrored here once, and
18903
+ * tests/brand-color.test.js holds it to packages/design-system/tokens/colors.css.
18904
+ */
18905
+ const CANVAS_COLOR = '#f7fafb';
18906
+
18907
+ /**
18908
+ * The ink, the design system's `--ink` (`--color-slate-900`): the dark text a
18909
+ * pairing paints on a fill and in place of a color too light to stand as
18910
+ * text. Mirrored here once for the same reason as CANVAS_COLOR, and held to
18911
+ * packages/design-system/tokens/colors.css by tests/brand-color.test.js.
18912
+ */
18913
+ const INK_COLOR = '#0d1a20';
18914
+
18915
+ /**
18916
+ * The design system's dark app grounds accent colors stand on, mirrored for
18917
+ * the same reason as CANVAS_COLOR and held to the tokens the same way: the
18918
+ * page (`--dark-app-canvas`), its cards (`--dark-app-surface`) and the
18919
+ * ground of selected text and of the composer's drop prompt
18920
+ * (`--dark-app-selection`), the lightest ground accent text stands on there.
18921
+ */
18922
+ const DARK_CANVAS_COLOR = '#071217';
18923
+ const DARK_SURFACE_COLOR = '#0d1a20';
18924
+ const DARK_SELECTION_COLOR = '#1b2e4c';
18925
+
18926
+ /**
18927
+ * The dark app ramp's ink, `--dark-app-ink`: the text on its grounds, and the
18928
+ * accent a grey or black brand color takes there. Mirrored and held to the
18929
+ * tokens as CANVAS_COLOR is.
18930
+ */
18931
+ const DARK_INK_COLOR = '#f0f5f7';
18932
+
18933
+ /**
18934
+ * The pairings a desk with no brand color paints, in the shape a brand
18935
+ * color's take (schemePairings), so every surface that paints a desk's accent
18936
+ * (the customer portal, the SDK's support journey, the desk's email, the
18937
+ * console's sample) paints this one default: on light grounds the design
18938
+ * system's primary button (`--color-btn-primary`, under the pointer
18939
+ * `--color-btn-primary-hover`) under white, with `--color-action` as text; on
18940
+ * the dark app grounds its action fill (`--dark-app-action`, under the
18941
+ * pointer `--dark-app-action-hover`) under white, with
18942
+ * `--color-action-on-dark` as text. Each color is its token's value,
18943
+ * mirrored and held to the tokens as CANVAS_COLOR is.
18944
+ */
18945
+ const DEFAULT_PAIRINGS = Object.freeze({
18946
+ light: Object.freeze({ fill: '#0a4eb1', onAccent: 'white', ink: '#216bde', hover: '#03439f' }),
18947
+ dark: Object.freeze({ fill: '#226ee3', onAccent: 'white', ink: '#72a8ff', hover: '#1d60c8' })
18948
+ });
18949
+
18950
+ /**
18951
+ * The chroma a reader sees (shownChroma) under which a color is a grey rather
18952
+ * than a hue: the neutral greys a brand picks (a pure, warm or cool grey,
18953
+ * stone, zinc) sit at 0 to 0.019, and the least saturated colors still named
18954
+ * by their hue (a desaturated olive, a charcoal navy, a taupe, a brown) at
18955
+ * 0.028 to 0.035.
18956
+ */
18957
+ const CHROMA_FLOOR = 0.02;
18958
+
18959
+ /**
18960
+ * The OKLCH lightness under which OKLCH's chroma names a hue a reader does
18961
+ * not see: CIE L*a*b*'s 6/29, under which L*a*b* weighs light linearly where
18962
+ * OKLab keeps its cube root to black. Near black that cube root finds a hue
18963
+ * in what little light there is (a chroma of 0.021 in #000001, 0.045 in
18964
+ * #00000a) in a color a reader sees as black.
18965
+ */
18966
+ const LINEAR_LIGHTNESS = 6 / 29;
18967
+
18968
+ /** WCAG AA's floor for a control's parts and a state's mark (1.4.11). */
18969
+ const AA_NON_TEXT_CONTRAST = 3;
18970
+
18971
+ /** sRGB's transfer function: an encoded channel, from 0 to 1, as linear light, and back. */
18972
+ const toLinear = (channel) => (channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4);
18973
+ const toGamma = (channel) => (channel <= 0.0031308 ? 12.92 * channel : 1.055 * channel ** (1 / 2.4) - 0.055);
18974
+
18975
+ /** A validated `#rrggbb` color's red, green and blue channels, each from 0 to 1. */
18976
+ const channelsOf = (color) => [1, 3, 5].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16) / 255);
18977
+
18978
+ /** Relative luminance (WCAG 2) of an sRGB color's red, green and blue channels, each from 0 to 1. */
18979
+ function channelLuminance(channels) {
18980
+ const [red, green, blue] = channels.map(toLinear);
18981
+ return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
18982
+ }
18983
+
18984
+ /** Relative luminance (WCAG 2) of a validated `#rrggbb` color. */
18985
+ function relativeLuminance(color) {
18986
+ return channelLuminance(channelsOf(color));
18987
+ }
18988
+
18989
+ /** The contrast ratio of two relative luminances. */
18990
+ function contrastRatio(first, second) {
18991
+ return (Math.max(first, second) + 0.05) / (Math.min(first, second) + 0.05);
18992
+ }
18993
+
18994
+ /** The relative luminance of the ink a fill's text is weighed in, the real ink rather than pure black. */
18995
+ const INK_LUMINANCE = relativeLuminance(INK_COLOR);
18996
+
18997
+ /** The relative luminances of the grounds accent text stands on: the white surface and the canvas tone. */
18998
+ const TEXT_GROUNDS = Object.freeze([1, relativeLuminance(CANVAS_COLOR)]);
18999
+
19000
+ /** The dark app ramp's grounds accent text stands on, as sRGB channels: the dark page, its cards and the selection. */
19001
+ const DARK_TEXT_GROUNDS = Object.freeze([DARK_CANVAS_COLOR, DARK_SURFACE_COLOR, DARK_SELECTION_COLOR].map((color) => Object.freeze(channelsOf(color))));
19002
+
19003
+ /** The dark app ramp's grounds an accent fill stands on, as sRGB channels: the dark page and its cards. */
19004
+ const DARK_FILL_GROUNDS = Object.freeze([DARK_CANVAS_COLOR, DARK_SURFACE_COLOR].map((color) => Object.freeze(channelsOf(color))));
19005
+
19006
+ /** How strongly a color of this luminance reads on the one of `grounds` it reads least on. */
19007
+ function lowestContrast(luminance, grounds) {
19008
+ return Math.min(...grounds.map((ground) => contrastRatio(luminance, ground)));
19009
+ }
19010
+
19011
+ /** The text a fill of this luminance takes: white or ink, whichever reads more strongly on it. */
19012
+ function labelOf(luminance) {
19013
+ return contrastRatio(luminance, 1) >= contrastRatio(luminance, INK_LUMINANCE) ? 'white' : 'ink';
19014
+ }
19015
+
19016
+ /** How strongly that text reads on a fill of this luminance. */
19017
+ function labelContrast(luminance) {
19018
+ return contrastRatio(luminance, labelOf(luminance) === 'white' ? 1 : INK_LUMINANCE);
19019
+ }
19020
+
19021
+ /** How strongly a color of this luminance reads as text on the light ground it reads least on. */
19022
+ function textContrast(luminance) {
19023
+ return lowestContrast(luminance, TEXT_GROUNDS);
19024
+ }
19025
+
19026
+ /**
19027
+ * A validated `#rrggbb` color in OKLCH (lightness from 0 to 1, chroma, hue in
19028
+ * radians), by the same transform the design system derives its palette with
19029
+ * (packages/design-system/scripts/token-css.mjs oklchOfRgb, by which
19030
+ * tests/brand-color.test.js measures every lift).
19031
+ */
19032
+ function oklchOf(color) {
19033
+ const [r, g, b] = channelsOf(color).map(toLinear);
19034
+ const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
19035
+ const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
19036
+ const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
19037
+ const a = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
19038
+ const bAxis = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
19039
+ return { L: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, C: Math.hypot(a, bAxis), H: Math.atan2(bAxis, a) };
19040
+ }
19041
+
19042
+ /** An OKLCH color's linear red, green and blue; a channel outside 0 to 1 is one sRGB cannot draw. */
19043
+ function linearOfOklch(L, C, H) {
19044
+ const [a, b] = [C * Math.cos(H), C * Math.sin(H)];
19045
+ const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
19046
+ const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
19047
+ const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
19048
+ return [
19049
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
19050
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
19051
+ -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
19052
+ ];
19053
+ }
19054
+
19055
+ /**
19056
+ * The chroma a reader sees in a color (its OKLCH lightness and chroma): its
19057
+ * OKLCH chroma, under LINEAR_LIGHTNESS faded by the square of the color's
19058
+ * share of that lightness, as L*a*b*'s linear weighing scales chroma against
19059
+ * the cube root there.
19060
+ */
19061
+ const shownChroma = ({ L, C }) => C * Math.min(1, (L / LINEAR_LIGHTNESS) ** 2);
19062
+
19063
+ /** Whether a color (its OKLCH lightness and chroma) has a hue a reader sees: its shown chroma at CHROMA_FLOOR or more. */
19064
+ const hasHue = (oklch) => shownChroma(oklch) >= CHROMA_FLOOR;
19065
+
19066
+ /**
19067
+ * The saturation a walk from a color keeps (shiftedUntil): its shown chroma
19068
+ * for its lightness. A color darker than LINEAR_LIGHTNESS with no hue a
19069
+ * reader sees keeps none, so it walks as a grey: a walk toward the light
19070
+ * would grow its trace into a hue. A lighter grey keeps its faint tint, which
19071
+ * its short walks barely move.
19072
+ */
19073
+ function saturationOf(oklch) {
19074
+ if (oklch.L <= 0 || (oklch.L < LINEAR_LIGHTNESS && !hasHue(oklch))) return 0;
19075
+ return shownChroma(oklch) / oklch.L;
19076
+ }
19077
+
19078
+ const drawable = (channels) => channels.every((channel) => channel >= 0 && channel <= 1);
19079
+
19080
+ /** The `#rrggbb` color at OKLCH lightness L and hue H, with as much of chroma C as sRGB holds there. */
19081
+ function colorAt(L, C, H) {
19082
+ let chroma = C;
19083
+ if (!drawable(linearOfOklch(L, chroma, H))) {
19084
+ let [low, high] = [0, C];
19085
+ for (let halving = 0; halving < 24; halving += 1) {
19086
+ const middle = (low + high) / 2;
19087
+ if (drawable(linearOfOklch(L, middle, H))) low = middle;
19088
+ else high = middle;
19089
+ }
19090
+ chroma = low;
19091
+ }
19092
+ return `#${linearOfOklch(L, chroma, H).map((channel) => Math.round(toGamma(Math.min(1, Math.max(0, channel))) * 255).toString(16).padStart(2, '0')).join('')}`;
19093
+ }
19094
+
19095
+ /** How far each step of a shift moves a color's OKLCH lightness. */
19096
+ const SHIFT_STEP = 0.005;
19097
+
19098
+ /**
19099
+ * A color as it stands where `reads` asks more of it: itself where it reads,
19100
+ * else moved in OKLCH lightness (up for `direction` 1, down for -1) at its
19101
+ * own hue, one step at a time, to the first step that reads, white or black
19102
+ * at the end. Its saturation (saturationOf), the chroma a reader sees for its
19103
+ * lightness, stays as it is, so a navy lifts to a clear blue of its own
19104
+ * family rather than greying out, with as much of that chroma as sRGB holds
19105
+ * at each step. Null where not even the end reads.
19106
+ *
19107
+ * @param {string} color - A validated brand color
19108
+ * @param {1|-1} direction
19109
+ * @param {(candidate: string) => boolean} reads
19110
+ * @returns {string|null}
19111
+ */
19112
+ function shiftedUntil(color, direction, reads) {
19113
+ if (reads(color)) return color;
19114
+ const oklch = oklchOf(color);
19115
+ const { L, H } = oklch;
19116
+ const saturation = saturationOf(oklch);
19117
+ for (let lightness = L + direction * SHIFT_STEP; lightness > 0 && lightness < 1; lightness += direction * SHIFT_STEP) {
19118
+ const shifted = colorAt(lightness, saturation * lightness, H);
19119
+ if (reads(shifted)) return shifted;
19120
+ }
19121
+ const end = direction > 0 ? '#ffffff' : '#000000';
19122
+ return reads(end) ? end : null;
19123
+ }
19124
+
19125
+ /**
19126
+ * A brand color as it may be stored and shown, or null when the value is not
19127
+ * one: a `#rrggbb` hex value, read case-insensitively.
19128
+ *
19129
+ * @param {unknown} value
19130
+ * @returns {string|null} The color in lowercase
19131
+ */
19132
+ function brandColor(value) {
19133
+ if (typeof value !== 'string') return null;
19134
+ const color = value.toLowerCase();
19135
+ return HEX_COLOR.test(color) ? color : null;
19136
+ }
19137
+
19138
+ /** How far a fill under the pointer moves at least, in OKLCH lightness. */
19139
+ const HOVER_SHIFT = 0.05;
19140
+
19141
+ /**
19142
+ * How far a fill under the pointer stands from the fill at least, as a
19143
+ * contrast ratio: where HOVER_SHIFT moves a very dark fill too little for a
19144
+ * reader to see (black's step is a 1.0:1 change), the hover moves on until
19145
+ * it stands this far apart.
19146
+ */
19147
+ const HOVER_CONTRAST = 1.1;
19148
+
19149
+ /**
19150
+ * A fill under the pointer: the first step in OKLCH lightness at its own hue
19151
+ * (shiftedUntil) at least HOVER_SHIFT from the fill that stands
19152
+ * HOVER_CONTRAST from it, away from its label (darker under white, lighter
19153
+ * under ink), so the label reads more strongly on it still, where that step
19154
+ * `stands` (for a dark fill, standsWhere: on the grounds it stands on, under
19155
+ * its label). Where it does not (a fill too near that end of the range, black
19156
+ * and its nearest neighbors under white or white under ink, or a dark fill
19157
+ * whose step away sinks into its grounds), the first such step toward its
19158
+ * label, where that one stands; a step further either way only moves further
19159
+ * from the fill. Null where neither stands.
19160
+ *
19161
+ * @param {string} fill - A `#rrggbb` color
19162
+ * @param {'white'|'ink'} onAccent - Its label
19163
+ * @param {(candidate: string) => boolean} [stands]
19164
+ * @returns {string|null}
19165
+ */
19166
+ function hoverOf(fill, onAccent, stands = () => true) {
19167
+ const { L } = oklchOf(fill);
19168
+ const luminance = relativeLuminance(fill);
19169
+ const apart = (candidate) => Math.abs(oklchOf(candidate).L - L) >= HOVER_SHIFT - Number.EPSILON
19170
+ && contrastRatio(relativeLuminance(candidate), luminance) >= HOVER_CONTRAST;
19171
+ const away = onAccent === 'white' ? -1 : 1;
19172
+ return [away, -away].map((direction) => shiftedUntil(fill, direction, apart)).find((step) => step !== null && stands(step)) ?? null;
19173
+ }
19174
+
19175
+ /**
19176
+ * Whether a dark fill's hover stands where the fill does: at
19177
+ * AA_NON_TEXT_CONTRAST on each of the grounds (their relative luminances),
19178
+ * under the fill's label at AA_TEXT_CONTRAST.
19179
+ *
19180
+ * @param {number[]} luminances
19181
+ * @param {'white'|'ink'} onAccent
19182
+ * @returns {(candidate: string) => boolean}
19183
+ */
19184
+ const standsWhere = (luminances, onAccent) => (candidate) => {
19185
+ const luminance = relativeLuminance(candidate);
19186
+ return lowestContrast(luminance, luminances) >= AA_NON_TEXT_CONTRAST
19187
+ && contrastRatio(luminance, onAccent === 'white' ? 1 : INK_LUMINANCE) >= AA_TEXT_CONTRAST;
19188
+ };
19189
+
19190
+ /**
19191
+ * @typedef {Object} AccentPairing
19192
+ * @property {string} fill - The fill of a primary action, `#rrggbb`
19193
+ * @property {'white'|'ink'} onAccent - The text on it: white, or the light ink (INK_COLOR)
19194
+ * @property {string} ink - The accent as text on the scheme's grounds, `#rrggbb`
19195
+ * @property {string} hover - The fill under the pointer, `#rrggbb`
19196
+ */
19197
+
19198
+ /**
19199
+ * What a brand color becomes on the light grounds (the white surface and the
19200
+ * canvas tone): its label, white or ink, whichever reads more strongly on
19201
+ * it; its fill, itself where that label reads on it at AA_TEXT_CONTRAST,
19202
+ * else moved in lightness away from the label (shiftedUntil) to the first
19203
+ * step where it does; the color itself as text where it reads at
19204
+ * AA_TEXT_CONTRAST on both grounds (accentTextContrast), INK_COLOR otherwise;
19205
+ * and its fill under the pointer (hoverOf).
19206
+ *
19207
+ * @param {unknown} value
19208
+ * @returns {AccentPairing|null} Null when the value is not a brand color
19209
+ */
19210
+ function lightAccent(value) {
19211
+ const color = brandColor(value);
19212
+ if (!color) return null;
19213
+ const luminance = relativeLuminance(color);
19214
+ const onAccent = labelOf(luminance);
19215
+ const fill = shiftedUntil(color, onAccent === 'white' ? -1 : 1, (candidate) => labelContrast(relativeLuminance(candidate)) >= AA_TEXT_CONTRAST);
19216
+ return { fill, onAccent, ink: textContrast(luminance) >= AA_TEXT_CONTRAST ? color : INK_COLOR, hover: hoverOf(fill, onAccent) };
19217
+ }
19218
+
19219
+ /**
19220
+ * The color a brand color starts its dark lift from: itself where it has a
19221
+ * hue a reader sees (hasHue), kept as it lifts; the dark scheme's ink
19222
+ * (DARK_INK_COLOR) for a grey or black, which has no hue to keep and lifted
19223
+ * would read as a disabled control.
19224
+ */
19225
+ const darkSource = (color) => (hasHue(oklchOf(color)) ? color : DARK_INK_COLOR);
19226
+
19227
+ /** The relative luminances of grounds given as sRGB channels. */
19228
+ const luminancesOf = (grounds) => grounds.map(channelLuminance);
19229
+
19230
+ /**
19231
+ * A brand color's fill on dark grounds: the color (darkSource) lifted
19232
+ * (shiftedUntil) until it stands at AA_NON_TEXT_CONTRAST on each of `grounds`,
19233
+ * white or ink, whichever reads more strongly on it, reads at
19234
+ * AA_TEXT_CONTRAST, and it has a fill under the pointer that stands there
19235
+ * too (hoverOf, standsWhere); that label; and that hover. A color that
19236
+ * already stands there is itself.
19237
+ *
19238
+ * @param {unknown} value
19239
+ * @param {number[][]} [grounds] - sRGB channels from 0 to 1; the dark app ramp's page and cards unless given
19240
+ * @returns {{ fill: string, onAccent: 'white'|'ink', hover: string }|null} Null when the value is not a brand color, or no lift stands on `grounds`
19241
+ */
19242
+ function darkAccentFill(value, grounds = DARK_FILL_GROUNDS) {
19243
+ const color = brandColor(value);
19244
+ if (!color) return null;
19245
+ const luminances = luminancesOf(grounds);
19246
+ // The step that stands, with its label and hover, kept from the walk that found it.
19247
+ let found = null;
19248
+ shiftedUntil(darkSource(color), 1, (candidate) => {
19249
+ const luminance = relativeLuminance(candidate);
19250
+ if (lowestContrast(luminance, luminances) < AA_NON_TEXT_CONTRAST || labelContrast(luminance) < AA_TEXT_CONTRAST) return false;
19251
+ const onAccent = labelOf(luminance);
19252
+ const hover = hoverOf(candidate, onAccent, standsWhere(luminances, onAccent));
19253
+ found = hover && { fill: candidate, onAccent, hover };
19254
+ return found !== null;
19255
+ });
19256
+ return found;
19257
+ }
19258
+
19259
+ /**
19260
+ * A brand color as text on dark grounds: the color (darkSource) lifted
19261
+ * (shiftedUntil) until it reads at AA_TEXT_CONTRAST on each of `grounds`. A
19262
+ * color that already reads there is itself.
19263
+ *
19264
+ * @param {unknown} value
19265
+ * @param {number[][]} [grounds] - sRGB channels from 0 to 1; the dark app ramp's page, cards and selection unless given
19266
+ * @returns {string|null} Null when the value is not a brand color, or no lift reads on `grounds`
19267
+ */
19268
+ function darkAccentInk(value, grounds = DARK_TEXT_GROUNDS) {
19269
+ const color = brandColor(value);
19270
+ if (!color) return null;
19271
+ const luminances = luminancesOf(grounds);
19272
+ return shiftedUntil(darkSource(color), 1, (candidate) => lowestContrast(relativeLuminance(candidate), luminances) >= AA_TEXT_CONTRAST);
19273
+ }
19274
+
19275
+ /**
19276
+ * What a brand color becomes on the design system's dark app grounds: its
19277
+ * fill and label (darkAccentFill) and its text (darkAccentInk), each lifted
19278
+ * at the color's own hue until it reads there. On a help center's own dark
19279
+ * ground the customer portal lifts this pairing again, with the same two,
19280
+ * against that ground and the grounds it draws from it.
19281
+ *
19282
+ * @param {unknown} value
19283
+ * @returns {AccentPairing|null} Null when the value is not a brand color
19284
+ */
19285
+ function darkAccent(value) {
19286
+ const fill = darkAccentFill(value);
19287
+ return fill && { ...fill, ink: darkAccentInk(value) };
19288
+ }
19289
+
19290
+ /**
19291
+ * A brand color's pairing in each scheme, derived once for whatever writes
19292
+ * them and weighs them together: on the light grounds (lightAccent) and on
19293
+ * the dark app grounds (darkAccent).
19294
+ *
19295
+ * @param {unknown} value
19296
+ * @returns {Readonly<{ light: AccentPairing, dark: AccentPairing }>|null} Null when the value is not a brand color
19297
+ */
19298
+ function schemePairings(value) {
19299
+ const light = lightAccent(value);
19300
+ return light && Object.freeze({ light, dark: darkAccent(value) });
19301
+ }
19302
+
19303
+ /**
19304
+ * How accentProperties writes white and each scheme's ink, the colors a
19305
+ * design-system token names: as those tokens (`tokens`), for a page whose
19306
+ * stylesheet declares them (the customer portal, the console's sample), or as
19307
+ * the colors themselves (`colors`), for a page that declares none (the SDK's
19308
+ * widget on a customer's website). Each token holds the color beside it.
19309
+ */
19310
+ const WRITINGS = Object.freeze({
19311
+ tokens: Object.freeze({ white: 'var(--color-white)', ink: 'var(--ink)', darkInk: 'var(--dark-app-ink)' }),
19312
+ colors: Object.freeze({ white: '#ffffff', ink: INK_COLOR, darkInk: DARK_INK_COLOR })
19313
+ });
19314
+
19315
+ /**
19316
+ * The accent custom properties for a desk's pairings (a brand color's,
19317
+ * schemePairings, or DEFAULT_PAIRINGS), for each scheme a help desk surface
19318
+ * paints in: on light grounds the fill (`--hd-light-accent`), the text on it
19319
+ * (`--hd-light-on-accent`), the accent as text (`--hd-light-accent-ink`) and
19320
+ * the fill under the pointer (`--hd-light-accent-hover`); on the dark app
19321
+ * grounds the same four (`--hd-dark-*`). The one place these names are
19322
+ * spelled: the customer portal's root, the console's sample and every element
19323
+ * of the SDK's widget carry what it returns.
19324
+ *
19325
+ * @param {{ light: AccentPairing, dark: AccentPairing }} pairings
19326
+ * @param {'tokens'|'colors'} [writing] - How white and each scheme's ink are written (WRITINGS)
19327
+ * @returns {Record<`--hd-${'light'|'dark'}-${'accent'|'on-accent'|'accent-ink'|'accent-hover'}`, string>}
19328
+ */
19329
+ function accentProperties(pairings, writing = 'tokens') {
19330
+ const { white, ink, darkInk } = WRITINGS[writing];
19331
+ const label = { white, ink };
19332
+ const { light, dark } = pairings;
19333
+ return {
19334
+ '--hd-light-accent': light.fill,
19335
+ '--hd-light-on-accent': label[light.onAccent],
19336
+ '--hd-light-accent-ink': light.ink === INK_COLOR ? ink : light.ink,
19337
+ '--hd-light-accent-hover': light.hover,
19338
+ '--hd-dark-accent': dark.fill === DARK_INK_COLOR ? darkInk : dark.fill,
19339
+ '--hd-dark-on-accent': label[dark.onAccent],
19340
+ '--hd-dark-accent-ink': dark.ink === DARK_INK_COLOR ? darkInk : dark.ink,
19341
+ '--hd-dark-accent-hover': dark.hover
19342
+ };
19343
+ }
19344
+
19345
+ /**
19346
+ * The help desk's color roles as every customer-facing piece of its UI reads
19347
+ * them, written once: the SDK's support launcher, its panel, the request
19348
+ * form and its modal (sdk-js products/help-desk) and the composer both share
19349
+ * (help-desk-composer.js). Each reads the customer portal's color role of the
19350
+ * same meaning (`--hd-*`, which the portal's root maps to its scheme's color
19351
+ * set), else the design system's light value, the one the portal's own light
19352
+ * set maps the role to, so on a page that sets none, a customer's own website
19353
+ * among them, the UI stays light.
19354
+ *
19355
+ * The accent reads the page's accent roles (`--hd-accent*`, which the portal's
19356
+ * root sets to the pairing its scheme paints), else the light pairing the
19357
+ * element it paints in carries (`--hd-light-accent*`: the SDK's launcher,
19358
+ * panel, form container and modal each carry the desk's), else the light
19359
+ * half of brand-color.js' DEFAULT_PAIRINGS, the pairing a desk without a
19360
+ * brand color takes.
19361
+ *
19362
+ * BROWSER-SAFE: data only; imports only brand-color.js.
19363
+ */
19364
+
19365
+
19366
+ /**
19367
+ * The light value of each design-system token a role falls back to, keyed by
19368
+ * that token (tests/help-desk-colors.test.js holds each to
19369
+ * packages/design-system/tokens). The canvas tone and the ink are
19370
+ * brand-color.js' mirrors of those tokens.
19371
+ */
19372
+ const HELP_DESK_LIGHT_COLORS = Object.freeze({
19373
+ '--surface': '#ffffff',
19374
+ '--canvas': CANVAS_COLOR,
19375
+ '--color-slate-100': '#f0f5f7',
19376
+ '--color-slate-200': '#e0e9ed',
19377
+ '--color-slate-300': '#c9d6dc',
19378
+ '--ink': INK_COLOR,
19379
+ '--text-body': '#425761',
19380
+ '--text-muted': '#5e757f',
19381
+ '--color-action-bg': '#eef4fe',
19382
+ '--color-error': '#b02b27'
19383
+ });
19384
+
19385
+ const LIGHT = HELP_DESK_LIGHT_COLORS;
19386
+
19387
+ /** The default pairings (DEFAULT_PAIRINGS) as the properties an element carries, written as colors: a page that declares none of the design system's tokens reads them. */
19388
+ const DEFAULT = accentProperties(DEFAULT_PAIRINGS, 'colors');
19389
+
19390
+ /** The neutral and error roles, each the page's `--hd-*` role, else its light value. */
19391
+ const HELP_DESK_COLORS = Object.freeze({
19392
+ /** A panel and its cards. */
19393
+ surface: `var(--hd-surface,${LIGHT['--surface']})`,
19394
+ /** A field's ground. */
19395
+ field: `var(--hd-field,${LIGHT['--surface']})`,
19396
+ /** A quiet ground: a question's recap, a note, code, a disabled field. */
19397
+ canvas: `var(--hd-canvas,${LIGHT['--canvas']})`,
19398
+ /** A raised row or control under the pointer. */
19399
+ hover: `var(--hd-hover,${LIGHT['--canvas']})`,
19400
+ /** An icon control under the pointer, and the quietest rules. */
19401
+ fill: `var(--hd-fill,${LIGHT['--color-slate-100']})`,
19402
+ /** Rules and edges. */
19403
+ fillStrong: `var(--hd-fill-strong,${LIGHT['--color-slate-200']})`,
19404
+ /** A field's and a secondary action's edge. */
19405
+ lineStrong: `var(--hd-line-strong,${LIGHT['--color-slate-300']})`,
19406
+ ink: `var(--hd-ink,${LIGHT['--ink']})`,
19407
+ body: `var(--hd-text-body,${LIGHT['--text-body']})`,
19408
+ muted: `var(--hd-text-muted,${LIGHT['--text-muted']})`,
19409
+ /** Selected text, and the composer's drop prompt. */
19410
+ selection: `var(--hd-selection,${LIGHT['--color-action-bg']})`,
19411
+ error: `var(--hd-error,${LIGHT['--color-error']})`
19412
+ });
19413
+
19414
+ /** The accent roles: the fill of a primary action, the text on it, the accent as text, and the fill under the pointer. */
19415
+ const HELP_DESK_ACCENT = Object.freeze({
19416
+ fill: `var(--hd-accent,var(--hd-light-accent,${DEFAULT['--hd-light-accent']}))`,
19417
+ onAccent: `var(--hd-on-accent,var(--hd-light-on-accent,${DEFAULT['--hd-light-on-accent']}))`,
19418
+ ink: `var(--hd-accent-ink,var(--hd-light-accent-ink,${DEFAULT['--hd-light-accent-ink']}))`,
19419
+ hover: `var(--hd-accent-hover,var(--hd-light-accent-hover,${DEFAULT['--hd-light-accent-hover']}))`
19420
+ });
19421
+
19422
+ /** The focus ring's color: the page's `--hd-focus` where it sets one, else the accent as text. */
19423
+ const HELP_DESK_FOCUS = `var(--hd-focus,${HELP_DESK_ACCENT.ink})`;
19424
+
19425
+ /**
19426
+ * Both schemes' pairings as the custom properties an element carries them
19427
+ * under (@sparkvault/app-sdk/brand-color accentProperties: `--hd-light-accent*`,
19428
+ * `--hd-dark-accent*`), written as colors, since a customer's website declares
19429
+ * none of the design system's tokens.
19430
+ */
19431
+ function pairingProperties(pairings) {
19432
+ return Object.freeze(accentProperties(pairings, 'colors'));
19433
+ }
19434
+ /** The default pairings (@sparkvault/app-sdk/brand-color DEFAULT_PAIRINGS) as the custom properties, every one an element can carry. */
19435
+ const DEFAULT_PROPERTIES = pairingProperties(DEFAULT_PAIRINGS);
19436
+ /**
19437
+ * The default pairings (@sparkvault/app-sdk/brand-color DEFAULT_PAIRINGS, the
19438
+ * ones the customer portal, the console's sample and the desk's email paint
19439
+ * for a desk without a brand color) as stylesheet declarations, which a
19440
+ * desk's brand color replaces (applySupportBrand). The launcher, the support
19441
+ * panel, the request form's container and its modal each carry them, so the
19442
+ * accent roles (@sparkvault/app-sdk/help-desk-colors HELP_DESK_ACCENT) read
19443
+ * the light pairing the element carries, and a website may point those roles
19444
+ * at the dark one.
19445
+ */
19446
+ const DEFAULT_PAIRING_DECLARATIONS = Object.entries(DEFAULT_PROPERTIES).map(([name, value]) => `${name}:${value}`).join(';');
19447
+ const NO_BRAND = Object.freeze({ color: null, properties: null });
19448
+ /**
19449
+ * Pairs a desk's brand color for every carrier, once: both of its pairings
19450
+ * (@sparkvault/app-sdk/brand-color schemePairings, the ones the customer
19451
+ * portal and the desk's email paint too), under each scheme's names: the
19452
+ * fill, white or the ink on it, the accent as text, and the fill under the
19453
+ * pointer. Whoever learns the desk's color derives it and hands the one brand
19454
+ * to each element it paints (applySupportBrand), so a desk's color is paired
19455
+ * once however often its elements render. A value that is no brand color is
19456
+ * none.
19457
+ */
19458
+ function supportBrand(value) {
19459
+ const color = brandColor(value);
19460
+ const pairings = color === null ? null : schemePairings(color);
19461
+ return pairings ? Object.freeze({ color, properties: pairingProperties(pairings) }) : NO_BRAND;
19462
+ }
19463
+ /**
19464
+ * The brand for a desk's color: `held` where it pairs that same color, so a
19465
+ * color learned again (a held desk's, then connect's answer for it) is paired
19466
+ * once and stays the one object every element compares.
19467
+ */
19468
+ function brandFor(value, held) {
19469
+ return brandColor(value) === held.color ? held : supportBrand(value);
19470
+ }
19471
+ /**
19472
+ * Sets a desk's brand (supportBrand) on the launcher, the support panel, the
19473
+ * request form's container or the form's modal. The stylesheet paints the
19474
+ * light pairing wherever the accent roles (`--hd-accent*`) are not set, so on
19475
+ * a website the widget's accent is the pairing the portal paints on light
19476
+ * pages until the page points the roles at the dark pairing, and inside the
19477
+ * customer portal each takes the portal's roles. Scoped to the element, so it
19478
+ * works on a hosted page and on any website the widget stands on; a brand
19479
+ * with no color clears them, and the stylesheet's default pairings return.
19480
+ */
19481
+ function applySupportBrand(target, brand) {
19482
+ for (const name of Object.keys(DEFAULT_PROPERTIES)) {
19483
+ const value = brand.properties?.[name];
19484
+ if (value)
19485
+ target.style.setProperty(name, value);
19486
+ else
19487
+ target.style.removeProperty(name);
19488
+ }
19489
+ }
19490
+
19491
+ /**
19492
+ * Scoped styles for the optional inline help desk form and its modal, in the
19493
+ * help desk's color roles (@sparkvault/app-sdk/help-desk-colors): their
19494
+ * neutrals the page's roles where it sets them (HOST), their accent the
19495
+ * page's accent roles, else the desk's light pairing, which the form's
19496
+ * container and the modal each carry (ACCENT, DEFAULT_PAIRING_DECLARATIONS),
19497
+ * as the support panel does.
19498
+ */
18849
19499
  function injectHelpDeskFormStyles() {
18850
19500
  if (document.getElementById('sparkvault-help-desk-styles'))
18851
19501
  return;
@@ -18854,33 +19504,33 @@ function injectHelpDeskFormStyles() {
18854
19504
  style.textContent = `
18855
19505
  .svhd-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;background:${DS.modalOverlay};overflow:auto}
18856
19506
  .svhd-blur{backdrop-filter:blur(5px)}
18857
- .svhd-modal{width:100%;max-width:36rem;max-height:calc(100dvh - 32px);overflow:auto;border-radius:12px;background:${DS.white};box-shadow:${DS.shadowPopover}}
19507
+ .svhd-modal{width:100%;max-width:36rem;max-height:calc(100dvh - 32px);overflow:auto;border-radius:12px;background:${HELP_DESK_COLORS.surface};box-shadow:${DS.shadowPopover};${DEFAULT_PAIRING_DECLARATIONS}}
18858
19508
  .svhd-modal-header{display:flex;justify-content:flex-end;padding:12px 16px 0}
18859
- .svhd-modal-close{border:0;border-radius:4px;background:transparent;color:${DS.slate600};cursor:pointer;font:600 14px/1.5 system-ui,sans-serif;padding:6px 8px;min-height:44px}
18860
- .svhd-modal-close:hover{color:${DS.slate900}}
18861
- .svhd-modal-close:focus-visible{outline:3px solid ${DS.action};outline-offset:2px}
19509
+ .svhd-modal-close{border:0;border-radius:4px;background:transparent;color:${HELP_DESK_COLORS.body};cursor:pointer;font:600 14px/1.5 system-ui,sans-serif;padding:6px 8px;min-height:44px}
19510
+ .svhd-modal-close:hover{color:${HELP_DESK_COLORS.ink}}
19511
+ .svhd-modal-close:focus-visible{outline:3px solid ${HELP_DESK_FOCUS};outline-offset:2px}
18862
19512
  .svhd-modal .svhd-container{max-width:none;border:0;border-radius:0;padding-top:8px}
18863
- .svhd-container{box-sizing:border-box;max-width:36rem;border:1px solid ${DS.slate200};border-radius:12px;background:${DS.white};color:${DS.slate900};font:400 15px/1.5 system-ui,sans-serif;padding:24px}
19513
+ .svhd-container{box-sizing:border-box;max-width:36rem;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:12px;background:${HELP_DESK_COLORS.surface};color:${HELP_DESK_COLORS.ink};font:400 15px/1.5 system-ui,sans-serif;padding:24px;${DEFAULT_PAIRING_DECLARATIONS}}
18864
19514
  .svhd-container *{box-sizing:border-box}
18865
19515
  .svhd-container h2{font-size:22px;line-height:1.25;margin:0}
18866
19516
  .svhd-step-head h2:focus{outline:none}
18867
19517
  .svhd-form{display:grid;gap:16px}
18868
19518
  .svhd-field{display:grid;gap:6px}
18869
19519
  .svhd-label{font-weight:600}
18870
- .svhd-input{width:100%;border:1px solid ${DS.slate300};border-radius:6px;padding:10px 12px;color:${DS.slate900};background:${DS.white};font:inherit;font-size:16px}
18871
- .svhd-input:focus-visible,.svhd-button:focus-visible,.svhd-link:focus-visible{outline:3px solid ${DS.action};outline-offset:2px}
18872
- .svhd-input:disabled{background:${DS.slate50}}
19520
+ .svhd-input{width:100%;border:1px solid ${HELP_DESK_COLORS.lineStrong};border-radius:6px;padding:10px 12px;color:${HELP_DESK_COLORS.ink};background:${HELP_DESK_COLORS.field};font:inherit;font-size:16px}
19521
+ .svhd-input:focus-visible,.svhd-button:focus-visible,.svhd-link:focus-visible{outline:3px solid ${HELP_DESK_FOCUS};outline-offset:2px}
19522
+ .svhd-input:disabled{background:${HELP_DESK_COLORS.canvas}}
18873
19523
  .svhd-auth{display:grid;gap:16px;border:0;padding:0;margin:0}
18874
19524
  .svhd-form[hidden],.svhd-step[hidden],.svhd-auth[hidden],.svhd-field[hidden],.svhd-field-error[hidden],.svhd-status[hidden],.svhd-link[hidden],.svhd-actions[hidden],.svhd-confirm[hidden],.svhd-widget-account[hidden],.svhd-text-button[hidden]{display:none}
18875
19525
  .svhd-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
18876
- .svhd-button{border:0;border-radius:6px;padding:10px 16px;min-height:44px;font:600 15px/1.5 system-ui,sans-serif;background:${DS.action};color:${DS.white};cursor:pointer}
18877
- .svhd-button:hover{background:${DS.actionHover}}
19526
+ .svhd-button{border:0;border-radius:6px;padding:10px 16px;min-height:44px;font:600 15px/1.5 system-ui,sans-serif;background:${HELP_DESK_ACCENT.fill};color:${HELP_DESK_ACCENT.onAccent};cursor:pointer}
19527
+ .svhd-button:hover{background:${HELP_DESK_ACCENT.hover}}
18878
19528
  .svhd-button:disabled{opacity:.6;cursor:default}
18879
- .svhd-secondary{background:transparent;color:${DS.slate600};padding:10px 4px}
18880
- .svhd-secondary:hover{background:transparent;color:${DS.slate900}}
18881
- .svhd-status{margin:0;color:${DS.slate600}}
18882
- .svhd-error{color:${DS.error}}
18883
- .svhd-field-error{margin:0;font-size:14px;color:${DS.error}}
19529
+ .svhd-secondary{background:transparent;color:${HELP_DESK_COLORS.body};padding:10px 4px}
19530
+ .svhd-secondary:hover{background:transparent;color:${HELP_DESK_COLORS.ink}}
19531
+ .svhd-status{margin:0;color:${HELP_DESK_COLORS.body}}
19532
+ .svhd-error{color:${HELP_DESK_COLORS.error}}
19533
+ .svhd-field-error{margin:0;font-size:14px;color:${HELP_DESK_COLORS.error}}
18884
19534
  .svhd-code-links{display:flex;flex-wrap:wrap;gap:4px 16px}
18885
19535
  .svhd-confirm{display:grid;gap:8px}
18886
19536
  .svhd-confirm-title{font-weight:600;margin:0}
@@ -18888,26 +19538,26 @@ function injectHelpDeskFormStyles() {
18888
19538
  .svhd-done-title{font-size:18px;line-height:1.3;margin:0}
18889
19539
  .svhd-done-title:focus{outline:none}
18890
19540
  .svhd-confirmation-message{white-space:pre-wrap;overflow-wrap:anywhere}
18891
- .svhd-link{display:inline-flex;align-items:center;justify-self:start;min-height:44px;color:${DS.action};text-decoration:underline}
18892
- .svhd-hint{font-size:13px;color:${DS.slate600};margin:0}
19541
+ .svhd-link{display:inline-flex;align-items:center;justify-self:start;min-height:44px;color:${HELP_DESK_ACCENT.ink};text-decoration:underline}
19542
+ .svhd-hint{font-size:13px;color:${HELP_DESK_COLORS.body};margin:0}
18893
19543
  .svhd-step{display:grid;gap:16px;min-width:0}
18894
19544
  .svhd-step-head{display:grid;gap:4px;margin-bottom:4px}
18895
- .svhd-step-label{margin:0;font-size:13px;font-weight:600;line-height:1.4;color:${DS.slate600}}
18896
- .svhd-text-button{display:inline-flex;align-items:center;min-height:44px;padding:0 4px;border:0;border-radius:6px;background:transparent;color:${DS.action};font:inherit;font-size:14px;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
18897
- .svhd-text-button:hover{color:${DS.actionHover}}
18898
- .svhd-text-button:focus-visible{outline:3px solid ${DS.action};outline-offset:2px}
18899
- .svhd-text-button:disabled{color:${DS.slate500};cursor:default}
19545
+ .svhd-step-label{margin:0;font-size:13px;font-weight:600;line-height:1.4;color:${HELP_DESK_COLORS.body}}
19546
+ .svhd-text-button{display:inline-flex;align-items:center;min-height:44px;padding:0 4px;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_ACCENT.ink};font:inherit;font-size:14px;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
19547
+ .svhd-text-button:not(:disabled):hover{text-decoration-thickness:2px}
19548
+ .svhd-text-button:focus-visible{outline:3px solid ${HELP_DESK_FOCUS};outline-offset:2px}
19549
+ .svhd-text-button:disabled{color:${HELP_DESK_COLORS.muted};cursor:default}
18900
19550
  .svhd-widget-account{display:flex;align-items:center;flex-wrap:wrap;gap:0 16px;min-width:0}
18901
- .svhd-posting-as{margin:0;color:${DS.slate600};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
18902
- .svhd-note{display:flex;align-items:flex-start;gap:10px;margin:0;padding:12px 14px;border:1px solid ${DS.slate200};border-radius:8px;background:${DS.slate50};color:${DS.slate900};font-size:14px;line-height:1.5}
18903
- .svhd-step .svhd-note svg{display:block;width:18px;height:18px;flex:none;margin-top:2px;color:${DS.action}}
18904
- .svhd-recap{display:flex;align-items:center;gap:12px;padding:6px 6px 6px 14px;border:1px solid ${DS.slate200};border-radius:8px}
19551
+ .svhd-posting-as{margin:0;color:${HELP_DESK_COLORS.body};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
19552
+ .svhd-note{display:flex;align-items:flex-start;gap:10px;margin:0;padding:12px 14px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:8px;background:${HELP_DESK_COLORS.canvas};color:${HELP_DESK_COLORS.ink};font-size:14px;line-height:1.5}
19553
+ .svhd-step .svhd-note svg{display:block;width:18px;height:18px;flex:none;margin-top:2px;color:${HELP_DESK_ACCENT.ink}}
19554
+ .svhd-recap{display:flex;align-items:center;gap:12px;padding:6px 6px 6px 14px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:8px}
18905
19555
  .svhd-recap-request{flex:1;min-width:0}
18906
- .svhd-recap-label{display:block;color:${DS.slate600};font-size:12px;font-weight:600;line-height:1.4}
18907
- .svhd-recap-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${DS.slate900};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
19556
+ .svhd-recap-label{display:block;color:${HELP_DESK_COLORS.body};font-size:12px;font-weight:600;line-height:1.4}
19557
+ .svhd-recap-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${HELP_DESK_COLORS.ink};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
18908
19558
  .svhd-recap .svhd-text-button{flex:none}
18909
19559
  .svhd-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
18910
- .svhd-footer{margin-top:20px;font-size:12px;color:${DS.slate500}}
19560
+ .svhd-footer{margin-top:20px;font-size:12px;color:${HELP_DESK_COLORS.muted}}
18911
19561
  `;
18912
19562
  document.head.appendChild(style);
18913
19563
  }
@@ -19526,123 +20176,6 @@ function refusalCopy(refusal, maxBytes) {
19526
20176
  return REFUSAL_COPY[refusal] ?? "This file can't be attached.";
19527
20177
  }
19528
20178
 
19529
- /**
19530
- * A tenant's brand color and the WCAG contrast rules that decide how it may be
19531
- * used: the one hex rule the server stores, the console checks and the portal
19532
- * paints, the one contrast reading the console's readouts, the portal's
19533
- * accent and the portal's reading of a help center's ground share, and the
19534
- * one way a readout writes that reading.
19535
- *
19536
- * A brand color is tenant-controlled, so it is used only when it is a
19537
- * six-digit hex color, read case-insensitively and held in lowercase; anything
19538
- * else (a color name, a CSS function, a value that runs on into more CSS) is
19539
- * no color at all.
19540
- *
19541
- * A brand color can be any lightness, so whatever shows it picks what goes
19542
- * with it: white or ink as the text on its fill, whichever reads more
19543
- * strongly (at least 4.2:1 on any fill, as far as two inks reach on a
19544
- * mid-tone), and the color itself as text only where it reaches 4.5:1 on
19545
- * both grounds accent text stands on, the white surface and the canvas
19546
- * tone, ink otherwise. accentProperties says that as the accent
19547
- * custom properties the customer portal paints with and the console's sample
19548
- * of it shows, in the design system's own tokens.
19549
- *
19550
- * BROWSER-SAFE: data only, no imports.
19551
- */
19552
-
19553
- const HEX_COLOR = /^#[0-9a-f]{6}$/;
19554
-
19555
- /** WCAG AA's floor for normal-size text. */
19556
- const AA_TEXT_CONTRAST = 4.5;
19557
-
19558
- /**
19559
- * The canvas tone, the design system's `--canvas` (`--color-slate-50`): the
19560
- * page ground the customer portal (its pages and a customer's own messages)
19561
- * and the knowledge base's default theme set accent text on, beside the white
19562
- * surface. The design system publishes its tokens only as CSS, which this
19563
- * import-free module cannot read, so the value is mirrored here once, and
19564
- * tests/brand-color.test.js holds it to packages/design-system/tokens/colors.css.
19565
- */
19566
- const CANVAS_COLOR = '#f7fafb';
19567
-
19568
- /**
19569
- * The ink, the design system's `--ink` (`--color-slate-900`): the dark text a
19570
- * pairing paints on a fill and in place of a color too light to stand as
19571
- * text. Mirrored here once for the same reason as CANVAS_COLOR, and held to
19572
- * packages/design-system/tokens/colors.css by tests/brand-color.test.js.
19573
- */
19574
- const INK_COLOR = '#0d1a20';
19575
-
19576
- /** Relative luminance (WCAG 2) of an sRGB color's red, green and blue channels, each from 0 to 1. */
19577
- function channelLuminance(channels) {
19578
- const [red, green, blue] = channels.map((channel) => (channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4));
19579
- return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
19580
- }
19581
-
19582
- /** Relative luminance (WCAG 2) of a validated `#rrggbb` color. */
19583
- function relativeLuminance(color) {
19584
- return channelLuminance([1, 3, 5].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16) / 255));
19585
- }
19586
-
19587
- /** The contrast ratio of two relative luminances. */
19588
- function contrastRatio(first, second) {
19589
- return (Math.max(first, second) + 0.05) / (Math.min(first, second) + 0.05);
19590
- }
19591
-
19592
- /** The relative luminance of the ink a fill's text is weighed in, the real ink rather than pure black. */
19593
- const INK_LUMINANCE = relativeLuminance(INK_COLOR);
19594
-
19595
- /** The relative luminances of the grounds accent text stands on: the white surface and the canvas tone. */
19596
- const TEXT_GROUNDS = Object.freeze([1, relativeLuminance(CANVAS_COLOR)]);
19597
-
19598
- /** How strongly a color of this luminance reads as text on the ground it reads least on. */
19599
- function textContrast(luminance) {
19600
- return Math.min(...TEXT_GROUNDS.map((ground) => contrastRatio(luminance, ground)));
19601
- }
19602
-
19603
- /**
19604
- * A brand color as it may be stored and shown, or null when the value is not
19605
- * one: a `#rrggbb` hex value, read case-insensitively.
19606
- *
19607
- * @param {unknown} value
19608
- * @returns {string|null} The color in lowercase
19609
- */
19610
- function brandColor(value) {
19611
- if (typeof value !== 'string') return null;
19612
- const color = value.toLowerCase();
19613
- return HEX_COLOR.test(color) ? color : null;
19614
- }
19615
-
19616
- /**
19617
- * What goes with a brand color: the text on its fill (white or ink,
19618
- * whichever reads more strongly, at least 4.2:1 on any fill) and the ink for
19619
- * it as text
19620
- * (the color itself where it reaches AA_TEXT_CONTRAST on both the white
19621
- * surface and the canvas tone, ink otherwise).
19622
- *
19623
- * @param {unknown} value
19624
- * @returns {{ onAccent: 'white'|'ink', accentInk: 'accent'|'ink', ratio: number }|null} Null when the value is not a brand color; `ratio` is its contrast as text (accentTextContrast)
19625
- */
19626
- function accentPairing(value) {
19627
- const color = brandColor(value);
19628
- if (!color) return null;
19629
- const luminance = relativeLuminance(color);
19630
- const ratio = textContrast(luminance);
19631
- return {
19632
- onAccent: contrastRatio(luminance, 1) >= contrastRatio(luminance, INK_LUMINANCE) ? 'white' : 'ink',
19633
- accentInk: ratio >= AA_TEXT_CONTRAST ? 'accent' : 'ink',
19634
- ratio
19635
- };
19636
- }
19637
-
19638
- /** Contrast between a brand fill and the label selected by accentPairing. */
19639
- function accentFillContrast(value) {
19640
- const color = brandColor(value);
19641
- if (!color) return null;
19642
- const pairing = accentPairing(color);
19643
- return contrastRatio(relativeLuminance(color), pairing.onAccent === 'white' ? 1 : INK_LUMINANCE);
19644
- }
19645
-
19646
20179
  /**
19647
20180
  * Files brought to a message's composer by drag, drop and paste, handled
19648
20181
  * alike by every composer that takes them: the console's reply composer and
@@ -19926,11 +20459,14 @@ function helpDeskIcon(name) {
19926
20459
  * and whether trying again can mend it.
19927
20460
  *
19928
20461
  * The composer draws its own stylesheet (one unlayered `<style>` per
19929
- * document), in the design system's colors with the help desk's accent
19930
- * (`--hd-accent-ink`) where the host sets one. Its focus ring is the one the
19931
- * host's fields wear: its color, width and offset are the host's
19932
- * `--hd-focus`, `--hd-focus-width` and `--hd-focus-offset`, else the SDK's
19933
- * field ring (Action Blue, 3px, 2px out).
20462
+ * document), in the help desk's color roles (help-desk-colors.js): the
20463
+ * host's where it sets them, else the design system's light values, with the
20464
+ * help desk's accent as text, the light pairing of the SDK's panel, form
20465
+ * container or modal it stands in where the host sets no accent role. Its
20466
+ * focus ring is the one the host's fields wear: its color, width and offset
20467
+ * are the host's `--hd-focus`, `--hd-focus-width` and `--hd-focus-offset`,
20468
+ * the color else that accent, the width and offset else the SDK's field
20469
+ * ring's (3px, 2px out).
19934
20470
  *
19935
20471
  * BROWSER-SAFE: builds its DOM through the page's `document`, and imports
19936
20472
  * only app-sdk's browser-safe modules.
@@ -19940,34 +20476,11 @@ function helpDeskIcon(name) {
19940
20476
  /** The id of the composer's one `<style>` element in a document. */
19941
20477
  const HELP_DESK_COMPOSER_STYLE_ID = 'sparkvault-help-desk-composer-styles';
19942
20478
 
19943
- /**
19944
- * The design-system colors the composer is drawn in, each the value of the
19945
- * token it names (tests/help-desk-composer.test.js holds them to
19946
- * packages/design-system/tokens). The canvas tone and the ink are
19947
- * brand-color.js' mirrors of those tokens.
19948
- */
19949
- const COMPOSER_COLORS = Object.freeze({
19950
- '--color-white': '#ffffff',
19951
- '--canvas': CANVAS_COLOR,
19952
- '--color-slate-100': '#f0f5f7',
19953
- '--color-slate-200': '#e0e9ed',
19954
- '--color-slate-300': '#c9d6dc',
19955
- '--color-slate-600': '#425761',
19956
- '--ink': INK_COLOR,
19957
- '--color-action': '#216bde',
19958
- '--color-action-bg': '#eef4fe',
19959
- '--color-error': '#b02b27'
19960
- });
19961
-
19962
- const C = COMPOSER_COLORS;
19963
- /** The help desk's accent ink where the host sets one, Action Blue where none does. */
19964
- const ACCENT_INK = `var(--hd-accent-ink,${C['--color-action']})`;
19965
- /** The focus ring of the host's fields: the SDK's field ring (`.svhd-input`) where the host sets none. */
19966
- const FOCUS = `var(--hd-focus,${C['--color-action']})`;
20479
+ /** The focus ring's width and offset: the host's where it sets them, else the SDK's field ring (`.svhd-input`). */
19967
20480
  const FOCUS_WIDTH = 'var(--hd-focus-width,3px)';
19968
20481
  const FOCUS_OFFSET = 'var(--hd-focus-offset,2px)';
19969
20482
  /** A control inside the frame wears the ring within its own hit area. */
19970
- const INSET_RING = `outline:${FOCUS_WIDTH} solid ${FOCUS};outline-offset:calc(-1 * ${FOCUS_WIDTH});box-shadow:none`;
20483
+ const INSET_RING = `outline:${FOCUS_WIDTH} solid ${HELP_DESK_FOCUS};outline-offset:calc(-1 * ${FOCUS_WIDTH});box-shadow:none`;
19971
20484
 
19972
20485
  /**
19973
20486
  * The composer's stylesheet. Every rule but the notice's sits under
@@ -19977,41 +20490,41 @@ const INSET_RING = `outline:${FOCUS_WIDTH} solid ${FOCUS};outline-offset:calc(-1
19977
20490
  */
19978
20491
  const COMPOSER_CSS = `
19979
20492
  .svhd-composer,.svhd-composer *{box-sizing:border-box}
19980
- .svhd-composer{position:relative;display:flex;flex-direction:column;min-width:0;border:1px solid ${C['--color-slate-300']};border-radius:6px;background:${C['--color-white']};color:${C['--ink']}}
19981
- .svhd-composer:has(.svhd-composer-input:focus-visible){outline:${FOCUS_WIDTH} solid ${FOCUS};outline-offset:${FOCUS_OFFSET}}
19982
- @supports not selector(:has(*)){.svhd-composer:focus-within{outline:${FOCUS_WIDTH} solid ${FOCUS};outline-offset:${FOCUS_OFFSET}}}
19983
- .svhd-composer:has(.svhd-composer-input[aria-invalid=true]){border-color:${C['--color-error']}}
19984
- .svhd-composer.svhd-composer-dragging{border-style:dashed;border-color:${ACCENT_INK}}
19985
- .svhd-composer .svhd-composer-input{display:block;width:100%;min-height:140px;margin:0;resize:vertical;border:0;border-radius:6px 6px 0 0;padding:10px 12px;background:transparent;color:${C['--ink']};font-family:inherit;font-size:16px;line-height:1.5}
20493
+ .svhd-composer{position:relative;display:flex;flex-direction:column;min-width:0;border:1px solid ${HELP_DESK_COLORS.lineStrong};border-radius:6px;background:${HELP_DESK_COLORS.field};color:${HELP_DESK_COLORS.ink}}
20494
+ .svhd-composer:has(.svhd-composer-input:focus-visible){outline:${FOCUS_WIDTH} solid ${HELP_DESK_FOCUS};outline-offset:${FOCUS_OFFSET}}
20495
+ @supports not selector(:has(*)){.svhd-composer:focus-within{outline:${FOCUS_WIDTH} solid ${HELP_DESK_FOCUS};outline-offset:${FOCUS_OFFSET}}}
20496
+ .svhd-composer:has(.svhd-composer-input[aria-invalid=true]){border-color:${HELP_DESK_COLORS.error}}
20497
+ .svhd-composer.svhd-composer-dragging{border-style:dashed;border-color:${HELP_DESK_ACCENT.ink}}
20498
+ .svhd-composer .svhd-composer-input{display:block;width:100%;min-height:140px;margin:0;resize:vertical;border:0;border-radius:6px 6px 0 0;padding:10px 12px;background:transparent;color:${HELP_DESK_COLORS.ink};font-family:inherit;font-size:16px;line-height:1.5}
19986
20499
  .svhd-composer .svhd-composer-input:focus,.svhd-composer .svhd-composer-input:focus-visible{outline:none;box-shadow:none}
19987
- .svhd-composer .svhd-composer-input:disabled{background:${C['--canvas']}}
19988
- .svhd-composer .svhd-composer-drop{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;margin:0;padding:12px;border-radius:5px;background:${C['--color-action-bg']};color:${ACCENT_INK};font-size:15px;font-weight:600;line-height:1.4;text-align:center;pointer-events:none}
19989
- .svhd-composer .svhd-composer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;padding:0 4px;border-top:1px solid ${C['--color-slate-200']}}
19990
- .svhd-composer .svhd-composer-attach{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin:0;padding:0 8px;border:0;border-radius:6px;background:transparent;color:${C['--color-slate-600']};font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;cursor:pointer}
19991
- .svhd-composer .svhd-composer-attach:hover,.svhd-composer .svhd-composer-help:hover{background:${C['--color-slate-100']};color:${C['--ink']}}
20500
+ .svhd-composer .svhd-composer-input:disabled{background:${HELP_DESK_COLORS.canvas}}
20501
+ .svhd-composer .svhd-composer-drop{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;margin:0;padding:12px;border-radius:5px;background:${HELP_DESK_COLORS.selection};color:${HELP_DESK_ACCENT.ink};font-size:15px;font-weight:600;line-height:1.4;text-align:center;pointer-events:none}
20502
+ .svhd-composer .svhd-composer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;padding:0 4px;border-top:1px solid ${HELP_DESK_COLORS.fillStrong}}
20503
+ .svhd-composer .svhd-composer-attach{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin:0;padding:0 8px;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.body};font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;cursor:pointer}
20504
+ .svhd-composer .svhd-composer-attach:hover,.svhd-composer .svhd-composer-help:hover{background:${HELP_DESK_COLORS.fill};color:${HELP_DESK_COLORS.ink}}
19992
20505
  .svhd-composer .svhd-composer-attach:disabled{opacity:.6;cursor:default}
19993
20506
  .svhd-composer .svhd-composer-attach svg{display:block;width:18px;height:18px}
19994
- .svhd-composer .svhd-composer-help{display:inline-grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:${C['--color-slate-600']};font-family:inherit;cursor:pointer}
20507
+ .svhd-composer .svhd-composer-help{display:inline-grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.body};font-family:inherit;cursor:pointer}
19995
20508
  .svhd-composer .svhd-composer-help-glyph{display:inline-grid;place-items:center;width:20px;height:20px;border:1px solid currentColor;border-radius:50%;font-size:13px;font-weight:600;line-height:1}
19996
- .svhd-composer .svhd-composer-help-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;align-items:start;flex:1 1 100%;min-width:0;margin:0 0 8px;padding:10px 12px;border:1px solid ${C['--color-slate-200']};border-radius:6px;background:${C['--canvas']};color:${C['--color-slate-600']};font-size:13px;line-height:1.5}
20509
+ .svhd-composer .svhd-composer-help-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;align-items:start;flex:1 1 100%;min-width:0;margin:0 0 8px;padding:10px 12px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:6px;background:${HELP_DESK_COLORS.canvas};color:${HELP_DESK_COLORS.body};font-size:13px;line-height:1.5}
19997
20510
  .svhd-composer .svhd-composer-help-copy{grid-column:1;min-width:0;overflow-wrap:anywhere}
19998
20511
  .svhd-composer .svhd-composer-help-copy p{margin:0}
19999
20512
  .svhd-composer .svhd-composer-help-copy p+p{margin-top:6px}
20000
- .svhd-composer .svhd-composer-help-close{grid-row:1;grid-column:2;display:grid;place-items:center;width:44px;height:44px;margin:-10px -12px 0 0;padding:0;border:0;border-radius:6px;background:transparent;color:${C['--color-slate-600']};cursor:pointer}
20001
- .svhd-composer .svhd-composer-help-close:hover,.svhd-composer .svhd-attachment-remove:hover{background:${C['--color-slate-200']};color:${C['--ink']}}
20513
+ .svhd-composer .svhd-composer-help-close{grid-row:1;grid-column:2;display:grid;place-items:center;width:44px;height:44px;margin:-10px -12px 0 0;padding:0;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.body};cursor:pointer}
20514
+ .svhd-composer .svhd-composer-help-close:hover,.svhd-composer .svhd-attachment-remove:hover{background:${HELP_DESK_COLORS.fillStrong};color:${HELP_DESK_COLORS.ink}}
20002
20515
  .svhd-composer .svhd-composer-help-close svg,.svhd-composer .svhd-attachment-remove svg{display:block;width:16px;height:16px}
20003
- .svhd-composer .svhd-attachment-chips{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:8px;border-top:1px solid ${C['--color-slate-200']}}
20516
+ .svhd-composer .svhd-attachment-chips{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:8px;border-top:1px solid ${HELP_DESK_COLORS.fillStrong}}
20004
20517
  .svhd-composer .svhd-attachment-chips:empty{display:none}
20005
- .svhd-composer .svhd-attachment-chip{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;align-content:start;flex:0 1 280px;min-width:0;max-width:100%;margin:0;padding:0 0 8px 10px;border:1px solid ${C['--color-slate-200']};border-radius:6px;background:${C['--canvas']};font-size:13px;line-height:1.4}
20006
- .svhd-composer .svhd-attachment-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;color:${C['--ink']}}
20007
- .svhd-composer .svhd-attachment-status{grid-column:1;padding-right:8px;color:${C['--color-slate-600']};font-size:12px;overflow-wrap:anywhere}
20008
- .svhd-composer .svhd-attachment-status.svhd-composer-problem{color:${C['--color-error']}}
20009
- .svhd-composer .svhd-attachment-progress{grid-column:1/-1;width:calc(100% - 10px);height:6px;margin-top:6px;accent-color:${ACCENT_INK}}
20010
- .svhd-composer .svhd-attachment-remove{display:grid;place-items:center;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:${C['--color-slate-600']};cursor:pointer}
20011
- .svhd-composer .svhd-attachment-retry{grid-column:2;min-height:44px;margin:0;padding:0 10px;border:0;border-radius:6px;background:transparent;color:${ACCENT_INK};font-family:inherit;font-size:13px;font-weight:600;line-height:1.4;text-decoration:underline;cursor:pointer}
20518
+ .svhd-composer .svhd-attachment-chip{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;align-content:start;flex:0 1 280px;min-width:0;max-width:100%;margin:0;padding:0 0 8px 10px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:6px;background:${HELP_DESK_COLORS.canvas};font-size:13px;line-height:1.4}
20519
+ .svhd-composer .svhd-attachment-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;color:${HELP_DESK_COLORS.ink}}
20520
+ .svhd-composer .svhd-attachment-status{grid-column:1;padding-right:8px;color:${HELP_DESK_COLORS.body};font-size:12px;overflow-wrap:anywhere}
20521
+ .svhd-composer .svhd-attachment-status.svhd-composer-problem{color:${HELP_DESK_COLORS.error}}
20522
+ .svhd-composer .svhd-attachment-progress{grid-column:1/-1;width:calc(100% - 10px);height:6px;margin-top:6px;accent-color:${HELP_DESK_ACCENT.ink}}
20523
+ .svhd-composer .svhd-attachment-remove{display:grid;place-items:center;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.body};cursor:pointer}
20524
+ .svhd-composer .svhd-attachment-retry{grid-column:2;min-height:44px;margin:0;padding:0 10px;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_ACCENT.ink};font-family:inherit;font-size:13px;font-weight:600;line-height:1.4;text-decoration:underline;cursor:pointer}
20012
20525
  .svhd-composer .svhd-attachment-remove:disabled,.svhd-composer .svhd-attachment-retry:disabled{opacity:.6;cursor:default}
20013
20526
  .svhd-composer .svhd-composer-attach:focus-visible,.svhd-composer .svhd-composer-help:focus-visible,.svhd-composer .svhd-composer-help-close:focus-visible,.svhd-composer .svhd-attachment-remove:focus-visible,.svhd-composer .svhd-attachment-retry:focus-visible{${INSET_RING}}
20014
- .svhd-composer-notice{margin:0;color:${C['--color-error']};font-size:14px;line-height:1.5}
20527
+ .svhd-composer-notice{margin:0;color:${HELP_DESK_COLORS.error};font-size:14px;line-height:1.5}
20015
20528
  .svhd-composer [hidden],.svhd-composer-notice[hidden]{display:none!important}
20016
20529
  `;
20017
20530
 
@@ -20933,6 +21446,7 @@ function mountHelpDeskForm(client, options) {
20933
21446
  // The page that lays the support wizard out carries the attribution itself.
20934
21447
  footer: options.hostShowsAttribution ? null : createSecuredByFooter('svhd'),
20935
21448
  });
21449
+ applySupportBrand(shell.container, options.brand ?? supportBrand(client.desk.branding?.color));
20936
21450
  const prefix = `svhd-${++formSequence}`;
20937
21451
  const form = document.createElement('form');
20938
21452
  form.className = 'svhd-form';
@@ -22545,9 +23059,12 @@ function openHelpDeskForm(client, options = {}) {
22545
23059
  close.addEventListener('click', requestDismiss);
22546
23060
  header.append(title, close);
22547
23061
  const body = document.createElement('div');
23062
+ // Paired once for the modal and the form inside it.
23063
+ const brand = options.brand ?? supportBrand(client.desk.branding?.color);
23064
+ applySupportBrand(shell.modal, brand);
22548
23065
  shell.modal.append(header, body);
22549
23066
  try {
22550
- inner = mountHelpDeskForm(client, { ...options, target: body, onCancel: cancel });
23067
+ inner = mountHelpDeskForm(client, { ...options, brand, target: body, onCancel: cancel });
22551
23068
  // State observers run while the inner form mounts. They can dismiss the
22552
23069
  // shell before mountHelpDeskForm hands us its cleanup handle.
22553
23070
  if (destroyed)
@@ -24604,8 +25121,12 @@ function createSupportAnalytics({ deskId, post }) {
24604
25121
  }
24605
25122
 
24606
25123
  let launcherSequence = 0;
24607
- /** A convenience path only: it never owns a second support flow. */
24608
- function createSupportLauncher(options, open) {
25124
+ /**
25125
+ * A convenience path only: it never owns a second support flow. It carries
25126
+ * the desk's brand (`brand`, then setBrand), so its focus ring is the desk's,
25127
+ * as the panel's are.
25128
+ */
25129
+ function createSupportLauncher(options, brand, open) {
24609
25130
  const button = document.createElement('button');
24610
25131
  button.type = 'button';
24611
25132
  button.className = 'sv-support-launcher';
@@ -24614,7 +25135,7 @@ function createSupportLauncher(options, open) {
24614
25135
  button.setAttribute('aria-haspopup', 'dialog');
24615
25136
  button.setAttribute('aria-expanded', 'false');
24616
25137
  const offset = (value, fallback) => typeof value === 'number' && Number.isFinite(value) ? Math.min(240, Math.max(12, value)) : fallback;
24617
- button.style.cssText = `position:fixed;right:calc(${offset(options.right, 24)}px + env(safe-area-inset-right,0px));bottom:calc(${offset(options.bottom, 24)}px + env(safe-area-inset-bottom,0px));z-index:2147482800;width:56px;height:56px;border-radius:50%;border:1px solid ${withAlpha(DS.white, .22)};background:${DS.slate900};color:${DS.white};box-shadow:${DS.shadowPopover};display:grid;place-items:center;cursor:pointer;padding:0;overflow:hidden;`;
25138
+ button.style.cssText = `position:fixed;right:calc(${offset(options.right, 24)}px + env(safe-area-inset-right,0px));bottom:calc(${offset(options.bottom, 24)}px + env(safe-area-inset-bottom,0px));z-index:2147482800;width:56px;height:56px;border-radius:50%;border:1px solid ${withAlpha(DS.white, .22)};background:${DS.slate900};color:${DS.white};display:grid;place-items:center;cursor:pointer;padding:0;overflow:hidden;`;
24618
25139
  if (options.imageUrl) {
24619
25140
  let url;
24620
25141
  try {
@@ -24640,19 +25161,37 @@ function createSupportLauncher(options, open) {
24640
25161
  mark.style.cssText = 'display:grid;place-items:center;width:26px;height:26px;border:1.8px solid currentColor;border-radius:50%;font:600 20px/1 system-ui,sans-serif';
24641
25162
  button.append(mark);
24642
25163
  }
25164
+ applySupportBrand(button, brand);
24643
25165
  button.addEventListener('click', open);
24644
25166
  document.body.append(button);
24645
25167
  return {
24646
25168
  setExpanded(expanded) { button.setAttribute('aria-expanded', String(expanded)); },
25169
+ setBrand(next) { applySupportBrand(button, next); },
24647
25170
  destroy() { button.removeEventListener('click', open); button.remove(); },
24648
25171
  };
24649
25172
  }
24650
25173
 
25174
+ /**
25175
+ * The launcher's focus ring. The launcher floats over whatever the website
25176
+ * draws beneath it, so its ring opens with two bands no page color hides
25177
+ * (WCAG technique C40): white, then slate-950, which stand over 9:1 apart, so
25178
+ * one of them stands at 3:1 or more on any ground. It is the design system's
25179
+ * focus ring (`--focus-ring`: a surface gap, then the ring) with the darkest
25180
+ * slate as its ring, and the desk's focus color rings outside both.
25181
+ */
25182
+ const LAUNCHER_RING = `0 0 0 2px ${DS.white},0 0 0 4px ${DS.slate950}`;
24651
25183
  /**
24652
25184
  * The support journey's only skin. Customer content stays in the product register.
24653
25185
  * The panel's focus ring is 2px, 3px out, in the desk's focus color: its width and
24654
25186
  * offset are the panel's custom properties, which the help desk composer inside
24655
- * its request form reads, so the composer rings as the fields beside it do.
25187
+ * its request form reads, so the composer rings as the fields beside it do. It
25188
+ * paints in the help desk's color roles (@sparkvault/app-sdk/help-desk-colors):
25189
+ * its neutrals read the page's roles (HOST), so in the customer portal they
25190
+ * follow the portal's scheme, and stay light anywhere else; its accent reads
25191
+ * the page's accent roles, else the desk's light pairing (ACCENT), which the
25192
+ * panel and the launcher each carry (DEFAULT_PAIRING_DECLARATIONS), so the
25193
+ * launcher rings in the desk's color, as every control in the panel does,
25194
+ * outside a ring of its own that reads on any page (LAUNCHER_RING).
24656
25195
  */
24657
25196
  function injectHelpDeskSupportStyles() {
24658
25197
  if (document.getElementById('sparkvault-help-desk-support-styles'))
@@ -24661,8 +25200,8 @@ function injectHelpDeskSupportStyles() {
24661
25200
  style.id = 'sparkvault-help-desk-support-styles';
24662
25201
  style.textContent = `
24663
25202
  .svhs-panel,.svhs-panel *{box-sizing:border-box}
24664
- .svhs-panel{--hd-focus-width:2px;--hd-focus-offset:3px}
24665
- .svhs-panel{position:fixed;right:calc(var(--svhs-right,24px) + env(safe-area-inset-right,0px));bottom:calc(var(--svhs-bottom,96px) + env(safe-area-inset-bottom,0px));z-index:2147482900;width:408px;height:422px;max-width:calc(100vw - 32px);max-height:calc(100dvh - var(--svhs-bottom,96px) - 24px);display:flex;flex-direction:column;overflow:hidden;border:1px solid ${DS.slate200};border-radius:12px;background:${DS.white};color:${DS.slate900};font:400 15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif;text-align:left;box-shadow:${DS.shadowPopover};transform-origin:bottom right;transition:width 180ms cubic-bezier(.2,0,0,1),height 180ms cubic-bezier(.2,0,0,1)}
25203
+ .svhs-panel{--hd-focus-width:2px;--hd-focus-offset:3px;${DEFAULT_PAIRING_DECLARATIONS}}
25204
+ .svhs-panel{position:fixed;right:calc(var(--svhs-right,24px) + env(safe-area-inset-right,0px));bottom:calc(var(--svhs-bottom,96px) + env(safe-area-inset-bottom,0px));z-index:2147482900;width:408px;height:422px;max-width:calc(100vw - 32px);max-height:calc(100dvh - var(--svhs-bottom,96px) - 24px);display:flex;flex-direction:column;overflow:hidden;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:12px;background:${HELP_DESK_COLORS.surface};color:${HELP_DESK_COLORS.ink};font:400 15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif;text-align:left;box-shadow:${DS.shadowPopover};transform-origin:bottom right;transition:width 180ms cubic-bezier(.2,0,0,1),height 180ms cubic-bezier(.2,0,0,1)}
24666
25205
  .svhs-panel[hidden],.svhs-panel [hidden]{display:none!important}
24667
25206
  .svhs-panel[data-stage=results]{height:680px}
24668
25207
  .svhs-panel[data-stage=article]{width:704px;height:700px}
@@ -24673,99 +25212,99 @@ function injectHelpDeskSupportStyles() {
24673
25212
  .svhs-panel button,.svhs-panel a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
24674
25213
  .svhs-panel button{appearance:none;cursor:pointer;margin:0}
24675
25214
  .svhs-panel button:active{transform:translateY(1px)}
24676
- .svhs-panel button:focus-visible,.svhs-panel a:focus-visible,.svhs-panel input:focus-visible,.svhs-panel textarea:focus-visible{outline:var(--hd-focus-width) solid var(--hd-focus,var(--hd-accent-ink,${DS.action}));outline-offset:var(--hd-focus-offset);box-shadow:none}
25215
+ .svhs-panel button:focus-visible,.svhs-panel a:focus-visible,.svhs-panel input:focus-visible,.svhs-panel textarea:focus-visible{outline:var(--hd-focus-width) solid ${HELP_DESK_FOCUS};outline-offset:var(--hd-focus-offset);box-shadow:none}
24677
25216
  .svhs-panel svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none;pointer-events:none}
24678
- .svhs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;flex:none;padding:8px 14px 8px 24px;border-bottom:1px solid ${DS.slate200}}
24679
- .svhs-desk-name{font-size:14px;font-weight:600;line-height:1.35;color:${DS.slate600};overflow-wrap:anywhere;min-width:0}
25217
+ .svhs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;flex:none;padding:8px 14px 8px 24px;border-bottom:1px solid ${HELP_DESK_COLORS.fillStrong}}
25218
+ .svhs-desk-name{font-size:14px;font-weight:600;line-height:1.35;color:${HELP_DESK_COLORS.body};overflow-wrap:anywhere;min-width:0}
24680
25219
  .svhs-toolbar-actions{display:flex;align-items:center;gap:4px;margin-left:auto;flex:none}
24681
- .svhs-identity-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:8px 24px;border-bottom:1px solid ${DS.slate200};background:${DS.slate50}}
25220
+ .svhs-identity-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:8px 24px;border-bottom:1px solid ${HELP_DESK_COLORS.fillStrong};background:${HELP_DESK_COLORS.canvas}}
24682
25221
  .svhs-identity-notice .svhs-status{margin:0;font-size:13px}
24683
25222
  .svhs-identity-notice .svhs-text-button{flex:none;font-size:13px!important}
24684
- .svhs-icon-button{display:grid;place-items:center;width:40px;height:40px;flex:none;padding:0;border:0;border-radius:6px;background:transparent;color:${DS.slate500};text-decoration:none}
24685
- .svhs-icon-button:hover{background:${DS.slate100};color:${DS.slate900}}
24686
- .svhs-back{display:flex;align-items:center;gap:4px;flex:none;min-height:40px;margin-left:-10px!important;padding:8px;border:0;border-radius:6px;background:transparent;color:${DS.slate600};font-size:14px!important;font-weight:500!important;line-height:1.4}
24687
- .svhs-back:hover{background:${DS.slate50}}
24688
- .svhs-back:disabled{background:transparent;color:${DS.slate500};cursor:default;transform:none}
25223
+ .svhs-icon-button{display:grid;place-items:center;width:40px;height:40px;flex:none;padding:0;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.muted};text-decoration:none}
25224
+ .svhs-icon-button:hover{background:${HELP_DESK_COLORS.fill};color:${HELP_DESK_COLORS.ink}}
25225
+ .svhs-back{display:flex;align-items:center;gap:4px;flex:none;min-height:40px;margin-left:-10px!important;padding:8px;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_COLORS.body};font-size:14px!important;font-weight:500!important;line-height:1.4}
25226
+ .svhs-back:hover{background:${HELP_DESK_COLORS.hover}}
25227
+ .svhs-back:disabled{background:transparent;color:${HELP_DESK_COLORS.muted};cursor:default;transform:none}
24689
25228
  .svhs-screen{display:flex;flex-direction:column;min-height:0;flex:1}
24690
25229
  .svhs-scroll{padding:26px 24px;overflow:auto;overscroll-behavior:contain;min-height:0;flex:1;scrollbar-gutter:stable}
24691
- .svhs-heading{margin:0 0 8px;padding:0;color:${DS.slate900};font-size:24px;font-weight:600;line-height:1.3;letter-spacing:-.6px;overflow-wrap:anywhere}
25230
+ .svhs-heading{margin:0 0 8px;padding:0;color:${HELP_DESK_COLORS.ink};font-size:24px;font-weight:600;line-height:1.3;letter-spacing:-.6px;overflow-wrap:anywhere}
24692
25231
  .svhs-heading:focus,.svhs-article-title:focus{outline:none;box-shadow:none}
24693
- .svhs-copy{margin:0 0 24px;color:${DS.slate600};font-size:14px;line-height:1.55}
24694
- .svhs-label{display:block;margin:0 0 7px;font-size:13px;font-weight:600;color:${DS.slate600}}
24695
- .svhs-issue{display:block;width:100%;min-height:120px;max-height:200px;resize:none;overflow-y:auto;border:1px solid ${DS.slate300};border-radius:8px;padding:12px 14px;background:${DS.white};color:${DS.slate900};font-size:16px!important;line-height:1.5!important;box-shadow:none}
25232
+ .svhs-copy{margin:0 0 24px;color:${HELP_DESK_COLORS.body};font-size:14px;line-height:1.55}
25233
+ .svhs-label{display:block;margin:0 0 7px;font-size:13px;font-weight:600;color:${HELP_DESK_COLORS.body}}
25234
+ .svhs-issue{display:block;width:100%;min-height:120px;max-height:200px;resize:none;overflow-y:auto;border:1px solid ${HELP_DESK_COLORS.lineStrong};border-radius:8px;padding:12px 14px;background:${HELP_DESK_COLORS.field};color:${HELP_DESK_COLORS.ink};font-size:16px!important;line-height:1.5!important;box-shadow:none}
24696
25235
  /* The heading is the field's label, so the field follows it at a label's distance from a question this large. */
24697
25236
  .svhs-heading+.svhs-issue{margin-top:16px}
24698
- .svhs-issue::placeholder{color:${DS.slate500};opacity:1}
24699
- .svhs-issue:focus{border-color:var(--hd-focus,var(--hd-accent-ink,${DS.action}))}
25237
+ .svhs-issue::placeholder{color:${HELP_DESK_COLORS.muted};opacity:1}
25238
+ .svhs-issue:focus{border-color:${HELP_DESK_FOCUS}}
24700
25239
  .svhs-primary,.svhs-secondary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid transparent;border-radius:6px;font-size:14px!important;font-weight:600!important;line-height:1.4!important;text-decoration:none;transition:background 120ms cubic-bezier(.2,0,0,1)}
24701
- .svhs-primary{background:var(--hd-accent,${DS.action});color:var(--hd-on-accent,${DS.white})}
24702
- .svhs-primary:hover{background:var(--hd-accent-hover,${DS.actionHover})}
25240
+ .svhs-primary{background:${HELP_DESK_ACCENT.fill};color:${HELP_DESK_ACCENT.onAccent}}
25241
+ .svhs-primary:hover{background:${HELP_DESK_ACCENT.hover}}
24703
25242
  .svhs-primary[aria-disabled=true]{cursor:progress}
24704
- .svhs-secondary{border-color:${DS.slate300};background:${DS.white};color:${DS.slate600}}
24705
- .svhs-secondary:hover{background:${DS.slate50}}
24706
- .svhs-text-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:9px 4px;border:0;border-radius:6px;background:transparent;color:var(--hd-accent-ink,${DS.action});font-size:14px!important;line-height:1.4!important;text-decoration:none}
25243
+ .svhs-secondary{border-color:${HELP_DESK_COLORS.lineStrong};background:${HELP_DESK_COLORS.surface};color:${HELP_DESK_COLORS.body}}
25244
+ .svhs-secondary:hover{background:${HELP_DESK_COLORS.hover}}
25245
+ .svhs-text-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:9px 4px;border:0;border-radius:6px;background:transparent;color:${HELP_DESK_ACCENT.ink};font-size:14px!important;line-height:1.4!important;text-decoration:none}
24707
25246
  .svhs-text-button:hover{text-decoration:underline}
24708
25247
  .svhs-full{width:100%}
24709
- .svhs-bottom{padding:16px 24px 18px;flex:none;border-top:1px solid ${DS.slate100}}
25248
+ .svhs-bottom{padding:16px 24px 18px;flex:none;border-top:1px solid ${HELP_DESK_COLORS.fill}}
24710
25249
  .svhs-start-bottom{display:flex;flex-direction:column;align-items:center;gap:6px;padding-top:0;border-top:0}
24711
25250
  .svhs-start-bottom .svhs-primary{width:100%}
24712
- .svhs-query{display:flex;align-items:center;gap:12px;margin:0 0 24px;padding:12px 14px;border:1px solid ${DS.slate200};border-radius:8px;background:${DS.slate50}}
25251
+ .svhs-query{display:flex;align-items:center;gap:12px;margin:0 0 24px;padding:12px 14px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:8px;background:${HELP_DESK_COLORS.canvas}}
24713
25252
  .svhs-question{flex:1;min-width:0}
24714
- .svhs-question-label{display:block;margin-bottom:3px;color:${DS.slate500};font-size:12px;font-weight:500;line-height:1.4}
24715
- .svhs-query-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${DS.slate900};font-size:14px;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}
25253
+ .svhs-question-label{display:block;margin-bottom:3px;color:${HELP_DESK_COLORS.muted};font-size:12px;font-weight:500;line-height:1.4}
25254
+ .svhs-query-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${HELP_DESK_COLORS.ink};font-size:14px;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}
24716
25255
  .svhs-query .svhs-text-button{flex:none;min-width:44px;padding:8px 0}
24717
25256
  .svhs-results{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}
24718
- .svhs-result{display:grid;grid-template-columns:24px minmax(0,1fr) 16px;align-items:start;gap:12px;width:100%;padding:18px 0;border:0;border-bottom:1px solid ${DS.slate200};border-radius:0;background:${DS.white};color:${DS.slate900};text-align:left}
24719
- .svhs-results li:first-child .svhs-result{border-top:1px solid ${DS.slate200}}
25257
+ .svhs-result{display:grid;grid-template-columns:24px minmax(0,1fr) 16px;align-items:start;gap:12px;width:100%;padding:18px 0;border:0;border-bottom:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:0;background:${HELP_DESK_COLORS.surface};color:${HELP_DESK_COLORS.ink};text-align:left}
25258
+ .svhs-results li:first-child .svhs-result{border-top:1px solid ${HELP_DESK_COLORS.fillStrong}}
24720
25259
  .svhs-results li:last-child .svhs-result{border-bottom:0}
24721
25260
  .svhs-result-copy{display:block;min-width:0}
24722
- .svhs-result-icon{margin-top:2px;color:${DS.slate500}}
24723
- .svhs-result-chevron{width:16px!important;height:16px!important;margin-top:4px;color:${DS.slate500}}
25261
+ .svhs-result-icon{margin-top:2px;color:${HELP_DESK_COLORS.muted}}
25262
+ .svhs-result-chevron{width:16px!important;height:16px!important;margin-top:4px;color:${HELP_DESK_COLORS.muted}}
24724
25263
  .svhs-result-title{display:block;margin:0 0 4px;color:inherit;font-size:16px;font-weight:600;line-height:1.4;letter-spacing:-.15px;overflow-wrap:anywhere}
24725
- .svhs-result:hover{background:${DS.slate50}}
24726
- .svhs-result:hover .svhs-result-title{color:var(--hd-accent-ink,${DS.action});text-decoration:underline}
24727
- .svhs-result-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${DS.slate600};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
24728
- .svhs-result-category{display:block;margin-top:6px;color:${DS.slate500};font-size:12px;line-height:1.4}
24729
- .svhs-results-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;background:${DS.slate50};border-top-color:${DS.slate200}}
25264
+ .svhs-result:hover{background:${HELP_DESK_COLORS.hover}}
25265
+ .svhs-result:hover .svhs-result-title{color:${HELP_DESK_ACCENT.ink};text-decoration:underline}
25266
+ .svhs-result-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${HELP_DESK_COLORS.body};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
25267
+ .svhs-result-category{display:block;margin-top:6px;color:${HELP_DESK_COLORS.muted};font-size:12px;line-height:1.4}
25268
+ .svhs-results-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;background:${HELP_DESK_COLORS.canvas};border-top-color:${HELP_DESK_COLORS.fillStrong}}
24730
25269
  /* Wraps below the ticket button when less than 200px remain beside it, as under the panel's full-width button. */
24731
- .svhs-contact-note{flex:1 1 200px;min-width:0;margin:0;color:${DS.slate500};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
24732
- .svhs-error{margin:12px 0 0;color:${DS.error};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
24733
- .svhs-status{margin:16px 0;color:${DS.slate600};font-size:14px;line-height:1.5}
25270
+ .svhs-contact-note{flex:1 1 200px;min-width:0;margin:0;color:${HELP_DESK_COLORS.muted};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
25271
+ .svhs-error{margin:12px 0 0;color:${HELP_DESK_COLORS.error};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
25272
+ .svhs-status{margin:16px 0;color:${HELP_DESK_COLORS.body};font-size:14px;line-height:1.5}
24734
25273
  .svhs-empty{padding:12px 0 4px}
24735
25274
  .svhs-empty .svhs-heading{font-size:18px;letter-spacing:-.3px}
24736
25275
  .svhs-spinner{width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:svhs-spin .7s linear infinite;flex:none}
24737
25276
  @keyframes svhs-spin{to{transform:rotate(360deg)}}
24738
25277
  .svhs-article-scroll{padding:34px 48px 28px}
24739
- .svhs-category{margin:0 0 12px;color:${DS.slate500};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
24740
- .svhs-article-title{margin:0 0 18px;color:${DS.slate900};font-size:28px;font-weight:600;line-height:1.2;letter-spacing:-.8px;overflow-wrap:anywhere}
24741
- .svhs-article-content{color:${DS.slate600};font-size:15px;line-height:1.65;overflow-wrap:anywhere}
25278
+ .svhs-category{margin:0 0 12px;color:${HELP_DESK_COLORS.muted};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
25279
+ .svhs-article-title{margin:0 0 18px;color:${HELP_DESK_COLORS.ink};font-size:28px;font-weight:600;line-height:1.2;letter-spacing:-.8px;overflow-wrap:anywhere}
25280
+ .svhs-article-content{color:${HELP_DESK_COLORS.body};font-size:15px;line-height:1.65;overflow-wrap:anywhere}
24742
25281
  .svhs-article-content>*:first-child{margin-top:0}
24743
25282
  .svhs-article-content p{margin:0 0 18px;font:inherit;color:inherit}
24744
- .svhs-article-content h1,.svhs-article-content h2,.svhs-article-content h3,.svhs-article-content h4,.svhs-article-content h5,.svhs-article-content h6{margin:28px 0 12px;color:${DS.slate900};font-size:18px;font-weight:600;line-height:1.35;letter-spacing:-.3px;scroll-margin-top:24px}
25283
+ .svhs-article-content h1,.svhs-article-content h2,.svhs-article-content h3,.svhs-article-content h4,.svhs-article-content h5,.svhs-article-content h6{margin:28px 0 12px;color:${HELP_DESK_COLORS.ink};font-size:18px;font-weight:600;line-height:1.35;letter-spacing:-.3px;scroll-margin-top:24px}
24745
25284
  .svhs-article-content h3,.svhs-article-content h4,.svhs-article-content h5,.svhs-article-content h6{font-size:16px}
24746
25285
  .svhs-article-content ul,.svhs-article-content ol{margin:0 0 22px;padding-left:22px}
24747
25286
  .svhs-article-content li{margin:8px 0;padding-left:5px}
24748
- .svhs-article-content strong{font-weight:600;color:${DS.slate900}}
24749
- .svhs-article-content a{color:var(--hd-accent-ink,${DS.action});text-decoration:underline;text-underline-offset:2px}
25287
+ .svhs-article-content strong{font-weight:600;color:${HELP_DESK_COLORS.ink}}
25288
+ .svhs-article-content a{color:${HELP_DESK_ACCENT.ink};text-decoration:underline;text-underline-offset:2px}
24750
25289
  .svhs-article-content img,.svhs-article-content video{display:block;max-width:100%;height:auto;margin:20px 0}
24751
25290
  .svhs-reader-asset{display:block;max-width:100%;margin:20px 0}
24752
25291
  .svhs-reader-asset img{margin:0}
24753
- .svhs-reader-asset-status{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;min-height:140px;padding:20px;border:1px solid ${DS.slate200};border-radius:6px;background:${DS.slate50};color:${DS.slate500};font-size:13px;text-align:center}
25292
+ .svhs-reader-asset-status{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;min-height:140px;padding:20px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:6px;background:${HELP_DESK_COLORS.canvas};color:${HELP_DESK_COLORS.muted};font-size:13px;text-align:center}
24754
25293
  .svhs-reader-asset-status[style]{min-height:0}
24755
- .svhs-article-content blockquote{margin:22px 0;padding:0 0 0 16px;border-left:2px solid ${DS.slate300};font-size:14px}
24756
- .svhs-article-content pre{margin:20px 0;padding:14px;border:1px solid ${DS.slate200};border-radius:6px;background:${DS.slate50};overflow:auto;overscroll-behavior:contain;font:13px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace}
25294
+ .svhs-article-content blockquote{margin:22px 0;padding:0 0 0 16px;border-left:2px solid ${HELP_DESK_COLORS.lineStrong};font-size:14px}
25295
+ .svhs-article-content pre{margin:20px 0;padding:14px;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:6px;background:${HELP_DESK_COLORS.canvas};overflow:auto;overscroll-behavior:contain;font:13px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace}
24757
25296
  .svhs-article-content code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}
24758
25297
  .svhs-article-content table{display:block;max-width:100%;border-collapse:collapse;overflow:auto;overscroll-behavior:contain;margin:20px 0;font-size:14px}
24759
- .svhs-article-content th,.svhs-article-content td{padding:10px 12px;border:1px solid ${DS.slate200};text-align:left}
24760
- .svhs-article-content hr{margin:24px 0;border:0;border-top:1px solid ${DS.slate200}}
24761
- .svhs-article-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 24px;border-top:1px solid ${DS.slate100};flex:none}
25298
+ .svhs-article-content th,.svhs-article-content td{padding:10px 12px;border:1px solid ${HELP_DESK_COLORS.fillStrong};text-align:left}
25299
+ .svhs-article-content hr{margin:24px 0;border:0;border-top:1px solid ${HELP_DESK_COLORS.fillStrong}}
25300
+ .svhs-article-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 24px;border-top:1px solid ${HELP_DESK_COLORS.fill};flex:none}
24762
25301
  .svhs-article-footer .svhs-primary{min-width:110px}
24763
25302
  .svhs-article-footer .svhs-text-button{white-space:nowrap;font-size:13px!important}
24764
- .svhs-article-question{color:${DS.slate500};font-size:13px;line-height:1.5}
25303
+ .svhs-article-question{color:${HELP_DESK_COLORS.muted};font-size:13px;line-height:1.5}
24765
25304
  .svhs-reader-actions{display:flex;align-items:stretch;gap:12px;flex:none}
24766
25305
  .svhs-feedback-scroll{padding-top:30px}
24767
25306
  .svhs-feedback-actions{display:flex;flex-direction:column;gap:9px;margin-top:24px}
24768
- .svhs-feedback-actions .svhs-text-button{align-self:center;color:${DS.slate500}}
25307
+ .svhs-feedback-actions .svhs-text-button{align-self:center;color:${HELP_DESK_COLORS.muted}}
24769
25308
  .svhs-review{margin-top:24px}
24770
25309
  .svhs-review .svhs-primary{width:fit-content}
24771
25310
  .svhs-contact-scroll{padding:0;scrollbar-gutter:auto}
@@ -24774,8 +25313,8 @@ function injectHelpDeskSupportStyles() {
24774
25313
  .svhs-contact-prelude{padding:24px}
24775
25314
  .svhs-contact-prelude .svhs-secondary{margin-top:16px}
24776
25315
  .svhs-ticket-gate{padding:0 24px 24px}
24777
- .svhs-unlock-input{display:block;box-sizing:border-box;width:100%;min-height:46px;margin:0 0 16px;border:1px solid ${DS.slate300};border-radius:6px;padding:11px 12px;background:${DS.white};color:${DS.slate900};font-size:16px!important;line-height:1.5!important}
24778
- .svhs-unlock-input:focus{border-color:var(--hd-focus,var(--hd-accent-ink,${DS.action}))}
25316
+ .svhs-unlock-input{display:block;box-sizing:border-box;width:100%;min-height:46px;margin:0 0 16px;border:1px solid ${HELP_DESK_COLORS.lineStrong};border-radius:6px;padding:11px 12px;background:${HELP_DESK_COLORS.field};color:${HELP_DESK_COLORS.ink};font-size:16px!important;line-height:1.5!important}
25317
+ .svhs-unlock-input:focus{border-color:${HELP_DESK_FOCUS}}
24779
25318
  .svhs-unlock-form{margin:0}
24780
25319
  .svhs-contact-target>.svhd-container{display:flex;flex:1;flex-direction:column;min-height:100%;max-width:none;padding:24px;border:0;border-radius:0;box-shadow:none;background:transparent}
24781
25320
  .svhs-contact-target .svhd-body{display:flex;flex:1;flex-direction:column;min-height:0}
@@ -24784,44 +25323,39 @@ function injectHelpDeskSupportStyles() {
24784
25323
  .svhs-contact-target .svhd-label{font-size:13px;line-height:1.5}
24785
25324
  .svhs-contact-target .svhd-input{font-size:16px;line-height:1.5}
24786
25325
  .svhs-contact-target .svhd-actions{gap:10px}
24787
- .svhs-contact-target .svhd-button:not(.svhd-secondary){background:var(--hd-accent,${DS.action});color:var(--hd-on-accent,${DS.white})}
24788
- .svhs-contact-target .svhd-button:not(.svhd-secondary):hover{background:var(--hd-accent-hover,${DS.actionHover})}
24789
- .svhs-contact-target .svhd-link{color:var(--hd-accent-ink,${DS.action})}
24790
25326
  .svhs-contact-target .svhd-actions>.svhd-button:first-child{flex:1}
24791
25327
  .svhs-contact-target .svhd-status{font-size:14px}
24792
25328
  .svhs-contact-target .svhd-auth{gap:14px}
24793
- .svhs-contact-target .svhd-text-button{color:var(--hd-accent-ink,${DS.action})}
24794
- .svhs-contact-target .svhd-text-button:disabled{color:${DS.slate500}}
24795
25329
  .svhs-contact-target .svhd-widget-form{display:flex;flex:1;flex-direction:column;gap:16px}
24796
25330
  /* The request fills the panel: the details step, and in it the composer and its text, take the height the fields leave. */
24797
25331
  .svhs-contact-target .svhd-widget-form>[data-contact-step=details]{display:flex;flex:1;flex-direction:column;gap:16px}
24798
25332
  .svhs-contact-target .svhd-widget-form .svhd-composer-field{display:flex;flex:1;flex-direction:column;gap:6px;min-height:164px}
24799
25333
  .svhs-contact-target .svhd-widget-form .svhd-composer{flex:1}
24800
25334
  .svhs-contact-target .svhd-widget-form .svhd-composer-input{flex:1;min-height:120px}
24801
- .svhs-contact-target .svhd-widget-form>.svhd-actions{position:sticky;bottom:0;z-index:1;margin:auto -24px 0;padding:16px 24px 0;border-top:1px solid ${DS.slate100};background:${DS.white}}
25335
+ .svhs-contact-target .svhd-widget-form>.svhd-actions{position:sticky;bottom:0;z-index:1;margin:auto -24px 0;padding:16px 24px 0;border-top:1px solid ${HELP_DESK_COLORS.fill};background:${HELP_DESK_COLORS.surface}}
24802
25336
  .svhs-contact-target .svhd-widget-form>.svhd-actions>.svhd-secondary{display:none}
24803
25337
  .svhs-contact-target .svhd-widget-form .svhd-actions>.svhd-button{font-size:14px}
24804
- .svhs-contact-target .svhd-widget-form>.svhd-confirm{position:sticky;bottom:-24px;z-index:2;margin:0 -24px -24px;padding:16px 24px 24px;border-top:1px solid ${DS.slate200};background:${DS.white}}
25338
+ .svhs-contact-target .svhd-widget-form>.svhd-confirm{position:sticky;bottom:-24px;z-index:2;margin:0 -24px -24px;padding:16px 24px 24px;border-top:1px solid ${HELP_DESK_COLORS.fillStrong};background:${HELP_DESK_COLORS.surface}}
24805
25339
  .svhs-contact-target .svhd-widget-form>.svhd-confirm .svhd-actions{flex-wrap:nowrap}
24806
25340
  .svhs-contact-target .svhd-widget-form>.svhd-confirm .svhd-button{flex:1}
24807
25341
  .svhs-contact-target .svhd-footer{margin-top:16px;text-align:center;font-size:11px}
24808
25342
  .svhs-receipt-scroll{padding-top:36px}
24809
- .svhs-receipt-mark{width:30px!important;height:30px!important;margin-bottom:20px;color:var(--hd-accent-ink,${DS.action})}
24810
- .svhs-ticket-link{display:inline-flex;align-items:center;min-height:44px;margin:0 0 10px;color:var(--hd-accent-ink,${DS.action});font-size:14px;font-weight:600;text-decoration:underline}
25343
+ .svhs-receipt-mark{width:30px!important;height:30px!important;margin-bottom:20px;color:${HELP_DESK_ACCENT.ink}}
25344
+ .svhs-ticket-link{display:inline-flex;align-items:center;min-height:44px;margin:0 0 10px;color:${HELP_DESK_ACCENT.ink};font-size:14px;font-weight:600;text-decoration:underline}
24811
25345
  .svhs-receipt-note{white-space:pre-wrap;overflow-wrap:anywhere}
24812
25346
  .svhs-receipt-actions{display:flex;flex-direction:column;align-items:center;gap:4px}
24813
25347
  .svhs-toast{box-sizing:border-box;position:fixed;right:24px;bottom:calc(96px + var(--svhs-toast-offset,0px) + env(safe-area-inset-bottom));z-index:2147482901;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 36px);padding:14px 18px;border:1px solid transparent;border-radius:8px;background:${DS.slate900};color:${DS.white};box-shadow:${DS.shadowPopover};font:400 14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif;overflow-wrap:anywhere}
24814
25348
  .svhs-toast svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
24815
- .svhs-overlay{position:fixed;inset:0;z-index:2147482900;display:flex;background:${DS.white};padding:0;overflow:hidden}
25349
+ .svhs-overlay{position:fixed;inset:0;z-index:2147482900;display:flex;background:${HELP_DESK_COLORS.surface};padding:0;overflow:hidden}
24816
25350
  .svhs-modal{width:100%;height:100%;min-width:0;outline:none}
24817
25351
  .svhs-overlay .svhs-panel{position:relative;inset:auto;width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;box-shadow:none;padding-top:env(safe-area-inset-top);transition:none}
24818
- .sv-support-launcher{touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background 120ms cubic-bezier(.2,0,0,1)}
25352
+ .sv-support-launcher{touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background 120ms cubic-bezier(.2,0,0,1);box-shadow:${DS.shadowPopover};${DEFAULT_PAIRING_DECLARATIONS}}
24819
25353
  .sv-support-launcher:hover{filter:brightness(1.12)}
24820
25354
  .sv-support-launcher:active{transform:translateY(1px)}
24821
- .sv-support-launcher:focus-visible{outline:3px solid var(--hd-accent-ink,${DS.action});outline-offset:3px}
25355
+ .sv-support-launcher:focus-visible{outline:3px solid ${HELP_DESK_FOCUS};outline-offset:4px;box-shadow:${LAUNCHER_RING},${DS.shadowPopover}}
24822
25356
  @media(max-width:640px){
24823
25357
  .svhs-panel{right:0;bottom:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0}
24824
- .svhs-toolbar{min-height:60px;padding:8px 16px 8px 24px;border-bottom-color:${DS.slate200}}
25358
+ .svhs-toolbar{min-height:60px;padding:8px 16px 8px 24px;border-bottom-color:${HELP_DESK_COLORS.fillStrong}}
24825
25359
  .svhs-icon-button{width:44px;height:44px}
24826
25360
  .svhs-back{min-height:44px;max-width:42%}
24827
25361
  .svhs-scroll{padding:24px}
@@ -24853,7 +25387,7 @@ function injectHelpDeskSupportStyles() {
24853
25387
  @media(pointer:coarse){.svhs-icon-button{width:44px;height:44px}.svhs-back{min-height:44px}.svhs-query .svhs-text-button{min-height:44px;min-width:44px}}
24854
25388
  @media(prefers-reduced-motion:reduce){.svhs-panel,.svhs-panel *,.sv-support-launcher{transition-duration:0s!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}
24855
25389
  @media(forced-colors:active){.svhs-panel button:focus-visible,.svhs-panel a:focus-visible,.svhs-panel input:focus-visible,.svhs-panel textarea:focus-visible{outline:2px solid Highlight}.svhs-panel,.svhs-primary,.svhs-secondary{border:1px solid ButtonText}}
24856
- .svhs-panel.svhs-page{position:static;inset:auto;z-index:auto;width:100%;height:auto;max-width:720px;max-height:none;margin:0 auto;border:1px solid ${DS.slate200};border-radius:12px;box-shadow:none;transition:none}
25390
+ .svhs-panel.svhs-page{position:static;inset:auto;z-index:auto;width:100%;height:auto;max-width:720px;max-height:none;margin:0 auto;border:1px solid ${HELP_DESK_COLORS.fillStrong};border-radius:12px;box-shadow:none;transition:none}
24857
25391
  .svhs-page .svhs-toolbar{min-height:52px;padding:4px 24px}
24858
25392
  .svhs-page .svhs-back{max-width:none;white-space:nowrap}
24859
25393
  .svhs-page .svhs-desk-name{display:none}
@@ -25050,35 +25584,6 @@ class SupportPhoneHistory {
25050
25584
  }
25051
25585
  }
25052
25586
 
25053
- /** Darken only the narrow range where neither white nor the product ink reaches AA. */
25054
- function accessibleFill(color) {
25055
- let fill = color;
25056
- while ((accentFillContrast(fill) ?? 0) < AA_TEXT_CONTRAST) {
25057
- fill = `#${[1, 3, 5].map(offset => Math.floor(Number.parseInt(fill.slice(offset, offset + 2), 16) * 0.98).toString(16).padStart(2, '0')).join('')}`;
25058
- }
25059
- return fill;
25060
- }
25061
- /** Scoped brand properties work in both a hosted page and an unrelated widget host. */
25062
- function applySupportBrand(target, value) {
25063
- const color = brandColor(value);
25064
- if (!color) {
25065
- for (const name of ['--hd-accent', '--hd-on-accent', '--hd-accent-ink', '--hd-accent-hover', '--hd-focus'])
25066
- target.style.removeProperty(name);
25067
- return;
25068
- }
25069
- const fill = accessibleFill(color);
25070
- const pairing = accentPairing(fill);
25071
- const ink = pairing.accentInk === 'accent' ? fill : DS.slate900;
25072
- const label = pairing.onAccent === 'white' ? DS.white : DS.slate900;
25073
- // Dark fills deepen on hover; light fills stay unchanged to preserve label contrast.
25074
- const hover = pairing.onAccent === 'white'
25075
- ? `#${[1, 3, 5].map(offset => Math.floor(Number.parseInt(fill.slice(offset, offset + 2), 16) * 0.9).toString(16).padStart(2, '0')).join('')}`
25076
- : fill;
25077
- const properties = { '--hd-accent': fill, '--hd-on-accent': label, '--hd-accent-ink': ink, '--hd-accent-hover': hover, '--hd-focus': ink };
25078
- for (const [name, content] of Object.entries(properties))
25079
- target.style.setProperty(name, content);
25080
- }
25081
-
25082
25587
  /* global MediaQueryList, HTMLImageElement, HTMLAnchorElement, Element */
25083
25588
  let sequence = 0;
25084
25589
  function element(tag, className, text) {
@@ -25365,7 +25870,8 @@ class SupportView {
25365
25870
  if (previous)
25366
25871
  this.saveScroll(previous);
25367
25872
  this.state = next;
25368
- applySupportBrand(this.panel, next.brandColor);
25873
+ if (next.brand !== previous?.brand)
25874
+ applySupportBrand(this.panel, next.brand);
25369
25875
  this.panel.dataset.stage = next.stage;
25370
25876
  const inset = (value, fallback) => typeof value === 'number' && Number.isFinite(value) ? Math.min(480, Math.max(0, value)) : fallback;
25371
25877
  this.panel.style.setProperty('--svhs-right', `${inset(next.position?.right, 24)}px`);
@@ -26068,7 +26574,11 @@ function createHelpDeskSupport(config, options) {
26068
26574
  let sourceArticleId;
26069
26575
  const lifetime = new AbortController();
26070
26576
  const bindings = new Set();
26071
- let state = { visible: false, stage: 'issue', deskName: 'Support', issue: '' };
26577
+ // A desk the page already holds brands the journey from the start, the
26578
+ // launcher included. Any other desk's brand arrives with connect, which the
26579
+ // first open, search or contact makes, never creation: connecting here would
26580
+ // add a desk lookup to every page load of a website that shows the launcher.
26581
+ let state = { visible: false, stage: 'issue', deskName: 'Support', issue: '', brand: supportBrand(options.desk?.branding?.color) };
26072
26582
  if (typeof options.launcher === 'object') {
26073
26583
  const offset = (value, fallback) => typeof value === 'number' && Number.isFinite(value) ? Math.min(240, Math.max(12, value)) : fallback;
26074
26584
  state.position = { right: offset(options.launcher.right, 24), bottom: offset(options.launcher.bottom, 24) + 72 };
@@ -26142,7 +26652,7 @@ function createHelpDeskSupport(config, options) {
26142
26652
  }, options.target === undefined ? undefined : resolveTarget(options.target));
26143
26653
  const launcher = (() => {
26144
26654
  try {
26145
- return options.launcher ? createSupportLauncher(typeof options.launcher === 'object' ? options.launcher : {}, () => { void open(); }) : null;
26655
+ return options.launcher ? createSupportLauncher(typeof options.launcher === 'object' ? options.launcher : {}, state.brand, () => { void open(); }) : null;
26146
26656
  }
26147
26657
  catch (error) {
26148
26658
  view.destroy();
@@ -26153,9 +26663,12 @@ function createHelpDeskSupport(config, options) {
26153
26663
  function update(change) {
26154
26664
  if (destroyed)
26155
26665
  return;
26666
+ const rebranded = change.brand !== undefined && change.brand !== state.brand;
26156
26667
  state = { ...state, ...change };
26157
26668
  view.render(state);
26158
26669
  launcher?.setExpanded(state.visible);
26670
+ if (rebranded)
26671
+ launcher?.setBrand(state.brand);
26159
26672
  notify(options.onStateChange, snapshot());
26160
26673
  }
26161
26674
  async function connect() {
@@ -26182,7 +26695,7 @@ function createHelpDeskSupport(config, options) {
26182
26695
  return (await http.request(path, { method: 'POST', body, credentials: 'omit', headers: { 'X-SV-Client': 'help-desk-portal', ...headers } })).data;
26183
26696
  },
26184
26697
  });
26185
- update({ deskName: answer.desk.organization_name || 'Support', brandColor: answer.desk.branding?.color, contactNote: answer.desk.ticket_contact_note ?? undefined });
26698
+ update({ deskName: answer.desk.organization_name || 'Support', brand: brandFor(answer.desk.branding?.color, state.brand), contactNote: answer.desk.ticket_contact_note ?? undefined });
26186
26699
  return answer;
26187
26700
  }).catch((error) => { connected = null; throw error; });
26188
26701
  return connected;
@@ -26573,6 +27086,7 @@ function createHelpDeskSupport(config, options) {
26573
27086
  persist: options.persist,
26574
27087
  pageLayout: options.target !== undefined,
26575
27088
  hostShowsAttribution: options.hostShowsAttribution === true,
27089
+ brand: state.brand,
26576
27090
  onSession: (session) => {
26577
27091
  anonymous = false;
26578
27092
  if (options.persist)
@@ -27005,7 +27519,7 @@ function createHelpDeskSupport(config, options) {
27005
27519
  client?.clearTicketAccess();
27006
27520
  client?.setSession(null);
27007
27521
  client = null;
27008
- state = { visible: false, stage: 'issue', deskName: 'Support', issue: '' };
27522
+ state = { visible: false, stage: 'issue', deskName: 'Support', issue: '', brand: state.brand };
27009
27523
  },
27010
27524
  };
27011
27525
  }
@@ -31774,7 +32288,7 @@ class SparkVault {
31774
32288
  }
31775
32289
  /** Get the SDK version */
31776
32290
  static get version() {
31777
- return '18.0.0';
32291
+ return '18.0.1';
31778
32292
  }
31779
32293
  }
31780
32294
  if (typeof window !== 'undefined') {