@launchsecure/launch-kit 0.0.30 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/beacon/beacon.mjs +1027 -929
  2. package/dist/beacon/beacon.mjs.map +1 -1
  3. package/dist/beacon/beacon.umd.js +9 -9
  4. package/dist/beacon/beacon.umd.js.map +1 -1
  5. package/dist/beacon/types/internal/pick-mode-overlay.d.ts.map +1 -1
  6. package/dist/beacon/types/internal/picker.d.ts.map +1 -1
  7. package/dist/beacon/types/internal/pin-popover.d.ts.map +1 -1
  8. package/dist/beacon/types/internal/screenshot.d.ts +19 -1
  9. package/dist/beacon/types/internal/screenshot.d.ts.map +1 -1
  10. package/dist/beacon/types/internal/selector.d.ts.map +1 -1
  11. package/dist/beacon/types/plugins/domEle.d.ts.map +1 -1
  12. package/dist/chart-client/assets/{index-CJ4mgRRF.css → index-CDIhdgWg.css} +1 -1
  13. package/dist/chart-client/index.html +2 -2
  14. package/dist/client/assets/{index-DI5qSR_w.css → index-CfW4n40I.css} +1 -1
  15. package/dist/client/index.html +2 -2
  16. package/dist/council-client/assets/{index-C_-vAM9L.css → index-CZim6x1u.css} +1 -1
  17. package/dist/council-client/index.html +2 -2
  18. package/dist/deck-client/assets/{_baseUniq-DCt2IMRR.js → _baseUniq-C7GsHvgg.js} +1 -1
  19. package/dist/deck-client/assets/{arc-h-ifqmNR.js → arc-CSrZRINY.js} +1 -1
  20. package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-C9dITSPv.js → architectureDiagram-Q4EWVU46-zoB-G17J.js} +1 -1
  21. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-BHuJT34t.js → blockDiagram-DXYQGD6D-BRjjtYH6.js} +1 -1
  22. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-CpvMGtDG.js → c4Diagram-AHTNJAMY-C3D3sd2U.js} +1 -1
  23. package/dist/deck-client/assets/channel-8ReQnQfH.js +1 -0
  24. package/dist/deck-client/assets/{chunk-4BX2VUAB-B6md1VIm.js → chunk-4BX2VUAB-DhpDMOPO.js} +1 -1
  25. package/dist/deck-client/assets/{chunk-4TB4RGXK-BmEnX8ik.js → chunk-4TB4RGXK-BIRgPXRl.js} +1 -1
  26. package/dist/deck-client/assets/{chunk-55IACEB6-BZPUyZAZ.js → chunk-55IACEB6-BF24dwDZ.js} +1 -1
  27. package/dist/deck-client/assets/{chunk-EDXVE4YY-BWwNUK-l.js → chunk-EDXVE4YY-CW75Y61B.js} +1 -1
  28. package/dist/deck-client/assets/{chunk-FMBD7UC4-o7gSppGI.js → chunk-FMBD7UC4-B5-oyL79.js} +1 -1
  29. package/dist/deck-client/assets/{chunk-OYMX7WX6-C4KoTL5p.js → chunk-OYMX7WX6-BB2bHe_Q.js} +1 -1
  30. package/dist/deck-client/assets/{chunk-QZHKN3VN-jkf68sDs.js → chunk-QZHKN3VN-D80eZO4B.js} +1 -1
  31. package/dist/deck-client/assets/{chunk-YZCP3GAM-Cd4yBE7o.js → chunk-YZCP3GAM-Dz9787p_.js} +1 -1
  32. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-cRxTeGkK.js +1 -0
  33. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-cRxTeGkK.js +1 -0
  34. package/dist/deck-client/assets/clone-LSHZ3K6R.js +1 -0
  35. package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-DeGFUgAV.js → cose-bilkent-S5V4N54A-MQjiZLcL.js} +1 -1
  36. package/dist/deck-client/assets/{dagre-KV5264BT-ekcYJuUV.js → dagre-KV5264BT-DG4EcLpJ.js} +1 -1
  37. package/dist/deck-client/assets/{diagram-5BDNPKRD-YHPk4rV2.js → diagram-5BDNPKRD-1n7hM3Gc.js} +1 -1
  38. package/dist/deck-client/assets/{diagram-G4DWMVQ6-DM-JCd_B.js → diagram-G4DWMVQ6-CYMarncV.js} +1 -1
  39. package/dist/deck-client/assets/{diagram-MMDJMWI5-l5FK1ybk.js → diagram-MMDJMWI5-DSisoipe.js} +1 -1
  40. package/dist/deck-client/assets/{diagram-TYMM5635-CIN4_1-j.js → diagram-TYMM5635-Btnq49OJ.js} +1 -1
  41. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-MyinSkEl.js → erDiagram-SMLLAGMA-Cu2Hb_Tz.js} +1 -1
  42. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-Dk8nn42x.js → flowDiagram-DWJPFMVM-CGJzUzsO.js} +1 -1
  43. package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-BU1ihicu.js → ganttDiagram-T4ZO3ILL-D9sqGUBT.js} +1 -1
  44. package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-BjsTL13C.js → gitGraphDiagram-UUTBAWPF-C0QwX2od.js} +1 -1
  45. package/dist/deck-client/assets/{graph-DJmh-xi7.js → graph-CcBjOQCl.js} +1 -1
  46. package/dist/deck-client/assets/index-0arwoc0z.js +1195 -0
  47. package/dist/deck-client/assets/index-6sdqbm2o.js +2 -0
  48. package/dist/deck-client/assets/{index-DsIZ3LqL.css → index-BlTlhxFW.css} +1 -1
  49. package/dist/deck-client/assets/{infoDiagram-42DDH7IO-Dxvy_RB4.js → infoDiagram-42DDH7IO-DTimhhhS.js} +1 -1
  50. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DPOaNF1l.js → ishikawaDiagram-UXIWVN3A-DxOxg_B4.js} +1 -1
  51. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-DMew3K5c.js → journeyDiagram-VCZTEJTY-Bpq0qa4j.js} +1 -1
  52. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-csciJFuk.js → kanban-definition-6JOO6SKY-aTIrpcVO.js} +1 -1
  53. package/dist/deck-client/assets/{layout-Dg4yyms2.js → layout-DqglLR2E.js} +1 -1
  54. package/dist/deck-client/assets/{linear-BA3zU6gq.js → linear-D5GxehPc.js} +1 -1
  55. package/dist/deck-client/assets/{min-lz-Ird-p.js → min-DXLfSREq.js} +1 -1
  56. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-CCEN8OQV.js → mindmap-definition-QFDTVHPH-mO5Vys7I.js} +1 -1
  57. package/dist/deck-client/assets/{pieDiagram-DEJITSTG-DM6n1HY7.js → pieDiagram-DEJITSTG-Dm0gzdAr.js} +1 -1
  58. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-_ULoR66n.js → quadrantDiagram-34T5L4WZ-Daq7j3qD.js} +1 -1
  59. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-BuwJs7Tn.js → requirementDiagram-MS252O5E-CmwV95um.js} +1 -1
  60. package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-BEsuzkW4.js → sankeyDiagram-XADWPNL6-BOYl3Nkf.js} +1 -1
  61. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-CP2H0YWf.js → sequenceDiagram-FGHM5R23-BuUjhIcW.js} +1 -1
  62. package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-B5Gw_NNL.js → stateDiagram-FHFEXIEX-LUZ_uwio.js} +1 -1
  63. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CnnRwE5D.js +1 -0
  64. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-DsoYydQa.js → timeline-definition-GMOUNBTQ-CDUxCCAW.js} +1 -1
  65. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-Dz8JT_ob.js → vennDiagram-DHZGUBPP-BRb24Tf7.js} +1 -1
  66. package/dist/deck-client/assets/{wardley-RL74JXVD-DGHQ_Ijv.js → wardley-RL74JXVD-B0BYyVBY.js} +1 -1
  67. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-DN1LJMB1.js → wardleyDiagram-NUSXRM2D-BLGlYrQz.js} +1 -1
  68. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-nb0oSfrQ.js → xychartDiagram-5P7HB3ND-De31MSnk.js} +1 -1
  69. package/dist/deck-client/index.html +2 -2
  70. package/dist/server/cli.js +666 -12
  71. package/dist/server/council-entry.js +0 -0
  72. package/dist/server/deck-mcp-entry.js +224 -61
  73. package/dist/server/deck-serve.js +195 -41
  74. package/dist/server/fb-wizard.js +0 -0
  75. package/dist/server/graph-mcp-entry.js +666 -12
  76. package/dist/server/init-entry.js +231 -82
  77. package/package.json +23 -21
  78. package/scaffolds/ls-marketplace/plugins/kit/skills/analyse/SKILL.md +180 -0
  79. package/scaffolds/ls-marketplace/plugins/kit/skills/{blast-radius.md → blast-radius/SKILL.md} +28 -12
  80. package/scaffolds/ls-marketplace/plugins/kit/skills/{debug.md → debug/SKILL.md} +2 -9
  81. package/scaffolds/ls-marketplace/plugins/kit/skills/diagram/SKILL.md +174 -0
  82. package/scaffolds/ls-marketplace/plugins/kit/skills/{prototype.md → prototype/SKILL.md} +21 -1
  83. package/scaffolds/ls-marketplace/plugins/kit/skills/recovery/SKILL.md +95 -0
  84. package/scaffolds/ls-marketplace/plugins/kit/skills/{wireframe.md → wireframe/SKILL.md} +21 -1
  85. package/scaffolds/migrate-safety/scripts/migrate-with-backup.sh +0 -0
  86. package/scaffolds/recall-hook/scripts/ensure-recall.sh +0 -0
  87. package/dist/deck-client/assets/channel-2PZVMiXf.js +0 -1
  88. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-Bt8xBAof.js +0 -1
  89. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-Bt8xBAof.js +0 -1
  90. package/dist/deck-client/assets/clone-BHQryoDl.js +0 -1
  91. package/dist/deck-client/assets/index-KsShfCV-.js +0 -476
  92. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-4T4wMDXr.js +0 -1
  93. package/scaffolds/ls-marketplace/plugins/kit/skills/diagram.md +0 -134
  94. package/scaffolds/ls-marketplace/plugins/kit/skills/recall.md +0 -83
  95. /package/dist/chart-client/assets/{index-Ccy-DpI-.js → index-B__ARB8k.js} +0 -0
  96. /package/dist/client/assets/{index-Dp0_okva.js → index-h8kMzVtG.js} +0 -0
  97. /package/dist/council-client/assets/{index-Dt4zWKSj.js → index-CWaDcsFR.js} +0 -0
  98. /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-array.md → beacon-array/SKILL.md} +0 -0
  99. /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-clear.md → beacon-clear/SKILL.md} +0 -0
  100. /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-pulse.md → beacon-pulse/SKILL.md} +0 -0
  101. /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-scan.md → beacon-scan/SKILL.md} +0 -0
  102. /package/scaffolds/ls-marketplace/plugins/kit/skills/{brief.md → brief/SKILL.md} +0 -0
  103. /package/scaffolds/ls-marketplace/plugins/kit/skills/{course.md → course/SKILL.md} +0 -0
  104. /package/scaffolds/ls-marketplace/plugins/kit/skills/{deploy-check.md → deploy-check/SKILL.md} +0 -0
  105. /package/scaffolds/ls-marketplace/plugins/kit/skills/{orbit.md → orbit/SKILL.md} +0 -0
  106. /package/scaffolds/ls-marketplace/plugins/kit/skills/{show-mcp-status.md → show-mcp-status/SKILL.md} +0 -0
@@ -1,4 +1,4 @@
1
- (function(C,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(C=typeof globalThis<"u"?globalThis:C||self,_(C.LaunchKitBeacon={}))})(this,function(C){"use strict";const _=String.raw`
1
+ (function(k,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(k=typeof globalThis<"u"?globalThis:k||self,D(k.LaunchKitBeacon={}))})(this,function(k){"use strict";const D=String.raw`
2
2
  :host {
3
3
  --beacon-accent: #0ea5e9;
4
4
  --beacon-bg: #ffffff;
@@ -693,10 +693,10 @@ dialog.beacon-dialog::backdrop {
693
693
  text-overflow: ellipsis;
694
694
  max-width: 100%;
695
695
  }
696
- `,Ae="launch-kit-beacon-portal-styles";function Rt(){if(typeof document>"u"||!document.head||document.getElementById(Ae))return;const e=document.createElement("style");e.id=Ae,e.textContent=_,document.head.appendChild(e)}const ne="http://www.w3.org/2000/svg";function It(){const e=document.createElementNS(ne,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");const t=document.createElementNS(ne,"path");t.setAttribute("d","M3 11l18-5v12L3 14v-3z");const n=document.createElementNS(ne,"path");return n.setAttribute("d","M11.6 16.8a3 3 0 1 1-5.8-1.6"),e.appendChild(t),e.appendChild(n),e}const F="launch-kit-beacon",Pt=typeof HTMLElement<"u"?HTMLElement:class{};class Nt extends Pt{constructor(){super(...arguments),this.onTriggerClick=null}connectedCallback(){if(this.shadow)return;this.shadow=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=_,this.shadow.appendChild(t),this.triggerSlot=document.createElement("slot"),this.triggerSlot.name="trigger",this.shadow.appendChild(this.triggerSlot),this.defaultTrigger=document.createElement("button"),this.defaultTrigger.type="button",this.defaultTrigger.className="beacon-default-trigger",this.defaultTrigger.appendChild(It());const n=document.createElement("span");n.textContent="Feedback",this.defaultTrigger.appendChild(n),this.healthDot=document.createElement("span"),this.healthDot.className="beacon-health-dot",this.defaultTrigger.appendChild(this.healthDot),this.shadow.appendChild(this.defaultTrigger),this.defaultTrigger.addEventListener("click",()=>{var o;return(o=this.onTriggerClick)==null?void 0:o.call(this)}),this.triggerSlot.addEventListener("slotchange",()=>{const o=this.triggerSlot.assignedElements();if(o.length>0){this.defaultTrigger.style.display="none";for(const r of o)r.addEventListener("click",()=>{var a;return(a=this.onTriggerClick)==null?void 0:a.call(this)})}else this.defaultTrigger.style.display=""}),this.hasAttribute("position")||this.setAttribute("position","bottom-right"),this.hasAttribute("theme")||this.setAttribute("theme","auto")}setTriggerLabel(t){if(!this.defaultTrigger)return;const n=this.defaultTrigger.querySelector("span");n&&(n.textContent=t)}setHealthIndicator(t){var n;(n=this.healthDot)==null||n.classList.toggle("visible",t)}}function Le(){typeof window>"u"||typeof customElements>"u"||customElements.get(F)||customElements.define(F,Nt)}function _t(e,t){return{pluginName:e,captured:n=>t.getCaptured(n),get formValues(){return t.getFormValues(e)},requestMode:n=>t.requestMode(n),overlay:n=>t.overlay(n),on:(n,o)=>t.onLifecycle(n,o),get signal(){return t.getInitSignal()},captureSignal:()=>t.getCaptureSignal()}}class $t extends Error{constructor(t){super(`Duplicate plugin name: "${t}"`),this.name="DuplicatePluginNameError"}}function Dt(e){const t=new Set;for(const o of e){if(t.has(o.name))throw new $t(o.name);t.add(o.name)}const n=e.map(o=>({plugin:o,ctx:null,status:{state:"active",failures:0}}));return{entries:n,install(o,r){for(const a of n)if(a.ctx=o(a.plugin.name),!!a.plugin.setupOnce)try{const i=a.plugin.setupOnce(a.ctx);typeof i=="function"&&(a.teardown=i)}catch(i){const s=i instanceof Error?i:new Error(String(i));a.status={state:"failed",failures:a.status.failures+1,error:{message:s.message,...s.stack?{stack:s.stack}:{},at:"setupOnce"}},r({plugin:a.plugin.name,error:s,at:"setupOnce"})}},destroy(){var o;for(const r of n){try{(o=r.teardown)==null||o.call(r)}catch{}r.teardown=void 0}},async capture(o,r){const a={};for(const i of n)if(i.plugin.capture)try{const s=await i.plugin.capture(i.ctx),c=Ot(s,i.plugin.version);c!==null&&(a[i.plugin.name]=c)}catch(s){const c=s instanceof Error?s:new Error(String(s));a[i.plugin.name]=Ft(c),i.status={state:"failed",failures:i.status.failures+1,error:{message:c.message,...c.stack?{stack:c.stack}:{},at:"capture"}},r({plugin:i.plugin.name,error:c,at:"capture"})}return a},status(){const o={};for(const r of n)o[r.plugin.name]=r.status;return o}}}function Ot(e,t){if(e==null)return null;const n=t??1;return Array.isArray(e)||typeof e!="object"?{v:n,value:e}:{...e,v:n}}function Ft(e){return{error:e.message,...e.stack?{stack:e.stack}:{}}}async function Bt(e,t,n,o,r="omit"){const a=await Ht(n),i=await fetch(e,{method:"POST",credentials:r,headers:{"Content-Type":"application/json",...a},body:JSON.stringify(t),signal:o}),c=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):await i.text();return{ok:i.ok,status:i.status,body:c}}async function Ht(e){return e?typeof e=="function"?await e()??{}:e:{}}function Ut(e,t,n){for(const o of t){const r=document.createElement("div");if(r.className="beacon-field",o.label){const i=document.createElement("label");i.className="beacon-label",i.textContent=o.label,r.appendChild(i)}if(o.description){const i=document.createElement("div");i.className="beacon-description",i.textContent=o.description,r.appendChild(i)}const a=zt(o,n);r.appendChild(a),e.appendChild(r)}}function zt(e,t){var o,r;const n=t.get(e.name);switch(e.type){case"toggle":{const a=document.createElement("label");a.className="beacon-toggle";const i=document.createElement("input");return i.type="checkbox",i.checked=n??e.defaultValue??!1,i.addEventListener("change",()=>t.set(e.name,i.checked)),a.appendChild(i),t.set(e.name,i.checked),a}case"text":{const a=document.createElement("input");a.type="text",a.className="beacon-input";const i=n??e.defaultValue??"";return a.value=i,e.placeholder&&(a.placeholder=e.placeholder),a.addEventListener("input",()=>t.set(e.name,a.value)),t.set(e.name,i),a}case"textarea":{const a=document.createElement("textarea");a.className="beacon-textarea";const i=n??e.defaultValue??"";return a.value=i,e.placeholder&&(a.placeholder=e.placeholder),e.rows&&(a.rows=e.rows),a.addEventListener("input",()=>t.set(e.name,a.value)),t.set(e.name,i),a}case"select":{const a=document.createElement("select");a.className="beacon-select";const i=n??e.defaultValue??((o=e.options[0])==null?void 0:o.value)??"";for(const s of e.options){const c=document.createElement("option");c.value=s.value,c.textContent=s.label??s.value,s.value===i&&(c.selected=!0),a.appendChild(c)}return a.addEventListener("change",()=>t.set(e.name,a.value)),t.set(e.name,i),a}case"radio":{const a=document.createElement("div");a.className="beacon-radio-group";const i=n??e.defaultValue??((r=e.options[0])==null?void 0:r.value)??"";for(const s of e.options){const c=document.createElement("label");c.className="beacon-radio-opt";const u=document.createElement("input");u.type="radio",u.name=e.name,u.value=s.value,s.value===i&&(u.checked=!0),u.addEventListener("change",()=>t.set(e.name,s.value));const l=document.createElement("span");l.textContent=s.label??s.value,c.appendChild(u),c.appendChild(l),a.appendChild(c)}return t.set(e.name,i),a}case"number":{const a=document.createElement("input");a.type="number",a.className="beacon-input";const i=n??e.defaultValue;return i!==void 0&&(a.value=String(i)),e.min!==void 0&&(a.min=String(e.min)),e.max!==void 0&&(a.max=String(e.max)),e.step!==void 0&&(a.step=String(e.step)),a.addEventListener("input",()=>{const s=a.value===""?void 0:Number(a.value);t.set(e.name,s)}),i!==void 0&&t.set(e.name,i),a}}}const oe="http://www.w3.org/2000/svg";function qt(){const e=document.createElementNS(oe,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");const t=document.createElementNS(oe,"line");t.setAttribute("x1","18"),t.setAttribute("y1","6"),t.setAttribute("x2","6"),t.setAttribute("y2","18");const n=document.createElementNS(oe,"line");return n.setAttribute("x1","6"),n.setAttribute("y1","6"),n.setAttribute("x2","18"),n.setAttribute("y2","18"),e.appendChild(t),e.appendChild(n),e}class jt{constructor(t,n,o){this.labels=t,this.severities=n,this.callbacks=o,this.severitySelected="bug",this.modeCounts={minimize:0,hide:0,pickElement:0},this.pluginCleanups=[],this.lastActive=null,this.submitSucceeded=!1,this.expectedSuppressedCloses=0,this.root=document.createElement("dialog"),this.root.className="beacon-dialog",this.inner=document.createElement("div"),this.inner.className="beacon-dialog-inner",this.root.appendChild(this.inner);const r=document.createElement("div");r.className="beacon-drawer-header";const a=document.createElement("div");a.className="beacon-drawer-title",a.textContent=t.drawerTitle,r.appendChild(a);const i=document.createElement("button");i.type="button",i.className="beacon-icon-btn",i.setAttribute("aria-label",t.closeButton),i.appendChild(qt()),i.addEventListener("click",()=>this.userCloseAttempt()),r.appendChild(i),this.inner.appendChild(r),this.root.addEventListener("cancel",b=>{this.submitSucceeded||this.hasUnsavedInput()&&(b.preventDefault(),window.confirm("You have unsaved feedback. Discard?")&&this.root.close())});const s=document.createElement("div");s.className="beacon-drawer-body",this.inner.appendChild(s);const c=document.createElement("div");c.className="beacon-field";const u=document.createElement("label");u.className="beacon-label",u.textContent=t.descriptionLabel,this.descTextarea=document.createElement("textarea"),this.descTextarea.className="beacon-textarea",this.descTextarea.placeholder=t.descriptionPlaceholder,this.descTextarea.rows=4,c.appendChild(u),c.appendChild(this.descTextarea),s.appendChild(c);const l=document.createElement("div");l.className="beacon-field";const p=document.createElement("label");p.className="beacon-label",p.textContent=t.severityLabel,this.severitiesContainer=document.createElement("div"),this.severitiesContainer.className="beacon-severity";for(const b of n){const m=document.createElement("label");m.className="beacon-severity-opt",m.dataset.sev=b;const w=document.createElement("input");w.type="radio",w.name="beacon-severity",w.value=b,b===this.severitySelected&&(w.checked=!0,m.classList.add("selected")),w.addEventListener("change",()=>this.setSeverity(b)),m.appendChild(w),m.appendChild(document.createTextNode(this.severityLabel(b))),this.severitiesContainer.appendChild(m)}l.appendChild(p),l.appendChild(this.severitiesContainer),s.appendChild(l),this.pluginSlot=document.createElement("div"),this.pluginSlot.className="beacon-plugin-panels",s.appendChild(this.pluginSlot),this.statusEl=document.createElement("div"),this.statusEl.className="beacon-status",s.appendChild(this.statusEl);const f=document.createElement("div");f.className="beacon-actions",this.submitBtn=document.createElement("button"),this.submitBtn.type="button",this.submitBtn.className="beacon-btn primary",this.submitBtn.textContent=t.send,this.submitBtn.addEventListener("click",()=>this.callbacks.onSubmit()),f.appendChild(this.submitBtn),s.appendChild(f),this.root.addEventListener("close",()=>{if(this.expectedSuppressedCloses>0){this.expectedSuppressedCloses-=1;return}this.callbacks.onClose("user")})}async requestMode(t){this.modeCounts[t]+=1,this.modeCounts[t]===1&&this.applyMode(t,!0);let n=!1;return()=>{n||(n=!0,this.modeCounts[t]-=1,this.modeCounts[t]===0&&this.applyMode(t,!1))}}applyMode(t,n){var o,r;switch(t){case"pickElement":{n?(this.lastActive=document.activeElement instanceof HTMLElement?document.activeElement:null,this.root.open&&(this.expectedSuppressedCloses+=1,this.root.close())):(this.root.open||this.tryShowModal(),(r=(o=this.lastActive)==null?void 0:o.focus)==null||r.call(o));break}case"hide":{this.inner.style.visibility=n?"hidden":"",this.root.style.opacity=n?"0":"";break}case"minimize":{const a=this.inner.querySelector(".beacon-drawer-body");a&&(a.style.display=n?"none":"");break}}}open(){this.root.open||this.tryShowModal()}close(t="user"){this.root.open&&this.root.close(),t==="submitted"&&(this.statusEl.textContent="")}userCloseAttempt(){!this.submitSucceeded&&this.hasUnsavedInput()&&!window.confirm("You have unsaved feedback. Discard?")||this.root.open&&this.root.close()}hasUnsavedInput(){return this.descTextarea.value.trim().length>0}setSubmitSucceeded(t){this.submitSucceeded=t}getDescription(){return this.descTextarea.value}setDescription(t){this.descTextarea.value=t}getSeverity(){return this.severitySelected}setSeverity(t){this.severitySelected=t;for(const n of Array.from(this.severitiesContainer.children)){n.classList.toggle("selected",n.dataset.sev===t);const o=n.querySelector("input");o&&(o.checked=n.dataset.sev===t)}}setStatus(t,n="idle"){this.statusEl.textContent=t,this.statusEl.classList.remove("error","success"),n!=="idle"&&this.statusEl.classList.add(n)}setSubmitting(t){this.submitBtn.disabled=t,this.submitBtn.textContent=t?this.labels.sending:this.labels.send}resetState(){this.descTextarea.value="",this.setStatus("","idle"),this.setSubmitting(!1),this.submitSucceeded=!1,this.severities[0]&&this.setSeverity(this.severities[0])}installPluginPanels(t,n){this.clearPluginPanels();for(const o of t){const r=document.createElement("div");if(r.className="beacon-plugin-panel",o.form.title){const a=document.createElement("div");a.className="beacon-plugin-panel-title",a.textContent=o.form.title,r.appendChild(a)}if("fields"in o.form)Ut(r,o.form.fields,{get:a=>n.get(o.name,a),set:(a,i)=>n.set(o.name,a,i)});else{const a=o.form.render(r,o.ctx);typeof a=="function"&&this.pluginCleanups.push(a)}this.pluginSlot.appendChild(r)}}clearPluginPanels(){for(const t of this.pluginCleanups)try{t()}catch{}this.pluginCleanups=[],this.pluginSlot.innerHTML=""}severityLabel(t){switch(t){case"bug":return this.labels.severityBug;case"idea":return this.labels.severityIdea;case"ux":return this.labels.severityUx;case"a11y":return this.labels.severityA11y}}tryShowModal(){try{this.root.showModal()}catch{this.root.show()}}}function Vt(){return{triggerButton:"Feedback",drawerTitle:"Send feedback",closeButton:"Close",send:"Send",sending:"Sending…",sentSuccess:"Sent — thanks!",descriptionLabel:"Description",descriptionPlaceholder:"What happened?",severityLabel:"Severity",severityBug:"bug",severityIdea:"idea",severityUx:"ux",severityA11y:"a11y"}}function Wt(e){const t=document.createElement("div");return t.className="beacon-overlay-layer",e.appendChild(t),{layer:t}}function Xt(e,t){const n=document.createElement("div");e.layer.appendChild(n);let o;try{o=t(n)}catch(r){throw n.remove(),r}return()=>{try{o==null||o()}catch{}n.parentNode&&n.parentNode.removeChild(n)}}function Kt(){var n,o;const e=navigator;return e.userAgentData?{brand:((n=e.userAgentData.brands.find(r=>!/Not[.\-]?A.?Brand/i.test(r.brand)))==null?void 0:n.brand)??((o=e.userAgentData.brands[0])==null?void 0:o.brand)??"unknown",mobile:e.userAgentData.mobile,platform:e.userAgentData.platform}:void 0}function Te(){return{name:"metadata",capture(){const e=Kt();return e?{uaData:e}:null}}}const Yt=30,re=500,Me=2e3,Gt=500,Jt=5e3,Zt=/launch-kit-beacon|beacon\.(?:es|umd|mjs)|\/beacon\//i;function B(e,t){if(e)return e.length>t?e.slice(0,t):e}function Qt(e,t){const n=(t==null?void 0:t.split(`
697
- `).slice(0,3).join("|"))??"";return`${e}::${n}`}function en(e){return!!e&&Zt.test(e)}function tn(e){try{return JSON.stringify(e).slice(0,re)}catch{return String(e)}}function Re(){const e=[],t=new Map,n=new Set;let o=!1,r,a;function i(s){if(en(s.stack)||s.kind==="unhandledrejection"&&/AbortError/i.test(s.message))return;const c=Qt(s.message,s.stack),u=t.get(c);if(u!==void 0&&s.ts-u<Jt){t.set(c,s.ts);return}t.set(c,s.ts),e.push(s),e.length>Yt&&e.shift();for(const l of n)try{l()}catch{}}return{install(){return o?()=>{}:typeof window>"u"?()=>{}:(o=!0,r=s=>{try{const c=s.error instanceof Error?s.error.message:void 0,u=s.error instanceof Error?s.error.stack:void 0;i({ts:Date.now(),kind:"error",message:B(s.message||c||"Unknown error",re)??"Unknown error",...u?{stack:B(u,Me)}:{},...s.filename?{source:B(s.filename,Gt)}:{},...Number.isFinite(s.lineno)?{line:s.lineno}:{},...Number.isFinite(s.colno)?{col:s.colno}:{}})}catch{}},a=s=>{try{const c=s.reason,u=c instanceof Error?c.message:typeof c=="string"?c:tn(c),l=c instanceof Error?c.stack:void 0;i({ts:Date.now(),kind:"unhandledrejection",message:B(u||"Unknown rejection",re)??"Unknown rejection",...l?{stack:B(l,Me)}:{}})}catch{}},window.addEventListener("error",r),window.addEventListener("unhandledrejection",a),()=>{r&&window.removeEventListener("error",r),a&&window.removeEventListener("unhandledrejection",a),o=!1,n.clear()})},snapshot(){return e.slice()},subscribe(s){return n.add(s),()=>{n.delete(s)}}}}function Ie(){let e=null;return{name:"errors",setupOnce(t){e=Re();const n=e.install();return t.signal.addEventListener("abort",n,{once:!0}),n},form(){return{render:t=>{const n=document.createElement("details");n.className="beacon-events";const o=document.createElement("summary");o.className="beacon-events-summary";const r=document.createElement("span");r.className="beacon-events-dot",r.textContent="●";const a=document.createElement("span");a.className="beacon-events-label",o.appendChild(r),o.appendChild(a),n.appendChild(o);const i=document.createElement("ul");i.className="beacon-events-list",n.appendChild(i),t.appendChild(n);function s(){const u=(e==null?void 0:e.snapshot())??[],l=u.length;if(l===0){t.style.display="none";return}t.style.display="",a.textContent=`${l} runtime error${l!==1?"s":""} captured`,i.innerHTML="";for(const p of u){const f=document.createElement("li");f.className="beacon-events-item";const b=document.createElement("span");b.className=`beacon-events-kind ${p.kind==="unhandledrejection"?"rejection":"error"}`,b.textContent=p.kind==="unhandledrejection"?"REJ":"ERR";const m=document.createElement("span");m.className="beacon-events-msg",m.textContent=p.message,f.appendChild(b),f.appendChild(m),i.appendChild(f)}}s();const c=e==null?void 0:e.subscribe(s);return()=>{c==null||c()}}}},capture(){const t=(e==null?void 0:e.snapshot())??[];return t.length===0?null:{events:t}}}}const nn=8;function Pe(e,t=document){if(!e)return!1;try{return t.querySelectorAll(`#${CSS.escape(e)}`).length===1}catch{return!1}}function on(e){const t=e.tagName.toLowerCase(),n=Array.from(e.classList).filter(o=>o.length>0&&o.length<40).slice(0,3).map(o=>`.${CSS.escape(o)}`).join("");return t+n}function rn(e){const t=e.parentElement;return t?Array.from(t.children).filter(o=>o.tagName===e.tagName).indexOf(e)+1:1}function an(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(e.id&&Pe(e.id))return`#${CSS.escape(e.id)}`;const t=[];let n=e,o=0;for(;n&&n.tagName.toLowerCase()!=="body"&&o<nn;){const r=n;if(r.id&&Pe(r.id)){t.unshift(`#${CSS.escape(r.id)}`);break}const a=on(r),i=r.parentElement;let s=a;if(i)try{const c=Array.from(r.classList).join(" ");Array.from(i.children).filter(l=>l.tagName===r.tagName&&Array.from(l.classList).join(" ")===c).length>1&&(s=`${r.tagName.toLowerCase()}:nth-of-type(${rn(r)})`)}catch{}t.unshift(s),n=i,o++}return t.join(" > ")}function sn(e){const t=Object.keys(e).filter(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"));if(t.length===0)return null;let n=e[t[0]];for(let o=0;o<10&&n;o++){const r=n,a=r.type;if(typeof a=="function"){const i=a.displayName??a.name;if(i&&i!=="_default")return{lib:"react",name:i}}if(typeof a=="object"&&a!==null){const i=a.displayName??a.name;if(i)return{lib:"react",name:i}}n=r.return}return{lib:"react"}}function cn(e){var o,r;const t=e,n=t.__vueParentComponent;if(n){const a=((o=n.type)==null?void 0:o.name)??((r=n.type)==null?void 0:r.__name);return{lib:"vue",...a?{name:a}:{}}}return t.__vue__?{lib:"vue"}:null}function ln(e){const t=window.ng;if(!(t!=null&&t.getComponent))return null;try{const n=t.getComponent(e);if(!n)return null;const o=n.constructor;return{lib:"angular",...o!=null&&o.name?{name:o.name}:{}}}catch{return null}}function un(e){return"__svelte_meta"in e?{lib:"svelte"}:null}function dn(e){return sn(e)??cn(e)??ln(e)??un(e)??void 0}const pn=5e3,fn=1e3,Ne=1e3,_e=200,mn=50,$e=200,hn=500,bn=["display","position","top","right","bottom","left","width","height","min-width","min-height","max-width","max-height","margin","padding","font-family","font-size","font-weight","line-height","text-align","color","background-color","background-image","border","border-radius","opacity","visibility","overflow","z-index","transform","transition","flex","flex-direction","justify-content","align-items","gap","grid-template-columns","grid-template-rows"];function De(e,t){return e.length<=t?e:e.slice(0,t)+`
696
+ `,Le="launch-kit-beacon-portal-styles";function It(){if(typeof document>"u"||!document.head||document.getElementById(Le))return;const e=document.createElement("style");e.id=Le,e.textContent=D,document.head.appendChild(e)}const oe="http://www.w3.org/2000/svg";function Nt(){const e=document.createElementNS(oe,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");const t=document.createElementNS(oe,"path");t.setAttribute("d","M3 11l18-5v12L3 14v-3z");const n=document.createElementNS(oe,"path");return n.setAttribute("d","M11.6 16.8a3 3 0 1 1-5.8-1.6"),e.appendChild(t),e.appendChild(n),e}const U="launch-kit-beacon",_t=typeof HTMLElement<"u"?HTMLElement:class{};class $t extends _t{constructor(){super(...arguments),this.onTriggerClick=null}connectedCallback(){if(this.shadow)return;this.shadow=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=D,this.shadow.appendChild(t),this.triggerSlot=document.createElement("slot"),this.triggerSlot.name="trigger",this.shadow.appendChild(this.triggerSlot),this.defaultTrigger=document.createElement("button"),this.defaultTrigger.type="button",this.defaultTrigger.className="beacon-default-trigger",this.defaultTrigger.appendChild(Nt());const n=document.createElement("span");n.textContent="Feedback",this.defaultTrigger.appendChild(n),this.healthDot=document.createElement("span"),this.healthDot.className="beacon-health-dot",this.defaultTrigger.appendChild(this.healthDot),this.shadow.appendChild(this.defaultTrigger),this.defaultTrigger.addEventListener("click",()=>{var o;return(o=this.onTriggerClick)==null?void 0:o.call(this)}),this.triggerSlot.addEventListener("slotchange",()=>{const o=this.triggerSlot.assignedElements();if(o.length>0){this.defaultTrigger.style.display="none";for(const a of o)a.addEventListener("click",()=>{var r;return(r=this.onTriggerClick)==null?void 0:r.call(this)})}else this.defaultTrigger.style.display=""}),this.hasAttribute("position")||this.setAttribute("position","bottom-right"),this.hasAttribute("theme")||this.setAttribute("theme","auto")}setTriggerLabel(t){if(!this.defaultTrigger)return;const n=this.defaultTrigger.querySelector("span");n&&(n.textContent=t)}setHealthIndicator(t){var n;(n=this.healthDot)==null||n.classList.toggle("visible",t)}}function Te(){typeof window>"u"||typeof customElements>"u"||customElements.get(U)||customElements.define(U,$t)}function Dt(e,t){return{pluginName:e,captured:n=>t.getCaptured(n),get formValues(){return t.getFormValues(e)},requestMode:n=>t.requestMode(n),overlay:n=>t.overlay(n),on:(n,o)=>t.onLifecycle(n,o),get signal(){return t.getInitSignal()},captureSignal:()=>t.getCaptureSignal()}}class Ft extends Error{constructor(t){super(`Duplicate plugin name: "${t}"`),this.name="DuplicatePluginNameError"}}function Ot(e){const t=new Set;for(const o of e){if(t.has(o.name))throw new Ft(o.name);t.add(o.name)}const n=e.map(o=>({plugin:o,ctx:null,status:{state:"active",failures:0}}));return{entries:n,install(o,a){for(const r of n)if(r.ctx=o(r.plugin.name),!!r.plugin.setupOnce)try{const i=r.plugin.setupOnce(r.ctx);typeof i=="function"&&(r.teardown=i)}catch(i){const s=i instanceof Error?i:new Error(String(i));r.status={state:"failed",failures:r.status.failures+1,error:{message:s.message,...s.stack?{stack:s.stack}:{},at:"setupOnce"}},a({plugin:r.plugin.name,error:s,at:"setupOnce"})}},destroy(){var o;for(const a of n){try{(o=a.teardown)==null||o.call(a)}catch{}a.teardown=void 0}},async capture(o,a){const r={};for(const i of n)if(i.plugin.capture)try{const s=await i.plugin.capture(i.ctx),c=Ht(s,i.plugin.version);c!==null&&(r[i.plugin.name]=c)}catch(s){const c=s instanceof Error?s:new Error(String(s));r[i.plugin.name]=Bt(c),i.status={state:"failed",failures:i.status.failures+1,error:{message:c.message,...c.stack?{stack:c.stack}:{},at:"capture"}},a({plugin:i.plugin.name,error:c,at:"capture"})}return r},status(){const o={};for(const a of n)o[a.plugin.name]=a.status;return o}}}function Ht(e,t){if(e==null)return null;const n=t??1;return Array.isArray(e)||typeof e!="object"?{v:n,value:e}:{...e,v:n}}function Bt(e){return{error:e.message,...e.stack?{stack:e.stack}:{}}}async function Ut(e,t,n,o,a="omit"){const r=await zt(n),i=await fetch(e,{method:"POST",credentials:a,headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t),signal:o}),c=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):await i.text();return{ok:i.ok,status:i.status,body:c}}async function zt(e){return e?typeof e=="function"?await e()??{}:e:{}}function qt(e,t,n){for(const o of t){const a=document.createElement("div");if(a.className="beacon-field",o.label){const i=document.createElement("label");i.className="beacon-label",i.textContent=o.label,a.appendChild(i)}if(o.description){const i=document.createElement("div");i.className="beacon-description",i.textContent=o.description,a.appendChild(i)}const r=jt(o,n);a.appendChild(r),e.appendChild(a)}}function jt(e,t){var o,a;const n=t.get(e.name);switch(e.type){case"toggle":{const r=document.createElement("label");r.className="beacon-toggle";const i=document.createElement("input");return i.type="checkbox",i.checked=n??e.defaultValue??!1,i.addEventListener("change",()=>t.set(e.name,i.checked)),r.appendChild(i),t.set(e.name,i.checked),r}case"text":{const r=document.createElement("input");r.type="text",r.className="beacon-input";const i=n??e.defaultValue??"";return r.value=i,e.placeholder&&(r.placeholder=e.placeholder),r.addEventListener("input",()=>t.set(e.name,r.value)),t.set(e.name,i),r}case"textarea":{const r=document.createElement("textarea");r.className="beacon-textarea";const i=n??e.defaultValue??"";return r.value=i,e.placeholder&&(r.placeholder=e.placeholder),e.rows&&(r.rows=e.rows),r.addEventListener("input",()=>t.set(e.name,r.value)),t.set(e.name,i),r}case"select":{const r=document.createElement("select");r.className="beacon-select";const i=n??e.defaultValue??((o=e.options[0])==null?void 0:o.value)??"";for(const s of e.options){const c=document.createElement("option");c.value=s.value,c.textContent=s.label??s.value,s.value===i&&(c.selected=!0),r.appendChild(c)}return r.addEventListener("change",()=>t.set(e.name,r.value)),t.set(e.name,i),r}case"radio":{const r=document.createElement("div");r.className="beacon-radio-group";const i=n??e.defaultValue??((a=e.options[0])==null?void 0:a.value)??"";for(const s of e.options){const c=document.createElement("label");c.className="beacon-radio-opt";const u=document.createElement("input");u.type="radio",u.name=e.name,u.value=s.value,s.value===i&&(u.checked=!0),u.addEventListener("change",()=>t.set(e.name,s.value));const l=document.createElement("span");l.textContent=s.label??s.value,c.appendChild(u),c.appendChild(l),r.appendChild(c)}return t.set(e.name,i),r}case"number":{const r=document.createElement("input");r.type="number",r.className="beacon-input";const i=n??e.defaultValue;return i!==void 0&&(r.value=String(i)),e.min!==void 0&&(r.min=String(e.min)),e.max!==void 0&&(r.max=String(e.max)),e.step!==void 0&&(r.step=String(e.step)),r.addEventListener("input",()=>{const s=r.value===""?void 0:Number(r.value);t.set(e.name,s)}),i!==void 0&&t.set(e.name,i),r}}}const re="http://www.w3.org/2000/svg";function Vt(){const e=document.createElementNS(re,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");const t=document.createElementNS(re,"line");t.setAttribute("x1","18"),t.setAttribute("y1","6"),t.setAttribute("x2","6"),t.setAttribute("y2","18");const n=document.createElementNS(re,"line");return n.setAttribute("x1","6"),n.setAttribute("y1","6"),n.setAttribute("x2","18"),n.setAttribute("y2","18"),e.appendChild(t),e.appendChild(n),e}class Wt{constructor(t,n,o){this.labels=t,this.severities=n,this.callbacks=o,this.severitySelected="bug",this.modeCounts={minimize:0,hide:0,pickElement:0},this.pluginCleanups=[],this.lastActive=null,this.submitSucceeded=!1,this.expectedSuppressedCloses=0,this.root=document.createElement("dialog"),this.root.className="beacon-dialog",this.inner=document.createElement("div"),this.inner.className="beacon-dialog-inner",this.root.appendChild(this.inner);const a=document.createElement("div");a.className="beacon-drawer-header";const r=document.createElement("div");r.className="beacon-drawer-title",r.textContent=t.drawerTitle,a.appendChild(r);const i=document.createElement("button");i.type="button",i.className="beacon-icon-btn",i.setAttribute("aria-label",t.closeButton),i.appendChild(Vt()),i.addEventListener("click",()=>this.userCloseAttempt()),a.appendChild(i),this.inner.appendChild(a),this.root.addEventListener("cancel",g=>{this.submitSucceeded||this.hasUnsavedInput()&&(g.preventDefault(),window.confirm("You have unsaved feedback. Discard?")&&this.root.close())});const s=document.createElement("div");s.className="beacon-drawer-body",this.inner.appendChild(s);const c=document.createElement("div");c.className="beacon-field";const u=document.createElement("label");u.className="beacon-label",u.textContent=t.descriptionLabel,this.descTextarea=document.createElement("textarea"),this.descTextarea.className="beacon-textarea",this.descTextarea.placeholder=t.descriptionPlaceholder,this.descTextarea.rows=4,c.appendChild(u),c.appendChild(this.descTextarea),s.appendChild(c);const l=document.createElement("div");l.className="beacon-field";const p=document.createElement("label");p.className="beacon-label",p.textContent=t.severityLabel,this.severitiesContainer=document.createElement("div"),this.severitiesContainer.className="beacon-severity";for(const g of n){const f=document.createElement("label");f.className="beacon-severity-opt",f.dataset.sev=g;const w=document.createElement("input");w.type="radio",w.name="beacon-severity",w.value=g,g===this.severitySelected&&(w.checked=!0,f.classList.add("selected")),w.addEventListener("change",()=>this.setSeverity(g)),f.appendChild(w),f.appendChild(document.createTextNode(this.severityLabel(g))),this.severitiesContainer.appendChild(f)}l.appendChild(p),l.appendChild(this.severitiesContainer),s.appendChild(l),this.pluginSlot=document.createElement("div"),this.pluginSlot.className="beacon-plugin-panels",s.appendChild(this.pluginSlot),this.statusEl=document.createElement("div"),this.statusEl.className="beacon-status",s.appendChild(this.statusEl);const d=document.createElement("div");d.className="beacon-actions",this.submitBtn=document.createElement("button"),this.submitBtn.type="button",this.submitBtn.className="beacon-btn primary",this.submitBtn.textContent=t.send,this.submitBtn.addEventListener("click",()=>this.callbacks.onSubmit()),d.appendChild(this.submitBtn),s.appendChild(d),this.root.addEventListener("close",()=>{if(this.expectedSuppressedCloses>0){this.expectedSuppressedCloses-=1;return}this.callbacks.onClose("user")})}async requestMode(t){this.modeCounts[t]+=1,this.modeCounts[t]===1&&this.applyMode(t,!0);let n=!1;return()=>{n||(n=!0,this.modeCounts[t]-=1,this.modeCounts[t]===0&&this.applyMode(t,!1))}}applyMode(t,n){var o,a;switch(t){case"pickElement":{n?(this.lastActive=document.activeElement instanceof HTMLElement?document.activeElement:null,this.root.open&&(this.expectedSuppressedCloses+=1,this.root.close())):(this.root.open||this.tryShowModal(),(a=(o=this.lastActive)==null?void 0:o.focus)==null||a.call(o));break}case"hide":{this.inner.style.visibility=n?"hidden":"",this.root.style.opacity=n?"0":"";break}case"minimize":{const r=this.inner.querySelector(".beacon-drawer-body");r&&(r.style.display=n?"none":"");break}}}open(){this.root.open||this.tryShowModal()}close(t="user"){this.root.open&&this.root.close(),t==="submitted"&&(this.statusEl.textContent="")}userCloseAttempt(){!this.submitSucceeded&&this.hasUnsavedInput()&&!window.confirm("You have unsaved feedback. Discard?")||this.root.open&&this.root.close()}hasUnsavedInput(){return this.descTextarea.value.trim().length>0}setSubmitSucceeded(t){this.submitSucceeded=t}getDescription(){return this.descTextarea.value}setDescription(t){this.descTextarea.value=t}getSeverity(){return this.severitySelected}setSeverity(t){this.severitySelected=t;for(const n of Array.from(this.severitiesContainer.children)){n.classList.toggle("selected",n.dataset.sev===t);const o=n.querySelector("input");o&&(o.checked=n.dataset.sev===t)}}setStatus(t,n="idle"){this.statusEl.textContent=t,this.statusEl.classList.remove("error","success"),n!=="idle"&&this.statusEl.classList.add(n)}setSubmitting(t){this.submitBtn.disabled=t,this.submitBtn.textContent=t?this.labels.sending:this.labels.send}resetState(){this.descTextarea.value="",this.setStatus("","idle"),this.setSubmitting(!1),this.submitSucceeded=!1,this.severities[0]&&this.setSeverity(this.severities[0])}installPluginPanels(t,n){this.clearPluginPanels();for(const o of t){const a=document.createElement("div");if(a.className="beacon-plugin-panel",o.form.title){const r=document.createElement("div");r.className="beacon-plugin-panel-title",r.textContent=o.form.title,a.appendChild(r)}if("fields"in o.form)qt(a,o.form.fields,{get:r=>n.get(o.name,r),set:(r,i)=>n.set(o.name,r,i)});else{const r=o.form.render(a,o.ctx);typeof r=="function"&&this.pluginCleanups.push(r)}this.pluginSlot.appendChild(a)}}clearPluginPanels(){for(const t of this.pluginCleanups)try{t()}catch{}this.pluginCleanups=[],this.pluginSlot.innerHTML=""}severityLabel(t){switch(t){case"bug":return this.labels.severityBug;case"idea":return this.labels.severityIdea;case"ux":return this.labels.severityUx;case"a11y":return this.labels.severityA11y}}tryShowModal(){try{this.root.showModal()}catch{this.root.show()}}}function Xt(){return{triggerButton:"Feedback",drawerTitle:"Send feedback",closeButton:"Close",send:"Send",sending:"Sending…",sentSuccess:"Sent — thanks!",descriptionLabel:"Description",descriptionPlaceholder:"What happened?",severityLabel:"Severity",severityBug:"bug",severityIdea:"idea",severityUx:"ux",severityA11y:"a11y"}}function Yt(e){const t=document.createElement("div");return t.className="beacon-overlay-layer",e.appendChild(t),{layer:t}}function Gt(e,t){const n=document.createElement("div");e.layer.appendChild(n);let o;try{o=t(n)}catch(a){throw n.remove(),a}return()=>{try{o==null||o()}catch{}n.parentNode&&n.parentNode.removeChild(n)}}function Kt(){var n,o;const e=navigator;return e.userAgentData?{brand:((n=e.userAgentData.brands.find(a=>!/Not[.\-]?A.?Brand/i.test(a.brand)))==null?void 0:n.brand)??((o=e.userAgentData.brands[0])==null?void 0:o.brand)??"unknown",mobile:e.userAgentData.mobile,platform:e.userAgentData.platform}:void 0}function Re(){return{name:"metadata",capture(){const e=Kt();return e?{uaData:e}:null}}}const Jt=30,ae=500,Me=2e3,Zt=500,Qt=5e3,en=/launch-kit-beacon|beacon\.(?:es|umd|mjs)|\/beacon\//i;function z(e,t){if(e)return e.length>t?e.slice(0,t):e}function tn(e,t){const n=(t==null?void 0:t.split(`
697
+ `).slice(0,3).join("|"))??"";return`${e}::${n}`}function nn(e){return!!e&&en.test(e)}function on(e){try{return JSON.stringify(e).slice(0,ae)}catch{return String(e)}}function Pe(){const e=[],t=new Map,n=new Set;let o=!1,a,r;function i(s){if(nn(s.stack)||s.kind==="unhandledrejection"&&/AbortError/i.test(s.message))return;const c=tn(s.message,s.stack),u=t.get(c);if(u!==void 0&&s.ts-u<Qt){t.set(c,s.ts);return}t.set(c,s.ts),e.push(s),e.length>Jt&&e.shift();for(const l of n)try{l()}catch{}}return{install(){return o?()=>{}:typeof window>"u"?()=>{}:(o=!0,a=s=>{try{const c=s.error instanceof Error?s.error.message:void 0,u=s.error instanceof Error?s.error.stack:void 0;i({ts:Date.now(),kind:"error",message:z(s.message||c||"Unknown error",ae)??"Unknown error",...u?{stack:z(u,Me)}:{},...s.filename?{source:z(s.filename,Zt)}:{},...Number.isFinite(s.lineno)?{line:s.lineno}:{},...Number.isFinite(s.colno)?{col:s.colno}:{}})}catch{}},r=s=>{try{const c=s.reason,u=c instanceof Error?c.message:typeof c=="string"?c:on(c),l=c instanceof Error?c.stack:void 0;i({ts:Date.now(),kind:"unhandledrejection",message:z(u||"Unknown rejection",ae)??"Unknown rejection",...l?{stack:z(l,Me)}:{}})}catch{}},window.addEventListener("error",a),window.addEventListener("unhandledrejection",r),()=>{a&&window.removeEventListener("error",a),r&&window.removeEventListener("unhandledrejection",r),o=!1,n.clear()})},snapshot(){return e.slice()},subscribe(s){return n.add(s),()=>{n.delete(s)}}}}function Ie(){let e=null;return{name:"errors",setupOnce(t){e=Pe();const n=e.install();return t.signal.addEventListener("abort",n,{once:!0}),n},form(){return{render:t=>{const n=document.createElement("details");n.className="beacon-events";const o=document.createElement("summary");o.className="beacon-events-summary";const a=document.createElement("span");a.className="beacon-events-dot",a.textContent="●";const r=document.createElement("span");r.className="beacon-events-label",o.appendChild(a),o.appendChild(r),n.appendChild(o);const i=document.createElement("ul");i.className="beacon-events-list",n.appendChild(i),t.appendChild(n);function s(){const u=(e==null?void 0:e.snapshot())??[],l=u.length;if(l===0){t.style.display="none";return}t.style.display="",r.textContent=`${l} runtime error${l!==1?"s":""} captured`,i.innerHTML="";for(const p of u){const d=document.createElement("li");d.className="beacon-events-item";const g=document.createElement("span");g.className=`beacon-events-kind ${p.kind==="unhandledrejection"?"rejection":"error"}`,g.textContent=p.kind==="unhandledrejection"?"REJ":"ERR";const f=document.createElement("span");f.className="beacon-events-msg",f.textContent=p.message,d.appendChild(g),d.appendChild(f),i.appendChild(d)}}s();const c=e==null?void 0:e.subscribe(s);return()=>{c==null||c()}}}},capture(){const t=(e==null?void 0:e.snapshot())??[];return t.length===0?null:{events:t}}}}const rn=8,an=" >> ";function Ne(e,t=document){if(!e)return!1;try{return t.querySelectorAll(`#${CSS.escape(e)}`).length===1}catch{return!1}}function sn(e){const t=e.tagName.toLowerCase(),n=Array.from(e.classList).filter(o=>o.length>0&&o.length<40).slice(0,3).map(o=>`.${CSS.escape(o)}`).join("");return t+n}function cn(e){const t=e.parentElement;return t?Array.from(t.children).filter(o=>o.tagName===e.tagName).indexOf(e)+1:1}function ln(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(e.id&&Ne(e.id))return`#${CSS.escape(e.id)}`;const t=[],n=[];let o=e,a=0;for(;o&&o.tagName.toLowerCase()!=="body"&&a<rn;){const i=o;if(i.id&&Ne(i.id)){t.unshift(`#${CSS.escape(i.id)}`);break}const s=sn(i),c=i.parentElement;let u=s;if(c)try{const l=Array.from(i.classList).join(" ");Array.from(c.children).filter(d=>d.tagName===i.tagName&&Array.from(d.classList).join(" ")===l).length>1&&(u=`${i.tagName.toLowerCase()}:nth-of-type(${cn(i)})`)}catch{}if(t.unshift(u),t.length>1&&n.unshift(" > "),c)o=c;else{const l=i.getRootNode();l instanceof ShadowRoot?(o=l.host,t.length>0&&(n[0]=an)):o=null}a++}let r=t[0]??"";for(let i=1;i<t.length;i++)r+=(n[i-1]??" > ")+t[i];return r}function un(e){const t=Object.keys(e).filter(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"));if(t.length===0)return null;let n=e[t[0]];for(let o=0;o<10&&n;o++){const a=n,r=a.type;if(typeof r=="function"){const i=r.displayName??r.name;if(i&&i!=="_default")return{lib:"react",name:i}}if(typeof r=="object"&&r!==null){const i=r.displayName??r.name;if(i)return{lib:"react",name:i}}n=a.return}return{lib:"react"}}function dn(e){var o,a;const t=e,n=t.__vueParentComponent;if(n){const r=((o=n.type)==null?void 0:o.name)??((a=n.type)==null?void 0:a.__name);return{lib:"vue",...r?{name:r}:{}}}return t.__vue__?{lib:"vue"}:null}function pn(e){const t=window.ng;if(!(t!=null&&t.getComponent))return null;try{const n=t.getComponent(e);if(!n)return null;const o=n.constructor;return{lib:"angular",...o!=null&&o.name?{name:o.name}:{}}}catch{return null}}function fn(e){return"__svelte_meta"in e?{lib:"svelte"}:null}function mn(e){return un(e)??dn(e)??pn(e)??fn(e)??void 0}const hn=5e3,bn=1e3,_e=1e3,$e=200,gn=50,De=200,yn=500,wn=["display","position","top","right","bottom","left","width","height","min-width","min-height","max-width","max-height","margin","padding","font-family","font-size","font-weight","line-height","text-align","color","background-color","background-image","border","border-radius","opacity","visibility","overflow","z-index","transform","transition","flex","flex-direction","justify-content","align-items","gap","grid-template-columns","grid-template-rows"];function Fe(e,t){return e.length<=t?e:e.slice(0,t)+`
698
698
 
699
- /* … truncated, original was ${e.length} chars */`}function gn(e){const t=getComputedStyle(e),n={};for(const o of bn){const r=t.getPropertyValue(o);r&&r!=="normal"&&r!=="none"&&r!=="auto"&&r!=="0px"&&(n[o]=r.trim().slice(0,hn))}return n}function yn(e){return Array.from(e.classList).slice(0,mn).map(t=>t.length>$e?t.slice(0,$e):t)}function vn(e){const t=e.getBoundingClientRect(),n=an(e),o=e.id||null,r=dn(e);return{selector:n.length>Ne?n.slice(0,Ne):n,tagName:e.tagName.toLowerCase(),id:o&&o.length>_e?o.slice(0,_e):o,classList:yn(e),outerHTML:De(e.outerHTML,pn),...e.parentElement?{parentOuterHTML:De(e.parentElement.outerHTML,fn)}:{},computedStyles:gn(e),boundingRect:{x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.width),h:Math.round(t.height)},...r?{framework:r}:{}}}const wn=14,xn="#ffffff",En="#ffffff",Sn=3,Cn="#0ea5e9";async function Oe(e,t,n,o=Cn){const r=await An(e),a=document.createElement("canvas");a.width=r.naturalWidth,a.height=r.naturalHeight;const i=a.getContext("2d");if(!i)throw new Error("Could not get 2D canvas context");i.drawImage(r,0,0);const s=a.width/n.w,c=a.height/n.h;for(const u of t){const l=kn(u);if(!l)continue;const p=l.x*s,f=l.y*c,b=l.w*s,m=l.h*c;i.lineWidth=Sn,i.strokeStyle=o,i.strokeRect(p,f,b,m);const w=p+b,g=f;i.beginPath(),i.fillStyle=o,i.arc(w,g,wn,0,Math.PI*2),i.fill(),i.lineWidth=3,i.strokeStyle=xn,i.stroke(),i.fillStyle=En,i.font="bold 16px system-ui, -apple-system, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(u.number),w,g+1)}return a.toDataURL("image/jpeg",.85)}function kn(e){if(e.liveElement&&document.contains(e.liveElement)){const t=e.liveElement.getBoundingClientRect();if(t.width>0||t.height>0)return{x:t.left,y:t.top,w:t.width,h:t.height}}if(e.selector)try{const t=document.querySelector(e.selector);if(t){const n=t.getBoundingClientRect();if(n.width>0||n.height>0)return{x:n.left,y:n.top,w:n.width,h:n.height}}}catch{}return e.boundingRect}function An(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=r=>n(r),o.src=e})}const H="beacon-no-capture",Ln="#0ea5e9",Fe="Click any element to pin it · Press Esc to finish";function Be(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Tn(e={}){const t=e.accent??Ln,n=Be(t,"b3"),o=Be(t,"2e"),r=document.createElement("style");r.className=H,r.textContent="@keyframes beacon-spin { to { transform: rotate(360deg); } }",document.head.appendChild(r);const a=document.createElement("div");a.className=H,a.setAttribute("aria-hidden","true"),a.style.cssText=["position: fixed","inset: 0","pointer-events: none","z-index: 2147483646",`border: 2px dashed ${n}`,"border-radius: 4px",`box-shadow: inset 0 0 56px ${o}`,"box-sizing: border-box"].join("; ");const i=document.createElement("div");i.className=H,i.setAttribute("role","status"),i.style.cssText=["position: fixed","top: 16px","left: 50%","transform: translateX(-50%)",`background: ${t}`,"color: #fff","padding: 6px 14px","border-radius: 999px","font: 500 12px/1.4 system-ui, -apple-system, sans-serif","letter-spacing: 0.01em","box-shadow: 0 4px 12px hsl(0 0% 0% / 0.3)","pointer-events: none","white-space: nowrap","z-index: 2147483646"].join("; "),i.textContent=Fe;const s=`<span style="
699
+ /* … truncated, original was ${e.length} chars */`}function vn(e){const t=getComputedStyle(e),n={};for(const o of wn){const a=t.getPropertyValue(o);a&&a!=="normal"&&a!=="none"&&a!=="auto"&&a!=="0px"&&(n[o]=a.trim().slice(0,yn))}return n}function xn(e){return Array.from(e.classList).slice(0,gn).map(t=>t.length>De?t.slice(0,De):t)}function En(e){const t=e.getBoundingClientRect(),n=ln(e),o=e.id||null,a=mn(e);return{selector:n.length>_e?n.slice(0,_e):n,tagName:e.tagName.toLowerCase(),id:o&&o.length>$e?o.slice(0,$e):o,classList:xn(e),outerHTML:Fe(e.outerHTML,hn),...e.parentElement?{parentOuterHTML:Fe(e.parentElement.outerHTML,bn)}:{},computedStyles:vn(e),boundingRect:{x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.width),h:Math.round(t.height)},...a?{framework:a}:{}}}const Sn=14,Cn="#ffffff",An="#ffffff",kn=3,Ln="#0ea5e9";async function Oe(e,t,n,o=Ln){const a=await Rn(e),r=document.createElement("canvas");r.width=a.naturalWidth,r.height=a.naturalHeight;const i=r.getContext("2d");if(!i)throw new Error("Could not get 2D canvas context");i.drawImage(a,0,0);const s=r.width/n.w,c=r.height/n.h;for(const u of t){const l=Tn(u);if(!l)continue;const p=l.x*s,d=l.y*c,g=l.w*s,f=l.h*c;i.lineWidth=kn,i.strokeStyle=o,i.strokeRect(p,d,g,f);const w=p+g,S=d;i.beginPath(),i.fillStyle=o,i.arc(w,S,Sn,0,Math.PI*2),i.fill(),i.lineWidth=3,i.strokeStyle=Cn,i.stroke(),i.fillStyle=An,i.font="bold 16px system-ui, -apple-system, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(u.number),w,S+1)}return r.toDataURL("image/jpeg",.85)}function Tn(e){if(e.liveElement&&document.contains(e.liveElement)){const t=e.liveElement.getBoundingClientRect();if(t.width>0||t.height>0)return{x:t.left,y:t.top,w:t.width,h:t.height}}if(e.selector)try{const t=document.querySelector(e.selector);if(t){const n=t.getBoundingClientRect();if(n.width>0||n.height>0)return{x:n.left,y:n.top,w:n.width,h:n.height}}}catch{}return e.boundingRect}function Rn(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=a=>n(a),o.src=e})}const q="beacon-no-capture",Mn="#0ea5e9",He="Click any element to pin it · Press Esc to finish";function Be(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Pn(e={}){const t=e.accent??Mn,n=Be(t,"b3"),o=Be(t,"2e"),a=document.createElement("style");a.className=q,a.textContent="@keyframes beacon-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a);const r=document.createElement("div");r.className=q,r.setAttribute("aria-hidden","true"),r.style.cssText=["position: fixed","inset: 0","pointer-events: none","z-index: 2147483646",`border: 2px dashed ${n}`,"border-radius: 4px",`box-shadow: inset 0 0 56px ${o}`,"box-sizing: border-box"].join("; ");const i=document.createElement("div");i.className=q,i.setAttribute("role","status"),i.style.cssText=["position: fixed","top: 16px","left: 50%","transform: translateX(-50%)",`background: ${t}`,"color: #fff","padding: 6px 14px","border-radius: 999px","font: 500 12px/1.4 system-ui, -apple-system, sans-serif","letter-spacing: 0.01em","box-shadow: 0 4px 12px hsl(0 0% 0% / 0.3)","pointer-events: none","white-space: nowrap","z-index: 2147483646"].join("; "),i.textContent=He;const s=`<span style="
700
700
  display: inline-block;
701
701
  width: 12px;
702
702
  height: 12px;
@@ -706,18 +706,18 @@ dialog.beacon-dialog::backdrop {
706
706
  animation: beacon-spin 800ms linear infinite;
707
707
  vertical-align: middle;
708
708
  margin-right: 8px;
709
- "></span>`;function c(d){return d.replace(/[<>&]/g,y=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[y])}document.body.appendChild(a),document.body.appendChild(i);const u=new Map;function l(d){const y=document.createElement("div");return y.className=H,y.setAttribute("aria-hidden","true"),y.style.cssText=["position: fixed","width: 24px","height: 24px","border-radius: 999px",`background: ${t}`,"color: #fff","display: flex","align-items: center","justify-content: center","font: 700 12px/1 system-ui, -apple-system, sans-serif","border: 2px solid #fff","box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)","pointer-events: none","z-index: 2147483646"].join("; "),y.textContent=String(d),document.body.appendChild(y),y}function p(){const d=document.createElement("div");return d.className=H,d.setAttribute("aria-hidden","true"),d.style.cssText=["position: fixed","pointer-events: none",`border: 2px solid ${t}`,"border-radius: 2px","box-sizing: border-box","z-index: 2147483645"].join("; "),document.body.appendChild(d),d}function f(d,y,h){const v=h?"0.5":"1";d.outline.style.display="block",d.outline.style.opacity=v,d.outline.style.left=`${y.x}px`,d.outline.style.top=`${y.y}px`,d.outline.style.width=`${y.w}px`,d.outline.style.height=`${y.h}px`,d.marker.style.display="flex",d.marker.style.opacity=v,d.marker.style.left=`${y.x+y.w-12}px`,d.marker.style.top=`${Math.max(2,y.y-12)}px`}function b(d){d.marker.style.display="none",d.outline.style.display="none"}function m(){u.forEach(d=>{let y=d.anchor.target;if(document.contains(y)||(y=null),!y&&d.anchor.selector&&(y=document.querySelector(d.anchor.selector),y&&(d.anchor.target=y)),y){const v=y.getBoundingClientRect();if(v.width>0||v.height>0){f(d,{x:v.left,y:v.top,w:v.width,h:v.height},!1);return}}const h=d.anchor.fallbackRect;if(h&&(h.w>0||h.h>0)){f(d,h,!0);return}b(d)})}let w=null;function g(){w===null&&(w=requestAnimationFrame(()=>{w=null,m()}))}return window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),{addPin(d,y){const h=l(d),v=p();u.set(d,{anchor:y,marker:h,outline:v}),m()},setLoading(d){d?i.innerHTML=s+c(d):i.textContent=Fe},destroy(){window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),w!==null&&cancelAnimationFrame(w),a.remove(),i.remove(),r.remove(),u.forEach(({marker:d,outline:y})=>{d.remove(),y.remove()}),u.clear()}}}const Mn='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',Rn='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';function In(e){return new Promise(t=>{const n=document.createElement("div");n.className="beacon-pin-popover open beacon-no-capture beacon-theme-auto",n.innerHTML=`
709
+ "></span>`;function c(h){return h.replace(/[<>&]/g,m=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[m])}document.body.appendChild(r),document.body.appendChild(i);const u=new Map;function l(h){const m=document.createElement("div");return m.className=q,m.setAttribute("aria-hidden","true"),m.style.cssText=["position: fixed","width: 24px","height: 24px","border-radius: 999px",`background: ${t}`,"color: #fff","display: flex","align-items: center","justify-content: center","font: 700 12px/1 system-ui, -apple-system, sans-serif","border: 2px solid #fff","box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)","pointer-events: none","z-index: 2147483646"].join("; "),m.textContent=String(h),document.body.appendChild(m),m}function p(){const h=document.createElement("div");return h.className=q,h.setAttribute("aria-hidden","true"),h.style.cssText=["position: fixed","pointer-events: none",`border: 2px solid ${t}`,"border-radius: 2px","box-sizing: border-box","z-index: 2147483645"].join("; "),document.body.appendChild(h),h}function d(h,m,E){const b=E?"0.5":"1";h.outline.style.display="block",h.outline.style.opacity=b,h.outline.style.left=`${m.x}px`,h.outline.style.top=`${m.y}px`,h.outline.style.width=`${m.w}px`,h.outline.style.height=`${m.h}px`,h.marker.style.display="flex",h.marker.style.opacity=b,h.marker.style.left=`${m.x+m.w-12}px`,h.marker.style.top=`${Math.max(2,m.y-12)}px`}function g(h){h.marker.style.display="none",h.outline.style.display="none"}function f(){u.forEach(h=>{let m=h.anchor.target;if(m&&!m.isConnected&&(m=null),!m&&h.anchor.selector){try{m=document.querySelector(h.anchor.selector)}catch{m=null}m&&(h.anchor.target=m)}if(m){const b=m.getBoundingClientRect();if(b.width>0||b.height>0){d(h,{x:b.left,y:b.top,w:b.width,h:b.height},!1);return}}const E=h.anchor.fallbackRect;if(E&&(E.w>0||E.h>0)){d(h,E,!0);return}g(h)})}let w=null;function S(){w===null&&(w=requestAnimationFrame(()=>{w=null,f()}))}return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),{addPin(h,m){const E=l(h),b=p();u.set(h,{anchor:m,marker:E,outline:b}),f()},setLoading(h){h?i.innerHTML=s+c(h):i.textContent=He},destroy(){window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S),w!==null&&cancelAnimationFrame(w),r.remove(),i.remove(),a.remove(),u.forEach(({marker:h,outline:m})=>{h.remove(),m.remove()}),u.clear()}}}const In='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',Nn='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';function _n(e){return new Promise(t=>{const n=document.createElement("div");n.className="beacon-pin-popover open beacon-no-capture beacon-theme-auto",n.innerHTML=`
710
710
  <div class="beacon-pin-popover-header">
711
711
  <div style="display:flex;align-items:center;gap:6px;font-weight:600;font-size:13px;">
712
712
  <span class="beacon-pin-num">${e.pinNumber}</span>
713
713
  <span>Note for this pin</span>
714
714
  </div>
715
- <button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${Mn}</button>
715
+ <button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${In}</button>
716
716
  </div>
717
717
  <textarea class="beacon-textarea" rows="2" placeholder="Optional — describe what's wrong here…" style="min-height:48px;"></textarea>
718
718
  <div class="beacon-pin-popover-actions">
719
- <button type="button" class="beacon-btn primary" data-action="save">${Rn} Save</button>
719
+ <button type="button" class="beacon-btn primary" data-action="save">${Nn} Save</button>
720
720
  </div>
721
- `;const o=240,r=160,a=Math.min(Math.max(8,e.anchor.x),window.innerWidth-o-8),i=Math.min(Math.max(8,e.anchor.y+12),window.innerHeight-r-8);n.style.left=`${a}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function c(l){document.removeEventListener("keydown",u,!0),n.remove(),t(l)}function u(l){l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),c({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",l=>{var b;const f=(b=l.target.closest("[data-action]"))==null?void 0:b.getAttribute("data-action");if(f==="cancel"&&c({cancelled:"pin"}),f==="save"){const m=s.value.trim();c({...m?{note:m}:{},cancelled:!1})}}),s.addEventListener("keydown",l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const p=s.value.trim();c({...p?{note:p}:{},cancelled:!1})}})})}const Pn="#0ea5e9";function Nn(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function _n(e){const{shadowRoot:t,onHover:n}=e,o=e.accent??Pn,r=Nn(o,"14"),a=document.createElement("div");a.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${o}`,`background: ${r}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(a);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let c=!1,u=()=>{};const l=new Promise(h=>{u=h});function p(h){if(!h||!(h instanceof Node))return!1;let v=h;for(;v;){if(v===t||v===t.host)return!0;v=v.parentNode??v.host??null}return!1}function f(h,v){a.style.display="none",i.style.display="none";const k=document.elementsFromPoint(h,v);a.style.display="block",i.style.display="block";for(const S of k)if(!p(S))return S;return null}function b(h){const v=h.getBoundingClientRect();a.style.left=`${v.left}px`,a.style.top=`${v.top}px`,a.style.width=`${v.width}px`,a.style.height=`${v.height}px`;const k=h.tagName.toLowerCase(),S=h.classList.length>0?"."+Array.from(h.classList).slice(0,2).join("."):"";i.textContent=k+S;const R=v.top-22;i.style.left=`${v.left}px`,i.style.top=`${R>=0?R:v.bottom+4}px`}function m(h){const v=f(h.clientX,h.clientY);v?(b(v),n==null||n(v)):(a.style.display="none",i.style.display="none",n==null||n(null))}function w(h){if(h.button!==0)return;h.preventDefault(),h.stopPropagation();const v=f(h.clientX,h.clientY);v&&y(v)}function g(h){h.preventDefault(),h.stopPropagation()}function d(h){h.key==="Escape"&&(h.preventDefault(),y(null))}function y(h){c||(c=!0,document.removeEventListener("mousemove",m,!0),document.removeEventListener("pointerdown",w,!0),document.removeEventListener("click",g,!0),document.removeEventListener("mouseup",g,!0),document.removeEventListener("keydown",d,!0),a.remove(),i.remove(),document.body.style.cursor=s,u(h))}return document.addEventListener("mousemove",m,!0),document.addEventListener("pointerdown",w,!0),document.addEventListener("click",g,!0),document.addEventListener("mouseup",g,!0),document.addEventListener("keydown",d,!0),{cancel:()=>y(null),promise:l}}let ae=null;async function $n(){return ae||(ae=await Promise.resolve().then(()=>Rr)),ae}const X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function He(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function Dn(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{He(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=X)}),document.querySelectorAll("image").forEach(n=>{const o=n,r=o.getAttribute("href"),a=o.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=r||a||"";i&&!He(i)&&(t.push({el:o,href:r,xlink:a}),r!==null&&o.setAttribute("href",X),a!==null&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",X))}),()=>{for(const{el:n,src:o}of e)n.src=o;for(const{el:n,href:o,xlink:r}of t)o!==null&&n.setAttribute("href",o),r!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",r)}}async function Ue(e={}){const{quality:t=.7,pixelRatio:n=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:o,excludeHosts:r}=e,a=await $n(),i=o||r!=null&&r.length?c=>{let u=c;for(;u;){if(o&&u===o.host||r&&u instanceof Element&&r.includes(u)||u instanceof Element&&u.classList.contains("beacon-no-capture"))return!1;u=u.parentNode}return!0}:void 0,s=Dn();try{return await a.toJpeg(document.documentElement,{quality:t,pixelRatio:n,cacheBust:!0,...i?{filter:i}:{},imagePlaceholder:X,width:window.innerWidth,height:window.innerHeight,style:{transform:"none"}})}finally{s()}}let ie=null;function On(e){ie=e}function Fn(){return ie}function U(){ie=null}const ze="http://www.w3.org/2000/svg";function Bn(){const e=document.createElementNS(ze,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const o=document.createElementNS(ze,"path");o.setAttribute("d",n),e.appendChild(o)}return e}function qe(e={}){const t=e.maxPins??20;let n=[],o=new WeakMap,r=null,a=null,i=null,s=null,c=null;function u(){n=[],o=new WeakMap,r=null,U(),m(),w()}function l(){const g=document.querySelector("launch-kit-beacon");return(g==null?void 0:g.shadowRoot)??null}function p(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const g=document.querySelector("launch-kit-beacon");return g&&getComputedStyle(g).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function f(g){const d=l();if(!d)return;const y=p(),h=await g.requestMode("pickElement"),v=Tn({accent:y});for(const k of n){const S=o.get(k);S&&v.addPin(k.number,{target:S,selector:k.selector,fallbackRect:k.boundingRect})}try{let k=!0;for(;k&&!(n.length>=t);){const R=await _n({shadowRoot:d,accent:y}).promise;if(!R)break;const N=R.getBoundingClientRect(),P=await In({anchor:{x:N.left,y:N.bottom},pinNumber:n.length+1});if(P.cancelled==="all"){k=!1;break}if(P.cancelled==="pin")continue;const E=vn(R),A={number:n.length+1,...E,...P.note?{note:P.note}:{}};n.push(A),o.set(A,R),v.addPin(A.number,{target:R,selector:E.selector,fallbackRect:E.boundingRect})}if(n.length>0){v.setLoading("Capturing screenshot…"),await new Promise(S=>requestAnimationFrame(()=>S()));try{const S=Array.from(document.querySelectorAll("launch-kit-beacon")),R=await Ue({excludeHosts:S}),N=n.map(A=>({number:A.number,selector:A.selector,boundingRect:A.boundingRect,...o.get(A)?{liveElement:o.get(A)}:{}})),P={w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},E=await Oe(R,N,P,y);r=E,On({dataUrl:E,mime:"image/jpeg"})}catch{r=null,U()}}else r=null,U()}finally{v.destroy(),h()}m(),w()}function b(g){const d=n.findIndex(y=>y.number===g);d!==-1&&(n.splice(d,1),n.forEach((y,h)=>{y.number=h+1}),r=null,U(),m(),w())}function m(){if(a&&(a.textContent=`Pins (${n.length})`,a.style.display=n.length===0?"none":""),c&&(c.textContent=n.length===0?"Annotate elements":"Add another pin"),!!i){i.innerHTML="",i.style.display=n.length===0?"none":"";for(const g of n){const d=document.createElement("div");d.className="beacon-pin-item",d.dataset.pin=String(g.number);const y=document.createElement("span");y.className="beacon-pin-num",y.textContent=String(g.number);const h=document.createElement("div");h.className="beacon-pin-meta";const v=document.createElement("div");v.className="beacon-pin-selector",v.title=g.selector,v.textContent=g.selector||g.tagName;const k=document.createElement("input");k.type="text",k.className="beacon-pin-note-input",k.placeholder="Add a note (optional)",k.value=g.note??"",k.addEventListener("input",()=>{k.value.trim()?g.note=k.value:delete g.note}),h.appendChild(v),h.appendChild(k);const S=document.createElement("button");S.type="button",S.className="beacon-icon-btn",S.setAttribute("aria-label",`Remove pin ${g.number}`),S.appendChild(Bn()),S.addEventListener("click",()=>b(g.number)),d.appendChild(y),d.appendChild(h),d.appendChild(S),i.appendChild(d)}}}function w(){s&&(r?(s.src=r,s.style.display="block"):(s.removeAttribute("src"),s.style.display="none"))}return{name:"domEle",setupOnce(g){return g.on("close",()=>u())},form(g){return{render:d=>(a=document.createElement("div"),a.className="beacon-pin-list-header",d.appendChild(a),i=document.createElement("div"),i.className="beacon-pin-list",d.appendChild(i),c=document.createElement("button"),c.type="button",c.className="beacon-btn secondary beacon-pin-annotate",c.addEventListener("click",()=>{f(g)}),d.appendChild(c),s=document.createElement("img"),s.className="beacon-thumb",s.alt="Annotated screenshot preview",s.style.display="none",d.appendChild(s),m(),w(),()=>{a=null,i=null,s=null,c=null})}},capture(){return n.length===0?null:{pins:n}}}}function je(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function Ve(e={}){return{name:"domSS",async capture(t){const n=Fn();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const o=await t.requestMode("hide");try{await new Promise(p=>requestAnimationFrame(()=>p()));const r=Array.from(document.querySelectorAll("launch-kit-beacon")),a=await Ue({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:r}),i=t.captured("domEle"),s=Hn(i),c={w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},u=e.accent??Un();return{dataUrl:s.length>0?await Oe(a,s,c,u):a,mime:"image/jpeg"}}finally{o()}}}}function Hn(e){if(!e||je(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function Un(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}const We="beacon-no-capture",Xe="__lsBeaconMonitorChipPos",zn="#10b981";function qn(e){const t=e.accent??zn,n=e.startedAt??Date.now(),o=document.createElement("div");o.className=`${We} beacon-monitor-overlay-frame`,o.setAttribute("aria-hidden","true"),o.style.setProperty("--beacon-monitor-accent",t),document.body.appendChild(o);const r=document.createElement("div");r.className=`${We} beacon-monitor-overlay-chip`,r.setAttribute("role","status"),r.setAttribute("aria-label","Recording — drag to move"),r.style.setProperty("--beacon-monitor-accent",t);const a=document.createElement("div");a.className="beacon-monitor-overlay-chip-row";const i=document.createElement("span");i.className="beacon-monitor-overlay-rec-dot",i.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className="beacon-monitor-overlay-rec-label",s.textContent="REC";const c=document.createElement("span");c.className="beacon-monitor-overlay-sep",c.setAttribute("aria-hidden","true"),c.textContent="·";const u=document.createElement("span");u.className="beacon-monitor-overlay-timer",u.textContent="00:00";const l=document.createElement("button");l.type="button",l.className="beacon-monitor-overlay-stop",l.textContent="Stop",l.setAttribute("aria-label","Stop monitoring"),a.appendChild(i),a.appendChild(s),a.appendChild(c),a.appendChild(u),a.appendChild(l),r.appendChild(a);const p=document.createElement("div");p.className="beacon-monitor-overlay-url",e.url?(p.textContent=e.url,p.title=e.url):p.style.display="none",r.appendChild(p),document.body.appendChild(r);const f=b()??m();g(w(f));function b(){try{const E=localStorage.getItem(Xe);if(!E)return null;const A=JSON.parse(E),W=typeof A.x=="number"?A.x:NaN,te=typeof A.y=="number"?A.y:NaN;return!Number.isFinite(W)||!Number.isFinite(te)?null:{x:W,y:te}}catch{return null}}function m(){const A=r.getBoundingClientRect().width||200;return{x:Math.max(8,Math.floor((window.innerWidth-A)/2)),y:16}}function w(E){const W=r.getBoundingClientRect(),te=W.width||200,Ir=W.height||40,Pr=Math.max(8,window.innerWidth-te-8),Nr=Math.max(8,window.innerHeight-Ir-8);return{x:Math.min(Math.max(8,E.x),Pr),y:Math.min(Math.max(8,E.y),Nr)}}function g(E){r.style.left=`${E.x}px`,r.style.top=`${E.y}px`}let d=!1,y=null,h={x:0,y:0};function v(E){if(E.target instanceof Element&&E.target.closest(".beacon-monitor-overlay-stop"))return;E.preventDefault(),d=!0,y=E.pointerId;try{r.setPointerCapture(E.pointerId)}catch{}r.setAttribute("data-dragging","true");const A=r.getBoundingClientRect();h={x:E.clientX-A.left,y:E.clientY-A.top}}function k(E){!d||E.pointerId!==y||g(w({x:E.clientX-h.x,y:E.clientY-h.y}))}function S(E){if(!d||E.pointerId!==y)return;d=!1,y=null,r.removeAttribute("data-dragging");try{r.releasePointerCapture(E.pointerId)}catch{}const A=r.getBoundingClientRect();try{localStorage.setItem(Xe,JSON.stringify({x:A.left,y:A.top}))}catch{}}r.addEventListener("pointerdown",v),r.addEventListener("pointermove",k),r.addEventListener("pointerup",S),r.addEventListener("pointercancel",S),l.addEventListener("click",E=>{E.stopPropagation(),e.onStop()});function R(){const E=r.getBoundingClientRect();g(w({x:E.left,y:E.top}))}window.addEventListener("resize",R);function N(){const E=Math.max(0,Math.floor((Date.now()-n)/1e3));u.textContent=jn(E)}N();const P=window.setInterval(N,1e3);return{updateUrl(E){E?(p.textContent=E,p.title=E,p.style.display=""):p.style.display="none"},destroy(){window.clearInterval(P),window.removeEventListener("resize",R),r.removeEventListener("pointerdown",v),r.removeEventListener("pointermove",k),r.removeEventListener("pointerup",S),r.removeEventListener("pointercancel",S),o.remove(),r.remove()}}}function jn(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return t>0?`${z(t)}:${z(n)}:${z(o)}`:`${z(n)}:${z(o)}`}function z(e){return e<10?`0${e}`:String(e)}const K=80,Vn='button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]',Wn=1024,Xn=5;function Kn(e,t){return e.length>t?e.slice(0,t):e}function se(e){if(e.id)return`#${CSS.escape(e.id)}`;const t=[];let n=e;for(let o=0;o<5&&n;o++){const r=n.tagName.toLowerCase(),a=n.id?`#${CSS.escape(n.id)}`:"",i=n.classList.length>0?"."+Array.from(n.classList).slice(0,3).map(CSS.escape).join("."):"";if(t.unshift(`${r}${a}${i}`),a)break;n=n.parentElement}return t.join(" > ")}function Y(e,t){if(!e)return;const n=e.replace(/\s+/g," ").trim();if(n)return n.length>t?n.slice(0,t):n}function Ke(e){const t=Y(e.textContent,K),n=Y(e.getAttribute("aria-label"),K),o=e.getAttribute("data-testid")||void 0,r=e.getAttribute("name")||void 0;let a=n||t;if(!a){const i=e.closest(Vn);i&&i!==e&&(a=Y(i.getAttribute("aria-label"),K)||Y(i.textContent,K))}return{tag:e.tagName.toLowerCase(),id:e.id||null,classes:Array.from(e.classList).slice(0,10),role:e.getAttribute("role"),selector:se(e),...t?{text:t}:{},...n?{ariaLabel:n}:{},...o?{testid:o}:{},...r?{name:r}:{},...a&&a!==t?{label:a}:{}}}function Yn(e,t){const n=[],o=document.querySelectorAll("body *");for(const r of Array.from(o)){const a=getComputedStyle(r);if(a.position!=="fixed"&&a.position!=="sticky")continue;const i=r.getBoundingClientRect();if(e<i.left||e>i.right||t<i.top||t>i.bottom)continue;const s=parseInt(a.zIndex,10);!Number.isFinite(s)&&a.zIndex!=="auto"||n.push({tag:r.tagName.toLowerCase(),zIndex:Number.isFinite(s)?s:0,pointerEvents:a.pointerEvents,classes:Array.from(r.classList).slice(0,5).join(" ")})}return n.sort((r,a)=>a.zIndex-r.zIndex).slice(0,Xn)}function Gn(e){const t=r=>a=>{const i=a,s=i.target;if(!(s instanceof Element))return;const c=i.clientX,u=i.clientY,l=document.elementFromPoint(c,u),p=l===s||(l?s.contains(l)||l.contains(s):!1),f=document.querySelectorAll('[role="dialog"][data-state="open"]').length,b=getComputedStyle(document.body).pointerEvents,m=p?[]:Yn(c,u);e.emitClick({kind:r,target:Ke(s),hitMatchesTarget:p,...!p&&l instanceof Element?{hitTarget:Ke(l)}:{},coords:{x:c,y:u},openDialogs:f,bodyPointerEvents:b,...m.length>0?{overlaysAtPoint:m}:{}})},n=t("click"),o=t("mousedown");return document.addEventListener("click",n,{capture:!0,passive:!0}),document.addEventListener("mousedown",o,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",o,{capture:!0})}}function Jn(e){const t=history.pushState,n=history.replaceState;let o=window.location.href;const r=s=>{const c=window.location.href;if(c===o)return;const u=o;o=c,e.emitRoute({kind:"route",from:u,to:c,via:s})};history.pushState=function(...c){const u=t.apply(this,c);return r("pushState"),u},history.replaceState=function(...c){const u=n.apply(this,c);return r("replaceState"),u};const a=()=>r("popstate"),i=()=>r("hashchange");return window.addEventListener("popstate",a),window.addEventListener("hashchange",i),()=>{history.pushState=t,history.replaceState=n,window.removeEventListener("popstate",a),window.removeEventListener("hashchange",i)}}function Zn(e){const t=new WeakSet,n=(r,a)=>{const i=se(r);e.emitDialog({kind:"dialog",action:a,selector:i,state:r.getAttribute("data-state"),...a==="mount"?{outerHTML:Kn(r.outerHTML,Wn)}:{}})};for(const r of Array.from(document.querySelectorAll('[role="dialog"]')))t.add(r);const o=new MutationObserver(r=>{var a,i,s,c;for(const u of r){for(const l of Array.from(u.addedNodes)){if(!(l instanceof Element))continue;const p=(a=l.matches)!=null&&a.call(l,'[role="dialog"]')?[l]:Array.from(((i=l.querySelectorAll)==null?void 0:i.call(l,'[role="dialog"]'))??[]);for(const f of p)t.has(f)||(t.add(f),n(f,"mount"))}for(const l of Array.from(u.removedNodes)){if(!(l instanceof Element))continue;const p=(s=l.matches)!=null&&s.call(l,'[role="dialog"]')?[l]:Array.from(((c=l.querySelectorAll)==null?void 0:c.call(l,'[role="dialog"]'))??[]);for(const f of p)t.has(f)&&(t.delete(f),n(f,"unmount"))}u.type==="attributes"&&u.attributeName==="data-state"&&u.target instanceof Element&&u.target.getAttribute("role")==="dialog"&&n(u.target,"state")}});return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state"]}),()=>o.disconnect()}function Qn(e){const t=n=>{const o=n.target;if(!(o instanceof HTMLFormElement))return;const r=[];for(const a of Array.from(o.elements)){if(!(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement))continue;const i=a.getAttribute("name")||"<unnamed>",s=a instanceof HTMLInputElement?a.type:a.tagName.toLowerCase();let c;a instanceof HTMLInputElement&&(a.type==="checkbox"||a.type==="radio")?c=a.checked:c=!!a.value,r.push({name:i,type:s,hasValue:c})}e.emitSubmit({kind:"submit",form:{id:o.id||null,action:o.getAttribute("action")||null,method:(o.getAttribute("method")||"GET").toUpperCase(),selector:se(o),fields:r}})};return document.addEventListener("submit",t,{capture:!0}),()=>document.removeEventListener("submit",t,{capture:!0})}function eo(e){const t=Gn(e),n=Jn(e),o=Zn(e),r=Qn(e);return{uninstall(){t(),n(),o(),r()}}}const ce=1e3,Ye=10*1024,Ge="[REDACTED]",Je=new Set(["POST","PUT","PATCH","DELETE"]),to=[/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,/\bls_pat_[A-Za-z0-9_]+/g,/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g],no=/^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;function le(e,t){return e.length>t?e.slice(0,t):e}function Ze(e){let t=e;for(const n of to)t=t.replace(n,Ge);return t}function ue(e){if(e===null||typeof e!="object")return typeof e=="string"?Ze(e):e;if(Array.isArray(e))return e.map(ue);const t={};for(const[n,o]of Object.entries(e))t[n]=no.test(n)?Ge:ue(o);return t}function Qe(e,t){if(t&&t.includes("application/json"))try{const n=JSON.parse(e);return JSON.stringify(ue(n))}catch{}return Ze(e)}function G(e,t){const n=e.length,o={bodySize:n};return n>Ye?(o.body=Qe(e.slice(0,Ye),t),o.bodyTruncated=!0):o.body=Qe(e,t),t&&(o.contentType=t),o}function oo(e,t){const n=t==null?void 0:t.body;if(n!=null){if(typeof n=="string")return n;if(n instanceof URLSearchParams)return n.toString();if(n instanceof FormData){const o=[];return n.forEach((r,a)=>{o.push(`${a}=${typeof r=="string"?`[${r.length}b]`:"[file]"}`)}),`[FormData] ${o.join("&")}`}return n instanceof Blob?`[Blob ${n.size}b ${n.type||"unknown"}]`:n instanceof ArrayBuffer?`[binary ${n.byteLength}b]`:ArrayBuffer.isView(n)?`[binary ${n.byteLength}b]`:null}return e instanceof Request,null}function ro(e,t){return!!((o=>o?o instanceof Headers?o.has("authorization"):Array.isArray(o)?o.some(([r])=>r.toLowerCase()==="authorization"):typeof o=="object"?Object.keys(o).some(r=>r.toLowerCase()==="authorization"):!1:!1)(t==null?void 0:t.headers)||e instanceof Request&&e.headers.has("authorization"))}function ao(e,t){return(o=>{if(o){if(o instanceof Headers)return o.get("content-type")||void 0;if(Array.isArray(o)){const r=o.find(([a])=>a.toLowerCase()==="content-type");return r?r[1]:void 0}if(typeof o=="object"){for(const[r,a]of Object.entries(o))if(r.toLowerCase()==="content-type")return a}}})(t==null?void 0:t.headers)??(e instanceof Request&&e.headers.get("content-type")||void 0)}function io(e,t,n){if(!Je.has(n))return;const o=ro(e,t),r=oo(e,t);if(r==null&&!o)return;const a=ao(e,t),i=r!=null?G(r,a):{};return o&&(i.hasAuth=!0),i}function so(e){const t=window.fetch;if(typeof t!="function")return()=>{};const n=async(o,r)=>{const a=performance.now(),i=((r==null?void 0:r.method)??(o instanceof Request?o.method:"GET")).toUpperCase(),s=typeof o=="string"?o:o instanceof URL?o.toString():o.url,c=io(o,r,i);try{const u=await t.call(window,o,r),l=Math.round(performance.now()-a),p=u.status>=400;let f;if(p||e.verbose)try{const b=await u.clone().text(),m=u.headers.get("content-type")||void 0;f=G(b,m)}catch{}return(p||e.verbose)&&e.emit({kind:"fetch",url:le(s,ce),method:i,status:u.status,durationMs:l,failed:p,...c?{request:c}:{},...f?{response:f}:{}}),u}catch(u){const l=Math.round(performance.now()-a);throw e.emit({kind:"fetch",url:le(s,ce),method:i,status:0,durationMs:l,failed:!0,error:u instanceof Error?u.message:String(u),...c?{request:c}:{}}),u}};return n.__lsBeaconWrapped=!0,window.fetch=n,()=>{window.fetch.__lsBeaconWrapped&&(window.fetch=t)}}function co(e){if(e==null)return null;if(typeof e=="string")return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((n,o)=>{t.push(`${o}=${typeof n=="string"?`[${n.length}b]`:"[file]"}`)}),`[FormData] ${t.join("&")}`}return e instanceof Blob?`[Blob ${e.size}b ${e.type||"unknown"}]`:e instanceof ArrayBuffer?`[binary ${e.byteLength}b]`:ArrayBuffer.isView(e)?`[binary ${e.byteLength}b]`:null}function lo(e){const t=XMLHttpRequest.prototype,n=t.open,o=t.send,r=t.setRequestHeader,a=new WeakMap;return t.open=function(s,c,...u){return a.set(this,{method:s.toUpperCase(),url:typeof c=="string"?c:c.toString(),start:0,hasAuth:!1}),n.call(this,s,c,...u)},t.setRequestHeader=function(s,c){const u=a.get(this);if(u){const l=s.toLowerCase();l==="authorization"?u.hasAuth=!0:l==="content-type"&&(u.requestContentType=c)}return r.call(this,s,c)},t.send=function(s){const c=a.get(this);if(c)if(c.start=performance.now(),Je.has(c.method)){const l=co(s);l!=null?c.request=G(l,c.requestContentType):c.request={},c.hasAuth&&(c.request.hasAuth=!0)}else c.hasAuth&&(c.request={hasAuth:!0});const u=()=>{this.removeEventListener("loadend",u);const l=a.get(this);if(!l)return;const p=Math.round(performance.now()-l.start),f=this.status===0||this.status>=400;let b;if((f||e.verbose)&&this.status>0)try{const m=this.responseType===""||this.responseType==="text"?this.responseText:"";if(m){const w=this.getResponseHeader("content-type")||void 0;b=G(m,w)}}catch{}(f||e.verbose)&&e.emit({kind:"xhr",url:le(l.url,ce),method:l.method,status:this.status,durationMs:p,failed:f,...l.request?{request:l.request}:{},...b?{response:b}:{}}),a.delete(this)};return this.addEventListener("loadend",u),o.call(this,s)},()=>{t.open=n,t.send=o,t.setRequestHeader=r}}function uo(e){const t=so(e),n=lo(e);return{uninstall(){t(),n()}}}const po=1e3,et=50,fo=500;class mo{constructor(t){this.buffer=[],this.inflight=!1,this.timer=null,this.destroyed=!1,this.handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this.flushSync()},this.url=t.url,this.sessionId=t.sessionId,this.onError=t.onError,this.timer=setInterval(()=>{this.flush()},po),this.pagehideHandler=()=>this.flushSync(),window.addEventListener("pagehide",this.pagehideHandler),document.addEventListener("visibilitychange",this.handleVisibilityChange)}enqueue(t){this.destroyed||(this.buffer.push(t),this.buffer.length>fo&&this.buffer.shift(),this.buffer.length>=et&&this.flush())}async flush(){var o,r;if(this.destroyed||this.inflight||this.buffer.length===0)return;const t=this.buffer.splice(0,et),n=this.makeBatch(t);this.inflight=!0;try{const a=await fetch(this.url,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0});a.ok||(o=this.onError)==null||o.call(this,new Error(`monitor flush: HTTP ${a.status}`))}catch(a){(r=this.onError)==null||r.call(this,a instanceof Error?a:new Error(String(a)))}finally{this.inflight=!1}}flushSync(){if(this.destroyed||this.buffer.length===0)return;if(!navigator.sendBeacon){this.flush();return}const t=this.buffer.splice(0),n=this.makeBatch(t),o=new Blob([JSON.stringify(n)],{type:"application/json"});try{navigator.sendBeacon(this.url,o)}catch{}}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.flushSync())}makeBatch(t){return{sessionId:this.sessionId,events:t,meta:{url:window.location.href,userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},v:1}}}}const de="__lsBeaconMonitorUrl",tt="__lsBeaconMonitorSession",pe="__lsBeaconMonitorVerbose",fe="__lsBeaconMonitorDeadline",nt=30*6e4,ot=4096;let x=null;const me=new Set;function ho(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function bo(e){const t=new WeakSet,n=o=>{if(o===null||typeof o!="object")return typeof o=="string"&&o.length>ot?o.slice(0,ot):o;if(t.has(o))return"[cyclic]";if(t.add(o),Array.isArray(o))return o.map(n);const r={};for(const a of Object.keys(o).slice(0,50))try{r[a]=n(o[a])}catch{r[a]="[unreadable]"}return r};try{return n(e)}catch{return"[unserialisable]"}}function he(){for(const e of me)try{e(x!==null,(x==null?void 0:x.url)??null)}catch{}}function go(e){return x?(x.seq+=1,{...e,ts:Date.now(),sessionId:x.sessionId,seq:x.seq}):{...e,ts:Date.now(),sessionId:"",seq:0}}function $(e){if(!x)return;const t=go(e);x.transport.enqueue(t)}function yo(){if(x)try{sessionStorage.setItem(de,x.url),sessionStorage.setItem(tt,x.sessionId),sessionStorage.setItem(pe,x.verbose?"1":"0"),sessionStorage.setItem(fe,String(x.deadlineMs))}catch{}}function rt(){try{sessionStorage.removeItem(de),sessionStorage.removeItem(tt),sessionStorage.removeItem(pe),sessionStorage.removeItem(fe)}catch{}}function vo(){try{const e=sessionStorage.getItem(de);if(!e)return null;const t=sessionStorage.getItem(pe)==="1",n=sessionStorage.getItem(fe),o=n?Number(n):Date.now()+nt;return Number.isFinite(o)&&o<=Date.now()?(rt(),null):{url:e,verbose:t,deadlineMs:o}}catch{return null}}function at(e){x&&(x.seq+=1,x.transport.enqueue({kind:e.kind,ts:e.ts,sessionId:x.sessionId,seq:x.seq,message:e.message,...e.stack?{stack:e.stack}:{},...e.source?{source:e.source}:{},...typeof e.line=="number"?{line:e.line}:{},...typeof e.col=="number"?{col:e.col}:{}}))}function be(e){if(x&&q(),!e.url)return;const t=e.maxSessionMs??nt,n=Date.now()+t,o=ho(),r=!!e.verbose,a=new mo({url:e.url,sessionId:o,onError:m=>{console.warn("[launch-kit-beacon] monitor transport error:",m.message)}}),i=Re(),s=i.install(),c=i.snapshot();for(const m of c)at(m);let u=c.length;const l=i.subscribe(()=>{if(!x)return;const m=x.errorsBuffer.snapshot();for(;x.drainedThrough<m.length;){const w=m[x.drainedThrough];w&&at(w),x.drainedThrough+=1}}),p=uo({emit:m=>$(m),verbose:r}),f=eo({emitClick:m=>$(m),emitRoute:m=>$(m),emitDialog:m=>$(m),emitSubmit:m=>$(m)}),b=setTimeout(()=>{console.info("[launch-kit-beacon] monitor session expired (max duration reached)"),q()},Math.max(0,n-Date.now()));x={url:e.url,sessionId:o,verbose:r,deadlineMs:n,seq:0,transport:a,errorsBuffer:i,uninstallNetwork:p.uninstall,uninstallDom:f.uninstall,uninstallErrors:s,errorsUnsub:l,deadlineTimer:b,drainedThrough:u},yo(),he()}function q(){it(),rt(),he()}function wo(){x&&(it(),he())}function it(){x&&(clearTimeout(x.deadlineTimer),x.errorsUnsub(),x.uninstallErrors(),x.uninstallNetwork(),x.uninstallDom(),x.transport.destroy(),x=null)}function xo(e,t){x&&$({kind:"probe",label:e.slice(0,200),data:bo(t)})}function ge(){return x!==null}function ye(){return(x==null?void 0:x.url)??null}function st(e){return me.add(e),()=>{me.delete(e)}}function Eo(){if(x||typeof window>"u")return;const e=vo();e&&be({url:e.url,verbose:e.verbose,maxSessionMs:Math.max(6e4,e.deadlineMs-Date.now())})}function So(e={}){let t=null,n=null,o="",r=null;function a(){r||(r=qn({onStop:()=>q(),url:ye()}))}function i(){if(r){try{r.destroy()}catch{}r=null}}function s(){if(!t)return;t.innerHTML="";const l=document.createElement("div");l.className="beacon-monitor-title",l.textContent="Monitor — paste a stream URL",t.appendChild(l);const p=document.createElement("div");p.className="beacon-monitor-row";const f=document.createElement("input");f.type="url",f.className="beacon-monitor-input",f.placeholder="http://localhost:9876/m/…",f.value=o,f.autocomplete="off",f.spellcheck=!1,p.appendChild(f);const b=document.createElement("button");b.type="button",b.className="beacon-monitor-btn",b.textContent="Start",b.disabled=!o.trim(),p.appendChild(b),t.appendChild(p);const m=document.createElement("label");m.className="beacon-monitor-verbose";const w=document.createElement("input");w.type="checkbox",w.dataset.role="verbose",m.appendChild(w),m.appendChild(document.createTextNode(" verbose (capture successful network too)")),t.appendChild(m);const g=document.createElement("div");g.className="beacon-monitor-help",g.textContent="Streams clicks, failed network, errors, route + dialog changes.",t.appendChild(g),f.addEventListener("input",()=>{o=f.value,b.disabled=!f.value.trim()}),b.addEventListener("click",()=>{const d=f.value.trim();if(d){try{new URL(d)}catch{f.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"),f.reportValidity();return}f.setCustomValidity(""),be({url:d,verbose:w.checked,...e.maxSessionMs!==void 0?{maxSessionMs:e.maxSessionMs}:{}})}})}function c(){if(!t)return;t.innerHTML="";const l=ye()??"",p=document.createElement("div");p.className="beacon-monitor-title";const f=document.createElement("span");f.className="beacon-monitor-rec",f.setAttribute("aria-hidden","true"),p.appendChild(f),p.appendChild(document.createTextNode(" Monitor — recording")),t.appendChild(p);const b=document.createElement("div");b.className="beacon-monitor-active-url",b.title=l,b.textContent=l,t.appendChild(b);const m=document.createElement("div");m.className="beacon-monitor-row";const w=document.createElement("button");w.type="button",w.className="beacon-monitor-btn stop",w.textContent="Stop monitoring",w.addEventListener("click",()=>q()),m.appendChild(w),t.appendChild(m);const g=document.createElement("div");g.className="beacon-monitor-help",g.textContent="Events stream to the URL above. Auto-stops after 30 min.",t.appendChild(g)}function u(){ge()?c():s()}return{name:"liveMonitor",setupOnce(l){Eo(),ge()&&a();const p=st((b,m)=>{b?(a(),r==null||r.updateUrl(m)):i()}),f=()=>{i(),p();try{wo()}catch{}};l.signal.addEventListener("abort",f,{once:!0})},form(){return{render:l=>(t=document.createElement("div"),t.className="beacon-monitor",l.appendChild(t),u(),n=st(()=>u()),()=>{n==null||n(),n=null,t=null})}}}}let L=null;const ve={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function Co(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Le(),lt();const t={...Vt(),...e.labels??{}},n=new AbortController,o=Mo(e),r=e.position??"bottom-right",a=e.theme??"auto";Rt(),To(e,r,a);const i=document.querySelector(F);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=Wt(i.shadow),c=new jt(t,["bug","idea","ux","a11y"],{onSubmit:()=>{Po()},onClose:p=>{J("close",{}),p==="user"&&pt()}});i.shadow.appendChild(c.root),i.classList.add("beacon-no-capture");const u=Dt(o),l={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:o,registry:u,dialog:c,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||Io(),healthIndicator:e.healthIndicator??"never",position:r,theme:a,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};L=l,i.onTriggerClick=()=>ct(),u.install(p=>dt(p),p=>we(p)),j("ready",{ready:!0}),l.debug&&console.info("[beacon] ready",l.endpoint)}function ct(){const e=L;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=dt(t.name);let o;try{o=t.form(n)}catch(r){return we({plugin:t.name,error:r instanceof Error?r:new Error(String(r)),at:"form"}),null}return{name:t.name,form:o,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var o;return(o=e.formValues[t])==null?void 0:o[n]},set:(t,n,o)=>{var a;const r=(a=e.formValues)[t]??(a[t]={});r[n]=o}}),e.dialog.open(),J("open",{})))}function ko(){const e=L;e&&e.dialog.close("user")}function lt(){var t;const e=L;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),U();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,L=null}}function Ao(){const e=L;return e?{ready:!0,transport:"idle",plugins:e.registry.status()}:{ready:!1,transport:"idle",plugins:{}}}function Lo(e,t){return ve[e].add(t),()=>ut(e,t)}function ut(e,t){ve[e].delete(t)}function To(e,t,n){let o=document.querySelector(F);if(!o){o=document.createElement(F),o.setAttribute("position",t),o.setAttribute("theme",n),t==="hidden"&&(o.style.position="absolute",o.style.left="-9999px"),(document.body??document.documentElement).appendChild(o);return}e.position!==void 0&&o.setAttribute("position",t),e.theme!==void 0&&o.setAttribute("theme",n)}function Mo(e){return e.plugins?e.plugins:e.defaultPlugins===!1?[]:Ro()}function Ro(){return[Te(),Ie(),qe(),Ve()]}function Io(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function dt(e){const t=L;return _t(e,{getCaptured:o=>t==null?void 0:t.capturedEntries[o],getFormValues:o=>{var r;return t?(r=t.formValues)[o]??(r[o]={}):{}},getCaptureSignal:()=>{var o;return(o=t==null?void 0:t.currentSubmit)==null?void 0:o.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async o=>t?t.dialog.requestMode(o):()=>{},overlay:o=>t?Xt(t.overlayHost,o.render):()=>{},onLifecycle:(o,r)=>{if(!t)return()=>{};const a=t.lifecycleHandlers[o];return a.add(r),()=>a.delete(r)}})}function J(e,t){const n=L;if(n)for(const o of n.lifecycleHandlers[e])try{o(t)}catch(r){n.debug&&console.error("[beacon] lifecycle handler threw:",r)}}function j(e,t){for(const n of ve[e])try{n(t)}catch(o){L!=null&&L.debug&&console.error("[beacon] system handler threw:",o)}}function we(e){j("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=L;t&&((t.healthIndicator==="always"||t.healthIndicator==="dev"&&t.debug)&&t.hostElement.setHealthIndicator(!0),t.debug&&console.warn(`[beacon] plugin "${e.plugin}" ${e.at} failed:`,e.error))}function pt(){const e=L;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function Po(){const e=L;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const o=await e.registry.capture(s=>e.capturedEntries[s],s=>we(s));e.capturedEntries=o,n=No(e,t,o);let r=null;if(J("beforeSubmit",{payload:n,cancel:s=>{r===null&&(r=s)}}),r!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${r}`,"error");return}e.dialog.setStatus("Sending…");const i=await Bt(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);J("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(j("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{L===e&&e.dialog.close("submitted"),pt()},1500)):(j("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(o){e.dialog.setSubmitting(!1);const r=o instanceof Error?o:new Error(String(o));n&&j("submit:error",{payload:n,error:r}),e.dialog.setStatus(`Failed: ${r.message}`,"error")}finally{e.currentSubmit=null}}function No(e,t,n){var a;const o=_o(),r=(a=e.context)==null?void 0:a.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:o,...r?{context:r}:{},plugins:n}}function _o(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Le();function $o(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}const Do=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function I(e){const t=[];for(let n=0,o=e.length;n<o;n++)t.push(e[n]);return t}let D=null;function ft(e={}){return D||(e.includeStyleProperties?(D=e.includeStyleProperties,D):(D=I(window.getComputedStyle(document.documentElement)),D))}function Z(e,t){const o=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return o?parseFloat(o.replace("px","")):0}function Oo(e){const t=Z(e,"border-left-width"),n=Z(e,"border-right-width");return e.clientWidth+t+n}function Fo(e){const t=Z(e,"border-top-width"),n=Z(e,"border-bottom-width");return e.clientHeight+t+n}function xe(e,t={}){const n=t.width||Oo(e),o=t.height||Fo(e);return{width:n,height:o}}function Bo(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const M=16384;function Ho(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function Uo(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const o=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),r=o.length,a=new Uint8Array(r);for(let i=0;i<r;i+=1)a[i]=o.charCodeAt(i);n(new Blob([a],{type:t.type?t.type:"image/png"}))})}function Q(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>t(o))})},o.onerror=n,o.crossOrigin="anonymous",o.decoding="async",o.src=e})}async function zo(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qo(e,t,n){const o="http://www.w3.org/2000/svg",r=document.createElementNS(o,"svg"),a=document.createElementNS(o,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),r.appendChild(a),a.appendChild(e),zo(r)}const T=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||T(n,t)};function jo(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Vo(e,t){return ft(t).map(n=>{const o=e.getPropertyValue(n),r=e.getPropertyPriority(n);return`${n}: ${o}${r?" !important":""};`}).join(" ")}function Wo(e,t,n,o){const r=`.${e}:${t}`,a=n.cssText?jo(n):Vo(n,o);return document.createTextNode(`${r}{${a}}`)}function mt(e,t,n,o){const r=window.getComputedStyle(e,n),a=r.getPropertyValue("content");if(a===""||a==="none")return;const i=Do();try{t.className=`${t.className} ${i}`}catch{return}const s=document.createElement("style");s.appendChild(Wo(i,n,r,o)),t.appendChild(s)}function Xo(e,t,n){mt(e,t,":before",n),mt(e,t,":after",n)}const ht="application/font-woff",bt="image/jpeg",Ko={woff:ht,woff2:ht,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:bt,jpeg:bt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yo(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ee(e){const t=Yo(e).toLowerCase();return Ko[t]||""}function Go(e){return e.split(/,/)[1]}function Se(e){return e.search(/^(data:)/)!==-1}function Jo(e,t){return`data:${t};base64,${e}`}async function gt(e,t,n){const o=await fetch(e,t);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const r=await o.blob();return new Promise((a,i)=>{const s=new FileReader;s.onerror=i,s.onloadend=()=>{try{a(n({res:o,result:s.result}))}catch(c){i(c)}},s.readAsDataURL(r)})}const Ce={};function Zo(e,t,n){let o=e.replace(/\?.*/,"");return n&&(o=e),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),t?`[${t}]${o}`:o}async function ke(e,t,n){const o=Zo(e,t,n.includeQueryParams);if(Ce[o]!=null)return Ce[o];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const a=await gt(e,n.fetchRequestInit,({res:i,result:s})=>(t||(t=i.headers.get("Content-Type")||""),Go(s)));r=Jo(a,t)}catch(a){r=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;a&&(i=typeof a=="string"?a:a.message),i&&console.warn(i)}return Ce[o]=r,r}async function Qo(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Q(t)}async function er(e,t){if(e.currentSrc){const a=document.createElement("canvas"),i=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,i==null||i.drawImage(e,0,0,a.width,a.height);const s=a.toDataURL();return Q(s)}const n=e.poster,o=Ee(n),r=await ke(n,o,t);return Q(r)}async function tr(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await ee(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function nr(e,t){return T(e,HTMLCanvasElement)?Qo(e):T(e,HTMLVideoElement)?er(e,t):T(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(yt(e))}const or=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",yt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function rr(e,t,n){var o,r;if(yt(t))return t;let a=[];return or(e)&&e.assignedNodes?a=I(e.assignedNodes()):T(e,HTMLIFrameElement)&&(!((o=e.contentDocument)===null||o===void 0)&&o.body)?a=I(e.contentDocument.body.childNodes):a=I(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),a.length===0||T(e,HTMLVideoElement)||await a.reduce((i,s)=>i.then(()=>ee(s,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function ar(e,t,n){const o=t.style;if(!o)return;const r=window.getComputedStyle(e);r.cssText?(o.cssText=r.cssText,o.transformOrigin=r.transformOrigin):ft(n).forEach(a=>{let i=r.getPropertyValue(a);a==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),T(e,HTMLIFrameElement)&&a==="display"&&i==="inline"&&(i="block"),a==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),o.setProperty(a,i,r.getPropertyPriority(a))})}function ir(e,t){T(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),T(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sr(e,t){if(T(e,HTMLSelectElement)){const n=t,o=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));o&&o.setAttribute("selected","")}}function cr(e,t,n){return T(t,Element)&&(ar(e,t,n),Xo(e,t,n),ir(e,t),sr(e,t)),t}async function lr(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const o={};for(let a=0;a<n.length;a++){const s=n[a].getAttribute("xlink:href");if(s){const c=e.querySelector(s),u=document.querySelector(s);!c&&u&&!o[s]&&(o[s]=await ee(u,t,!0))}}const r=Object.values(o);if(r.length){const a="http://www.w3.org/1999/xhtml",i=document.createElementNS(a,"svg");i.setAttribute("xmlns",a),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(a,"defs");i.appendChild(s);for(let c=0;c<r.length;c++)s.appendChild(r[c]);e.appendChild(i)}return e}async function ee(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(o=>nr(o,t)).then(o=>rr(e,o,t)).then(o=>cr(e,o,t)).then(o=>lr(o,t))}const vt=/url\((['"]?)([^'"]+?)\1\)/g,ur=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,dr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function pr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function fr(e){const t=[];return e.replace(vt,(n,o,r)=>(t.push(r),n)),t.filter(n=>!Se(n))}async function mr(e,t,n,o,r){try{const a=n?$o(t,n):t,i=Ee(t);let s;return r||(s=await ke(a,i,o)),e.replace(pr(t),`$1${s}$3`)}catch{}return e}function hr(e,{preferredFontFormat:t}){return t?e.replace(dr,n=>{for(;;){const[o,,r]=ur.exec(n)||[];if(!r)return"";if(r===t)return`src: ${o};`}}):e}function wt(e){return e.search(vt)!==-1}async function xt(e,t,n){if(!wt(e))return e;const o=hr(e,n);return fr(o).reduce((a,i)=>a.then(s=>mr(s,i,t,n)),Promise.resolve(o))}async function O(e,t,n){var o;const r=(o=t.style)===null||o===void 0?void 0:o.getPropertyValue(e);if(r){const a=await xt(r,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function br(e,t){await O("background",e,t)||await O("background-image",e,t),await O("mask",e,t)||await O("-webkit-mask",e,t)||await O("mask-image",e,t)||await O("-webkit-mask-image",e,t)}async function gr(e,t){const n=T(e,HTMLImageElement);if(!(n&&!Se(e.src))&&!(T(e,SVGImageElement)&&!Se(e.href.baseVal)))return;const o=n?e.src:e.href.baseVal,r=await ke(o,Ee(o),t);await new Promise((a,i)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...c)=>{try{a(t.onImageErrorHandler(...c))}catch(u){i(u)}}:i;const s=e;s.decode&&(s.decode=a),s.loading==="lazy"&&(s.loading="eager"),n?(e.srcset="",e.src=r):e.href.baseVal=r})}async function yr(e,t){const o=I(e.childNodes).map(r=>Et(r,t));await Promise.all(o).then(()=>e)}async function Et(e,t){T(e,Element)&&(await br(e,t),await gr(e,t),await yr(e,t))}function vr(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const o=t.style;return o!=null&&Object.keys(o).forEach(r=>{n[r]=o[r]}),e}const St={};async function Ct(e){let t=St[e];if(t!=null)return t;const o=await(await fetch(e)).text();return t={url:e,cssText:o},St[e]=t,t}async function kt(e,t){let n=e.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(o,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),gt(s,t.fetchRequestInit,({result:c})=>(n=n.replace(i,`url(${c})`),[i,c]))});return Promise.all(a).then(()=>n)}function At(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let o=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(o);if(c===null)break;t.push(c[0])}o=o.replace(r,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let c=a.exec(o);if(c===null){if(c=s.exec(o),c===null)break;a.lastIndex=s.lastIndex}else s.lastIndex=a.lastIndex;t.push(c[0])}return t}async function wr(e,t){const n=[],o=[];return e.forEach(r=>{if("cssRules"in r)try{I(r.cssRules||[]).forEach((a,i)=>{if(a.type===CSSRule.IMPORT_RULE){let s=i+1;const c=a.href,u=Ct(c).then(l=>kt(l,t)).then(l=>At(l).forEach(p=>{try{r.insertRule(p,p.startsWith("@import")?s+=1:r.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:p,error:f})}})).catch(l=>{console.error("Error loading remote css",l.toString())});o.push(u)}})}catch(a){const i=e.find(s=>s.href==null)||document.styleSheets[0];r.href!=null&&o.push(Ct(r.href).then(s=>kt(s,t)).then(s=>At(s).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",a)}}),Promise.all(o).then(()=>(e.forEach(r=>{if("cssRules"in r)try{I(r.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${r.href}`,a)}}),n))}function xr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>wt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=I(e.ownerDocument.styleSheets),o=await wr(n,t);return xr(o)}function Lt(e){return e.trim().replace(/["']/g,"")}function Sr(e){const t=new Set;function n(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(a=>{t.add(Lt(a))}),Array.from(o.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Tt(e,t){const n=await Er(e,t),o=Sr(e);return(await Promise.all(n.filter(a=>o.has(Lt(a.style.fontFamily))).map(a=>{const i=a.parentStyleSheet?a.parentStyleSheet.href:null;return xt(a.cssText,i,t)}))).join(`
722
- `)}async function Cr(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Tt(e,t);if(n){const o=document.createElement("style"),r=document.createTextNode(n);o.appendChild(r),e.firstChild?e.insertBefore(o,e.firstChild):e.appendChild(o)}}async function Mt(e,t={}){const{width:n,height:o}=xe(e,t),r=await ee(e,t,!0);return await Cr(r,t),await Et(r,t),vr(r,t),await qo(r,n,o)}async function V(e,t={}){const{width:n,height:o}=xe(e,t),r=await Mt(e,t),a=await Q(r),i=document.createElement("canvas"),s=i.getContext("2d"),c=t.pixelRatio||Bo(),u=t.canvasWidth||n,l=t.canvasHeight||o;return i.width=u*c,i.height=l*c,t.skipAutoScale||Ho(i),i.style.width=`${u}`,i.style.height=`${l}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(a,0,0,i.width,i.height),i}async function kr(e,t={}){const{width:n,height:o}=xe(e,t);return(await V(e,t)).getContext("2d").getImageData(0,0,n,o).data}async function Ar(e,t={}){return(await V(e,t)).toDataURL()}async function Lr(e,t={}){return(await V(e,t)).toDataURL("image/jpeg",t.quality||1)}async function Tr(e,t={}){const n=await V(e,t);return await Uo(n)}async function Mr(e,t={}){return Tt(e,t)}const Rr=Object.freeze(Object.defineProperty({__proto__:null,getFontEmbedCSS:Mr,toBlob:Tr,toCanvas:V,toJpeg:Lr,toPixelData:kr,toPng:Ar,toSvg:Mt},Symbol.toStringTag,{value:"Module"}));C.currentMonitorUrl=ye,C.destroy=lt,C.domEle=qe,C.domSS=Ve,C.errors=Ie,C.hide=ko,C.init=Co,C.isMonitorActive=ge,C.isPluginFailure=je,C.liveMonitor=So,C.metadata=Te,C.off=ut,C.on=Lo,C.probe=xo,C.show=ct,C.startMonitor=be,C.status=Ao,C.stopMonitor=q,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
721
+ `;const o=240,a=160,r=Math.min(Math.max(8,e.anchor.x),window.innerWidth-o-8),i=Math.min(Math.max(8,e.anchor.y+12),window.innerHeight-a-8);n.style.left=`${r}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function c(l){document.removeEventListener("keydown",u,!0),n.remove(),t(l)}function u(l){l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),c({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",l=>{var g;const d=(g=l.target.closest("[data-action]"))==null?void 0:g.getAttribute("data-action");if(d&&(l.stopPropagation(),d==="cancel"&&c({cancelled:"pin"}),d==="save")){const f=s.value.trim();c({...f?{note:f}:{},cancelled:!1})}}),s.addEventListener("keydown",l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const p=s.value.trim();c({...p?{note:p}:{},cancelled:!1})}})})}const $n="#0ea5e9";function Dn(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Fn(e){const{shadowRoot:t,onHover:n}=e,o=e.accent??$n,a=Dn(o,"14"),r=document.createElement("div");r.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${o}`,`background: ${a}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(r);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let c=!1,u=()=>{};const l=new Promise(b=>{u=b});function p(b){if(!b||!(b instanceof Node))return!1;let x=b;for(;x;){if(x===t||x===t.host)return!0;x=x.parentNode??x.host??null}return!1}function d(b){return b.tagName.includes("-")}function g(b,x){var C,A;r.style.display="none",i.style.display="none";const L=document.elementsFromPoint(b,x);r.style.display="block",i.style.display="block";for(const R of L){if(p(R))continue;let y=R,T=16;for(;y.shadowRoot&&!d(y)&&T-- >0;){const N=(((A=(C=y.shadowRoot).elementsFromPoint)==null?void 0:A.call(C,b,x))??[]).find(ne=>!p(ne)&&ne!==y);if(!N)break;y=N}return y}return null}function f(b){const x=b.getBoundingClientRect();r.style.left=`${x.left}px`,r.style.top=`${x.top}px`,r.style.width=`${x.width}px`,r.style.height=`${x.height}px`;const L=b.tagName.toLowerCase(),C=b.classList.length>0?"."+Array.from(b.classList).slice(0,2).join("."):"";i.textContent=L+C;const A=x.top-22;i.style.left=`${x.left}px`,i.style.top=`${A>=0?A:x.bottom+4}px`}function w(b){const x=g(b.clientX,b.clientY);x?(f(x),n==null||n(x)):(r.style.display="none",i.style.display="none",n==null||n(null))}function S(b){if(b.button!==0)return;b.preventDefault(),b.stopPropagation();const x=g(b.clientX,b.clientY);x&&E(x)}function h(b){b.preventDefault(),b.stopPropagation()}function m(b){b.key==="Escape"&&(b.preventDefault(),E(null))}function E(b){c||(c=!0,document.removeEventListener("mousemove",w,!0),document.removeEventListener("pointerdown",S,!0),document.removeEventListener("click",h,!0),document.removeEventListener("mouseup",h,!0),document.removeEventListener("keydown",m,!0),r.remove(),i.remove(),document.body.style.cursor=s,u(b))}return document.addEventListener("mousemove",w,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("click",h,!0),document.addEventListener("mouseup",h,!0),document.addEventListener("keydown",m,!0),{cancel:()=>E(null),promise:l}}let ie=null;async function On(){return ie||(ie=await Promise.resolve().then(()=>$r)),ie}const Y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function Ue(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function Hn(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{Ue(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=Y)}),document.querySelectorAll("image").forEach(n=>{const o=n,a=o.getAttribute("href"),r=o.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=a||r||"";i&&!Ue(i)&&(t.push({el:o,href:a,xlink:r}),a!==null&&o.setAttribute("href",Y),r!==null&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",Y))}),()=>{for(const{el:n,src:o}of e)n.src=o;for(const{el:n,href:o,xlink:a}of t)o!==null&&n.setAttribute("href",o),a!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",a)}}function Bn(){const e=[];document.querySelectorAll("*").forEach(r=>{const i=getComputedStyle(r),s=(i.overflowY==="auto"||i.overflowY==="scroll")&&r.scrollHeight>r.clientHeight,c=(i.overflowX==="auto"||i.overflowX==="scroll")&&r.scrollWidth>r.clientWidth;(s||c)&&e.push(r)});const t=window.scrollX,n=window.scrollY,o=e.map(r=>({el:r,scrollLeft:r.scrollLeft,scrollTop:r.scrollTop})),a=new Map;for(const r of e){let i=r;for(;i&&i!==document.documentElement.parentElement;)a.has(i)||a.set(i,i.style.cssText),i=i.parentElement}for(const r of a.keys())r.style.setProperty("overflow","visible","important"),r.style.setProperty("overflow-x","visible","important"),r.style.setProperty("overflow-y","visible","important"),r.style.setProperty("max-height","none","important"),r.style.setProperty("height","auto","important"),r.style.setProperty("min-height","0","important");return()=>{for(const[r,i]of a)r.style.cssText=i;for(const{el:r,scrollLeft:i,scrollTop:s}of o)r.scrollLeft=i,r.scrollTop=s;window.scrollTo(t,n)}}let ze=Promise.resolve();async function qe(e={}){const t=ze;let n;ze=new Promise(o=>{n=o});try{return await t,await Un(e,n)}catch(o){throw n(),o}}async function Un(e,t){const{quality:n=.7,pixelRatio:o=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:a,excludeHosts:r,fullPage:i=!0}=e,s=await On(),c=a||r!=null&&r.length?g=>{let f=g;for(;f;){if(a&&f===a.host||r&&f instanceof Element&&r.includes(f)||f instanceof Element&&f.classList.contains("beacon-no-capture"))return!1;f=f.parentNode}return!0}:void 0,u=Hn(),l=i?Bn():()=>{};let p=!1;const d=()=>{if(!p){p=!0;try{l()}finally{try{u()}finally{t()}}}};try{i&&await new Promise(h=>requestAnimationFrame(()=>h()));const g=document.documentElement,f=i?Math.max(g.scrollWidth,window.innerWidth):window.innerWidth,w=i?Math.max(g.scrollHeight,window.innerHeight):window.innerHeight;return{dataUrl:await s.toJpeg(g,{quality:n,pixelRatio:o,cacheBust:!0,...c?{filter:c}:{},imagePlaceholder:Y,width:f,height:w,style:{transform:"none"}}),width:f,height:w,pixelRatio:o,dispose:d}}catch(g){throw d(),g}}let se=null;function zn(e){se=e}function qn(){return se}function F(){se=null}const je="http://www.w3.org/2000/svg";function jn(){const e=document.createElementNS(je,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const o=document.createElementNS(je,"path");o.setAttribute("d",n),e.appendChild(o)}return e}function Ve(e={}){const t=e.maxPins??20;let n=[],o=new WeakMap,a=null,r=0,i=null,s=null,c=null,u=null;function l(){n=[],o=new WeakMap,a=null,r+=1,F(),S(),h()}function p(){const m=document.querySelector("launch-kit-beacon");return(m==null?void 0:m.shadowRoot)??null}function d(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const m=document.querySelector("launch-kit-beacon");return m&&getComputedStyle(m).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function g(m){const E=p();if(!E)return;const b=d(),x=await m.requestMode("pickElement"),L=Pn({accent:b});for(const C of n){const A=o.get(C);A&&L.addPin(C.number,{target:A,selector:C.selector,fallbackRect:C.boundingRect})}try{let C=!0;for(;C&&!(n.length>=t);){const R=await Fn({shadowRoot:E,accent:b}).promise;if(!R)break;const y=R.getBoundingClientRect(),T=await _n({anchor:{x:y.left,y:y.bottom},pinNumber:n.length+1});if(T.cancelled==="all"){C=!1;break}if(T.cancelled==="pin")continue;const _=En(R),N={number:n.length+1,..._,...T.note?{note:T.note}:{}};n.push(N),o.set(N,R),L.addPin(N.number,{target:R,selector:_.selector,fallbackRect:_.boundingRect})}n.length>0?(L.setLoading("Capturing screenshot…"),await new Promise(A=>requestAnimationFrame(()=>A())),await f()):(a=null,F())}finally{L.destroy(),x()}S(),h()}async function f(){const m=++r;if(n.length===0){a=null,F(),h();return}const E=d();try{const b=Array.from(document.querySelectorAll("launch-kit-beacon")),x=await qe({excludeHosts:b});try{if(m!==r)return;const L=n.map(R=>({number:R.number,selector:R.selector,boundingRect:R.boundingRect,...o.get(R)?{liveElement:o.get(R)}:{}})),C={w:x.width,h:x.height,dpr:x.pixelRatio},A=await Oe(x.dataUrl,L,C,E);if(m!==r)return;a=A,zn({dataUrl:A,mime:"image/jpeg"})}finally{x.dispose()}}catch{if(m!==r)return;a=null,F()}m===r&&h()}function w(m){const E=n.findIndex(b=>b.number===m);E!==-1&&(n.splice(E,1),n.forEach((b,x)=>{b.number=x+1}),a=null,F(),S(),h(),f())}function S(){if(i&&(i.textContent=`Pins (${n.length})`,i.style.display=n.length===0?"none":""),u&&(u.textContent=n.length===0?"Annotate elements":"Add another pin"),!!s){s.innerHTML="",s.style.display=n.length===0?"none":"";for(const m of n){const E=document.createElement("div");E.className="beacon-pin-item",E.dataset.pin=String(m.number);const b=document.createElement("span");b.className="beacon-pin-num",b.textContent=String(m.number);const x=document.createElement("div");x.className="beacon-pin-meta";const L=document.createElement("div");L.className="beacon-pin-selector",L.title=m.selector,L.textContent=m.selector||m.tagName;const C=document.createElement("input");C.type="text",C.className="beacon-pin-note-input",C.placeholder="Add a note (optional)",C.value=m.note??"",C.addEventListener("input",()=>{C.value.trim()?m.note=C.value:delete m.note}),x.appendChild(L),x.appendChild(C);const A=document.createElement("button");A.type="button",A.className="beacon-icon-btn",A.setAttribute("aria-label",`Remove pin ${m.number}`),A.appendChild(jn()),A.addEventListener("click",()=>w(m.number)),E.appendChild(b),E.appendChild(x),E.appendChild(A),s.appendChild(E)}}}function h(){c&&(a?(c.src=a,c.style.display="block"):(c.removeAttribute("src"),c.style.display="none"))}return{name:"domEle",setupOnce(m){return m.on("close",()=>l())},form(m){return{render:E=>(i=document.createElement("div"),i.className="beacon-pin-list-header",E.appendChild(i),s=document.createElement("div"),s.className="beacon-pin-list",E.appendChild(s),u=document.createElement("button"),u.type="button",u.className="beacon-btn secondary beacon-pin-annotate",u.addEventListener("click",()=>{g(m)}),E.appendChild(u),c=document.createElement("img"),c.className="beacon-thumb",c.alt="Annotated screenshot preview",c.style.display="none",E.appendChild(c),S(),h(),()=>{i=null,s=null,c=null,u=null})}},capture(){return n.length===0?null:{pins:n}}}}function We(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function Xe(e={}){return{name:"domSS",async capture(t){const n=qn();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const o=await t.requestMode("hide");try{await new Promise(i=>requestAnimationFrame(()=>i()));const a=Array.from(document.querySelectorAll("launch-kit-beacon")),r=await qe({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:a});try{const i=t.captured("domEle"),s=Vn(i),c={w:r.width,h:r.height,dpr:r.pixelRatio},u=e.accent??Wn();return{dataUrl:s.length>0?await Oe(r.dataUrl,s,c,u):r.dataUrl,mime:"image/jpeg"}}finally{r.dispose()}}finally{o()}}}}function Vn(e){if(!e||We(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function Wn(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}const Ye="beacon-no-capture",Ge="__lsBeaconMonitorChipPos",Xn="#10b981";function Yn(e){const t=e.accent??Xn,n=e.startedAt??Date.now(),o=document.createElement("div");o.className=`${Ye} beacon-monitor-overlay-frame`,o.setAttribute("aria-hidden","true"),o.style.setProperty("--beacon-monitor-accent",t),document.body.appendChild(o);const a=document.createElement("div");a.className=`${Ye} beacon-monitor-overlay-chip`,a.setAttribute("role","status"),a.setAttribute("aria-label","Recording — drag to move"),a.style.setProperty("--beacon-monitor-accent",t);const r=document.createElement("div");r.className="beacon-monitor-overlay-chip-row";const i=document.createElement("span");i.className="beacon-monitor-overlay-rec-dot",i.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className="beacon-monitor-overlay-rec-label",s.textContent="REC";const c=document.createElement("span");c.className="beacon-monitor-overlay-sep",c.setAttribute("aria-hidden","true"),c.textContent="·";const u=document.createElement("span");u.className="beacon-monitor-overlay-timer",u.textContent="00:00";const l=document.createElement("button");l.type="button",l.className="beacon-monitor-overlay-stop",l.textContent="Stop",l.setAttribute("aria-label","Stop monitoring"),r.appendChild(i),r.appendChild(s),r.appendChild(c),r.appendChild(u),r.appendChild(l),a.appendChild(r);const p=document.createElement("div");p.className="beacon-monitor-overlay-url",e.url?(p.textContent=e.url,p.title=e.url):p.style.display="none",a.appendChild(p),document.body.appendChild(a);const d=g()??f();S(w(d));function g(){try{const y=localStorage.getItem(Ge);if(!y)return null;const T=JSON.parse(y),_=typeof T.x=="number"?T.x:NaN,N=typeof T.y=="number"?T.y:NaN;return!Number.isFinite(_)||!Number.isFinite(N)?null:{x:_,y:N}}catch{return null}}function f(){const T=a.getBoundingClientRect().width||200;return{x:Math.max(8,Math.floor((window.innerWidth-T)/2)),y:16}}function w(y){const _=a.getBoundingClientRect(),N=_.width||200,ne=_.height||40,Dr=Math.max(8,window.innerWidth-N-8),Fr=Math.max(8,window.innerHeight-ne-8);return{x:Math.min(Math.max(8,y.x),Dr),y:Math.min(Math.max(8,y.y),Fr)}}function S(y){a.style.left=`${y.x}px`,a.style.top=`${y.y}px`}let h=!1,m=null,E={x:0,y:0};function b(y){if(y.target instanceof Element&&y.target.closest(".beacon-monitor-overlay-stop"))return;y.preventDefault(),h=!0,m=y.pointerId;try{a.setPointerCapture(y.pointerId)}catch{}a.setAttribute("data-dragging","true");const T=a.getBoundingClientRect();E={x:y.clientX-T.left,y:y.clientY-T.top}}function x(y){!h||y.pointerId!==m||S(w({x:y.clientX-E.x,y:y.clientY-E.y}))}function L(y){if(!h||y.pointerId!==m)return;h=!1,m=null,a.removeAttribute("data-dragging");try{a.releasePointerCapture(y.pointerId)}catch{}const T=a.getBoundingClientRect();try{localStorage.setItem(Ge,JSON.stringify({x:T.left,y:T.top}))}catch{}}a.addEventListener("pointerdown",b),a.addEventListener("pointermove",x),a.addEventListener("pointerup",L),a.addEventListener("pointercancel",L),l.addEventListener("click",y=>{y.stopPropagation(),e.onStop()});function C(){const y=a.getBoundingClientRect();S(w({x:y.left,y:y.top}))}window.addEventListener("resize",C);function A(){const y=Math.max(0,Math.floor((Date.now()-n)/1e3));u.textContent=Gn(y)}A();const R=window.setInterval(A,1e3);return{updateUrl(y){y?(p.textContent=y,p.title=y,p.style.display=""):p.style.display="none"},destroy(){window.clearInterval(R),window.removeEventListener("resize",C),a.removeEventListener("pointerdown",b),a.removeEventListener("pointermove",x),a.removeEventListener("pointerup",L),a.removeEventListener("pointercancel",L),o.remove(),a.remove()}}}function Gn(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return t>0?`${j(t)}:${j(n)}:${j(o)}`:`${j(n)}:${j(o)}`}function j(e){return e<10?`0${e}`:String(e)}const G=80,Kn='button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]',Jn=1024,Zn=5;function Qn(e,t){return e.length>t?e.slice(0,t):e}function ce(e){if(e.id)return`#${CSS.escape(e.id)}`;const t=[];let n=e;for(let o=0;o<5&&n;o++){const a=n.tagName.toLowerCase(),r=n.id?`#${CSS.escape(n.id)}`:"",i=n.classList.length>0?"."+Array.from(n.classList).slice(0,3).map(CSS.escape).join("."):"";if(t.unshift(`${a}${r}${i}`),r)break;n=n.parentElement}return t.join(" > ")}function K(e,t){if(!e)return;const n=e.replace(/\s+/g," ").trim();if(n)return n.length>t?n.slice(0,t):n}function Ke(e){const t=K(e.textContent,G),n=K(e.getAttribute("aria-label"),G),o=e.getAttribute("data-testid")||void 0,a=e.getAttribute("name")||void 0;let r=n||t;if(!r){const i=e.closest(Kn);i&&i!==e&&(r=K(i.getAttribute("aria-label"),G)||K(i.textContent,G))}return{tag:e.tagName.toLowerCase(),id:e.id||null,classes:Array.from(e.classList).slice(0,10),role:e.getAttribute("role"),selector:ce(e),...t?{text:t}:{},...n?{ariaLabel:n}:{},...o?{testid:o}:{},...a?{name:a}:{},...r&&r!==t?{label:r}:{}}}function eo(e,t){const n=[],o=document.querySelectorAll("body *");for(const a of Array.from(o)){const r=getComputedStyle(a);if(r.position!=="fixed"&&r.position!=="sticky")continue;const i=a.getBoundingClientRect();if(e<i.left||e>i.right||t<i.top||t>i.bottom)continue;const s=parseInt(r.zIndex,10);!Number.isFinite(s)&&r.zIndex!=="auto"||n.push({tag:a.tagName.toLowerCase(),zIndex:Number.isFinite(s)?s:0,pointerEvents:r.pointerEvents,classes:Array.from(a.classList).slice(0,5).join(" ")})}return n.sort((a,r)=>r.zIndex-a.zIndex).slice(0,Zn)}function to(e){const t=a=>r=>{const i=r,s=i.target;if(!(s instanceof Element))return;const c=i.clientX,u=i.clientY,l=document.elementFromPoint(c,u),p=l===s||(l?s.contains(l)||l.contains(s):!1),d=document.querySelectorAll('[role="dialog"][data-state="open"]').length,g=getComputedStyle(document.body).pointerEvents,f=p?[]:eo(c,u);e.emitClick({kind:a,target:Ke(s),hitMatchesTarget:p,...!p&&l instanceof Element?{hitTarget:Ke(l)}:{},coords:{x:c,y:u},openDialogs:d,bodyPointerEvents:g,...f.length>0?{overlaysAtPoint:f}:{}})},n=t("click"),o=t("mousedown");return document.addEventListener("click",n,{capture:!0,passive:!0}),document.addEventListener("mousedown",o,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",o,{capture:!0})}}function no(e){const t=history.pushState,n=history.replaceState;let o=window.location.href;const a=s=>{const c=window.location.href;if(c===o)return;const u=o;o=c,e.emitRoute({kind:"route",from:u,to:c,via:s})};history.pushState=function(...c){const u=t.apply(this,c);return a("pushState"),u},history.replaceState=function(...c){const u=n.apply(this,c);return a("replaceState"),u};const r=()=>a("popstate"),i=()=>a("hashchange");return window.addEventListener("popstate",r),window.addEventListener("hashchange",i),()=>{history.pushState=t,history.replaceState=n,window.removeEventListener("popstate",r),window.removeEventListener("hashchange",i)}}function oo(e){const t=new WeakSet,n=(a,r)=>{const i=ce(a);e.emitDialog({kind:"dialog",action:r,selector:i,state:a.getAttribute("data-state"),...r==="mount"?{outerHTML:Qn(a.outerHTML,Jn)}:{}})};for(const a of Array.from(document.querySelectorAll('[role="dialog"]')))t.add(a);const o=new MutationObserver(a=>{var r,i,s,c;for(const u of a){for(const l of Array.from(u.addedNodes)){if(!(l instanceof Element))continue;const p=(r=l.matches)!=null&&r.call(l,'[role="dialog"]')?[l]:Array.from(((i=l.querySelectorAll)==null?void 0:i.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)||(t.add(d),n(d,"mount"))}for(const l of Array.from(u.removedNodes)){if(!(l instanceof Element))continue;const p=(s=l.matches)!=null&&s.call(l,'[role="dialog"]')?[l]:Array.from(((c=l.querySelectorAll)==null?void 0:c.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)&&(t.delete(d),n(d,"unmount"))}u.type==="attributes"&&u.attributeName==="data-state"&&u.target instanceof Element&&u.target.getAttribute("role")==="dialog"&&n(u.target,"state")}});return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state"]}),()=>o.disconnect()}function ro(e){const t=n=>{const o=n.target;if(!(o instanceof HTMLFormElement))return;const a=[];for(const r of Array.from(o.elements)){if(!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))continue;const i=r.getAttribute("name")||"<unnamed>",s=r instanceof HTMLInputElement?r.type:r.tagName.toLowerCase();let c;r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?c=r.checked:c=!!r.value,a.push({name:i,type:s,hasValue:c})}e.emitSubmit({kind:"submit",form:{id:o.id||null,action:o.getAttribute("action")||null,method:(o.getAttribute("method")||"GET").toUpperCase(),selector:ce(o),fields:a}})};return document.addEventListener("submit",t,{capture:!0}),()=>document.removeEventListener("submit",t,{capture:!0})}function ao(e){const t=to(e),n=no(e),o=oo(e),a=ro(e);return{uninstall(){t(),n(),o(),a()}}}const le=1e3,Je=10*1024,Ze="[REDACTED]",Qe=new Set(["POST","PUT","PATCH","DELETE"]),io=[/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,/\bls_pat_[A-Za-z0-9_]+/g,/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g],so=/^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;function ue(e,t){return e.length>t?e.slice(0,t):e}function et(e){let t=e;for(const n of io)t=t.replace(n,Ze);return t}function de(e){if(e===null||typeof e!="object")return typeof e=="string"?et(e):e;if(Array.isArray(e))return e.map(de);const t={};for(const[n,o]of Object.entries(e))t[n]=so.test(n)?Ze:de(o);return t}function tt(e,t){if(t&&t.includes("application/json"))try{const n=JSON.parse(e);return JSON.stringify(de(n))}catch{}return et(e)}function J(e,t){const n=e.length,o={bodySize:n};return n>Je?(o.body=tt(e.slice(0,Je),t),o.bodyTruncated=!0):o.body=tt(e,t),t&&(o.contentType=t),o}function co(e,t){const n=t==null?void 0:t.body;if(n!=null){if(typeof n=="string")return n;if(n instanceof URLSearchParams)return n.toString();if(n instanceof FormData){const o=[];return n.forEach((a,r)=>{o.push(`${r}=${typeof a=="string"?`[${a.length}b]`:"[file]"}`)}),`[FormData] ${o.join("&")}`}return n instanceof Blob?`[Blob ${n.size}b ${n.type||"unknown"}]`:n instanceof ArrayBuffer?`[binary ${n.byteLength}b]`:ArrayBuffer.isView(n)?`[binary ${n.byteLength}b]`:null}return e instanceof Request,null}function lo(e,t){return!!((o=>o?o instanceof Headers?o.has("authorization"):Array.isArray(o)?o.some(([a])=>a.toLowerCase()==="authorization"):typeof o=="object"?Object.keys(o).some(a=>a.toLowerCase()==="authorization"):!1:!1)(t==null?void 0:t.headers)||e instanceof Request&&e.headers.has("authorization"))}function uo(e,t){return(o=>{if(o){if(o instanceof Headers)return o.get("content-type")||void 0;if(Array.isArray(o)){const a=o.find(([r])=>r.toLowerCase()==="content-type");return a?a[1]:void 0}if(typeof o=="object"){for(const[a,r]of Object.entries(o))if(a.toLowerCase()==="content-type")return r}}})(t==null?void 0:t.headers)??(e instanceof Request&&e.headers.get("content-type")||void 0)}function po(e,t,n){if(!Qe.has(n))return;const o=lo(e,t),a=co(e,t);if(a==null&&!o)return;const r=uo(e,t),i=a!=null?J(a,r):{};return o&&(i.hasAuth=!0),i}function fo(e){const t=window.fetch;if(typeof t!="function")return()=>{};const n=async(o,a)=>{const r=performance.now(),i=((a==null?void 0:a.method)??(o instanceof Request?o.method:"GET")).toUpperCase(),s=typeof o=="string"?o:o instanceof URL?o.toString():o.url,c=po(o,a,i);try{const u=await t.call(window,o,a),l=Math.round(performance.now()-r),p=u.status>=400;let d;if(p||e.verbose)try{const g=await u.clone().text(),f=u.headers.get("content-type")||void 0;d=J(g,f)}catch{}return(p||e.verbose)&&e.emit({kind:"fetch",url:ue(s,le),method:i,status:u.status,durationMs:l,failed:p,...c?{request:c}:{},...d?{response:d}:{}}),u}catch(u){const l=Math.round(performance.now()-r);throw e.emit({kind:"fetch",url:ue(s,le),method:i,status:0,durationMs:l,failed:!0,error:u instanceof Error?u.message:String(u),...c?{request:c}:{}}),u}};return n.__lsBeaconWrapped=!0,window.fetch=n,()=>{window.fetch.__lsBeaconWrapped&&(window.fetch=t)}}function mo(e){if(e==null)return null;if(typeof e=="string")return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((n,o)=>{t.push(`${o}=${typeof n=="string"?`[${n.length}b]`:"[file]"}`)}),`[FormData] ${t.join("&")}`}return e instanceof Blob?`[Blob ${e.size}b ${e.type||"unknown"}]`:e instanceof ArrayBuffer?`[binary ${e.byteLength}b]`:ArrayBuffer.isView(e)?`[binary ${e.byteLength}b]`:null}function ho(e){const t=XMLHttpRequest.prototype,n=t.open,o=t.send,a=t.setRequestHeader,r=new WeakMap;return t.open=function(s,c,...u){return r.set(this,{method:s.toUpperCase(),url:typeof c=="string"?c:c.toString(),start:0,hasAuth:!1}),n.call(this,s,c,...u)},t.setRequestHeader=function(s,c){const u=r.get(this);if(u){const l=s.toLowerCase();l==="authorization"?u.hasAuth=!0:l==="content-type"&&(u.requestContentType=c)}return a.call(this,s,c)},t.send=function(s){const c=r.get(this);if(c)if(c.start=performance.now(),Qe.has(c.method)){const l=mo(s);l!=null?c.request=J(l,c.requestContentType):c.request={},c.hasAuth&&(c.request.hasAuth=!0)}else c.hasAuth&&(c.request={hasAuth:!0});const u=()=>{this.removeEventListener("loadend",u);const l=r.get(this);if(!l)return;const p=Math.round(performance.now()-l.start),d=this.status===0||this.status>=400;let g;if((d||e.verbose)&&this.status>0)try{const f=this.responseType===""||this.responseType==="text"?this.responseText:"";if(f){const w=this.getResponseHeader("content-type")||void 0;g=J(f,w)}}catch{}(d||e.verbose)&&e.emit({kind:"xhr",url:ue(l.url,le),method:l.method,status:this.status,durationMs:p,failed:d,...l.request?{request:l.request}:{},...g?{response:g}:{}}),r.delete(this)};return this.addEventListener("loadend",u),o.call(this,s)},()=>{t.open=n,t.send=o,t.setRequestHeader=a}}function bo(e){const t=fo(e),n=ho(e);return{uninstall(){t(),n()}}}const go=1e3,nt=50,yo=500;class wo{constructor(t){this.buffer=[],this.inflight=!1,this.timer=null,this.destroyed=!1,this.handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this.flushSync()},this.url=t.url,this.sessionId=t.sessionId,this.onError=t.onError,this.timer=setInterval(()=>{this.flush()},go),this.pagehideHandler=()=>this.flushSync(),window.addEventListener("pagehide",this.pagehideHandler),document.addEventListener("visibilitychange",this.handleVisibilityChange)}enqueue(t){this.destroyed||(this.buffer.push(t),this.buffer.length>yo&&this.buffer.shift(),this.buffer.length>=nt&&this.flush())}async flush(){var o,a;if(this.destroyed||this.inflight||this.buffer.length===0)return;const t=this.buffer.splice(0,nt),n=this.makeBatch(t);this.inflight=!0;try{const r=await fetch(this.url,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0});r.ok||(o=this.onError)==null||o.call(this,new Error(`monitor flush: HTTP ${r.status}`))}catch(r){(a=this.onError)==null||a.call(this,r instanceof Error?r:new Error(String(r)))}finally{this.inflight=!1}}flushSync(){if(this.destroyed||this.buffer.length===0)return;if(!navigator.sendBeacon){this.flush();return}const t=this.buffer.splice(0),n=this.makeBatch(t),o=new Blob([JSON.stringify(n)],{type:"application/json"});try{navigator.sendBeacon(this.url,o)}catch{}}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.flushSync())}makeBatch(t){return{sessionId:this.sessionId,events:t,meta:{url:window.location.href,userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},v:1}}}}const pe="__lsBeaconMonitorUrl",ot="__lsBeaconMonitorSession",fe="__lsBeaconMonitorVerbose",me="__lsBeaconMonitorDeadline",rt=30*6e4,at=4096;let v=null;const he=new Set;function vo(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function xo(e){const t=new WeakSet,n=o=>{if(o===null||typeof o!="object")return typeof o=="string"&&o.length>at?o.slice(0,at):o;if(t.has(o))return"[cyclic]";if(t.add(o),Array.isArray(o))return o.map(n);const a={};for(const r of Object.keys(o).slice(0,50))try{a[r]=n(o[r])}catch{a[r]="[unreadable]"}return a};try{return n(e)}catch{return"[unserialisable]"}}function be(){for(const e of he)try{e(v!==null,(v==null?void 0:v.url)??null)}catch{}}function Eo(e){return v?(v.seq+=1,{...e,ts:Date.now(),sessionId:v.sessionId,seq:v.seq}):{...e,ts:Date.now(),sessionId:"",seq:0}}function O(e){if(!v)return;const t=Eo(e);v.transport.enqueue(t)}function So(){if(v)try{sessionStorage.setItem(pe,v.url),sessionStorage.setItem(ot,v.sessionId),sessionStorage.setItem(fe,v.verbose?"1":"0"),sessionStorage.setItem(me,String(v.deadlineMs))}catch{}}function it(){try{sessionStorage.removeItem(pe),sessionStorage.removeItem(ot),sessionStorage.removeItem(fe),sessionStorage.removeItem(me)}catch{}}function Co(){try{const e=sessionStorage.getItem(pe);if(!e)return null;const t=sessionStorage.getItem(fe)==="1",n=sessionStorage.getItem(me),o=n?Number(n):Date.now()+rt;return Number.isFinite(o)&&o<=Date.now()?(it(),null):{url:e,verbose:t,deadlineMs:o}}catch{return null}}function st(e){v&&(v.seq+=1,v.transport.enqueue({kind:e.kind,ts:e.ts,sessionId:v.sessionId,seq:v.seq,message:e.message,...e.stack?{stack:e.stack}:{},...e.source?{source:e.source}:{},...typeof e.line=="number"?{line:e.line}:{},...typeof e.col=="number"?{col:e.col}:{}}))}function ge(e){if(v&&V(),!e.url)return;const t=e.maxSessionMs??rt,n=Date.now()+t,o=vo(),a=!!e.verbose,r=new wo({url:e.url,sessionId:o,onError:f=>{console.warn("[launch-kit-beacon] monitor transport error:",f.message)}}),i=Pe(),s=i.install(),c=i.snapshot();for(const f of c)st(f);let u=c.length;const l=i.subscribe(()=>{if(!v)return;const f=v.errorsBuffer.snapshot();for(;v.drainedThrough<f.length;){const w=f[v.drainedThrough];w&&st(w),v.drainedThrough+=1}}),p=bo({emit:f=>O(f),verbose:a}),d=ao({emitClick:f=>O(f),emitRoute:f=>O(f),emitDialog:f=>O(f),emitSubmit:f=>O(f)}),g=setTimeout(()=>{console.info("[launch-kit-beacon] monitor session expired (max duration reached)"),V()},Math.max(0,n-Date.now()));v={url:e.url,sessionId:o,verbose:a,deadlineMs:n,seq:0,transport:r,errorsBuffer:i,uninstallNetwork:p.uninstall,uninstallDom:d.uninstall,uninstallErrors:s,errorsUnsub:l,deadlineTimer:g,drainedThrough:u},So(),be()}function V(){ct(),it(),be()}function Ao(){v&&(ct(),be())}function ct(){v&&(clearTimeout(v.deadlineTimer),v.errorsUnsub(),v.uninstallErrors(),v.uninstallNetwork(),v.uninstallDom(),v.transport.destroy(),v=null)}function ko(e,t){v&&O({kind:"probe",label:e.slice(0,200),data:xo(t)})}function ye(){return v!==null}function we(){return(v==null?void 0:v.url)??null}function lt(e){return he.add(e),()=>{he.delete(e)}}function Lo(){if(v||typeof window>"u")return;const e=Co();e&&ge({url:e.url,verbose:e.verbose,maxSessionMs:Math.max(6e4,e.deadlineMs-Date.now())})}function To(e={}){let t=null,n=null,o="",a=null;function r(){a||(a=Yn({onStop:()=>V(),url:we()}))}function i(){if(a){try{a.destroy()}catch{}a=null}}function s(){if(!t)return;t.innerHTML="";const l=document.createElement("div");l.className="beacon-monitor-title",l.textContent="Monitor — paste a stream URL",t.appendChild(l);const p=document.createElement("div");p.className="beacon-monitor-row";const d=document.createElement("input");d.type="url",d.className="beacon-monitor-input",d.placeholder="http://localhost:9876/m/…",d.value=o,d.autocomplete="off",d.spellcheck=!1,p.appendChild(d);const g=document.createElement("button");g.type="button",g.className="beacon-monitor-btn",g.textContent="Start",g.disabled=!o.trim(),p.appendChild(g),t.appendChild(p);const f=document.createElement("label");f.className="beacon-monitor-verbose";const w=document.createElement("input");w.type="checkbox",w.dataset.role="verbose",f.appendChild(w),f.appendChild(document.createTextNode(" verbose (capture successful network too)")),t.appendChild(f);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Streams clicks, failed network, errors, route + dialog changes.",t.appendChild(S),d.addEventListener("input",()=>{o=d.value,g.disabled=!d.value.trim()}),g.addEventListener("click",()=>{const h=d.value.trim();if(h){try{new URL(h)}catch{d.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"),d.reportValidity();return}d.setCustomValidity(""),ge({url:h,verbose:w.checked,...e.maxSessionMs!==void 0?{maxSessionMs:e.maxSessionMs}:{}})}})}function c(){if(!t)return;t.innerHTML="";const l=we()??"",p=document.createElement("div");p.className="beacon-monitor-title";const d=document.createElement("span");d.className="beacon-monitor-rec",d.setAttribute("aria-hidden","true"),p.appendChild(d),p.appendChild(document.createTextNode(" Monitor — recording")),t.appendChild(p);const g=document.createElement("div");g.className="beacon-monitor-active-url",g.title=l,g.textContent=l,t.appendChild(g);const f=document.createElement("div");f.className="beacon-monitor-row";const w=document.createElement("button");w.type="button",w.className="beacon-monitor-btn stop",w.textContent="Stop monitoring",w.addEventListener("click",()=>V()),f.appendChild(w),t.appendChild(f);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Events stream to the URL above. Auto-stops after 30 min.",t.appendChild(S)}function u(){ye()?c():s()}return{name:"liveMonitor",setupOnce(l){Lo(),ye()&&r();const p=lt((g,f)=>{g?(r(),a==null||a.updateUrl(f)):i()}),d=()=>{i(),p();try{Ao()}catch{}};l.signal.addEventListener("abort",d,{once:!0})},form(){return{render:l=>(t=document.createElement("div"),t.className="beacon-monitor",l.appendChild(t),u(),n=lt(()=>u()),()=>{n==null||n(),n=null,t=null})}}}}let M=null;const ve={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function Ro(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Te(),dt();const t={...Xt(),...e.labels??{}},n=new AbortController,o=_o(e),a=e.position??"bottom-right",r=e.theme??"auto";It(),No(e,a,r);const i=document.querySelector(U);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=Yt(i.shadow),c=new Wt(t,["bug","idea","ux","a11y"],{onSubmit:()=>{Fo()},onClose:p=>{Z("close",{}),p==="user"&&mt()}});i.shadow.appendChild(c.root),i.classList.add("beacon-no-capture");const u=Ot(o),l={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:o,registry:u,dialog:c,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||Do(),healthIndicator:e.healthIndicator??"never",position:a,theme:r,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};M=l,i.onTriggerClick=()=>ut(),u.install(p=>ft(p),p=>xe(p)),W("ready",{ready:!0}),l.debug&&console.info("[beacon] ready",l.endpoint)}function ut(){const e=M;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=ft(t.name);let o;try{o=t.form(n)}catch(a){return xe({plugin:t.name,error:a instanceof Error?a:new Error(String(a)),at:"form"}),null}return{name:t.name,form:o,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var o;return(o=e.formValues[t])==null?void 0:o[n]},set:(t,n,o)=>{var r;const a=(r=e.formValues)[t]??(r[t]={});a[n]=o}}),e.dialog.open(),Z("open",{})))}function Mo(){const e=M;e&&e.dialog.close("user")}function dt(){var t;const e=M;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),F();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,M=null}}function Po(){const e=M;return e?{ready:!0,transport:"idle",plugins:e.registry.status()}:{ready:!1,transport:"idle",plugins:{}}}function Io(e,t){return ve[e].add(t),()=>pt(e,t)}function pt(e,t){ve[e].delete(t)}function No(e,t,n){let o=document.querySelector(U);if(!o){o=document.createElement(U),o.setAttribute("position",t),o.setAttribute("theme",n),t==="hidden"&&(o.style.position="absolute",o.style.left="-9999px"),(document.body??document.documentElement).appendChild(o);return}e.position!==void 0&&o.setAttribute("position",t),e.theme!==void 0&&o.setAttribute("theme",n)}function _o(e){return e.plugins?e.plugins:e.defaultPlugins===!1?[]:$o()}function $o(){return[Re(),Ie(),Ve(),Xe()]}function Do(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function ft(e){const t=M;return Dt(e,{getCaptured:o=>t==null?void 0:t.capturedEntries[o],getFormValues:o=>{var a;return t?(a=t.formValues)[o]??(a[o]={}):{}},getCaptureSignal:()=>{var o;return(o=t==null?void 0:t.currentSubmit)==null?void 0:o.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async o=>t?t.dialog.requestMode(o):()=>{},overlay:o=>t?Gt(t.overlayHost,o.render):()=>{},onLifecycle:(o,a)=>{if(!t)return()=>{};const r=t.lifecycleHandlers[o];return r.add(a),()=>r.delete(a)}})}function Z(e,t){const n=M;if(n)for(const o of n.lifecycleHandlers[e])try{o(t)}catch(a){n.debug&&console.error("[beacon] lifecycle handler threw:",a)}}function W(e,t){for(const n of ve[e])try{n(t)}catch(o){M!=null&&M.debug&&console.error("[beacon] system handler threw:",o)}}function xe(e){W("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=M;t&&((t.healthIndicator==="always"||t.healthIndicator==="dev"&&t.debug)&&t.hostElement.setHealthIndicator(!0),t.debug&&console.warn(`[beacon] plugin "${e.plugin}" ${e.at} failed:`,e.error))}function mt(){const e=M;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function Fo(){const e=M;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const o=await e.registry.capture(s=>e.capturedEntries[s],s=>xe(s));e.capturedEntries=o,n=Oo(e,t,o);let a=null;if(Z("beforeSubmit",{payload:n,cancel:s=>{a===null&&(a=s)}}),a!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${a}`,"error");return}e.dialog.setStatus("Sending…");const i=await Ut(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);Z("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(W("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{M===e&&e.dialog.close("submitted"),mt()},1500)):(W("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(o){e.dialog.setSubmitting(!1);const a=o instanceof Error?o:new Error(String(o));n&&W("submit:error",{payload:n,error:a}),e.dialog.setStatus(`Failed: ${a.message}`,"error")}finally{e.currentSubmit=null}}function Oo(e,t,n){var r;const o=Ho(),a=(r=e.context)==null?void 0:r.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:o,...a?{context:a}:{},plugins:n}}function Ho(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Te();function Bo(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),o=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(a),t&&(o.href=t),a.href=e,a.href}const Uo=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function $(e){const t=[];for(let n=0,o=e.length;n<o;n++)t.push(e[n]);return t}let H=null;function ht(e={}){return H||(e.includeStyleProperties?(H=e.includeStyleProperties,H):(H=$(window.getComputedStyle(document.documentElement)),H))}function Q(e,t){const o=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return o?parseFloat(o.replace("px","")):0}function zo(e){const t=Q(e,"border-left-width"),n=Q(e,"border-right-width");return e.clientWidth+t+n}function qo(e){const t=Q(e,"border-top-width"),n=Q(e,"border-bottom-width");return e.clientHeight+t+n}function Ee(e,t={}){const n=t.width||zo(e),o=t.height||qo(e);return{width:n,height:o}}function jo(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function Vo(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Wo(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const o=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=o.length,r=new Uint8Array(a);for(let i=0;i<a;i+=1)r[i]=o.charCodeAt(i);n(new Blob([r],{type:t.type?t.type:"image/png"}))})}function ee(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>t(o))})},o.onerror=n,o.crossOrigin="anonymous",o.decoding="async",o.src=e})}async function Xo(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yo(e,t,n){const o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),r=document.createElementNS(o,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),a.appendChild(r),r.appendChild(e),Xo(a)}const P=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||P(n,t)};function Go(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ko(e,t){return ht(t).map(n=>{const o=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${o}${a?" !important":""};`}).join(" ")}function Jo(e,t,n,o){const a=`.${e}:${t}`,r=n.cssText?Go(n):Ko(n,o);return document.createTextNode(`${a}{${r}}`)}function bt(e,t,n,o){const a=window.getComputedStyle(e,n),r=a.getPropertyValue("content");if(r===""||r==="none")return;const i=Uo();try{t.className=`${t.className} ${i}`}catch{return}const s=document.createElement("style");s.appendChild(Jo(i,n,a,o)),t.appendChild(s)}function Zo(e,t,n){bt(e,t,":before",n),bt(e,t,":after",n)}const gt="application/font-woff",yt="image/jpeg",Qo={woff:gt,woff2:gt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yt,jpeg:yt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Se(e){const t=er(e).toLowerCase();return Qo[t]||""}function tr(e){return e.split(/,/)[1]}function Ce(e){return e.search(/^(data:)/)!==-1}function nr(e,t){return`data:${t};base64,${e}`}async function wt(e,t,n){const o=await fetch(e,t);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const a=await o.blob();return new Promise((r,i)=>{const s=new FileReader;s.onerror=i,s.onloadend=()=>{try{r(n({res:o,result:s.result}))}catch(c){i(c)}},s.readAsDataURL(a)})}const Ae={};function or(e,t,n){let o=e.replace(/\?.*/,"");return n&&(o=e),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),t?`[${t}]${o}`:o}async function ke(e,t,n){const o=or(e,t,n.includeQueryParams);if(Ae[o]!=null)return Ae[o];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const r=await wt(e,n.fetchRequestInit,({res:i,result:s})=>(t||(t=i.headers.get("Content-Type")||""),tr(s)));a=nr(r,t)}catch(r){a=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;r&&(i=typeof r=="string"?r:r.message),i&&console.warn(i)}return Ae[o]=a,a}async function rr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ee(t)}async function ar(e,t){if(e.currentSrc){const r=document.createElement("canvas"),i=r.getContext("2d");r.width=e.clientWidth,r.height=e.clientHeight,i==null||i.drawImage(e,0,0,r.width,r.height);const s=r.toDataURL();return ee(s)}const n=e.poster,o=Se(n),a=await ke(n,o,t);return ee(a)}async function ir(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await te(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function sr(e,t){return P(e,HTMLCanvasElement)?rr(e):P(e,HTMLVideoElement)?ar(e,t):P(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(vt(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",vt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function lr(e,t,n){var o,a;if(vt(t))return t;let r=[];return cr(e)&&e.assignedNodes?r=$(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((o=e.contentDocument)===null||o===void 0)&&o.body)?r=$(e.contentDocument.body.childNodes):r=$(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),r.length===0||P(e,HTMLVideoElement)||await r.reduce((i,s)=>i.then(()=>te(s,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function ur(e,t,n){const o=t.style;if(!o)return;const a=window.getComputedStyle(e);a.cssText?(o.cssText=a.cssText,o.transformOrigin=a.transformOrigin):ht(n).forEach(r=>{let i=a.getPropertyValue(r);r==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&r==="display"&&i==="inline"&&(i="block"),r==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),o.setProperty(r,i,a.getPropertyPriority(r))})}function dr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function pr(e,t){if(P(e,HTMLSelectElement)){const n=t,o=Array.from(n.children).find(a=>e.value===a.getAttribute("value"));o&&o.setAttribute("selected","")}}function fr(e,t,n){return P(t,Element)&&(ur(e,t,n),Zo(e,t,n),dr(e,t),pr(e,t)),t}async function mr(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const o={};for(let r=0;r<n.length;r++){const s=n[r].getAttribute("xlink:href");if(s){const c=e.querySelector(s),u=document.querySelector(s);!c&&u&&!o[s]&&(o[s]=await te(u,t,!0))}}const a=Object.values(o);if(a.length){const r="http://www.w3.org/1999/xhtml",i=document.createElementNS(r,"svg");i.setAttribute("xmlns",r),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(r,"defs");i.appendChild(s);for(let c=0;c<a.length;c++)s.appendChild(a[c]);e.appendChild(i)}return e}async function te(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(o=>sr(o,t)).then(o=>lr(e,o,t)).then(o=>fr(e,o,t)).then(o=>mr(o,t))}const xt=/url\((['"]?)([^'"]+?)\1\)/g,hr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,br=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function yr(e){const t=[];return e.replace(xt,(n,o,a)=>(t.push(a),n)),t.filter(n=>!Ce(n))}async function wr(e,t,n,o,a){try{const r=n?Bo(t,n):t,i=Se(t);let s;return a||(s=await ke(r,i,o)),e.replace(gr(t),`$1${s}$3`)}catch{}return e}function vr(e,{preferredFontFormat:t}){return t?e.replace(br,n=>{for(;;){const[o,,a]=hr.exec(n)||[];if(!a)return"";if(a===t)return`src: ${o};`}}):e}function Et(e){return e.search(xt)!==-1}async function St(e,t,n){if(!Et(e))return e;const o=vr(e,n);return yr(o).reduce((r,i)=>r.then(s=>wr(s,i,t,n)),Promise.resolve(o))}async function B(e,t,n){var o;const a=(o=t.style)===null||o===void 0?void 0:o.getPropertyValue(e);if(a){const r=await St(a,null,n);return t.style.setProperty(e,r,t.style.getPropertyPriority(e)),!0}return!1}async function xr(e,t){await B("background",e,t)||await B("background-image",e,t),await B("mask",e,t)||await B("-webkit-mask",e,t)||await B("mask-image",e,t)||await B("-webkit-mask-image",e,t)}async function Er(e,t){const n=P(e,HTMLImageElement);if(!(n&&!Ce(e.src))&&!(P(e,SVGImageElement)&&!Ce(e.href.baseVal)))return;const o=n?e.src:e.href.baseVal,a=await ke(o,Se(o),t);await new Promise((r,i)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...c)=>{try{r(t.onImageErrorHandler(...c))}catch(u){i(u)}}:i;const s=e;s.decode&&(s.decode=r),s.loading==="lazy"&&(s.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Sr(e,t){const o=$(e.childNodes).map(a=>Ct(a,t));await Promise.all(o).then(()=>e)}async function Ct(e,t){P(e,Element)&&(await xr(e,t),await Er(e,t),await Sr(e,t))}function Cr(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const o=t.style;return o!=null&&Object.keys(o).forEach(a=>{n[a]=o[a]}),e}const At={};async function kt(e){let t=At[e];if(t!=null)return t;const o=await(await fetch(e)).text();return t={url:e,cssText:o},At[e]=t,t}async function Lt(e,t){let n=e.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(o,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),wt(s,t.fetchRequestInit,({result:c})=>(n=n.replace(i,`url(${c})`),[i,c]))});return Promise.all(r).then(()=>n)}function Tt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let o=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=a.exec(o);if(c===null)break;t.push(c[0])}o=o.replace(a,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let c=r.exec(o);if(c===null){if(c=s.exec(o),c===null)break;r.lastIndex=s.lastIndex}else s.lastIndex=r.lastIndex;t.push(c[0])}return t}async function Ar(e,t){const n=[],o=[];return e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach((r,i)=>{if(r.type===CSSRule.IMPORT_RULE){let s=i+1;const c=r.href,u=kt(c).then(l=>Lt(l,t)).then(l=>Tt(l).forEach(p=>{try{a.insertRule(p,p.startsWith("@import")?s+=1:a.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:p,error:d})}})).catch(l=>{console.error("Error loading remote css",l.toString())});o.push(u)}})}catch(r){const i=e.find(s=>s.href==null)||document.styleSheets[0];a.href!=null&&o.push(kt(a.href).then(s=>Lt(s,t)).then(s=>Tt(s).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",r)}}),Promise.all(o).then(()=>(e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${a.href}`,r)}}),n))}function kr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Et(t.style.getPropertyValue("src")))}async function Lr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=$(e.ownerDocument.styleSheets),o=await Ar(n,t);return kr(o)}function Rt(e){return e.trim().replace(/["']/g,"")}function Tr(e){const t=new Set;function n(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(r=>{t.add(Rt(r))}),Array.from(o.children).forEach(r=>{r instanceof HTMLElement&&n(r)})}return n(e),t}async function Mt(e,t){const n=await Lr(e,t),o=Tr(e);return(await Promise.all(n.filter(r=>o.has(Rt(r.style.fontFamily))).map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return St(r.cssText,i,t)}))).join(`
722
+ `)}async function Rr(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Mt(e,t);if(n){const o=document.createElement("style"),a=document.createTextNode(n);o.appendChild(a),e.firstChild?e.insertBefore(o,e.firstChild):e.appendChild(o)}}async function Pt(e,t={}){const{width:n,height:o}=Ee(e,t),a=await te(e,t,!0);return await Rr(a,t),await Ct(a,t),Cr(a,t),await Yo(a,n,o)}async function X(e,t={}){const{width:n,height:o}=Ee(e,t),a=await Pt(e,t),r=await ee(a),i=document.createElement("canvas"),s=i.getContext("2d"),c=t.pixelRatio||jo(),u=t.canvasWidth||n,l=t.canvasHeight||o;return i.width=u*c,i.height=l*c,t.skipAutoScale||Vo(i),i.style.width=`${u}`,i.style.height=`${l}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(r,0,0,i.width,i.height),i}async function Mr(e,t={}){const{width:n,height:o}=Ee(e,t);return(await X(e,t)).getContext("2d").getImageData(0,0,n,o).data}async function Pr(e,t={}){return(await X(e,t)).toDataURL()}async function Ir(e,t={}){return(await X(e,t)).toDataURL("image/jpeg",t.quality||1)}async function Nr(e,t={}){const n=await X(e,t);return await Wo(n)}async function _r(e,t={}){return Mt(e,t)}const $r=Object.freeze(Object.defineProperty({__proto__:null,getFontEmbedCSS:_r,toBlob:Nr,toCanvas:X,toJpeg:Ir,toPixelData:Mr,toPng:Pr,toSvg:Pt},Symbol.toStringTag,{value:"Module"}));k.currentMonitorUrl=we,k.destroy=dt,k.domEle=Ve,k.domSS=Xe,k.errors=Ie,k.hide=Mo,k.init=Ro,k.isMonitorActive=ye,k.isPluginFailure=We,k.liveMonitor=To,k.metadata=Re,k.off=pt,k.on=Io,k.probe=ko,k.show=ut,k.startMonitor=ge,k.status=Po,k.stopMonitor=V,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
723
723
  //# sourceMappingURL=beacon.umd.js.map