@heypointerhq/sdk 0.2.0 → 0.2.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/README.md CHANGED
@@ -15,20 +15,20 @@ import { HeyPointer } from "@heypointerhq/sdk"; // ESM, types included,
15
15
  import { defineHeyPointerElement } from "@heypointerhq/sdk/element"; // registers <heypointer-assistant> when you call it
16
16
  ```
17
17
 
18
- For a plain `<script>` tag, copy `node_modules/@heypointerhq/sdk/dist/heypointer.global.js` (export `@heypointerhq/sdk/global`) to your static files. Version 0.2.0. The packages are still `private` (not on a registry); until publishing is approved, install the tarball: `npm pack -w @heypointerhq/sdk`, then `npm install ./heypointer-sdk-0.2.0.tgz`. See [docs/PACKAGES.md](../../docs/PACKAGES.md).
18
+ For a plain `<script>` tag, copy `node_modules/@heypointerhq/sdk/dist/heypointer.global.js` (export `@heypointerhq/sdk/global`) to your static files. Version 0.2.1. Install it with `npm install @heypointerhq/sdk`. See [docs/PACKAGES.md](../../docs/PACKAGES.md).
19
19
 
20
20
  ## Add it to an app
21
21
 
22
22
  **Script tag** (any web app, no build step):
23
23
 
24
24
  ```html
25
- <script src="https://your-cdn/heypointer.global.js" data-base-url="https://your-heypointer-server" data-client-id="gfc_..." defer></script>
25
+ <script src="https://your-cdn/heypointer.global.js" data-base-url="https://your-heypointer-server" data-client-id="hpc_..." defer></script>
26
26
  ```
27
27
 
28
28
  **Global component** (any framework that can render a custom element):
29
29
 
30
30
  ```html
31
- <heypointer-assistant base-url="https://your-heypointer-server" client-id="gfc_..."></heypointer-assistant>
31
+ <heypointer-assistant base-url="https://your-heypointer-server" client-id="hpc_..."></heypointer-assistant>
32
32
  ```
33
33
 
34
34
  Attributes: `base-url` (required), `client-id` (required in practice), `target-timeout-ms`, `assist`, and the customization attributes `labels`, `theme`, `color-scheme`, `dir`, `lang`, `launcher`, `launcher-side` (see [Customizing](#customizing)). Changing `base-url`, `client-id`, `assist` or `target-timeout-ms` remounts; the customization attributes update in place; removing the element destroys the guide. `element.open()`, `element.close()` and `element.ask(goal)` drive it; `element.player` is the live `HeyPointer`.
@@ -37,14 +37,14 @@ Attributes: `base-url` (required), `client-id` (required in practice), `target-t
37
37
 
38
38
  ```ts
39
39
  import { HeyPointer } from "@heypointerhq/sdk";
40
- const gf = new HeyPointer({ baseUrl: "http://localhost:8791", clientId: "gfc_..." });
40
+ const gf = new HeyPointer({ baseUrl: "http://localhost:8791", clientId: "hpc_..." });
41
41
  ```
42
42
 
43
43
  Options: `baseUrl`, `clientId`, `fetch`, `recorderFactory`, `speechSupported`, `targetTimeoutMs` (default 1500), `mountTo`, `assist`, `onAssist`, `labels`, `theme`, `colorScheme`, `dir`, `lang`, `launcher`, `launcherSide`. Methods: `open()`, `close()`, `ask(goal)`, `next()`, `prev()`, `setLabels()`, `setTheme()`, `setColorScheme()`, `setLayout()`, `destroy()`. Events (bubbling, composed, on the guide's root): `heypointer:open`, `heypointer:close`, `heypointer:assist`.
44
44
 
45
45
  ### Client ID
46
46
 
47
- The server only answers guide requests that carry a client id, sent as the `X-HeyPointer-Client` header on `POST /api/walkthrough`. You get one from `heypointer init`. It looks like `gfc_` plus 24 hex characters and is **public**, like a Stripe publishable key: it is fine in page source, and the server limits it with allowed origins and rate limits. Never put the server API key in an app.
47
+ The server only answers guide requests that carry a client id, sent as the `X-HeyPointer-Client` header on `POST /api/walkthrough`. You get one from `heypointer init`. It looks like `hpc_` plus 24 hex characters and is **public**, like a Stripe publishable key: it is fine in page source, and the server limits it with allowed origins and rate limits. Never put the server API key in an app.
48
48
 
49
49
  An id that is clearly malformed is rejected in the browser without a request. A missing or unknown id, a page origin the client does not allow, and rate limiting each show a plain message in the guide (never the raw server response). Transcription requests do not carry the id.
50
50
 
@@ -102,7 +102,7 @@ Click through your app once and get a flow draft: `author: true` (or `data-autho
102
102
  Labels (every string, so translation is configuration), theme (colors, radius, font as `--hp-*` CSS variables or a validated `theme` option, with dark-scheme counterparts and a forced `colorScheme`), stable `::part()` names, right-to-left, and a hideable launcher with `open()`/`close()` for your own button. Full reference, with the rules for what a value may contain and the Android equivalents: [docs/CUSTOMIZING.md](../../docs/CUSTOMIZING.md).
103
103
 
104
104
  ```html
105
- <heypointer-assistant base-url="..." client-id="gfc_..."
105
+ <heypointer-assistant base-url="..." client-id="hpc_..."
106
106
  labels='{"next":"Weiter","stepProgress":"Schritt {current} von {total}"}'
107
107
  theme='{"accent":"#6d28d9","accentFg":"#ffffff","dark":{"accent":"#a78bfa","accentFg":"#1e1b4b"}}'></heypointer-assistant>
108
108
  ```
@@ -126,3 +126,7 @@ The built package (`dist/`, the script-tag bundle, and the React and Vue wrapper
126
126
  ## Limits
127
127
 
128
128
  Only the web DOM is supported. Real microphone capture is untested. Targets inside iframes or other shadow roots are not resolved. Browser coverage is Chromium, Firefox and WebKit on the shop and global-bundle specs, Chromium elsewhere.
129
+
130
+ ---
131
+
132
+ [Website](https://heypointer.com/) · [Docs](https://heypointer.com/docs/) · [X](https://x.com/heypointer) · [Instagram](https://www.instagram.com/heypointer/) · Support: [Buy Me a Coffee](https://buymeacoffee.com/heypointer) · [Ko-fi](https://ko-fi.com/heypointer)
@@ -44,7 +44,7 @@ function _(e) {
44
44
  return r.length ? n.suggestions = r : delete n.suggestions, n;
45
45
  }
46
46
  // src/client.ts
47
- var v = /^gfc_[0-9a-f]{24}$/, y = "X-HeyPointer-Client";
47
+ var v = /^(?:hpc|gfc)_[0-9a-f]{24}$/, y = "X-HeyPointer-Client";
48
48
  n.clientRequired;
49
49
  async function b(e, t) {
50
50
  let n;
@@ -50,7 +50,7 @@ var e = {
50
50
  clientRequired: "HeyPointer needs a client ID. Run heypointer init or pass data-client-id.",
51
51
  clientInvalid: "HeyPointer does not recognise this client ID. Check that it matches the one heypointer init gave you.",
52
52
  clientOrigin: "This site's address is not allowed for this HeyPointer client ID. Ask the HeyPointer admin to add it to the client's allowed origins.",
53
- clientMalformed: "The HeyPointer client ID looks wrong (it should start with gfc_). Check data-client-id against what heypointer init printed.",
53
+ clientMalformed: "The HeyPointer client ID looks wrong (it should start with hpc_). Check data-client-id against what heypointer init printed.",
54
54
  rateLimited: "HeyPointer is getting too many requests right now. Wait a moment and try again.",
55
55
  serverUnreachable: "Cannot reach the HeyPointer server at {host}. Check that it is running and the address is right.",
56
56
  requestFailed: "Walkthrough request failed ({status})"
package/dist/client.d.ts CHANGED
@@ -2,7 +2,7 @@ import { type LabelKey } from './labels';
2
2
  import type { Walkthrough } from './types';
3
3
  export interface ClientOptions {
4
4
  baseUrl: string;
5
- /** Publishable client id from `heypointer init` (`gfc_` + 24 hex). Not a secret; sent as X-HeyPointer-Client. */
5
+ /** Publishable client id from `heypointer init` (`hpc_` + 24 hex). Not a secret; sent as X-HeyPointer-Client. */
6
6
  clientId?: string;
7
7
  fetch?: typeof fetch;
8
8
  /** Looks up a user-visible message by label key (host overrides, translations). Defaults to the English labels. */
package/dist/element.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type HeyPointerLabels } from './labels';
3
3
  import type { HeyPointerTheme } from './theme';
4
4
  export declare const HEYPOINTER_TAG = "heypointer-assistant";
5
5
  /**
6
- * `<heypointer-assistant base-url="https://api.example.com" client-id="gfc_...">`: the one integration surface
6
+ * `<heypointer-assistant base-url="https://api.example.com" client-id="hpc_...">`: the one integration surface
7
7
  * every web framework shares. React, Vue, Angular and Svelte render this element; none of
8
8
  * them re-implement the player.
9
9
  *
@@ -1,2 +1,2 @@
1
- var HeyPointerGlobal=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={launcher:`Guide me`,dialogName:`HeyPointer assistant`,heading:`HeyPointer`,closeLabel:`Close guide`,goalQuestion:`What do you want to do?`,goalAria:`Your goal`,goalPlaceholder:`e.g. invite a teammate`,submit:`Show me`,speak:`Speak`,stop:`Stop`,changeGoal:`Change goal or use voice`,assistToggle:`Assist: do safe clicks for me when I press Next`,assistHint:`You need to do this one yourself.`,assistClicked:`Clicked "{label}" for you.`,assistFailed:`I couldn't click "{label}" for you. Do this step yourself, then press Next.`,releasedNote:`It looks like you did that. Press Next to continue.`,next:`Next`,finish:`Finish`,back:`Back`,skip:`Skip`,stepProgress:`Step {current} of {total}`,tourCount:`{current} / {total}`,stepAnnounce:`Step {current} of {total}: {title}. {instruction}`,suggestedValue:`Suggested value: {value}`,gateWarning:`This changes data. Confirm before continuing.`,gateCheckbox:`I understand and want to do this myself.`,gateWhy:`Tick the confirmation box to continue.`,evidenceSummary:`Source ({count})`,loading:`Finding the steps…`,tryAgain:`Try again`,skipStep:`Skip step`,done:`Done. You finished: {goal}`,startAnother:`Start another`,suggestLabel:`Did you mean:`,suggestAnnounce:`Did you mean: {list}?`,notFound:`I can't find "{label}" on this page. The screen may differ from the docs.`,ambiguous:`I found more than one match for this step, so I won't guess. Look for: {label}.`,notFoundAnnounce:`Cannot find the target for: {title}. You can try again or skip this step.`,ambiguousAnnounce:`Several matches for: {title}. You can try again or skip this step.`,emptyGoal:`Type what you want to do first.`,recording:`Recording… press Stop when done.`,transcribing:`Transcribing…`,voiceUnavailable:`Voice isn't available. Type your goal instead.`,noSpeech:`I didn't hear anything. Try again or type your goal.`,audioFailed:`Could not process audio. Type your goal instead.`,insufficient:`I don't have enough documented steps to guide this safely.`,genericError:`Something went wrong.`,clientRequired:`HeyPointer needs a client ID. Run heypointer init or pass data-client-id.`,clientInvalid:`HeyPointer does not recognise this client ID. Check that it matches the one heypointer init gave you.`,clientOrigin:`This site's address is not allowed for this HeyPointer client ID. Ask the HeyPointer admin to add it to the client's allowed origins.`,clientMalformed:`The HeyPointer client ID looks wrong (it should start with gfc_). Check data-client-id against what heypointer init printed.`,rateLimited:`HeyPointer is getting too many requests right now. Wait a moment and try again.`,serverUnreachable:`Cannot reach the HeyPointer server at {host}. Check that it is running and the address is right.`,requestFailed:`Walkthrough request failed ({status})`},n=/\{(\w+)\}/g,r={done:[`goal`],stepAnnounce:[`instruction`]},i=e=>[...e.matchAll(n)].map(e=>e[1]),a=e=>[...new Set(i(t[e]))].filter(t=>!r[e]?.includes(t));function o(e,t={}){return e.replace(n,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?String(t[n]):e)}function s(e){let n={...t},r=[];if(typeof e!=`object`||!e||Array.isArray(e))return{labels:n,problems:r};for(let[r,o]of Object.entries(e)){if(r.startsWith(`author`)||!Object.prototype.hasOwnProperty.call(t,r))continue;let e=r;if(typeof o!=`string`||!o.trim()||o.length>300)continue;let s=i(o);a(e).filter(e=>!s.includes(e)).length||(n[e]=o)}return{labels:n,problems:r}}function c(e,t){if(t!=null&&t.trim())try{return JSON.parse(t)}catch{return}}var l=[`click`,`type`,`select`,`navigate`,`observe`],u=e=>typeof e==`object`&&!!e,d=e=>typeof e==`string`;function f(e,t){if(!u(e))throw Error(`step ${t} is not an object`);let{id:n,title:r,instruction:i,target:a,action:o,requiresConfirmation:s,evidence:c}=e;if(!d(n)||!d(r)||!d(i))throw Error(`step ${t} missing id/title/instruction`);if(!d(o)||!l.includes(o))throw Error(`step ${t} has invalid action`);if(!u(a)||!Array.isArray(a.selectors)||!a.selectors.every(d))throw Error(`step ${t} has invalid target`);if(typeof s!=`boolean`)throw Error(`step ${t} missing requiresConfirmation`);if(!Array.isArray(c)||c.length===0)throw Error(`step ${t} has no evidence`);return e}function ee(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(!u(r)||!d(r.workflowId)||!d(r.title))continue;let e=r.title.trim();if(!(!r.workflowId||!e||e.length>200||t.has(e))&&(t.add(e),n.push({workflowId:r.workflowId,title:e}),n.length===5))break}return n}function te(e){if(!u(e))throw Error(`walkthrough is not an object`);if(e.status!==`ok`&&e.status!==`insufficient_evidence`)throw Error(`invalid walkthrough status`);if(!d(e.id)||!d(e.goal)||!Array.isArray(e.steps))throw Error(`walkthrough missing id/goal/steps`);let t=e.steps.map(f);if(e.status===`ok`&&t.length===0)throw Error(`ok walkthrough has no steps`);if(e.status===`insufficient_evidence`&&t.length>0)throw Error(`insufficient_evidence walkthrough must have no steps`);let n={...e,steps:t},r=e.status===`insufficient_evidence`?ee(e.suggestions):[];return r.length?n.suggestions=r:delete n.suggestions,n}function p(e){"@babel/helpers - typeof";return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function ne(e,t){if(p(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=ne(e,`string`);return p(t)==`symbol`?t:t+``}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var re=/^gfc_[0-9a-f]{24}$/,ie=`X-HeyPointer-Client`;t.clientRequired;async function ae(e,t){let n;try{n=(await e.json()).error}catch{}return e.status===401&&n===`client_required`?t(`clientRequired`):e.status===401&&n===`client_invalid`?t(`clientInvalid`):e.status===403&&n===`client_origin_not_allowed`?t(`clientOrigin`):e.status===429?t(`rateLimited`):t(`requestFailed`,{status:e.status})}var g=class extends Error{},_=class extends Error{},oe=class{constructor(e){h(this,`base`,void 0),h(this,`fetchImpl`,void 0),h(this,`clientId`,void 0),h(this,`t`,void 0),this.base=e.baseUrl.replace(/\/$/,``),this.clientId=e.clientId?.trim()||void 0,this.fetchImpl=e.fetch??((...e)=>globalThis.fetch(...e)),this.t=e.text??((e,n)=>o(t[e],n))}async send(e,t){try{return await this.fetchImpl(`${this.base}${e}`,t)}catch{let e=this.base;try{e=new URL(this.base).host}catch{}throw Error(this.t(`serverUnreachable`,{host:e}))}}async requestWalkthrough(e,t){if(this.clientId!==void 0&&!re.test(this.clientId))throw Error(this.t(`clientMalformed`));let n=await this.send(`/api/walkthrough`,{method:`POST`,headers:{"content-type":`application/json`,...this.clientId?{[ie]:this.clientId}:{}},body:JSON.stringify({goal:e,context:t})});if(!n.ok)throw Error(await ae(n,this.t));return te(await n.json())}async transcribe(e){let t=await this.send(`/api/transcribe`,{method:`POST`,headers:{"content-type":e.type||`audio/webm`},body:e});if(t.status===400)throw new _(`No speech detected`);if(!t.ok)throw new g(`Transcription unavailable (${t.status})`);let n=await t.json();if(typeof n.text!=`string`||!n.text.trim())throw new _(`Empty transcript`);return n.text.trim()}};function v(e){let t=0,n=0,r=e.ownerDocument?.defaultView??null;for(;r&&r!==r.top;){let e=r.frameElement;if(!e)break;let i=e.getBoundingClientRect();t+=i.left,n+=i.top,r=r.parent}return{x:t,y:n}}var y=class{constructor(e){h(this,`host`,void 0),h(this,`box`,void 0),h(this,`target`,null),h(this,`offset`,{x:0,y:0}),h(this,`onMove`,()=>this.position()),h(this,`frame`,0),h(this,`observer`,void 0),this.host=e,this.box=document.createElement(`div`),this.box.className=`hp-highlight`,this.box.setAttribute(`part`,`highlight`),this.box.setAttribute(`aria-hidden`,`true`),this.box.hidden=!0,e.appendChild(this.box)}show(e){this.target=e,this.offset=v(e);let t=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`}),this.box.hidden=!1,cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.position()),this.position(),addEventListener(`scroll`,this.onMove,!0),addEventListener(`resize`,this.onMove),this.observer?.disconnect(),typeof ResizeObserver<`u`&&(this.observer=new ResizeObserver(this.onMove),this.observer.observe(document.documentElement),this.observer.observe(e))}hide(){this.target=null,cancelAnimationFrame(this.frame),this.box.hidden=!0,this.observer?.disconnect(),removeEventListener(`scroll`,this.onMove,!0),removeEventListener(`resize`,this.onMove)}current(){return this.target}position(){if(this.target){if(!this.target.isConnected)return this.hide();cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.place()),this.place()}}place(){if(!this.target?.isConnected)return;let e=this.target.getBoundingClientRect();Object.assign(this.box.style,{top:`${e.top+this.offset.y-4}px`,left:`${e.left+this.offset.x-4}px`,width:`${e.width+8}px`,height:`${e.height+8}px`})}};function b(){return typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`}var se=class{constructor(){h(this,`rec`,null),h(this,`chunks`,[]),h(this,`stream`,null)}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.chunks=[],this.rec=new MediaRecorder(this.stream),this.rec.ondataavailable=e=>e.data.size&&this.chunks.push(e.data),this.rec.start()}stop(){return new Promise((e,t)=>{let n=this.rec;if(!n)return t(Error(`not recording`));n.onstop=()=>{this.stream?.getTracks().forEach(e=>e.stop()),e(new Blob(this.chunks,{type:n.mimeType||`audio/webm`}))},n.stop()})}},ce={button:`button, [role="button"], input[type="button"], input[type="submit"]`,link:`a[href], [role="link"]`,textbox:`input:not([type]), input[type="text"], input[type="email"], input[type="search"], textarea, [role="textbox"]`,combobox:`select, [role="combobox"]`,checkbox:`input[type="checkbox"], [role="checkbox"]`};function le(e){for(let t=e;t;t=t.parentElement){if(t.hidden||t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`inert`))return!1;let e=getComputedStyle(t);if(e.display===`none`||e.visibility===`hidden`)return!1}return!0}function x(e){if(!e.isConnected||!le(e))return!1;if(typeof e.checkVisibility!=`function`)return!0;if(!e.checkVisibility({checkVisibilityCSS:!0,contentVisibilityAuto:!0})||!e.getClientRects().length)return!1;let t=e.getBoundingClientRect();return t.width>0||t.height>0}function S(e){let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.labels;return n&&n.length?Array.from(n).map(e=>e.textContent??``).join(` `):e.textContent??``}var C=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),w=`a[href], button, input, select, textarea, summary, [role="button"], [role="link"], [role="checkbox"], [role="radio"], [role="switch"], [role="tab"], [role="menuitem"], [role="option"], [role="combobox"], [role="textbox"]`;function ue(e){if(e.length<2)return e;let t=(e,t)=>{let n=e.matches(w);return n===t.matches(w)?t.contains(e):n};return e.filter(n=>!e.some(e=>e!==n&&(n.contains(e)||e.contains(n))&&t(e,n)))}function T(e,t){try{return Array.from(e.querySelectorAll(t))}catch{return[]}}function de(e){try{let t=e.contentDocument;return!!t&&!!t.defaultView}catch{return!1}}function fe(e){let t=[],n=e=>{e instanceof HTMLElement&&e.shadowRoot&&!e.hasAttribute(`data-heypointer-author`)&&(t.push(e.shadowRoot),n(e.shadowRoot));for(let t of Array.from(e.childNodes))n(t)};return n(e),t}function pe(e){let t=[],n=Array.from(e.querySelectorAll(`iframe`));for(let e of n)de(e)&&e.contentDocument&&t.push(e.contentDocument);return t}function me(e){let t=[e];return t.push(...fe(e)),t.push(...pe(e)),t}function E(e,t){let n=[];for(let r of e)n.push(...t(r));return{hits:n}}function D(e,t=document){let n=me(t),r=0,i=(e,t)=>e.length===1?{status:`found`,element:e[0],strategy:t}:(e.length>1&&(r=Math.max(r,e.length)),null);for(let t of e.selectors){let{hits:e}=E(n,e=>T(e,t).filter(x)),r=i(e,`selector`);if(r)return r}let a=e.text?C(e.text):``;if(e.role&&a){let t=ce[e.role]??`[role="${CSS.escape(e.role)}"]`,{hits:r}=E(n,e=>T(e,t).filter(e=>x(e)&&C(S(e))===a)),o=i(r,`role-text`);if(o)return o}let o=e.label?C(e.label):``;if(o){let{hits:e}=E(n,e=>T(e,`input, select, textarea, [role="textbox"], [role="combobox"]`).filter(e=>x(e)&&C(S(e))===o)),t=i(e,`label`);if(t)return t}if(a){let{hits:e}=E(n,e=>T(e,`button, a, label, [role], input, select, textarea, h1, h2, h3, li, p, span`).filter(e=>x(e)&&C(S(e))===a)),t=i(ue(e.filter(t=>!(t instanceof HTMLLabelElement&&t.control instanceof HTMLElement&&e.includes(t.control)))),`text`);if(t)return t}return r?{status:`ambiguous`,count:r}:{status:`missing`}}function O(e,t=1500,n=document){let r=D(e,n);return r.status===`found`||t<=0?Promise.resolve(r):new Promise(r=>{let i=e=>{a.disconnect(),clearTimeout(o),r(e)},a=new MutationObserver(()=>{let t=D(e,n);t.status===`found`&&i(t)});a.observe(n,{childList:!0,subtree:!0,attributes:!0});let o=setTimeout(()=>i(D(e,n)),t)})}var k=[`style`,`class`,`hidden`,`open`,`inert`,`aria-hidden`],A=[`transitionend`,`transitioncancel`,`animationend`,`animationcancel`],j=[`transitionrun`,`animationstart`],M=1e3;function N(e,t){let n=!0,r=!1,i=0,a=0,o=()=>{if(i=0,r)return;let o=x(e);o!==n&&(n=o,t(o)),!r&&performance.now()<a&&s()},s=()=>{!i&&!r&&(i=requestAnimationFrame(o))},c=t=>{t.target instanceof Node&&t.target.contains(e)&&s()},l=t=>{t.target instanceof Node&&t.target.contains(e)&&(a=performance.now()+M,s())},u=new MutationObserver(s);u.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:k});for(let e of A)document.addEventListener(e,c,!0);for(let e of j)document.addEventListener(e,l,!0);return s(),()=>{r=!0,cancelAnimationFrame(i),u.disconnect();for(let e of A)document.removeEventListener(e,c,!0);for(let e of j)document.removeEventListener(e,l,!0)}}function P(e,t,n,r=n.width<=600,i=!1){if(r)return{left:12,top:e.bottom+16+t.height<=n.height-12?e.bottom+16:e.top-t.height-16>=12?e.top-t.height-16:16,placement:`floating`,arrowLeft:0};let a=(e,r)=>e>=12&&r>=12&&e+t.width<=n.width-12&&r+t.height<=n.height-12,o=e.left+(e.right-e.left-t.width)/2,s=e.top+(e.bottom-e.top-t.height)/2,c=[{placement:`below`,left:o,top:e.bottom+16},{placement:`above`,left:o,top:e.top-t.height-16},{placement:`right`,left:e.right+16,top:s},{placement:`left`,left:e.left-t.width-16,top:s}];i&&([c[2],c[3]]=[c[3],c[2]]);let l=c.find(e=>a(e.left,e.top))??c.map(e=>({...e,left:Math.max(12,Math.min(e.left,n.width-t.width-12)),top:Math.max(12,Math.min(e.top,n.height-t.height-12))})).sort((n,r)=>{let i=n=>Math.max(0,Math.min(e.right,n.left+t.width)-Math.max(e.left,n.left))*Math.max(0,Math.min(e.bottom,n.top+t.height)-Math.max(e.top,n.top));return i(n)-i(r)})[0],u=Math.max(24,Math.min((e.left+e.right)/2-l.left,t.width-24));return{...l,arrowLeft:u}}var F=class{constructor(e){h(this,`overlay`,void 0),h(this,`target`,null),h(this,`offset`,{x:0,y:0}),h(this,`enabled`,!1),h(this,`onReposition`,void 0),h(this,`frame`,0),h(this,`observer`,void 0),h(this,`onMove`,()=>this.position()),this.overlay=document.createElement(`div`),this.overlay.className=`hp-spotlight`,this.overlay.setAttribute(`part`,`spotlight`),this.overlay.setAttribute(`aria-hidden`,`true`),this.overlay.hidden=!0,e.appendChild(this.overlay)}show(e,t){this.hide(),this.target=e,this.onReposition=t,this.enabled=!0,this.overlay.hidden=!1,e&&(this.offset=v(e)),this.position(),cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.position()),addEventListener(`scroll`,this.onMove,!0),addEventListener(`resize`,this.onMove),typeof ResizeObserver<`u`&&(this.observer=new ResizeObserver(this.onMove),this.observer.observe(document.documentElement),this.observer.observe(this.overlay),e&&this.observer.observe(e))}hide(){this.target=null,this.enabled=!1,cancelAnimationFrame(this.frame),this.overlay.hidden=!0,this.overlay.style.clipPath=``,this.observer?.disconnect(),removeEventListener(`scroll`,this.onMove,!0),removeEventListener(`resize`,this.onMove)}position(){this.enabled&&(!this.target||this.target.isConnected)&&(cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>{this.enabled&&this.update()}),this.update())}update(){if(!this.enabled)return;let e=this.target?.getBoundingClientRect()??{top:0,left:0,width:0,height:0},t=e.left+this.offset.x-5,n=e.top+this.offset.y-5,r=e.width+10,i=e.height+10;this.overlay.style.clipPath=this.target?`polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${t}px ${n}px, ${t}px ${n+i}px, ${t+r}px ${n+i}px, ${t+r}px ${n}px, ${t}px ${n}px)`:``,this.onReposition?.()}},I=async()=>null,L=`heypointer:author:active:v1`,R=``,z=e=>{R=e};function he(e){if(e.author)return!0;if(!e.allowAuthorParam)return!1;try{return new URLSearchParams(location.search).has(`heypointer-author`)||sessionStorage.getItem(L)===`1`}catch{return!1}}async function ge(){let e=window;return e.HeyPointerAuthor?e.HeyPointerAuthor:await I()||(R?(await new Promise((e,t)=>{let n=document.createElement(`script`);n.src=R.replace(/[^/?#]*([?#].*)?$/,`heypointer.author.js`),n.onload=()=>e(),n.onerror=()=>t(Error(`heypointer.author.js did not load`)),document.head.appendChild(n)}),e.HeyPointerAuthor??null):null)}var B=[`auto`,`light`,`dark`],V=[`accent`,`accentFg`,`bg`,`fg`,`muted`,`border`,`warnBg`,`warnBorder`,`errBg`,`errBorder`,`focus`,`halo`,`ring`,`dim`],H=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),_e=/[;{}@\\<>"'`\u0000-\u001f]|url\(|expression\(|\/\*|javascript:|image\(|image-set\(/i,ve=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ye=/^[a-z]{3,30}$/i,be=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\([0-9a-z%.,/\s+-]{1,120}\)$/i,xe=/^var\(--[a-z0-9_-]{1,60}\)$/i,Se=/^\d{1,3}(?:\.\d{1,3})?(?:px|rem|em)$/,Ce=/^[A-Za-z0-9 ,_'"-]{1,200}$/;function we(e){if(typeof e!=`string`)return!1;let t=e.trim();return!t||t.length>140||_e.test(t)?!1:ve.test(t)||ye.test(t)||be.test(t)||xe.test(t)}var U=e=>typeof e==`string`&&Se.test(e.trim()),Te=e=>typeof e==`string`&&Ce.test(e.trim())&&!/url|expression/i.test(e);function W(e,t,n){let r={};if(e===void 0||!e||typeof e!=`object`||Array.isArray(e))return r;for(let[t,n]of Object.entries(e))t!==`dark`&&t!==`radius`&&t!==`font`&&t!==`fontSize`&&V.includes(t)&&we(n)&&(r[t]=n.trim());return r}function Ee(e){let t=[];if(e==null)return{theme:{},problems:t};if(typeof e!=`object`||Array.isArray(e))return{theme:{},problems:[]};let n=e,r=W(n,`theme`,t);if(n.radius!==void 0&&U(n.radius)&&(r.radius=n.radius.trim()),n.fontSize!==void 0&&U(n.fontSize)&&(r.fontSize=n.fontSize.trim()),n.font!==void 0&&Te(n.font)&&(r.font=n.font.trim()),n.dark!==void 0){let e=W(n.dark,`theme.dark`,t);Object.keys(e).length&&(r.dark=e)}return{theme:r,problems:t}}function De(e){let t={};for(let n of V)e[n]&&(t[`--hp-${H(n)}`]=e[n]),e.dark?.[n]&&(t[`--hp-dark-${H(n)}`]=e.dark[n]);return e.radius&&(t[`--hp-radius`]=e.radius),e.font&&(t[`--hp-font`]=e.font),e.fontSize&&(t[`--hp-font-size`]=e.fontSize),t}var Oe=`/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
1
+ var HeyPointerGlobal=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={launcher:`Guide me`,dialogName:`HeyPointer assistant`,heading:`HeyPointer`,closeLabel:`Close guide`,goalQuestion:`What do you want to do?`,goalAria:`Your goal`,goalPlaceholder:`e.g. invite a teammate`,submit:`Show me`,speak:`Speak`,stop:`Stop`,changeGoal:`Change goal or use voice`,assistToggle:`Assist: do safe clicks for me when I press Next`,assistHint:`You need to do this one yourself.`,assistClicked:`Clicked "{label}" for you.`,assistFailed:`I couldn't click "{label}" for you. Do this step yourself, then press Next.`,releasedNote:`It looks like you did that. Press Next to continue.`,next:`Next`,finish:`Finish`,back:`Back`,skip:`Skip`,stepProgress:`Step {current} of {total}`,tourCount:`{current} / {total}`,stepAnnounce:`Step {current} of {total}: {title}. {instruction}`,suggestedValue:`Suggested value: {value}`,gateWarning:`This changes data. Confirm before continuing.`,gateCheckbox:`I understand and want to do this myself.`,gateWhy:`Tick the confirmation box to continue.`,evidenceSummary:`Source ({count})`,loading:`Finding the steps…`,tryAgain:`Try again`,skipStep:`Skip step`,done:`Done. You finished: {goal}`,startAnother:`Start another`,suggestLabel:`Did you mean:`,suggestAnnounce:`Did you mean: {list}?`,notFound:`I can't find "{label}" on this page. The screen may differ from the docs.`,ambiguous:`I found more than one match for this step, so I won't guess. Look for: {label}.`,notFoundAnnounce:`Cannot find the target for: {title}. You can try again or skip this step.`,ambiguousAnnounce:`Several matches for: {title}. You can try again or skip this step.`,emptyGoal:`Type what you want to do first.`,recording:`Recording… press Stop when done.`,transcribing:`Transcribing…`,voiceUnavailable:`Voice isn't available. Type your goal instead.`,noSpeech:`I didn't hear anything. Try again or type your goal.`,audioFailed:`Could not process audio. Type your goal instead.`,insufficient:`I don't have enough documented steps to guide this safely.`,genericError:`Something went wrong.`,clientRequired:`HeyPointer needs a client ID. Run heypointer init or pass data-client-id.`,clientInvalid:`HeyPointer does not recognise this client ID. Check that it matches the one heypointer init gave you.`,clientOrigin:`This site's address is not allowed for this HeyPointer client ID. Ask the HeyPointer admin to add it to the client's allowed origins.`,clientMalformed:`The HeyPointer client ID looks wrong (it should start with hpc_). Check data-client-id against what heypointer init printed.`,rateLimited:`HeyPointer is getting too many requests right now. Wait a moment and try again.`,serverUnreachable:`Cannot reach the HeyPointer server at {host}. Check that it is running and the address is right.`,requestFailed:`Walkthrough request failed ({status})`},n=/\{(\w+)\}/g,r={done:[`goal`],stepAnnounce:[`instruction`]},i=e=>[...e.matchAll(n)].map(e=>e[1]),a=e=>[...new Set(i(t[e]))].filter(t=>!r[e]?.includes(t));function o(e,t={}){return e.replace(n,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?String(t[n]):e)}function s(e){let n={...t},r=[];if(typeof e!=`object`||!e||Array.isArray(e))return{labels:n,problems:r};for(let[r,o]of Object.entries(e)){if(r.startsWith(`author`)||!Object.prototype.hasOwnProperty.call(t,r))continue;let e=r;if(typeof o!=`string`||!o.trim()||o.length>300)continue;let s=i(o);a(e).filter(e=>!s.includes(e)).length||(n[e]=o)}return{labels:n,problems:r}}function c(e,t){if(t!=null&&t.trim())try{return JSON.parse(t)}catch{return}}var l=[`click`,`type`,`select`,`navigate`,`observe`],u=e=>typeof e==`object`&&!!e,d=e=>typeof e==`string`;function f(e,t){if(!u(e))throw Error(`step ${t} is not an object`);let{id:n,title:r,instruction:i,target:a,action:o,requiresConfirmation:s,evidence:c}=e;if(!d(n)||!d(r)||!d(i))throw Error(`step ${t} missing id/title/instruction`);if(!d(o)||!l.includes(o))throw Error(`step ${t} has invalid action`);if(!u(a)||!Array.isArray(a.selectors)||!a.selectors.every(d))throw Error(`step ${t} has invalid target`);if(typeof s!=`boolean`)throw Error(`step ${t} missing requiresConfirmation`);if(!Array.isArray(c)||c.length===0)throw Error(`step ${t} has no evidence`);return e}function ee(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(!u(r)||!d(r.workflowId)||!d(r.title))continue;let e=r.title.trim();if(!(!r.workflowId||!e||e.length>200||t.has(e))&&(t.add(e),n.push({workflowId:r.workflowId,title:e}),n.length===5))break}return n}function te(e){if(!u(e))throw Error(`walkthrough is not an object`);if(e.status!==`ok`&&e.status!==`insufficient_evidence`)throw Error(`invalid walkthrough status`);if(!d(e.id)||!d(e.goal)||!Array.isArray(e.steps))throw Error(`walkthrough missing id/goal/steps`);let t=e.steps.map(f);if(e.status===`ok`&&t.length===0)throw Error(`ok walkthrough has no steps`);if(e.status===`insufficient_evidence`&&t.length>0)throw Error(`insufficient_evidence walkthrough must have no steps`);let n={...e,steps:t},r=e.status===`insufficient_evidence`?ee(e.suggestions):[];return r.length?n.suggestions=r:delete n.suggestions,n}function p(e){"@babel/helpers - typeof";return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function ne(e,t){if(p(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=ne(e,`string`);return p(t)==`symbol`?t:t+``}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var re=/^(?:hpc|gfc)_[0-9a-f]{24}$/,ie=`X-HeyPointer-Client`;t.clientRequired;async function ae(e,t){let n;try{n=(await e.json()).error}catch{}return e.status===401&&n===`client_required`?t(`clientRequired`):e.status===401&&n===`client_invalid`?t(`clientInvalid`):e.status===403&&n===`client_origin_not_allowed`?t(`clientOrigin`):e.status===429?t(`rateLimited`):t(`requestFailed`,{status:e.status})}var g=class extends Error{},_=class extends Error{},oe=class{constructor(e){h(this,`base`,void 0),h(this,`fetchImpl`,void 0),h(this,`clientId`,void 0),h(this,`t`,void 0),this.base=e.baseUrl.replace(/\/$/,``),this.clientId=e.clientId?.trim()||void 0,this.fetchImpl=e.fetch??((...e)=>globalThis.fetch(...e)),this.t=e.text??((e,n)=>o(t[e],n))}async send(e,t){try{return await this.fetchImpl(`${this.base}${e}`,t)}catch{let e=this.base;try{e=new URL(this.base).host}catch{}throw Error(this.t(`serverUnreachable`,{host:e}))}}async requestWalkthrough(e,t){if(this.clientId!==void 0&&!re.test(this.clientId))throw Error(this.t(`clientMalformed`));let n=await this.send(`/api/walkthrough`,{method:`POST`,headers:{"content-type":`application/json`,...this.clientId?{[ie]:this.clientId}:{}},body:JSON.stringify({goal:e,context:t})});if(!n.ok)throw Error(await ae(n,this.t));return te(await n.json())}async transcribe(e){let t=await this.send(`/api/transcribe`,{method:`POST`,headers:{"content-type":e.type||`audio/webm`},body:e});if(t.status===400)throw new _(`No speech detected`);if(!t.ok)throw new g(`Transcription unavailable (${t.status})`);let n=await t.json();if(typeof n.text!=`string`||!n.text.trim())throw new _(`Empty transcript`);return n.text.trim()}};function v(e){let t=0,n=0,r=e.ownerDocument?.defaultView??null;for(;r&&r!==r.top;){let e=r.frameElement;if(!e)break;let i=e.getBoundingClientRect();t+=i.left,n+=i.top,r=r.parent}return{x:t,y:n}}var y=class{constructor(e){h(this,`host`,void 0),h(this,`box`,void 0),h(this,`target`,null),h(this,`offset`,{x:0,y:0}),h(this,`onMove`,()=>this.position()),h(this,`frame`,0),h(this,`observer`,void 0),this.host=e,this.box=document.createElement(`div`),this.box.className=`hp-highlight`,this.box.setAttribute(`part`,`highlight`),this.box.setAttribute(`aria-hidden`,`true`),this.box.hidden=!0,e.appendChild(this.box)}show(e){this.target=e,this.offset=v(e);let t=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`}),this.box.hidden=!1,cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.position()),this.position(),addEventListener(`scroll`,this.onMove,!0),addEventListener(`resize`,this.onMove),this.observer?.disconnect(),typeof ResizeObserver<`u`&&(this.observer=new ResizeObserver(this.onMove),this.observer.observe(document.documentElement),this.observer.observe(e))}hide(){this.target=null,cancelAnimationFrame(this.frame),this.box.hidden=!0,this.observer?.disconnect(),removeEventListener(`scroll`,this.onMove,!0),removeEventListener(`resize`,this.onMove)}current(){return this.target}position(){if(this.target){if(!this.target.isConnected)return this.hide();cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.place()),this.place()}}place(){if(!this.target?.isConnected)return;let e=this.target.getBoundingClientRect();Object.assign(this.box.style,{top:`${e.top+this.offset.y-4}px`,left:`${e.left+this.offset.x-4}px`,width:`${e.width+8}px`,height:`${e.height+8}px`})}};function b(){return typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`}var se=class{constructor(){h(this,`rec`,null),h(this,`chunks`,[]),h(this,`stream`,null)}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.chunks=[],this.rec=new MediaRecorder(this.stream),this.rec.ondataavailable=e=>e.data.size&&this.chunks.push(e.data),this.rec.start()}stop(){return new Promise((e,t)=>{let n=this.rec;if(!n)return t(Error(`not recording`));n.onstop=()=>{this.stream?.getTracks().forEach(e=>e.stop()),e(new Blob(this.chunks,{type:n.mimeType||`audio/webm`}))},n.stop()})}},ce={button:`button, [role="button"], input[type="button"], input[type="submit"]`,link:`a[href], [role="link"]`,textbox:`input:not([type]), input[type="text"], input[type="email"], input[type="search"], textarea, [role="textbox"]`,combobox:`select, [role="combobox"]`,checkbox:`input[type="checkbox"], [role="checkbox"]`};function le(e){for(let t=e;t;t=t.parentElement){if(t.hidden||t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`inert`))return!1;let e=getComputedStyle(t);if(e.display===`none`||e.visibility===`hidden`)return!1}return!0}function x(e){if(!e.isConnected||!le(e))return!1;if(typeof e.checkVisibility!=`function`)return!0;if(!e.checkVisibility({checkVisibilityCSS:!0,contentVisibilityAuto:!0})||!e.getClientRects().length)return!1;let t=e.getBoundingClientRect();return t.width>0||t.height>0}function S(e){let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.labels;return n&&n.length?Array.from(n).map(e=>e.textContent??``).join(` `):e.textContent??``}var C=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),w=`a[href], button, input, select, textarea, summary, [role="button"], [role="link"], [role="checkbox"], [role="radio"], [role="switch"], [role="tab"], [role="menuitem"], [role="option"], [role="combobox"], [role="textbox"]`;function ue(e){if(e.length<2)return e;let t=(e,t)=>{let n=e.matches(w);return n===t.matches(w)?t.contains(e):n};return e.filter(n=>!e.some(e=>e!==n&&(n.contains(e)||e.contains(n))&&t(e,n)))}function T(e,t){try{return Array.from(e.querySelectorAll(t))}catch{return[]}}function de(e){try{let t=e.contentDocument;return!!t&&!!t.defaultView}catch{return!1}}function fe(e){let t=[],n=e=>{e instanceof HTMLElement&&e.shadowRoot&&!e.hasAttribute(`data-heypointer-author`)&&(t.push(e.shadowRoot),n(e.shadowRoot));for(let t of Array.from(e.childNodes))n(t)};return n(e),t}function pe(e){let t=[],n=Array.from(e.querySelectorAll(`iframe`));for(let e of n)de(e)&&e.contentDocument&&t.push(e.contentDocument);return t}function me(e){let t=[e];return t.push(...fe(e)),t.push(...pe(e)),t}function E(e,t){let n=[];for(let r of e)n.push(...t(r));return{hits:n}}function D(e,t=document){let n=me(t),r=0,i=(e,t)=>e.length===1?{status:`found`,element:e[0],strategy:t}:(e.length>1&&(r=Math.max(r,e.length)),null);for(let t of e.selectors){let{hits:e}=E(n,e=>T(e,t).filter(x)),r=i(e,`selector`);if(r)return r}let a=e.text?C(e.text):``;if(e.role&&a){let t=ce[e.role]??`[role="${CSS.escape(e.role)}"]`,{hits:r}=E(n,e=>T(e,t).filter(e=>x(e)&&C(S(e))===a)),o=i(r,`role-text`);if(o)return o}let o=e.label?C(e.label):``;if(o){let{hits:e}=E(n,e=>T(e,`input, select, textarea, [role="textbox"], [role="combobox"]`).filter(e=>x(e)&&C(S(e))===o)),t=i(e,`label`);if(t)return t}if(a){let{hits:e}=E(n,e=>T(e,`button, a, label, [role], input, select, textarea, h1, h2, h3, li, p, span`).filter(e=>x(e)&&C(S(e))===a)),t=i(ue(e.filter(t=>!(t instanceof HTMLLabelElement&&t.control instanceof HTMLElement&&e.includes(t.control)))),`text`);if(t)return t}return r?{status:`ambiguous`,count:r}:{status:`missing`}}function O(e,t=1500,n=document){let r=D(e,n);return r.status===`found`||t<=0?Promise.resolve(r):new Promise(r=>{let i=e=>{a.disconnect(),clearTimeout(o),r(e)},a=new MutationObserver(()=>{let t=D(e,n);t.status===`found`&&i(t)});a.observe(n,{childList:!0,subtree:!0,attributes:!0});let o=setTimeout(()=>i(D(e,n)),t)})}var k=[`style`,`class`,`hidden`,`open`,`inert`,`aria-hidden`],A=[`transitionend`,`transitioncancel`,`animationend`,`animationcancel`],j=[`transitionrun`,`animationstart`],M=1e3;function N(e,t){let n=!0,r=!1,i=0,a=0,o=()=>{if(i=0,r)return;let o=x(e);o!==n&&(n=o,t(o)),!r&&performance.now()<a&&s()},s=()=>{!i&&!r&&(i=requestAnimationFrame(o))},c=t=>{t.target instanceof Node&&t.target.contains(e)&&s()},l=t=>{t.target instanceof Node&&t.target.contains(e)&&(a=performance.now()+M,s())},u=new MutationObserver(s);u.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:k});for(let e of A)document.addEventListener(e,c,!0);for(let e of j)document.addEventListener(e,l,!0);return s(),()=>{r=!0,cancelAnimationFrame(i),u.disconnect();for(let e of A)document.removeEventListener(e,c,!0);for(let e of j)document.removeEventListener(e,l,!0)}}function P(e,t,n,r=n.width<=600,i=!1){if(r)return{left:12,top:e.bottom+16+t.height<=n.height-12?e.bottom+16:e.top-t.height-16>=12?e.top-t.height-16:16,placement:`floating`,arrowLeft:0};let a=(e,r)=>e>=12&&r>=12&&e+t.width<=n.width-12&&r+t.height<=n.height-12,o=e.left+(e.right-e.left-t.width)/2,s=e.top+(e.bottom-e.top-t.height)/2,c=[{placement:`below`,left:o,top:e.bottom+16},{placement:`above`,left:o,top:e.top-t.height-16},{placement:`right`,left:e.right+16,top:s},{placement:`left`,left:e.left-t.width-16,top:s}];i&&([c[2],c[3]]=[c[3],c[2]]);let l=c.find(e=>a(e.left,e.top))??c.map(e=>({...e,left:Math.max(12,Math.min(e.left,n.width-t.width-12)),top:Math.max(12,Math.min(e.top,n.height-t.height-12))})).sort((n,r)=>{let i=n=>Math.max(0,Math.min(e.right,n.left+t.width)-Math.max(e.left,n.left))*Math.max(0,Math.min(e.bottom,n.top+t.height)-Math.max(e.top,n.top));return i(n)-i(r)})[0],u=Math.max(24,Math.min((e.left+e.right)/2-l.left,t.width-24));return{...l,arrowLeft:u}}var F=class{constructor(e){h(this,`overlay`,void 0),h(this,`target`,null),h(this,`offset`,{x:0,y:0}),h(this,`enabled`,!1),h(this,`onReposition`,void 0),h(this,`frame`,0),h(this,`observer`,void 0),h(this,`onMove`,()=>this.position()),this.overlay=document.createElement(`div`),this.overlay.className=`hp-spotlight`,this.overlay.setAttribute(`part`,`spotlight`),this.overlay.setAttribute(`aria-hidden`,`true`),this.overlay.hidden=!0,e.appendChild(this.overlay)}show(e,t){this.hide(),this.target=e,this.onReposition=t,this.enabled=!0,this.overlay.hidden=!1,e&&(this.offset=v(e)),this.position(),cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.position()),addEventListener(`scroll`,this.onMove,!0),addEventListener(`resize`,this.onMove),typeof ResizeObserver<`u`&&(this.observer=new ResizeObserver(this.onMove),this.observer.observe(document.documentElement),this.observer.observe(this.overlay),e&&this.observer.observe(e))}hide(){this.target=null,this.enabled=!1,cancelAnimationFrame(this.frame),this.overlay.hidden=!0,this.overlay.style.clipPath=``,this.observer?.disconnect(),removeEventListener(`scroll`,this.onMove,!0),removeEventListener(`resize`,this.onMove)}position(){this.enabled&&(!this.target||this.target.isConnected)&&(cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>{this.enabled&&this.update()}),this.update())}update(){if(!this.enabled)return;let e=this.target?.getBoundingClientRect()??{top:0,left:0,width:0,height:0},t=e.left+this.offset.x-5,n=e.top+this.offset.y-5,r=e.width+10,i=e.height+10;this.overlay.style.clipPath=this.target?`polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${t}px ${n}px, ${t}px ${n+i}px, ${t+r}px ${n+i}px, ${t+r}px ${n}px, ${t}px ${n}px)`:``,this.onReposition?.()}},I=async()=>null,L=`heypointer:author:active:v1`,R=``,z=e=>{R=e};function he(e){if(e.author)return!0;if(!e.allowAuthorParam)return!1;try{return new URLSearchParams(location.search).has(`heypointer-author`)||sessionStorage.getItem(L)===`1`}catch{return!1}}async function ge(){let e=window;return e.HeyPointerAuthor?e.HeyPointerAuthor:await I()||(R?(await new Promise((e,t)=>{let n=document.createElement(`script`);n.src=R.replace(/[^/?#]*([?#].*)?$/,`heypointer.author.js`),n.onload=()=>e(),n.onerror=()=>t(Error(`heypointer.author.js did not load`)),document.head.appendChild(n)}),e.HeyPointerAuthor??null):null)}var B=[`auto`,`light`,`dark`],V=[`accent`,`accentFg`,`bg`,`fg`,`muted`,`border`,`warnBg`,`warnBorder`,`errBg`,`errBorder`,`focus`,`halo`,`ring`,`dim`],H=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),_e=/[;{}@\\<>"'`\u0000-\u001f]|url\(|expression\(|\/\*|javascript:|image\(|image-set\(/i,ve=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ye=/^[a-z]{3,30}$/i,be=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\([0-9a-z%.,/\s+-]{1,120}\)$/i,xe=/^var\(--[a-z0-9_-]{1,60}\)$/i,Se=/^\d{1,3}(?:\.\d{1,3})?(?:px|rem|em)$/,Ce=/^[A-Za-z0-9 ,_'"-]{1,200}$/;function we(e){if(typeof e!=`string`)return!1;let t=e.trim();return!t||t.length>140||_e.test(t)?!1:ve.test(t)||ye.test(t)||be.test(t)||xe.test(t)}var U=e=>typeof e==`string`&&Se.test(e.trim()),Te=e=>typeof e==`string`&&Ce.test(e.trim())&&!/url|expression/i.test(e);function W(e,t,n){let r={};if(e===void 0||!e||typeof e!=`object`||Array.isArray(e))return r;for(let[t,n]of Object.entries(e))t!==`dark`&&t!==`radius`&&t!==`font`&&t!==`fontSize`&&V.includes(t)&&we(n)&&(r[t]=n.trim());return r}function Ee(e){let t=[];if(e==null)return{theme:{},problems:t};if(typeof e!=`object`||Array.isArray(e))return{theme:{},problems:[]};let n=e,r=W(n,`theme`,t);if(n.radius!==void 0&&U(n.radius)&&(r.radius=n.radius.trim()),n.fontSize!==void 0&&U(n.fontSize)&&(r.fontSize=n.fontSize.trim()),n.font!==void 0&&Te(n.font)&&(r.font=n.font.trim()),n.dark!==void 0){let e=W(n.dark,`theme.dark`,t);Object.keys(e).length&&(r.dark=e)}return{theme:r,problems:t}}function De(e){let t={};for(let n of V)e[n]&&(t[`--hp-${H(n)}`]=e[n]),e.dark?.[n]&&(t[`--hp-dark-${H(n)}`]=e.dark[n]);return e.radius&&(t[`--hp-radius`]=e.radius),e.font&&(t[`--hp-font`]=e.font),e.fontSize&&(t[`--hp-font-size`]=e.fontSize),t}var Oe=`/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
2
  @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-leading:initial;--tw-font-weight:initial}}}@layer theme{:root,:host{--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-semibold:600;--leading-snug:1.375;--radius-lg:.5rem;--color-hp-accent:var(--hp-accent,#087ea4);--color-hp-accent-fg:var(--hp-accent-fg,#fff);--color-hp-bg:var(--hp-bg,#fff);--color-hp-fg:var(--hp-fg,#172b3a);--color-hp-muted:var(--hp-muted,#334155);--color-hp-border:var(--hp-border,#64748b);--color-hp-warn-bg:var(--hp-warn-bg,#fef3c7);--color-hp-warn-bd:var(--hp-warn-border,#92400e);--color-hp-err-bg:var(--hp-err-bg,#fee2e2);--color-hp-err-bd:var(--hp-err-border,#b91c1c);--color-hp-focus:var(--hp-focus,#1e3a8a);--color-hp-halo:var(--hp-halo,#fff);--color-hp-ring:var(--hp-ring,#f59e0b);--color-hp-dim:var(--hp-dim,#09141e8c);--radius-hp:var(--hp-radius,12px)}}@layer utilities;:host{all:revert;pointer-events:none;font-family:var(--hp-font,system-ui, sans-serif);font-size:var(--hp-font-size,14px);color:var(--color-hp-fg);--tw-border-style:solid;--tw-outline-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-inset-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;line-height:1.45}@media (prefers-color-scheme:dark){:host(:not([data-scheme=light])){--color-hp-accent:var(--hp-dark-accent,var(--hp-accent,#38bdf8));--color-hp-accent-fg:var(--hp-dark-accent-fg,var(--hp-accent-fg,#082f49));--color-hp-bg:var(--hp-dark-bg,#0f172a);--color-hp-fg:var(--hp-dark-fg,#f1f5f9);--color-hp-muted:var(--hp-dark-muted,#cbd5e1);--color-hp-border:var(--hp-dark-border,#94a3b8);--color-hp-warn-bg:var(--hp-dark-warn-bg,#422006);--color-hp-warn-bd:var(--hp-dark-warn-border,#fbbf24);--color-hp-err-bg:var(--hp-dark-err-bg,#450a0a);--color-hp-err-bd:var(--hp-dark-err-border,#f87171);--color-hp-focus:var(--hp-dark-focus,#fff);--color-hp-halo:var(--hp-dark-halo,#1e3a8a);--color-hp-ring:var(--hp-dark-ring,var(--hp-ring,#f59e0b));--color-hp-dim:var(--hp-dark-dim,var(--hp-dim,#09141e8c))}}:host([data-scheme=dark]){--color-hp-accent:var(--hp-dark-accent,var(--hp-accent,#38bdf8));--color-hp-accent-fg:var(--hp-dark-accent-fg,var(--hp-accent-fg,#082f49));--color-hp-bg:var(--hp-dark-bg,#0f172a);--color-hp-fg:var(--hp-dark-fg,#f1f5f9);--color-hp-muted:var(--hp-dark-muted,#cbd5e1);--color-hp-border:var(--hp-dark-border,#94a3b8);--color-hp-warn-bg:var(--hp-dark-warn-bg,#422006);--color-hp-warn-bd:var(--hp-dark-warn-border,#fbbf24);--color-hp-err-bg:var(--hp-dark-err-bg,#450a0a);--color-hp-err-bd:var(--hp-dark-err-border,#f87171);--color-hp-focus:var(--hp-dark-focus,#fff);--color-hp-halo:var(--hp-dark-halo,#1e3a8a);--color-hp-ring:var(--hp-dark-ring,var(--hp-ring,#f59e0b));--color-hp-dim:var(--hp-dark-dim,var(--hp-dim,#09141e8c))}@layer base{*,:before,:after{box-sizing:border-box}}@layer components{.hp-launcher{z-index:2147483646;bottom:calc(var(--spacing) * 4);min-height:calc(var(--spacing) * 10);cursor:pointer;border-style:var(--tw-border-style);background-color:var(--color-hp-accent);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);color:var(--color-hp-accent-fg);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);pointer-events:auto;font:inherit;border-width:0;border-radius:2147483647px;position:fixed;inset-inline-end:16px}.hp-launcher[hidden]{display:none}.hp-panel{z-index:2147483646;bottom:calc(var(--spacing) * 18);border-radius:var(--radius-hp);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-hp-border);background-color:var(--color-hp-bg);padding:calc(var(--spacing) * 4);color:var(--color-hp-fg);text-align:start;pointer-events:auto;width:min(360px,100vw - 32px);max-height:min(70dvh,32rem);position:fixed;inset-inline-end:16px;overflow:auto;box-shadow:0 8px 30px #0004}.hp-panel[hidden],.hp-spotlight[hidden],.hp-tour-arrow[hidden]{display:none}:host([data-launcher-side=start]) .hp-launcher{inset-inline:16px auto}@media (min-width:601px){:host([data-launcher-side=start]) .hp-panel:not(.hp-tour){inset-inline:16px auto}}.hp-spotlight{z-index:2147483644;background-color:var(--color-hp-dim);pointer-events:none;width:100vw;height:100dvh;position:fixed;top:0;left:0}.hp-highlight{z-index:2147483645;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-hp-ring);outline-style:var(--tw-outline-style);outline-width:2px;outline-color:var(--color-hp-focus);pointer-events:none;transition:all .2s;position:fixed}.hp-panel.hp-tour{border-style:var(--tw-border-style);width:auto;padding:calc(var(--spacing) * 5);inset-inline-end:auto;border-width:0;border-radius:14px;width:min(400px,100vw - 24px);max-height:calc(100dvh - 24px);bottom:auto;box-shadow:0 10px 36px #0005}.hp-tour-head{justify-content:space-between;align-items:flex-start;gap:calc(var(--spacing) * 3);display:flex}.hp-tour h2{margin:0;margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.hp-tour p{margin:0;margin-bottom:calc(var(--spacing) * 4.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.hp-tour .hp-progress,.hp-tour-count{margin:0;margin-bottom:calc(var(--spacing) * 1.75);white-space:nowrap;font-size:13px}.hp-tour .hp-close{margin-top:calc(var(--spacing) * -2);min-height:calc(var(--spacing) * 9);min-width:calc(var(--spacing) * 9);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));margin-inline-end:-8px}.hp-tour .hp-row{margin-top:calc(var(--spacing) * 4);flex-wrap:nowrap;justify-content:space-between;align-items:center}.hp-tour .hp-primary{min-height:calc(var(--spacing) * 10);padding-inline:calc(var(--spacing) * 5);padding-block:calc(var(--spacing) * 2);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);border-radius:2147483647px}.hp-tour .hp-skip{cursor:pointer;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-hp-accent);background-color:#0000;border-width:0}.hp-tour .hp-back{cursor:pointer;border-style:var(--tw-border-style);padding-inline:0;padding-block:calc(var(--spacing) * 2);color:var(--color-hp-fg);background-color:#0000;border-width:0}.hp-tour .hp-evidence{margin-top:calc(var(--spacing) * 3)}.hp-tour .hp-warn{margin-block:calc(var(--spacing) * 3);font-size:13px}.hp-released h2,.hp-released>p:not(.hp-released-note){color:var(--color-hp-muted)}.hp-released .hp-released-note{margin:0;margin-bottom:calc(var(--spacing) * 3);--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold);color:var(--color-hp-fg)}.hp-tour-tools{margin-bottom:calc(var(--spacing) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-hp-muted)}.hp-tour-tools summary{cursor:pointer;padding-block:var(--spacing)}.hp-goal-compact{margin-top:calc(var(--spacing) * 2);margin-bottom:0}.hp-goal-compact .hp-row{flex-wrap:nowrap;margin-top:0}.hp-goal-compact input[type=text]{height:calc(var(--spacing) * 8);min-height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.hp-goal-compact button{min-height:calc(var(--spacing) * 8);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.hp-tour.hp-floating{width:auto;inset:auto 12px 12px!important}.hp-tour-arrow{z-index:2147483645;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);background-color:var(--color-hp-bg);pointer-events:none;position:fixed;rotate:45deg}.hp-tour[data-placement=below]+.hp-tour-arrow{clip-path:polygon(0 0,100% 0,0 100%)}.hp-tour[data-placement=above]+.hp-tour-arrow{clip-path:polygon(100% 0,100% 100%,0 100%)}.hp-tour[data-placement=left]+.hp-tour-arrow,.hp-tour[data-placement=right]+.hp-tour-arrow{display:none}.hp-row{margin-top:calc(var(--spacing) * 2);gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.hp-row>input[type=text]{flex:1;min-width:0}button,input[type=text]{min-height:calc(var(--spacing) * 9);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-hp-border);background-color:var(--color-hp-bg);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);color:var(--color-hp-fg);font:inherit}button.hp-primary{border-color:var(--color-hp-accent);background-color:var(--color-hp-accent);color:var(--color-hp-accent-fg)}button[aria-disabled=true],button:disabled{cursor:not-allowed;opacity:.55}button:focus-visible,input:focus-visible,.hp-launcher:focus-visible,h2:focus-visible,summary:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--color-hp-focus);box-shadow:0 0 0 4px var(--color-hp-halo)}h2:focus{outline:none}h2{margin:0;margin-bottom:var(--spacing);font-size:15px}.hp-assist{margin-top:calc(var(--spacing) * 2);cursor:pointer;align-items:center;gap:calc(var(--spacing) * 2.5);color:var(--color-hp-fg);min-height:44px;font-size:13px;display:flex}.hp-assist input{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:pointer;accent-color:var(--color-hp-accent);flex-shrink:0;min-height:0;margin:0}.hp-assist-note{margin:0;margin-bottom:calc(var(--spacing) * 2);color:var(--color-hp-muted);font-size:13px}.hp-assist-note.hp-alert{color:var(--color-hp-fg)}.hp-assist-hint{margin:0;margin-bottom:calc(var(--spacing) * 3);color:var(--color-hp-muted);font-size:13px}.hp-assist-hint[hidden]{display:none}.hp-warn{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-hp-warn-bd);background-color:var(--color-hp-warn-bg);padding:calc(var(--spacing) * 2)}.hp-alert{margin-top:calc(var(--spacing) * 2);border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-hp-err-bd);background-color:var(--color-hp-err-bg);padding:calc(var(--spacing) * 2)}.hp-suggest{margin-top:calc(var(--spacing) * 3);align-items:stretch;gap:calc(var(--spacing) * 2);flex-direction:column;display:flex}.hp-suggest-label{--tw-font-weight:var(--font-weight-semibold);font-size:13px;font-weight:var(--font-weight-semibold);color:var(--color-hp-muted);margin:0}.hp-suggestion{cursor:pointer;text-align:start;overflow-wrap:anywhere}.hp-evidence{margin-top:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-hp-muted)}.hp-evidence summary{cursor:pointer}.hp-head{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);display:flex}.hp-close{cursor:pointer;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 2.5);padding-block:var(--spacing);--tw-leading:1;color:var(--color-hp-fg);background-color:#0000;border-width:0;font-size:22px;line-height:1}.hp-progress{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-hp-muted)}.hp-sr-only{white-space:nowrap;clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}@media (pointer:coarse){button,input[type=text],.hp-launcher{min-height:44px}}@media (max-width:600px){.hp-panel:not(.hp-tour){border-radius:var(--radius-hp) var(--radius-hp) 0 0;width:100%;max-height:75dvh;bottom:0;left:0;right:0}.hp-tour h2{font-size:15px}.hp-tour{padding:calc(var(--spacing) * 4)}}@media (prefers-reduced-motion:reduce){.hp-highlight{transition:none}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}`,ke=/\b(send|submit|delete|remove|pay|purchase|buy|transfer|publish|revoke|deploy)\b/i,G=e=>e.requiresConfirmation||e.action===`click`&&[e.target.text,e.target.label,e.title,e.instruction].some(e=>ke.test(e??``)),Ae=`button, a, label, summary, [role="button"], [role="link"], [role="checkbox"], [role="menuitem"], [role="tab"]`,je=`heypointer:assist`,Me=`heypointer:open`,Ne=`heypointer:close`;function Pe(e=80,t=600){return new Promise(n=>{let r,i=()=>{a.disconnect(),clearTimeout(r),clearTimeout(o),n()},a=new MutationObserver(()=>{clearTimeout(r),r=setTimeout(i,e)});a.observe(document,{childList:!0,subtree:!0}),r=setTimeout(i,e);let o=setTimeout(i,t)})}var K=(e,t)=>(e.setAttribute(`part`,t),e),q=class{constructor(e){h(this,`opts`,void 0),h(this,`host`,void 0),h(this,`root`,void 0),h(this,`client`,void 0),h(this,`hl`,void 0),h(this,`spotlight`,void 0),h(this,`arrow`,void 0),h(this,`panel`,void 0),h(this,`launcher`,void 0),h(this,`live`,void 0),h(this,`view`,{kind:`idle`}),h(this,`wt`,null),h(this,`index`,0),h(this,`confirmed`,new Set),h(this,`missing`,!1),h(this,`ambiguous`,!1),h(this,`recorder`,null),h(this,`recording`,!1),h(this,`notice`,``),h(this,`noticeAlert`,!1),h(this,`goalToolsOpen`,!1),h(this,`lastGoal`,``),h(this,`focusTitle`,!1),h(this,`target`,null),h(this,`targetOffset`,{x:0,y:0}),h(this,`renderToken`,0),h(this,`micOk`,void 0),h(this,`assist`,void 0),h(this,`userActed`,!1),h(this,`assisting`,!1),h(this,`assisted`,new Set),h(this,`assistNote`,null),h(this,`hintEl`,null),h(this,`released`,!1),h(this,`stopWatch`,void 0),h(this,`anchor`,null),h(this,`onDocClick`,e=>this.noteClick(e)),h(this,`L`,void 0),h(this,`theme`,{}),h(this,`themeProps`,[]),h(this,`cfg`,void 0),h(this,`opener`,null),this.opts=e;let t=s(e.labels);t.problems,this.L=t.labels,this.cfg={dir:e.dir===`ltr`||e.dir===`rtl`?e.dir:`auto`,lang:typeof e.lang==`string`?e.lang.trim().slice(0,35):``,scheme:B.includes(e.colorScheme)?e.colorScheme:`auto`,launcher:e.launcher===`none`?`none`:`default`,side:e.launcherSide===`start`?`start`:`end`},this.client=new oe({baseUrl:e.baseUrl,clientId:e.clientId,fetch:e.fetch,text:(e,t)=>this.t(e,t)}),this.micOk=e.speechSupported??b(),this.assist=!!e.assist,document.addEventListener(`click`,this.onDocClick,!0),this.host=document.createElement(`div`),this.host.setAttribute(`data-heypointer-root`,``),this.host.style.pointerEvents=`none`,this.root=this.host.attachShadow({mode:`open`});let n=document.createElement(`style`);n.textContent=Oe,this.root.appendChild(n),this.hl=new y(this.root),this.spotlight=new F(this.root),this.arrow=document.createElement(`div`),this.arrow.className=`hp-tour-arrow`,this.arrow.setAttribute(`part`,`arrow`),this.arrow.hidden=!0,this.arrow.setAttribute(`aria-hidden`,`true`),this.launcher=document.createElement(`button`),this.launcher.className=`hp-launcher`,this.launcher.textContent=this.t(`launcher`),this.launcher.setAttribute(`part`,`launcher`),this.launcher.setAttribute(`aria-expanded`,`false`),this.launcher.addEventListener(`click`,()=>this.panel.hidden?this.open():this.close()),this.panel=document.createElement(`section`),this.panel.className=`hp-panel`,this.panel.setAttribute(`role`,`dialog`),this.panel.setAttribute(`aria-label`,this.t(`dialogName`)),this.panel.setAttribute(`part`,`panel`),this.panel.hidden=!0,this.panel.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.close()}),this.live=document.createElement(`div`),this.live.setAttribute(`aria-live`,`polite`),this.live.setAttribute(`role`,`status`),Object.assign(this.live.style,{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,clip:`rect(0 0 0 0)`}),this.root.append(this.launcher,this.panel,this.arrow,this.live),this.applyLayout(),e.theme!==void 0&&this.setTheme(e.theme),(e.mountTo??document.body).appendChild(this.host),this.render(),he(e)&&this.startAuthor()}async startAuthor(){try{(await ge())?.startAuthoring({labels:this.opts.labels,theme:this.opts.theme,colorScheme:this.cfg.scheme,dir:this.cfg.dir,lang:this.cfg.lang})}catch{}}t(e,t){return o(this.L[e],t)}setLabels(e){let t=s(e);t.problems,this.L=t.labels,this.launcher.textContent=this.t(`launcher`),this.panel.setAttribute(`aria-label`,this.t(`dialogName`)),this.render()}setTheme(e){let t=Ee(e);this.theme=t.theme;for(let e of this.themeProps)this.host.style.removeProperty(e);let n=De(t.theme);for(let[e,t]of Object.entries(n))this.host.style.setProperty(e,t);this.themeProps=Object.keys(n)}setColorScheme(e){this.cfg.scheme=B.includes(e)?e:`auto`,this.applyLayout(),this.setTheme(this.theme)}setLayout(e){e.dir!==void 0&&(this.cfg.dir=e.dir===`ltr`||e.dir===`rtl`?e.dir:`auto`),e.lang!==void 0&&(this.cfg.lang=e.lang.trim().slice(0,35)),e.launcher!==void 0&&(this.cfg.launcher=e.launcher===`none`?`none`:`default`),e.launcherSide!==void 0&&(this.cfg.side=e.launcherSide===`start`?`start`:`end`),this.applyLayout(),this.syncTour()}applyLayout(){let e=(e,t)=>t===null?this.host.removeAttribute(e):this.host.setAttribute(e,t);e(`dir`,this.cfg.dir===`auto`?null:this.cfg.dir),e(`lang`,this.cfg.lang||null),e(`data-scheme`,this.cfg.scheme===`auto`?null:this.cfg.scheme),e(`data-launcher`,this.cfg.launcher===`none`?`none`:null),e(`data-launcher-side`,this.cfg.side===`start`?`start`:null),this.launcher.hidden=this.cfg.launcher===`none`}isRtl(){try{return getComputedStyle(this.host).direction===`rtl`}catch{return!1}}emit(e){this.host.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}currentOpener(){let e=document.activeElement;return e instanceof HTMLElement&&e!==document.body&&e!==this.host&&!this.host.contains(e)?e:null}open(){let e=!this.panel.hidden;e||(this.opener=this.currentOpener()),this.panel.hidden=!1,this.launcher.setAttribute(`aria-expanded`,`true`),this.syncTour(),this.focusFirst(),e||this.emit(Me)}close(){let e=!this.panel.hidden;this.panel.hidden=!0,this.launcher.setAttribute(`aria-expanded`,`false`),this.hl.hide(),this.spotlight.hide(),this.arrow.hidden=!0,this.stopWatching();let t=this.opener?.isConnected?this.opener:null;this.opener=null,t?t.focus():this.launcher.hidden||this.launcher.focus(),e&&this.emit(Ne)}destroy(){document.removeEventListener(`click`,this.onDocClick,!0),this.stopWatching(),this.hl.hide(),this.spotlight.hide(),this.host.remove()}async ask(e){let t=e.trim();if(!t)return this.notice=this.t(`emptyGoal`),this.render();this.notice=``,this.noticeAlert=!1,this.lastGoal=t,this.focusTitle=!0,this.hl.hide(),this.view={kind:`loading`},this.render();try{let e=await this.client.requestWalkthrough(t,{url:location.href});this.wt=e,this.index=0,this.confirmed.clear(),this.assisted.clear(),this.userActed=!1,this.assistNote=null,this.view=e.status===`ok`?{kind:`step`}:{kind:`insufficient`,wt:e}}catch(e){this.view={kind:`error`,message:e instanceof Error?e.message:this.t(`genericError`)}}await this.render()}async next(){let e=this.step();if(!this.wt||!e||G(e)&&!this.confirmed.has(e.id))return;let t=this.attemptAssist(e);this.assistNote=null,t&&`failed`in t?(this.assistNote={text:this.t(`assistFailed`,{label:t.failed}),alert:!0},await this.render()):(t&&await Pe(),this.index>=this.wt.steps.length-1?(this.hl.hide(),this.view={kind:`done`}):this.index++,this.userActed=!1,t&&(this.assistNote={text:this.t(`assistClicked`,{label:t.label}),alert:!1}),this.focusTitle=!0,await this.render())}async prev(){this.index>0&&(this.index--,this.userActed=!1,this.assistNote=null,this.view={kind:`step`},this.focusTitle=!0,await this.render())}async skip(){this.wt&&this.step()&&(this.userActed=!1,this.assistNote=null,this.index>=this.wt.steps.length-1?(this.hl.hide(),this.view={kind:`done`}):this.index++,this.focusTitle=!0,await this.render())}async confirm(){let e=this.step();e&&this.confirmed.add(e.id),await this.render()}async retry(){await this.render()}state(){return{view:this.view.kind,index:this.index,missing:this.missing,ambiguous:this.ambiguous,wt:this.wt}}assistBlock(e){if(this.host.contains(e)||e.getRootNode()===this.root)return`guide`;if(e.closest(`[inert]`))return`inert`;if(e.getAttribute(`aria-disabled`)===`true`||e.closest(`[aria-disabled="true"]`))return`disabled`;try{if(e.matches(`:disabled`))return`disabled`}catch{}if(e instanceof HTMLInputElement&&e.type===`file`)return`file`;let t=e.closest(`a`);if(t){if(t.hasAttribute(`download`)||t.target&&t.target!==`_self`)return`link`;let e=t.getAttribute(`href`);if(e!==null)try{let t=new URL(e,location.href);if(t.protocol!==`http:`&&t.protocol!==`https:`||t.origin!==location.origin)return`link`}catch{return`link`}}return null}attemptAssist(e){if(!this.assist||this.released||this.userActed||this.assisted.has(this.index)||e.action!==`click`||G(e))return null;let t=e.target;if(!t.selectors.length&&!t.text&&!t.label)return null;let n=D(t,document);if(n.status!==`found`)return null;let r=n.element;if(this.target?.isConnected&&r!==this.target||this.assistBlock(r))return null;let i=(S(r).replace(/\s+/g,` `).trim()||t.text||t.label||e.title).slice(0,80);this.assisted.add(this.index),this.assisting=!0;try{r.click()}catch{return{failed:i}}finally{this.assisting=!1}let a={stepIndex:this.index,action:`click`,label:i};try{this.opts.onAssist?.(a)}catch{}return this.host.dispatchEvent(new CustomEvent(je,{detail:a,bubbles:!0,composed:!0})),{label:i}}noteClick(e){if(this.assisting||!this.target||this.view.kind!==`step`)return;let t=e.composedPath();if(t.includes(this.host))return;if(t.includes(this.target)){this.userActed=!0;return}let n=t[0];n instanceof Element&&n.contains(this.target)&&n.matches(Ae)&&(this.userActed=!0)}step(){return this.view.kind===`step`?this.wt?.steps[this.index]:void 0}async toggleRecording(){if(!this.recording){try{this.recorder??(this.recorder=(this.opts.recorderFactory??(()=>new se))()),await this.recorder.start(),this.recording=!0,this.notice=this.t(`recording`)}catch{this.recorder=null,this.notice=this.t(`voiceUnavailable`)}return this.render()}this.recording=!1,this.noticeAlert=!1;try{let e=await this.recorder.stop();this.notice=this.t(`transcribing`),await this.render();let t=await this.client.transcribe(e);this.notice=``,await this.ask(t)}catch(e){if(e instanceof _){this.notice=this.t(`noSpeech`),this.noticeAlert=!0,await this.render(),this.panel.querySelector(`[data-autofocus]`)?.focus();return}this.notice=e instanceof g?this.t(`voiceUnavailable`):this.t(`audioFailed`),await this.render()}}focusFirst(){(this.panel.querySelector(`[data-autofocus]`)??this.panel.querySelector(`button, input`))?.focus()}el(e,t={},n){let r=document.createElement(e);return Object.assign(r,t),n!==void 0&&(r.textContent=n),r}async render(){let e=++this.renderToken;this.stopWatching(),this.released=!1;let t=this.root.activeElement?.getAttribute(`data-key`),n=this.panel,r=this.view.kind===`step`;this.spotlight.hide(),n.className=r?`hp-panel hp-tour`:`hp-panel`,n.setAttribute(`part`,r?`panel card`:`panel`),n.removeAttribute(`data-placement`),n.style.left=``,n.style.top=``,n.replaceChildren(),this.target=null,this.arrow.hidden=!0,this.missing=!1,this.ambiguous=!1;let i=this.el(`div`,{className:r?`hp-tour-head`:`hp-head`});r||i.append(K(this.el(`h2`,{},this.t(`heading`)),`title`)),r&&i.append(K(this.el(`div`,{className:`hp-tour-count`},this.t(`tourCount`,{current:this.index+1,total:this.wt.steps.length})),`progress`));let a=K(this.el(`button`,{type:`button`,className:`hp-close`},`×`),`button close`);if(a.setAttribute(`aria-label`,this.t(`closeLabel`)),a.setAttribute(`data-key`,`close`),a.addEventListener(`click`,()=>this.close()),i.append(a),n.append(i),n.append(this.goalForm(r)),r){let e=this.el(`details`,{className:`hp-tour-tools`,open:this.goalToolsOpen||this.recording||!!this.notice});K(e,`tools`),e.append(this.el(`summary`,{},this.t(`changeGoal`))),e.addEventListener(`toggle`,()=>{this.goalToolsOpen=e.open}),e.append(n.querySelector(`form`)),n.append(e)}this.notice&&n.append(K(this.el(`p`,{role:this.noticeAlert?`alert`:`status`},this.notice),this.noticeAlert?`alert`:`text`)),this.assistNote&&n.append(this.assistNote.alert?K(this.el(`p`,{className:`hp-assist-note hp-alert`,role:`alert`},this.assistNote.text),`alert`):K(this.el(`p`,{className:`hp-assist-note`},this.assistNote.text),`hint`));let o=this.view;if(o.kind===`loading`&&n.append(K(this.el(`p`,{},this.t(`loading`)),`text`)),o.kind===`error`){let e=this.alert(o.message),t=K(this.el(`button`,{type:`button`},this.t(`tryAgain`)),`button button-secondary`);t.addEventListener(`click`,()=>void this.ask(this.lastGoal)),e.append(t),n.append(e)}if(o.kind===`insufficient`&&this.renderInsufficient(o.wt),o.kind===`done`){let e=this.wt?.goal??this.lastGoal,t=K(this.el(`p`,{},this.t(`done`,{goal:e})),`text`);t.tabIndex=-1;let r=K(this.el(`button`,{type:`button`},this.t(`startAnother`)),`button button-secondary`);r.addEventListener(`click`,()=>{this.view={kind:`idle`},this.wt=null,this.render().then(()=>this.focusFirst())}),n.append(t,r),this.announce(this.t(`done`,{goal:e})),this.focusTitle&&t.focus(),this.focusTitle=!1}if(o.kind===`step`){let t=this.step();this.renderStep(t),await this.locate(t,e)}r&&!this.panel.hidden?this.spotlight.show(this.target,()=>this.positionTour()):this.spotlight.hide(),o.kind===`step`&&this.watch(),t&&this.panel.querySelector(`[data-key="${t}"]`)?.focus({preventScroll:!0})}syncTour(){if(this.view.kind!==`step`)return this.spotlight.hide();this.released?this.reengage():this.spotlight.show(this.target,()=>this.positionTour()),this.watch()}stopWatching(){this.stopWatch?.(),this.stopWatch=void 0}watch(){this.stopWatching();let e=this.target;e&&this.view.kind===`step`&&(this.stopWatch=N(e,e=>e?this.reengage():this.release()))}release(){let e=this.step(),t=this.target;if(!e||!t||this.released)return;let n=D(e.target,document);if(n.status===`found`&&n.element!==t&&this.anchor?.isConnected&&this.anchor.contains(n.element))return this.rebind(n.element);this.released=!0,this.hl.hide(),this.spotlight.hide(),this.arrow.hidden=!0,this.panel.classList.add(`hp-released`,`hp-floating`),this.panel.removeAttribute(`data-placement`);let r=K(this.el(`p`,{className:`hp-released-note`},this.t(`releasedNote`)),`hint`);this.hintEl?this.hintEl.after(r):this.panel.append(r),this.announce(this.t(`releasedNote`))}reengage(){if(!this.released||!this.target)return;this.released=!1,this.panel.classList.remove(`hp-released`),this.panel.querySelector(`.hp-released-note`)?.remove();let e=this.step();e&&(!G(e)||this.confirmed.has(e.id))&&this.hl.show(this.target),this.spotlight.show(this.target,()=>this.positionTour())}rebind(e){this.target=e,this.targetOffset=v(e),this.anchor=e.parentElement;let t=this.step();t&&(!G(t)||this.confirmed.has(t.id))&&this.hl.show(e),this.spotlight.show(e,()=>this.positionTour()),this.watch()}positionTour(){if(this.panel.hidden||this.view.kind!==`step`)return;if(!this.target){this.panel.classList.add(`hp-floating`),this.panel.removeAttribute(`data-placement`),this.arrow.hidden=!0;return}let e=this.target.getBoundingClientRect(),t={left:e.left+this.targetOffset.x,top:e.top+this.targetOffset.y,right:e.right+this.targetOffset.x,bottom:e.bottom+this.targetOffset.y};this.panel.classList.remove(`hp-floating`),this.panel.style.left=`12px`,this.panel.style.top=`12px`;let n=this.panel.getBoundingClientRect(),r=P(t,n,{width:innerWidth,height:innerHeight},void 0,this.isRtl());this.panel.style.left=`${r.left}px`,this.panel.style.top=`${r.top}px`,this.panel.dataset.placement=r.placement,this.arrow.hidden=r.placement===`floating`||r.placement===`left`||r.placement===`right`,this.arrow.hidden||(this.arrow.style.left=`${r.left+r.arrowLeft-8}px`,this.arrow.style.top=`${r.placement===`below`?r.top-8:r.top+n.height-8}px`)}goalForm(e=!1){let t=this.el(`form`);e&&(t.className=`hp-goal-compact`);let n=this.el(`label`,{className:e?`hp-sr-only`:``},this.t(`goalQuestion`)),r=this.el(`input`,{type:`text`,name:`goal`,autocomplete:`off`});r.setAttribute(`data-autofocus`,``),r.setAttribute(`data-key`,`goal`),r.setAttribute(`aria-label`,this.t(`goalAria`)),r.setAttribute(`part`,`goal-input`),r.placeholder=this.t(`goalPlaceholder`),(this.view.kind===`step`||this.view.kind===`done`)&&(r.value=this.wt?.goal??``);let i=K(this.el(`button`,{type:`submit`,className:`hp-primary`},this.t(`submit`)),`button button-primary`),a=this.el(`div`,{className:`hp-row`});if(a.append(r,i),this.micOk){let e=K(this.el(`button`,{type:`button`},this.recording?this.t(`stop`):this.t(`speak`)),`button button-secondary`);e.setAttribute(`aria-pressed`,String(this.recording)),e.setAttribute(`data-key`,`mic`),e.addEventListener(`click`,()=>void this.toggleRecording()),a.append(e)}let o=K(this.el(`label`,{className:`hp-assist`}),`toggle`),s=this.el(`input`,{type:`checkbox`,checked:this.assist});return s.setAttribute(`data-key`,`assist`),s.addEventListener(`change`,()=>{this.assist=s.checked,this.render()}),o.append(s,this.el(`span`,{},this.t(`assistToggle`))),t.append(n,a,o),t.addEventListener(`submit`,e=>{e.preventDefault(),this.ask(r.value)}),t}alert(e){return K(this.el(`div`,{className:`hp-alert`,role:`alert`},e),`alert`)}renderInsufficient(e){let t=this.alert(e.message??this.t(`insufficient`));if(e.missingEvidence?.length){let n=this.el(`ul`);e.missingEvidence.forEach(e=>n.append(this.el(`li`,{},e))),t.append(n)}this.panel.append(t);let n=e.suggestions??[];if(!n.length)return;let r=K(this.el(`div`,{className:`hp-suggest`}),`suggestions`);r.setAttribute(`role`,`group`),r.setAttribute(`aria-labelledby`,`hp-suggest-label`),r.append(this.el(`p`,{id:`hp-suggest-label`,className:`hp-suggest-label`},this.t(`suggestLabel`))),n.forEach((e,t)=>{let n=K(this.el(`button`,{type:`button`,className:`hp-suggestion`},e.title),`button button-secondary suggestion`);n.setAttribute(`data-key`,`suggest-${t}`),n.addEventListener(`click`,()=>void this.ask(e.title)),r.append(n)}),this.panel.append(r),this.announce(this.t(`suggestAnnounce`,{list:n.map(e=>e.title).join(`; `)}))}renderStep(e){let t=this.wt.steps.length,n=this.panel;n.append(K(this.el(`span`,{className:`hp-progress hp-sr-only`},this.t(`stepProgress`,{current:this.index+1,total:t})),`progress`));let r=K(this.el(`h2`,{},e.title),`title`);r.setAttribute(`data-key`,`title`),r.tabIndex=-1,this.focusTitle&&queueMicrotask(()=>r.focus({preventScroll:!0})),this.focusTitle=!1,n.append(r,K(this.el(`p`,{},e.instruction),`text`)),e.value&&n.append(K(this.el(`p`,{},this.t(`suggestedValue`,{value:e.value})),`text`)),this.hintEl=K(this.el(`p`,{className:`hp-assist-hint`},this.t(`assistHint`)),`hint`),this.hintEl.hidden=!this.assist||!!G(e)||e.action!==`type`&&e.action!==`select`&&e.action!==`navigate`,n.append(this.hintEl);let i=G(e),a=this.confirmed.has(e.id);if(i){let e=K(this.el(`div`,{className:`hp-warn`}),`warning`);e.append(this.el(`strong`,{},this.t(`gateWarning`)));let t=this.el(`label`),r=this.el(`input`,{type:`checkbox`,checked:a});r.setAttribute(`data-key`,`confirm`),r.addEventListener(`change`,()=>void this.confirm()),t.append(r,` ${this.t(`gateCheckbox`)}`),e.append(this.el(`br`),t),n.append(e)}let o=this.el(`div`,{className:`hp-row`}),s=K(this.el(`button`,{type:`button`,className:`hp-back`,disabled:this.index===0},this.t(`back`)),`button button-secondary`);s.addEventListener(`click`,()=>void this.prev());let c=K(this.el(`button`,{type:`button`,className:`hp-skip`},this.t(`skip`)),`button button-secondary`);c.setAttribute(`data-key`,`skip`),c.addEventListener(`click`,()=>void this.skip());let l=this.index===t-1,u=i&&!a,d=K(this.el(`button`,{type:`button`,className:`hp-primary`},l?this.t(`finish`):this.t(`next`)),`button button-primary`);d.setAttribute(`data-key`,`next`),u&&(d.setAttribute(`aria-disabled`,`true`),d.setAttribute(`aria-describedby`,`hp-why`),o.append(this.el(`span`,{id:`hp-why`,hidden:!0},this.t(`gateWhy`)))),d.addEventListener(`click`,()=>void this.next());let f=K(this.el(`div`,{className:`hp-row`}),`actions`);if(f.append(c,d),o.append(s,f),n.append(o),e.evidence.length){let t=K(this.el(`details`,{className:`hp-evidence`}),`evidence`);t.append(this.el(`summary`,{},this.t(`evidenceSummary`,{count:e.evidence.length}))),e.evidence.forEach(e=>t.append(this.el(`div`,{},`${e.sourceType} · ${e.path}:${e.lineStart}${e.lineEnd===e.lineStart?``:`-`+e.lineEnd} — ${e.excerpt}`))),n.append(t)}this.announce(this.t(`stepAnnounce`,{current:this.index+1,total:t,title:e.title,instruction:e.instruction}))}async locate(e,t){this.hl.hide();let n=e.target;if(!(n.selectors.length>0||n.text||n.label))return;let r=await O(n,this.opts.targetTimeoutMs??1500,document);if(t!==this.renderToken)return;if(r.status===`found`){this.target=r.element,this.anchor=r.element.parentElement,this.targetOffset=v(r.element),(!G(e)||this.confirmed.has(e.id))&&this.hl.show(r.element),this.assist&&e.action===`click`&&!G(e)&&this.hintEl&&this.assistBlock(r.element)&&(this.hintEl.hidden=!1);return}this.missing=!0;let i=n.text??n.label??n.selectors[0],a=r.status===`ambiguous`;this.ambiguous=a;let o=this.alert(a?this.t(`ambiguous`,{label:i}):this.t(`notFound`,{label:i})),s=this.el(`div`,{className:`hp-row`}),c=K(this.el(`button`,{type:`button`},this.t(`tryAgain`)),`button button-secondary`);c.setAttribute(`data-key`,`retry`),c.addEventListener(`click`,()=>void this.retry());let l=K(this.el(`button`,{type:`button`},this.t(`skipStep`)),`button button-secondary`);l.setAttribute(`data-key`,`skip`),l.addEventListener(`click`,()=>void this.skip()),s.append(c,l),o.append(s),this.panel.append(o),this.announce(this.t(a?`ambiguousAnnounce`:`notFoundAnnounce`,{title:e.title}))}announce(e){let t=this.assistNote&&!this.assistNote.alert?`${this.assistNote.text} ${e}`:e;this.live.textContent=``,queueMicrotask(()=>this.live.textContent=t)}},J=`heypointer-assistant`,Y=typeof HTMLElement>`u`?class{}:HTMLElement,X=[`base-url`,`client-id`,`target-timeout-ms`,`assist`,`author`,`allow-author-param`],Fe=[`labels`,`theme`,`color-scheme`,`dir`,`lang`,`launcher`,`launcher-side`],Z=class extends Y{constructor(...e){super(...e),h(this,`gf`,null),h(this,`labelsProp`,void 0),h(this,`themeProp`,void 0)}get player(){return this.gf}get labels(){return this.labelsProp}set labels(e){this.labelsProp=typeof e==`string`?c(`labels`,e):e,this.gf?.setLabels(this.currentLabels())}get theme(){return this.themeProp}set theme(e){this.themeProp=typeof e==`string`?c(`theme`,e):e,this.gf?.setTheme(this.currentTheme())}setLabels(e){this.labels=e}open(){this.gf?.open()}close(){this.gf?.close()}ask(e){return this.gf?this.gf.ask(e):Promise.resolve()}connectedCallback(){this.style.display=`contents`,this.mount()}disconnectedCallback(){this.gf?.destroy(),this.gf=null}attributeChangedCallback(e,t,n){if(this.isConnected&&t!==n){if(X.includes(e)||!this.gf)return void this.mount();switch(e){case`labels`:this.gf.setLabels(this.currentLabels());break;case`theme`:this.gf.setTheme(this.currentTheme());break;case`color-scheme`:this.gf.setColorScheme(this.scheme());break;default:this.gf.setLayout(this.layout())}}}currentLabels(){return this.labelsProp??c(`labels`,this.getAttribute(`labels`))}currentTheme(){return this.themeProp??c(`theme`,this.getAttribute(`theme`))}scheme(){return this.getAttribute(`color-scheme`)??void 0}layout(){return{dir:this.getAttribute(`dir`)??`auto`,lang:this.getAttribute(`lang`)??``,launcher:this.getAttribute(`launcher`)===`none`?`none`:`default`,launcherSide:this.getAttribute(`launcher-side`)===`start`?`start`:`end`}}mount(){let e=this.getAttribute(`base-url`);if(this.gf?.destroy(),this.gf=null,!e)return;let t=Number(this.getAttribute(`target-timeout-ms`)),n=this.getAttribute(`client-id`)?.trim(),r=this.hasAttribute(`assist`)&&this.getAttribute(`assist`)!==`false`,i=e=>this.hasAttribute(e)&&this.getAttribute(e)!==`false`,a=this.layout(),o=this.currentLabels(),s=this.currentTheme(),c={baseUrl:e,...r?{assist:r}:{},...i(`author`)?{author:!0}:{},...i(`allow-author-param`)?{allowAuthorParam:!0}:{},...n?{clientId:n}:{},mountTo:this,...Number.isFinite(t)&&t>0?{targetTimeoutMs:t}:{},...o===void 0?{}:{labels:o},...s===void 0?{}:{theme:s},colorScheme:this.scheme(),dir:a.dir,lang:a.lang,launcher:a.launcher,launcherSide:a.launcherSide};this.gf=new q(c)}};h(Z,`observedAttributes`,[...X,...Fe]);function Ie(e=J){typeof customElements<`u`&&!customElements.get(e)&&customElements.define(e,Z)}Ie();var Q=document.currentScript;Q?.src&&z(Q.src);var $=Q?.dataset.baseUrl;if($&&!document.querySelector(`heypointer-assistant`)){let e=()=>{let e=document.createElement(J);e.setAttribute(`base-url`,$),Q?.dataset.clientId&&e.setAttribute(`client-id`,Q.dataset.clientId),Q?.dataset.assist!==void 0&&Q.dataset.assist!==`false`&&e.setAttribute(`assist`,``),Q?.dataset.author!==void 0&&Q.dataset.author!==`false`&&e.setAttribute(`author`,``),Q?.dataset.allowAuthorParam!==void 0&&Q.dataset.allowAuthorParam!==`false`&&e.setAttribute(`allow-author-param`,``),Q?.dataset.targetTimeoutMs&&e.setAttribute(`target-timeout-ms`,Q.dataset.targetTimeoutMs);let t=[[`labels`,Q?.dataset.labels],[`theme`,Q?.dataset.theme],[`color-scheme`,Q?.dataset.colorScheme],[`dir`,Q?.dataset.dir],[`lang`,Q?.dataset.lang],[`launcher`,Q?.dataset.launcher],[`launcher-side`,Q?.dataset.launcherSide]];for(let[n,r]of t)r&&e.setAttribute(n,r);document.body.appendChild(e)};document.body?e():document.addEventListener(`DOMContentLoaded`,e,{once:!0})}return e.HeyPointer=q,e})({});
package/dist/labels.d.ts CHANGED
@@ -55,7 +55,7 @@ export declare const DEFAULT_LABELS: {
55
55
  readonly clientRequired: "HeyPointer needs a client ID. Run heypointer init or pass data-client-id.";
56
56
  readonly clientInvalid: "HeyPointer does not recognise this client ID. Check that it matches the one heypointer init gave you.";
57
57
  readonly clientOrigin: "This site's address is not allowed for this HeyPointer client ID. Ask the HeyPointer admin to add it to the client's allowed origins.";
58
- readonly clientMalformed: "The HeyPointer client ID looks wrong (it should start with gfc_). Check data-client-id against what heypointer init printed.";
58
+ readonly clientMalformed: "The HeyPointer client ID looks wrong (it should start with hpc_). Check data-client-id against what heypointer init printed.";
59
59
  readonly rateLimited: "HeyPointer is getting too many requests right now. Wait a moment and try again.";
60
60
  readonly serverUnreachable: "Cannot reach the HeyPointer server at {host}. Check that it is running and the address is right.";
61
61
  readonly requestFailed: "Walkthrough request failed ({status})";
package/dist/player.d.ts CHANGED
@@ -4,7 +4,7 @@ import { type ColorScheme, type HeyPointerTheme } from './theme';
4
4
  import type { WalkthroughStep } from './types';
5
5
  export interface HeyPointerOptions {
6
6
  baseUrl: string;
7
- /** Publishable client id from `heypointer init` (`gfc_` + 24 hex). */
7
+ /** Publishable client id from `heypointer init` (`hpc_` + 24 hex). */
8
8
  clientId?: string;
9
9
  fetch?: typeof fetch;
10
10
  recorderFactory?: () => AudioRecorder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heypointerhq/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "HeyPointer in-app guide: turns a goal into a spotlight-and-tooltip walkthrough of the real page. ESM, custom element and script-tag bundle; styles are compiled in.",
6
6
  "keywords": [
@@ -54,7 +54,7 @@
54
54
  "NOTICE"
55
55
  ],
56
56
  "dependencies": {
57
- "@heypointerhq/contracts": "^0.2.0"
57
+ "@heypointerhq/contracts": "^0.2.1"
58
58
  },
59
59
  "homepage": "https://heypointer.com/docs/"
60
60
  }