@qaiddev/thumbs-embed 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -12
- package/dist/bootstrap.d.ts +4 -2
- package/dist/chunks/{loader-DHtXHt1z.js → loader-XbJ2b8KE.js} +204 -158
- package/dist/chunks/{loader-DHtXHt1z.js.map → loader-XbJ2b8KE.js.map} +1 -1
- package/dist/chunks/{modal-CTbqN-h9.js → modal-XxYobTKE.js} +2 -2
- package/dist/chunks/{modal-CTbqN-h9.js.map → modal-XxYobTKE.js.map} +1 -1
- package/dist/index.js +381 -335
- package/dist/index.js.map +1 -1
- package/dist/loader.js +1 -1
- package/dist/qaid.umd.cjs +14 -14
- package/dist/qaid.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
const V = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
2
2
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"/>
|
|
3
|
-
</svg>`,
|
|
3
|
+
</svg>`, U = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
4
4
|
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.737 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.095c.5 0 .905-.405.905-.905 0-.714.211-1.412.608-2.006L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"/>
|
|
5
|
-
</svg>`,
|
|
5
|
+
</svg>`, re = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
6
6
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"/>
|
|
7
|
-
</svg>`,
|
|
7
|
+
</svg>`, St = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
8
8
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 10h8M8 14h5m-9 6l3.5-3.5H18a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v14z"/>
|
|
9
|
-
</svg>`,
|
|
9
|
+
</svg>`, de = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
10
10
|
<rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
|
|
11
|
-
</svg>`,
|
|
11
|
+
</svg>`, ce = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
12
12
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 19L19 5m0 0h-8m8 0v8"/>
|
|
13
|
-
</svg>`,
|
|
13
|
+
</svg>`, le = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
14
14
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/>
|
|
15
|
-
</svg>`,
|
|
15
|
+
</svg>`, he = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
16
16
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3s6 6.4 6 10a6 6 0 01-12 0c0-3.6 6-10 6-10z"/>
|
|
17
|
-
</svg>`,
|
|
17
|
+
</svg>`, ue = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
18
18
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 14L4 9l5-5M4 9h11a5 5 0 010 10h-4"/>
|
|
19
|
-
</svg>`,
|
|
19
|
+
</svg>`, Et = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
20
20
|
<path stroke-linecap="round" stroke-linejoin="round" d="M20 6L9 17l-5-5"/>
|
|
21
|
-
</svg>`,
|
|
21
|
+
</svg>`, pe = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
22
22
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v8m0 4h.01"/>
|
|
23
|
-
</svg>`,
|
|
23
|
+
</svg>`, fe = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
24
24
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6L6 18"/>
|
|
25
|
-
</svg>`, ae = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}:where(button.qaid-btn-structural)>svg:where(:not(.qaid-icon):not([width])){width:var(--qaid-icon-size, 24px);height:var(--qaid-icon-size, 24px)}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:var(--qaid-font-size, 16px);font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6365f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875)}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:var(--qaid-font-size, 16px);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:calc(var(--qaid-font-size, 16px) * .75);font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .875);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-error{margin:0 0 .75rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;color:light-dark(#b91c1c,#fca5a5)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .8125);line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .8125);font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6365f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6365f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}.qaid-confirm{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:.5rem 0}.qaid-confirm-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:9999px;color:#fff;background:var(--qaid-success, #22c55e);margin-bottom:.25rem;animation:qaid-confirm-pop .28s cubic-bezier(.34,1.56,.64,1)}.qaid-confirm-icon .qaid-icon{width:24px;height:24px}.qaid-confirm-error .qaid-confirm-icon{background:var(--qaid-error, #dc2626)}.qaid-confirm-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:600;color:var(--qaid-text, light-dark(#111827, #f9fafb))}.qaid-confirm-title:focus-visible{outline:2px solid var(--qaid-primary, #6365f1);outline-offset:3px;border-radius:4px}.qaid-confirm-message{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875);color:var(--qaid-text-muted, light-dark(#6b7280, #9ca3af))}.qaid-confirm .qaid-confirm-close{margin-top:.5rem;min-width:96px}@keyframes qaid-confirm-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.qaid-confirm-icon{animation:none}}", re = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
|
|
25
|
+
</svg>`, me = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}:where(button.qaid-btn-structural)>svg:where(:not(.qaid-icon):not([width])){width:var(--qaid-icon-size, 24px);height:var(--qaid-icon-size, 24px)}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:var(--qaid-font-size, 16px);font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6365f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875)}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:var(--qaid-font-size, 16px);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:calc(var(--qaid-font-size, 16px) * .75);font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .875);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-error{margin:0 0 .75rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;color:light-dark(#b91c1c,#fca5a5)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .8125);line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .8125);font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6365f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6365f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}.qaid-confirm{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:.5rem 0}.qaid-confirm-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:9999px;color:#fff;background:var(--qaid-success, #22c55e);margin-bottom:.25rem;animation:qaid-confirm-pop .28s cubic-bezier(.34,1.56,.64,1)}.qaid-confirm-icon .qaid-icon{width:24px;height:24px}.qaid-confirm-error .qaid-confirm-icon{background:var(--qaid-error, #dc2626)}.qaid-confirm-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:600;color:var(--qaid-text, light-dark(#111827, #f9fafb))}.qaid-confirm-title:focus-visible{outline:2px solid var(--qaid-primary, #6365f1);outline-offset:3px;border-radius:4px}.qaid-confirm-message{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875);color:var(--qaid-text-muted, light-dark(#6b7280, #9ca3af))}.qaid-confirm .qaid-confirm-close{margin-top:.5rem;min-width:96px}@keyframes qaid-confirm-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.qaid-confirm-icon{animation:none}}", be = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
|
|
26
26
|
let D = 0;
|
|
27
|
-
const
|
|
27
|
+
const ge = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6365f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", ve = {
|
|
28
28
|
small: 36,
|
|
29
29
|
medium: 48,
|
|
30
30
|
large: 64
|
|
31
|
-
},
|
|
31
|
+
}, ye = {
|
|
32
32
|
small: 18,
|
|
33
33
|
medium: 24,
|
|
34
34
|
large: 32
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function we(i, t, e) {
|
|
37
37
|
const [o, n, s] = [i, t, e].map((a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4)));
|
|
38
38
|
return 0.2126 * o + 0.7152 * n + 0.0722 * s;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ke(i) {
|
|
41
41
|
if (i.startsWith("#")) {
|
|
42
42
|
const e = i.slice(1), o = e.length === 3 ? e.split("").map((s) => s + s).join("") : e, n = parseInt(o, 16);
|
|
43
43
|
return {
|
|
@@ -53,11 +53,11 @@ function ue(i) {
|
|
|
53
53
|
b: parseInt(t[3])
|
|
54
54
|
} : null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const t =
|
|
58
|
-
return t &&
|
|
56
|
+
function xe(i) {
|
|
57
|
+
const t = ke(i);
|
|
58
|
+
return t && we(t.r, t.g, t.b) > 0.4 ? "black" : "white";
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function qe(i = {}) {
|
|
61
61
|
const {
|
|
62
62
|
positiveColor: t = "rgb(0, 200, 83)",
|
|
63
63
|
negativeColor: e = "rgb(255, 0, 0)",
|
|
@@ -67,7 +67,7 @@ function fe(i = {}) {
|
|
|
67
67
|
backdropOpacity: a = 0.3,
|
|
68
68
|
fontFamily: c = "system-ui, -apple-system, sans-serif",
|
|
69
69
|
fontSize: l = 16
|
|
70
|
-
} = i, d =
|
|
70
|
+
} = i, d = ve[n], r = ye[n], h = xe(o);
|
|
71
71
|
return {
|
|
72
72
|
"--qaid-positive": t,
|
|
73
73
|
"--qaid-negative": e,
|
|
@@ -81,22 +81,22 @@ function fe(i = {}) {
|
|
|
81
81
|
"--qaid-font-size": `${l}px`
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ce(i, t) {
|
|
85
85
|
for (const [e, o] of Object.entries(t))
|
|
86
86
|
i.style.setProperty(e, o);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function at() {
|
|
89
|
+
return me + ge;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Se() {
|
|
92
92
|
if (D++, D > 1) return;
|
|
93
93
|
const i = document.createElement("style");
|
|
94
|
-
i.id = "qaid-styles", i.textContent =
|
|
94
|
+
i.id = "qaid-styles", i.textContent = be, document.head.appendChild(i);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Ee() {
|
|
97
97
|
D <= 0 || (D--, D === 0 && document.getElementById("qaid-styles")?.remove());
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const rt = "data-qaid-a11y-live", Te = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", Ae = [
|
|
100
100
|
"a[href]",
|
|
101
101
|
"button",
|
|
102
102
|
"input",
|
|
@@ -104,25 +104,25 @@ const it = "data-qaid-a11y-live", ve = "position:absolute;width:1px;height:1px;m
|
|
|
104
104
|
"select",
|
|
105
105
|
"[tabindex]"
|
|
106
106
|
].join(",");
|
|
107
|
-
function
|
|
107
|
+
function Ie(i) {
|
|
108
108
|
return i.ownerDocument || document;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Le(i, t) {
|
|
111
111
|
const e = t ? "assertive" : "polite", o = i.querySelector(
|
|
112
|
-
`[${
|
|
112
|
+
`[${rt}="${e}"]`
|
|
113
113
|
);
|
|
114
114
|
if (o) return o;
|
|
115
|
-
const s =
|
|
116
|
-
return s.setAttribute(
|
|
115
|
+
const s = Ie(i).createElement("div");
|
|
116
|
+
return s.setAttribute(rt, e), s.setAttribute("role", t ? "alert" : "status"), s.setAttribute("aria-live", t ? "assertive" : "polite"), s.setAttribute("aria-atomic", "true"), s.style.cssText = Te, i.appendChild(s), s;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
const o =
|
|
118
|
+
function De(i, t, e = {}) {
|
|
119
|
+
const o = Le(i, !!e.assertive);
|
|
120
120
|
o.textContent = "", o.textContent = t;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Me(i) {
|
|
123
123
|
return i.hasAttribute("disabled") ? !0 : i.disabled === !0;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Re(i) {
|
|
126
126
|
let t = i;
|
|
127
127
|
for (; t; ) {
|
|
128
128
|
if (t.hasAttribute("hidden")) return !0;
|
|
@@ -133,52 +133,52 @@ function Ce(i) {
|
|
|
133
133
|
}
|
|
134
134
|
return !1;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function dt(i) {
|
|
137
137
|
return Array.from(
|
|
138
|
-
i.querySelectorAll(
|
|
139
|
-
).filter((e) => !(e.getAttribute("tabindex") === "-1" || e instanceof HTMLInputElement && e.type === "hidden" || e instanceof HTMLAnchorElement && !e.getAttribute("href") ||
|
|
138
|
+
i.querySelectorAll(Ae)
|
|
139
|
+
).filter((e) => !(e.getAttribute("tabindex") === "-1" || e instanceof HTMLInputElement && e.type === "hidden" || e instanceof HTMLAnchorElement && !e.getAttribute("href") || Me(e) || Re(e)));
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Tt(i) {
|
|
142
142
|
let t = i.activeElement;
|
|
143
143
|
for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
|
|
144
144
|
t = t.shadowRoot.activeElement;
|
|
145
145
|
return t instanceof HTMLElement ? t : null;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Pe(i) {
|
|
148
148
|
const t = i.ownerDocument || document;
|
|
149
149
|
let e = !1;
|
|
150
150
|
const o = (s) => {
|
|
151
151
|
if (s.key !== "Tab") return;
|
|
152
|
-
const a =
|
|
152
|
+
const a = dt(i);
|
|
153
153
|
if (a.length === 0) {
|
|
154
154
|
s.preventDefault(), i.focus();
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
const c = a[0], l = a[a.length - 1], d =
|
|
157
|
+
const c = a[0], l = a[a.length - 1], d = Tt(t), r = d ? a.indexOf(d) !== -1 : !1;
|
|
158
158
|
s.shiftKey ? (!r || d === c) && (s.preventDefault(), l.focus()) : (!r || d === l) && (s.preventDefault(), c.focus());
|
|
159
159
|
};
|
|
160
160
|
i.addEventListener("keydown", o);
|
|
161
|
-
const n =
|
|
161
|
+
const n = dt(i);
|
|
162
162
|
return n.length > 0 ? n[0].focus() : (i.hasAttribute("tabindex") || (i.setAttribute("tabindex", "-1"), e = !0), i.focus()), {
|
|
163
163
|
release() {
|
|
164
164
|
i.removeEventListener("keydown", o), e && (i.removeAttribute("tabindex"), e = !1);
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
return
|
|
168
|
+
function Be() {
|
|
169
|
+
return Tt(document);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function He(i) {
|
|
172
172
|
if (!(!i || typeof i.focus != "function"))
|
|
173
173
|
try {
|
|
174
174
|
i.focus();
|
|
175
175
|
} catch {
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Oe(i, t = {}) {
|
|
179
179
|
i.setAttribute("role", "dialog"), i.setAttribute("aria-modal", "true"), t.labelledbyId && i.setAttribute("aria-labelledby", t.labelledbyId), t.describedbyId && i.setAttribute("aria-describedby", t.describedbyId), t.label && i.setAttribute("aria-label", t.label);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function ze(i, t) {
|
|
182
182
|
let e = i;
|
|
183
183
|
for (; e && e !== t; ) {
|
|
184
184
|
const o = e.parentNode;
|
|
@@ -192,11 +192,11 @@ function Ie(i, t) {
|
|
|
192
192
|
}
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function $e(i) {
|
|
196
196
|
const e = (i.ownerDocument || document).body;
|
|
197
197
|
if (!e) return () => {
|
|
198
198
|
};
|
|
199
|
-
const o =
|
|
199
|
+
const o = ze(i, e), n = [];
|
|
200
200
|
return Array.from(e.children).forEach((s) => {
|
|
201
201
|
if (!(s instanceof HTMLElement) || o && s === o) return;
|
|
202
202
|
const a = s.inert === !0, c = s.getAttribute("aria-hidden");
|
|
@@ -208,14 +208,14 @@ function Le(i) {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
const
|
|
211
|
+
const At = {
|
|
212
212
|
width: 400,
|
|
213
213
|
height: 280,
|
|
214
214
|
arrowHeight: 12,
|
|
215
215
|
gap: 8,
|
|
216
216
|
viewportPadding: 16
|
|
217
217
|
};
|
|
218
|
-
function
|
|
218
|
+
function _e(i, t, e, o, n) {
|
|
219
219
|
const s = i.y, a = t - (i.y + i.height);
|
|
220
220
|
if (a >= e + o)
|
|
221
221
|
return {
|
|
@@ -234,22 +234,22 @@ function De(i, t, e, o, n) {
|
|
|
234
234
|
t - e - n
|
|
235
235
|
) : l = Math.max(n, i.y - e - o), { top: l, position: c };
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Ne(i, t, e, o) {
|
|
238
238
|
let s = i.x + i.width / 2 - e / 2;
|
|
239
239
|
return s = Math.max(o, Math.min(s, t - e - o)), s;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Fe(i, t, e, o = 24, n = 24) {
|
|
242
242
|
const a = i.clickX - t - n / 2;
|
|
243
243
|
return Math.max(o, Math.min(a, e - o - n / 2));
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
const n = o.height + o.arrowHeight, s =
|
|
245
|
+
function Ve(i, t, e, o = At) {
|
|
246
|
+
const n = o.height + o.arrowHeight, s = _e(
|
|
247
247
|
i,
|
|
248
248
|
e,
|
|
249
249
|
n,
|
|
250
250
|
o.gap,
|
|
251
251
|
o.viewportPadding
|
|
252
|
-
), a =
|
|
252
|
+
), a = Ne(
|
|
253
253
|
i,
|
|
254
254
|
t,
|
|
255
255
|
o.width,
|
|
@@ -261,15 +261,15 @@ function Pe(i, t, e, o = qt) {
|
|
|
261
261
|
position: s.position
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Ue(i, t, e, o = {}) {
|
|
265
265
|
const n = o.gap ?? 8;
|
|
266
266
|
let s = i.bottom + n;
|
|
267
267
|
s + t.height > e.height - n && (s = i.top - t.height - n);
|
|
268
268
|
let a = i.left;
|
|
269
269
|
return a < n ? a = n : a + t.width > e.width - n && (a = e.width - t.width - n), s < n ? s = n : s + t.height > e.height - n && (s = e.height - t.height - n), { top: s, left: a };
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
const n =
|
|
271
|
+
function je(i, t, e, o = At) {
|
|
272
|
+
const n = Ve(i, t, e, o), s = Fe(
|
|
273
273
|
i,
|
|
274
274
|
n.left,
|
|
275
275
|
o.width
|
|
@@ -279,15 +279,15 @@ function He(i, t, e, o = qt) {
|
|
|
279
279
|
arrow: { left: s }
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
function
|
|
282
|
+
const Ke = 20;
|
|
283
|
+
function We(i) {
|
|
284
284
|
const t = [], e = console.error, o = console.warn, n = console.log, s = (a, c) => {
|
|
285
285
|
const l = {
|
|
286
286
|
message: c.map((d) => String(d)).join(" "),
|
|
287
287
|
timestamp: Date.now(),
|
|
288
288
|
level: a
|
|
289
289
|
};
|
|
290
|
-
t.length >=
|
|
290
|
+
t.length >= Ke && t.shift(), t.push(l), i && i(l);
|
|
291
291
|
};
|
|
292
292
|
return console.error = function(...a) {
|
|
293
293
|
s("error", a), e.apply(console, a);
|
|
@@ -309,19 +309,19 @@ function q(i, t, e) {
|
|
|
309
309
|
n === "className" ? o.className = s : o.setAttribute(n, s);
|
|
310
310
|
return o;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Xe(i = 640) {
|
|
313
313
|
return typeof window < "u" && window.innerWidth < i;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function ct(i, t, e) {
|
|
316
316
|
const o = e.map((s) => s.style.visibility);
|
|
317
317
|
e.forEach((s) => s.style.visibility = "hidden");
|
|
318
318
|
const n = document.elementFromPoint(i, t);
|
|
319
319
|
return e.forEach((s, a) => s.style.visibility = o[a]), n;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function R(i) {
|
|
322
322
|
return i ? i.hasAttribute("data-qaid-embed") || i.hasAttribute("data-qaid-embed-overlay") ? !0 : !!i.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function lt(i, t = 0) {
|
|
325
325
|
const e = i.getBoundingClientRect();
|
|
326
326
|
return {
|
|
327
327
|
x: e.left - t,
|
|
@@ -330,7 +330,7 @@ function st(i, t = 0) {
|
|
|
330
330
|
height: e.height + t * 2
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const Ye = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", Qe = (i) => (
|
|
334
334
|
// The URL is a runtime value, not a static specifier — keep Vite from
|
|
335
335
|
// trying to analyze/bundle it.
|
|
336
336
|
import(
|
|
@@ -338,19 +338,19 @@ const _e = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", Fe =
|
|
|
338
338
|
i
|
|
339
339
|
)
|
|
340
340
|
);
|
|
341
|
-
let
|
|
342
|
-
function
|
|
343
|
-
return I &&
|
|
341
|
+
let Je = Qe, I = null, N = null;
|
|
342
|
+
function Ge(i) {
|
|
343
|
+
return I && N === i || (N = i, I = Promise.resolve(Je(i)).then((t) => {
|
|
344
344
|
const e = t;
|
|
345
345
|
if (!e || typeof e.QaidQuests != "function")
|
|
346
346
|
throw new Error("quests module has no QaidQuests export");
|
|
347
347
|
return e;
|
|
348
348
|
}).catch((t) => {
|
|
349
|
-
throw I = null,
|
|
349
|
+
throw I = null, N = null, t;
|
|
350
350
|
})), I;
|
|
351
351
|
}
|
|
352
|
-
async function
|
|
353
|
-
const t = await
|
|
352
|
+
async function Ze(i) {
|
|
353
|
+
const t = await Ge(i.moduleUrl), e = i.base.replace(/\/+$/, ""), o = i.feedbackId != null ? { feedbackId: i.feedbackId } : void 0;
|
|
354
354
|
return new t.QaidQuests({
|
|
355
355
|
endpoint: `${e}/responses`,
|
|
356
356
|
configUrl: `${e}/${encodeURIComponent(i.questId)}/definition`,
|
|
@@ -359,7 +359,7 @@ async function Ue(i) {
|
|
|
359
359
|
onClose: i.onClose
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const ht = "qaid_visitor_id", ut = "qaid_hide_feedback", ti = [
|
|
363
363
|
"#ef4444",
|
|
364
364
|
"#f59e0b",
|
|
365
365
|
"#22c55e",
|
|
@@ -367,26 +367,26 @@ const at = "qaid_visitor_id", rt = "qaid_hide_feedback", je = [
|
|
|
367
367
|
"#111827",
|
|
368
368
|
"#ffffff"
|
|
369
369
|
];
|
|
370
|
-
function
|
|
370
|
+
function ei() {
|
|
371
371
|
return typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return i ? `${
|
|
373
|
+
function j(i) {
|
|
374
|
+
return i ? `${ut}_${i}` : ut;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function ii(i) {
|
|
377
377
|
try {
|
|
378
|
-
return localStorage.getItem(
|
|
378
|
+
return localStorage.getItem(j(i)) === "1";
|
|
379
379
|
} catch {
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function pt(i, t = !0) {
|
|
384
384
|
try {
|
|
385
|
-
t ? localStorage.setItem(
|
|
385
|
+
t ? localStorage.setItem(j(i), "1") : localStorage.removeItem(j(i));
|
|
386
386
|
} catch {
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function ft() {
|
|
390
390
|
const i = typeof crypto < "u" ? crypto : void 0;
|
|
391
391
|
if (i && typeof i.randomUUID == "function") return i.randomUUID();
|
|
392
392
|
const t = new Uint8Array(16);
|
|
@@ -398,15 +398,15 @@ function ct() {
|
|
|
398
398
|
const e = Array.from(t, (o) => o.toString(16).padStart(2, "0")).join("");
|
|
399
399
|
return `${e.slice(0, 8)}-${e.slice(8, 12)}-${e.slice(12, 16)}-${e.slice(16, 20)}-${e.slice(20)}`;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function oi() {
|
|
402
402
|
try {
|
|
403
|
-
let i = localStorage.getItem(
|
|
404
|
-
return i || (i =
|
|
403
|
+
let i = localStorage.getItem(ht);
|
|
404
|
+
return i || (i = ft(), localStorage.setItem(ht, i)), i;
|
|
405
405
|
} catch {
|
|
406
|
-
return
|
|
406
|
+
return ft();
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
class
|
|
409
|
+
class ni {
|
|
410
410
|
config;
|
|
411
411
|
state = "IDLE";
|
|
412
412
|
feedbackData = {
|
|
@@ -524,7 +524,7 @@ class Ye {
|
|
|
524
524
|
captureScreenshot: t.captureScreenshot ?? !1,
|
|
525
525
|
annotate: t.annotate ?? !0,
|
|
526
526
|
annotationColor: t.annotationColor ?? t.colors?.marker ?? "#6365f1",
|
|
527
|
-
annotationPalette: t.annotationPalette ??
|
|
527
|
+
annotationPalette: t.annotationPalette ?? ti,
|
|
528
528
|
screenshotMethod: t.screenshotMethod ?? "permission",
|
|
529
529
|
screenshotOptions: {
|
|
530
530
|
quality: t.screenshotOptions?.quality ?? 0.8,
|
|
@@ -551,12 +551,12 @@ class Ye {
|
|
|
551
551
|
video: t.quests?.video ?? "",
|
|
552
552
|
// Quest service reuses the feedback API key unless overridden.
|
|
553
553
|
apiKey: t.quests?.apiKey ?? t.apiKey ?? "",
|
|
554
|
-
moduleUrl: t.quests?.moduleUrl ??
|
|
554
|
+
moduleUrl: t.quests?.moduleUrl ?? Ye
|
|
555
555
|
}
|
|
556
|
-
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId =
|
|
556
|
+
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = oi(), this.init();
|
|
557
557
|
}
|
|
558
558
|
applyVars(t) {
|
|
559
|
-
|
|
559
|
+
Ce(t, this.cssVars);
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
562
562
|
* Announce a message via the shared visually-hidden live regions.
|
|
@@ -566,7 +566,7 @@ class Ye {
|
|
|
566
566
|
*/
|
|
567
567
|
announceMsg(t, e = !1) {
|
|
568
568
|
const o = this.overlayShadowRoot ?? this.shadowRoot;
|
|
569
|
-
o &&
|
|
569
|
+
o && De(o, t, { assertive: e });
|
|
570
570
|
}
|
|
571
571
|
/**
|
|
572
572
|
* Turn a transient surface into an accessible modal dialog: save the
|
|
@@ -574,16 +574,16 @@ class Ye {
|
|
|
574
574
|
* background. Paired with closeDialogA11y() on every close path.
|
|
575
575
|
*/
|
|
576
576
|
openDialogA11y(t, e) {
|
|
577
|
-
this.dialogTrigger =
|
|
577
|
+
this.dialogTrigger = Be(), Oe(t, e), this.dialogTrap = Pe(t), this.dialogRestoreInert = $e(t);
|
|
578
578
|
}
|
|
579
579
|
closeDialogA11y() {
|
|
580
|
-
this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null),
|
|
580
|
+
this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), He(this.dialogTrigger), this.dialogTrigger = null;
|
|
581
581
|
}
|
|
582
582
|
clearActiveThumb() {
|
|
583
583
|
this.activeThumbBtn && (this.activeThumbBtn.setAttribute("aria-pressed", "false"), this.activeThumbBtn = null);
|
|
584
584
|
}
|
|
585
585
|
init() {
|
|
586
|
-
|
|
586
|
+
Se(), this.cssVars = qe({
|
|
587
587
|
positiveColor: this.config.colors.positive,
|
|
588
588
|
negativeColor: this.config.colors.negative,
|
|
589
589
|
markerColor: this.config.colors.marker,
|
|
@@ -592,7 +592,7 @@ class Ye {
|
|
|
592
592
|
backdropOpacity: this.config.backdropOpacity,
|
|
593
593
|
fontFamily: this.config.fontFamily,
|
|
594
594
|
fontSize: this.config.fontSize
|
|
595
|
-
}), !this.config.hideDismiss &&
|
|
595
|
+
}), !this.config.hideDismiss && ii(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = We((t) => {
|
|
596
596
|
this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
|
|
597
597
|
}), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot) && this.schedulePrewarm(() => {
|
|
598
598
|
this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot();
|
|
@@ -605,13 +605,13 @@ class Ye {
|
|
|
605
605
|
* swallowed — a failed preload just falls back to an on-demand load.
|
|
606
606
|
*/
|
|
607
607
|
prewarmVideo() {
|
|
608
|
-
this.videoPrewarmed || (this.videoPrewarmed = !0, Promise.resolve().then(() =>
|
|
609
|
-
}), Promise.resolve().then(() =>
|
|
608
|
+
this.videoPrewarmed || (this.videoPrewarmed = !0, Promise.resolve().then(() => kt).catch(() => {
|
|
609
|
+
}), Promise.resolve().then(() => Bt).catch(() => {
|
|
610
610
|
}));
|
|
611
611
|
}
|
|
612
612
|
prewarmScreenshot() {
|
|
613
|
-
this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? Promise.resolve().then(() =>
|
|
614
|
-
}), this.config.annotate && Promise.resolve().then(() =>
|
|
613
|
+
this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? Promise.resolve().then(() => vt) : Promise.resolve().then(() => xt)).catch(() => {
|
|
614
|
+
}), this.config.annotate && Promise.resolve().then(() => wt).catch(() => {
|
|
615
615
|
}));
|
|
616
616
|
}
|
|
617
617
|
/** Run fn when the main thread is idle; cancelled by destroy(). */
|
|
@@ -640,7 +640,7 @@ class Ye {
|
|
|
640
640
|
}), this.domObserver.observe(document.body, { childList: !0 });
|
|
641
641
|
}
|
|
642
642
|
checkMobile() {
|
|
643
|
-
this.isMobile =
|
|
643
|
+
this.isMobile = Xe();
|
|
644
644
|
}
|
|
645
645
|
handleResize() {
|
|
646
646
|
this.checkMobile();
|
|
@@ -650,7 +650,7 @@ class Ye {
|
|
|
650
650
|
let t = null;
|
|
651
651
|
this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !0, this.config.hideDismiss = !0) : (this.shadowHost.style.position = "fixed", this.shadowHost.style.display = "block", this.shadowHost.style.inset = "0", this.shadowHost.style.pointerEvents = "none", this.shadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.shadowHost)), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" });
|
|
652
652
|
const e = document.createElement("style");
|
|
653
|
-
if (e.textContent =
|
|
653
|
+
if (e.textContent = at(), this.shadowRoot.appendChild(e), this.config.css) {
|
|
654
654
|
const d = document.createElement("style");
|
|
655
655
|
d.textContent = this.config.css, this.shadowRoot.appendChild(d);
|
|
656
656
|
}
|
|
@@ -674,7 +674,7 @@ class Ye {
|
|
|
674
674
|
const d = document.createElement("div");
|
|
675
675
|
d.className = "qaid-tooltip-wrapper";
|
|
676
676
|
const r = document.createElement("button");
|
|
677
|
-
r.type = "button", r.className = n ? `${s} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon ||
|
|
677
|
+
r.type = "button", r.className = n ? `${s} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon || St, r.addEventListener("click", (h) => this.handleThumbClick("neutral", h.currentTarget, h)), r.addEventListener("mouseenter", () => {
|
|
678
678
|
this.prewarmTargeting(), this.showTooltip(r);
|
|
679
679
|
}), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
|
|
680
680
|
} else if (!this.config.hideThumbs) {
|
|
@@ -687,7 +687,7 @@ class Ye {
|
|
|
687
687
|
const h = document.createElement("div");
|
|
688
688
|
h.className = "qaid-tooltip-wrapper";
|
|
689
689
|
const f = document.createElement("button");
|
|
690
|
-
f.type = "button", f.className = n ? `${s} qaid-btn-down` : "qaid-btn qaid-btn-down", f.setAttribute("aria-label", this.config.text.negativeLabel), f.innerHTML = this.config.negativeIcon ||
|
|
690
|
+
f.type = "button", f.className = n ? `${s} qaid-btn-down` : "qaid-btn qaid-btn-down", f.setAttribute("aria-label", this.config.text.negativeLabel), f.innerHTML = this.config.negativeIcon || U, f.addEventListener("click", (b) => this.handleThumbClick("down", b.currentTarget, b)), f.addEventListener("mouseenter", () => {
|
|
691
691
|
this.prewarmTargeting(), this.showTooltip(f);
|
|
692
692
|
}), f.addEventListener("mouseleave", () => this.hideTooltip()), h.appendChild(f), this.buttonsContainer.appendChild(d), this.buttonsContainer.appendChild(h);
|
|
693
693
|
}
|
|
@@ -695,7 +695,7 @@ class Ye {
|
|
|
695
695
|
const d = document.createElement("div");
|
|
696
696
|
d.className = "qaid-tooltip-wrapper";
|
|
697
697
|
const r = document.createElement("button");
|
|
698
|
-
r.type = "button", r.className = n ? `${s} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon ||
|
|
698
|
+
r.type = "button", r.className = n ? `${s} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon || re, r.addEventListener("click", () => {
|
|
699
699
|
this.ensureRecording().then(
|
|
700
700
|
(f) => this.config.videoOptions.redaction ? f.startPicking() : f.startRecording()
|
|
701
701
|
);
|
|
@@ -719,7 +719,7 @@ class Ye {
|
|
|
719
719
|
if (this.overlayShadowRoot) return this.overlayShadowRoot;
|
|
720
720
|
this.overlayShadowHost = document.createElement("div"), this.overlayShadowHost.setAttribute("data-qaid-embed-overlay", ""), this.overlayShadowHost.style.position = "fixed", this.overlayShadowHost.style.inset = "0", this.overlayShadowHost.style.pointerEvents = "none", this.overlayShadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.overlayShadowHost), this.overlayShadowRoot = this.overlayShadowHost.attachShadow({ mode: "open" });
|
|
721
721
|
const t = document.createElement("style");
|
|
722
|
-
if (t.textContent =
|
|
722
|
+
if (t.textContent = at(), this.overlayShadowRoot.appendChild(t), this.config.css) {
|
|
723
723
|
const e = document.createElement("style");
|
|
724
724
|
e.textContent = this.config.css, this.overlayShadowRoot.appendChild(e);
|
|
725
725
|
}
|
|
@@ -729,7 +729,7 @@ class Ye {
|
|
|
729
729
|
showTooltip(t) {
|
|
730
730
|
const e = this.tooltipElement;
|
|
731
731
|
e.style.visibility = "hidden", e.classList.add("qaid-tooltip-visible");
|
|
732
|
-
const o = t.getBoundingClientRect(), n = e.getBoundingClientRect(), { top: s, left: a } =
|
|
732
|
+
const o = t.getBoundingClientRect(), n = e.getBoundingClientRect(), { top: s, left: a } = Ue(
|
|
733
733
|
o,
|
|
734
734
|
n,
|
|
735
735
|
{ width: window.innerWidth, height: window.innerHeight }
|
|
@@ -740,10 +740,10 @@ class Ye {
|
|
|
740
740
|
this.tooltipElement.classList.remove("qaid-tooltip-visible");
|
|
741
741
|
}
|
|
742
742
|
handleDismiss() {
|
|
743
|
-
this.buttonsContainer.classList.add("qaid-dismissed"),
|
|
743
|
+
this.buttonsContainer.classList.add("qaid-dismissed"), pt(this.config.apiKey, !0);
|
|
744
744
|
}
|
|
745
745
|
handleThumbClick(t, e, o) {
|
|
746
|
-
if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"),
|
|
746
|
+
if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), pt(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
|
|
747
747
|
this.submitDirectFeedback(t, e);
|
|
748
748
|
else {
|
|
749
749
|
this.activeThumbBtn = e, e.setAttribute("aria-pressed", "true");
|
|
@@ -776,7 +776,7 @@ class Ye {
|
|
|
776
776
|
* instead of the permission-based Screen Capture API. Explicit "dom" wins;
|
|
777
777
|
* otherwise DOM is used on touch devices to avoid the getDisplayMedia prompt. */
|
|
778
778
|
shouldCaptureViaDom() {
|
|
779
|
-
return this.config.screenshotMethod === "dom" ||
|
|
779
|
+
return this.config.screenshotMethod === "dom" || ei();
|
|
780
780
|
}
|
|
781
781
|
/**
|
|
782
782
|
* Open the full-screen annotation editor over the captured screenshot,
|
|
@@ -789,7 +789,7 @@ class Ye {
|
|
|
789
789
|
const e = this.ensureOverlayHost(), o = this.overlayShadowHost, n = o.style.pointerEvents;
|
|
790
790
|
o.style.pointerEvents = "auto";
|
|
791
791
|
try {
|
|
792
|
-
const { openAnnotationEditor: s } = await Promise.resolve().then(() =>
|
|
792
|
+
const { openAnnotationEditor: s } = await Promise.resolve().then(() => wt);
|
|
793
793
|
return await s({
|
|
794
794
|
dataUrl: t,
|
|
795
795
|
root: e,
|
|
@@ -812,10 +812,10 @@ class Ye {
|
|
|
812
812
|
if (this.config.captureScreenshot || this.config.feedbackMode === "annotate")
|
|
813
813
|
try {
|
|
814
814
|
if (this.shouldCaptureViaDom()) {
|
|
815
|
-
const { captureDomScreenshot: a } = await Promise.resolve().then(() =>
|
|
815
|
+
const { captureDomScreenshot: a } = await Promise.resolve().then(() => vt);
|
|
816
816
|
t = await a(this.config.screenshotOptions);
|
|
817
817
|
} else {
|
|
818
|
-
const { captureScreenshot: a } = await Promise.resolve().then(() =>
|
|
818
|
+
const { captureScreenshot: a } = await Promise.resolve().then(() => xt);
|
|
819
819
|
t = await a(this.config.screenshotOptions);
|
|
820
820
|
}
|
|
821
821
|
t && this.announceMsg("Screenshot captured");
|
|
@@ -893,7 +893,7 @@ class Ye {
|
|
|
893
893
|
const o = this.questIdFor(t);
|
|
894
894
|
if (!o) return !1;
|
|
895
895
|
try {
|
|
896
|
-
return this.activeQuest?.destroy(), this.activeQuest = await
|
|
896
|
+
return this.activeQuest?.destroy(), this.activeQuest = await Ze({
|
|
897
897
|
questId: o,
|
|
898
898
|
base: this.config.quests.base,
|
|
899
899
|
apiKey: this.config.quests.apiKey || void 0,
|
|
@@ -922,7 +922,7 @@ class Ye {
|
|
|
922
922
|
*/
|
|
923
923
|
async ensureModal() {
|
|
924
924
|
if (!this.modal) {
|
|
925
|
-
const { ModalController: t } = await Promise.resolve().then(() =>
|
|
925
|
+
const { ModalController: t } = await Promise.resolve().then(() => qt);
|
|
926
926
|
this.modal = new t(this.makeModalHost());
|
|
927
927
|
}
|
|
928
928
|
return this.modal;
|
|
@@ -968,7 +968,7 @@ class Ye {
|
|
|
968
968
|
}
|
|
969
969
|
/** Warm the modal chunk while the user is targeting, so it opens instantly. */
|
|
970
970
|
prewarmModal() {
|
|
971
|
-
this.modalPrewarmed || (this.modalPrewarmed = !0, Promise.resolve().then(() =>
|
|
971
|
+
this.modalPrewarmed || (this.modalPrewarmed = !0, Promise.resolve().then(() => qt).catch(() => {
|
|
972
972
|
}));
|
|
973
973
|
}
|
|
974
974
|
/**
|
|
@@ -978,7 +978,7 @@ class Ye {
|
|
|
978
978
|
*/
|
|
979
979
|
async ensureTargeting() {
|
|
980
980
|
if (!this.targeting) {
|
|
981
|
-
const { TargetingController: t } = await Promise.resolve().then(() =>
|
|
981
|
+
const { TargetingController: t } = await Promise.resolve().then(() => Ct);
|
|
982
982
|
this.targeting = new t(this.makeTargetingHost());
|
|
983
983
|
}
|
|
984
984
|
return this.targeting;
|
|
@@ -1023,7 +1023,7 @@ class Ye {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
/** Warm the targeting chunk on thumb-button hover, before the click. */
|
|
1025
1025
|
prewarmTargeting() {
|
|
1026
|
-
this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, Promise.resolve().then(() =>
|
|
1026
|
+
this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, Promise.resolve().then(() => Ct).catch(() => {
|
|
1027
1027
|
}));
|
|
1028
1028
|
}
|
|
1029
1029
|
// ==================== Video Recording ====================
|
|
@@ -1042,7 +1042,7 @@ class Ye {
|
|
|
1042
1042
|
*/
|
|
1043
1043
|
async ensureRecording() {
|
|
1044
1044
|
if (!this.recording) {
|
|
1045
|
-
const { RecordingController: t } = await Promise.resolve().then(() =>
|
|
1045
|
+
const { RecordingController: t } = await Promise.resolve().then(() => kt);
|
|
1046
1046
|
this.recording = new t(this.makeRecordingHost());
|
|
1047
1047
|
}
|
|
1048
1048
|
return this.recording;
|
|
@@ -1098,13 +1098,13 @@ class Ye {
|
|
|
1098
1098
|
const t = window;
|
|
1099
1099
|
this.prewarmIsTimeout ? clearTimeout(this.prewarmHandle) : t.cancelIdleCallback?.(this.prewarmHandle), this.prewarmHandle = null;
|
|
1100
1100
|
}
|
|
1101
|
-
this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null,
|
|
1101
|
+
this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, Ee();
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function It(i) {
|
|
1105
1105
|
return document.querySelector(i)?.textContent?.trim() ?? "";
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function si() {
|
|
1108
1108
|
const i = document.querySelector(
|
|
1109
1109
|
'script[type="application/json"][data-feedback-config]'
|
|
1110
1110
|
);
|
|
@@ -1113,31 +1113,72 @@ function Qe() {
|
|
|
1113
1113
|
if (!t) return null;
|
|
1114
1114
|
try {
|
|
1115
1115
|
const e = JSON.parse(t);
|
|
1116
|
-
return e.cssSelector && !e.css && (e.css =
|
|
1116
|
+
return e.cssSelector && !e.css && (e.css = It(e.cssSelector), delete e.cssSelector), e;
|
|
1117
1117
|
} catch {
|
|
1118
1118
|
return null;
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Lt(i, t, e) {
|
|
1122
|
+
console.warn(`[thumbs-embed] Ignoring ${i}="${t}": expected ${e}.`);
|
|
1123
|
+
}
|
|
1124
|
+
function ai(i) {
|
|
1125
|
+
const t = [];
|
|
1126
|
+
let e = 0, o = "";
|
|
1127
|
+
for (const n of i)
|
|
1128
|
+
n === "(" && e++, n === ")" && (e = Math.max(0, e - 1)), n === "," && e === 0 ? (t.push(o.trim()), o = "") : o += n;
|
|
1129
|
+
return t.push(o.trim()), t;
|
|
1130
|
+
}
|
|
1131
|
+
function ri(i, t) {
|
|
1132
|
+
if (t === null) return;
|
|
1133
|
+
const e = t.trim();
|
|
1134
|
+
let o = null;
|
|
1135
|
+
if (e.startsWith("[") || e.startsWith("{"))
|
|
1136
|
+
try {
|
|
1137
|
+
o = JSON.parse(e);
|
|
1138
|
+
} catch {
|
|
1139
|
+
o = null;
|
|
1140
|
+
}
|
|
1141
|
+
else
|
|
1142
|
+
o = ai(e);
|
|
1143
|
+
if (Array.isArray(o) && o.length > 0 && o.every((n) => typeof n == "string" && n.trim() !== ""))
|
|
1144
|
+
return o.map((n) => n.trim());
|
|
1145
|
+
Lt(i, t, "a JSON array of colours or a comma-separated list");
|
|
1146
|
+
}
|
|
1147
|
+
function M(i, t) {
|
|
1148
|
+
if (t !== null) {
|
|
1149
|
+
if (t.trim() === "") {
|
|
1150
|
+
Lt(i, t, "a non-empty label");
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
return t;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
function di(i) {
|
|
1122
1157
|
const t = i.getAttribute("data-endpoint");
|
|
1123
1158
|
if (!t) return null;
|
|
1124
|
-
const e = i.getAttribute("data-position"), o = i.getAttribute("data-zindex"), n = i.getAttribute("data-positive-color"), s = i.getAttribute("data-negative-color"), a = i.getAttribute("data-marker-color"), c = i.getAttribute("data-container"), l = i.getAttribute("data-button-class"), d = i.getAttribute("data-skip-targeting"), r = i.getAttribute("data-hide-confirmation"), h = i.getAttribute("data-single-button"), f = i.getAttribute("data-feedback-mode"), b = i.getAttribute("data-incognito"), y = i.getAttribute("data-button-size"), g = i.getAttribute("data-offset-x"), w = i.getAttribute("data-offset-y"), x = i.getAttribute("data-modal-width"), u = i.getAttribute("data-backdrop-opacity"), k = i.getAttribute("data-font-family"), v = i.getAttribute("data-font-size"), C = i.getAttribute("data-tooltip"), A = i.getAttribute("data-modal-title"), S = i.getAttribute("data-confirmation-title"), m = i.getAttribute("data-confirmation-message"), E = i.getAttribute("data-confirmation-close"),
|
|
1159
|
+
const e = i.getAttribute("data-position"), o = i.getAttribute("data-zindex"), n = i.getAttribute("data-positive-color"), s = i.getAttribute("data-negative-color"), a = i.getAttribute("data-marker-color"), c = i.getAttribute("data-container"), l = i.getAttribute("data-button-class"), d = i.getAttribute("data-skip-targeting"), r = i.getAttribute("data-hide-confirmation"), h = i.getAttribute("data-single-button"), f = i.getAttribute("data-feedback-mode"), b = i.getAttribute("data-incognito"), y = i.getAttribute("data-button-size"), g = i.getAttribute("data-offset-x"), w = i.getAttribute("data-offset-y"), x = i.getAttribute("data-modal-width"), u = i.getAttribute("data-backdrop-opacity"), k = i.getAttribute("data-font-family"), v = i.getAttribute("data-font-size"), C = i.getAttribute("data-tooltip"), A = i.getAttribute("data-modal-title"), S = i.getAttribute("data-confirmation-title"), m = i.getAttribute("data-confirmation-message"), E = i.getAttribute("data-confirmation-close"), K = i.getAttribute("data-error-title"), W = i.getAttribute("data-error-message"), X = i.getAttribute("data-modal-subtitle"), Y = i.getAttribute("data-placeholder"), Q = i.getAttribute("data-submit-button"), J = i.getAttribute("data-skip-button"), Nt = i.getAttribute("data-positive-icon"), Ft = i.getAttribute("data-negative-icon"), Vt = i.getAttribute("data-feedback-icon"), G = i.getAttribute("data-feedback-label"), Ut = i.getAttribute("data-api-key"), jt = i.getAttribute("data-capture-screenshot"), Kt = i.getAttribute("data-annotate"), Wt = i.getAttribute("data-annotation-color"), O = i.getAttribute("data-screenshot-quality"), z = i.getAttribute("data-screenshot-max-width"), $ = i.getAttribute("data-screenshot-max-height"), Xt = i.getAttribute("data-capture-video"), Z = i.getAttribute("data-video-redaction"), Yt = i.getAttribute("data-hide-thumbs"), Qt = i.getAttribute("data-hide-dismiss"), _ = i.getAttribute("data-video-max-duration"), Jt = i.getAttribute("data-screenshot-method"), Gt = i.getAttribute("data-direction"), tt = i.getAttribute("data-css-selector"), Zt = i.getAttribute("data-css"), et = M("data-positive-label", i.getAttribute("data-positive-label")), it = M("data-negative-label", i.getAttribute("data-negative-label")), ot = M("data-record-label", i.getAttribute("data-record-label")), nt = M("data-dismiss-label", i.getAttribute("data-dismiss-label")), te = ri(
|
|
1160
|
+
"data-annotation-palette",
|
|
1161
|
+
i.getAttribute("data-annotation-palette")
|
|
1162
|
+
), ee = i.getAttribute("data-record-icon"), st = i.getAttribute("data-quest-base"), ie = i.getAttribute("data-quest-up"), oe = i.getAttribute("data-quest-down"), ne = i.getAttribute("data-quest-video"), se = i.getAttribute("data-quest-api-key"), ae = i.getAttribute("data-quest-module-url");
|
|
1125
1163
|
return {
|
|
1126
1164
|
endpoint: t,
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1165
|
+
// Inline CSS wins over a selector, as `css` wins over `cssSelector` in
|
|
1166
|
+
// the JSON block.
|
|
1167
|
+
css: Zt || (tt ? It(tt) : void 0),
|
|
1168
|
+
apiKey: Ut ?? void 0,
|
|
1169
|
+
captureScreenshot: jt === "true" ? !0 : void 0,
|
|
1130
1170
|
// Annotation is on by default; only an explicit "false" disables it.
|
|
1131
|
-
annotate:
|
|
1132
|
-
annotationColor:
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1171
|
+
annotate: Kt === "false" ? !1 : void 0,
|
|
1172
|
+
annotationColor: Wt ?? void 0,
|
|
1173
|
+
annotationPalette: te,
|
|
1174
|
+
screenshotOptions: O || z || $ ? {
|
|
1175
|
+
quality: O ? parseFloat(O) : void 0,
|
|
1176
|
+
maxWidth: z ? parseInt(z, 10) : void 0,
|
|
1177
|
+
maxHeight: $ ? parseInt($, 10) : void 0
|
|
1137
1178
|
} : void 0,
|
|
1138
1179
|
container: c ?? void 0,
|
|
1139
1180
|
buttonClass: l ?? void 0,
|
|
1140
|
-
direction:
|
|
1181
|
+
direction: Gt ?? void 0,
|
|
1141
1182
|
position: e ?? void 0,
|
|
1142
1183
|
zIndex: o ? parseInt(o, 10) : void 0,
|
|
1143
1184
|
skipTargeting: d === "true" ? !0 : void 0,
|
|
@@ -1159,75 +1200,80 @@ function Ge(i) {
|
|
|
1159
1200
|
negative: s ?? void 0,
|
|
1160
1201
|
marker: a ?? void 0
|
|
1161
1202
|
},
|
|
1162
|
-
text: C || A ||
|
|
1203
|
+
text: C || A || X || Y || Q || J || G || S || m || E || K || W || et || it || ot || nt ? {
|
|
1163
1204
|
tooltip: C ?? void 0,
|
|
1164
1205
|
modalTitle: A ?? void 0,
|
|
1165
|
-
modalSubtitle:
|
|
1166
|
-
placeholder:
|
|
1167
|
-
submitButton:
|
|
1168
|
-
skipButton:
|
|
1206
|
+
modalSubtitle: X ?? void 0,
|
|
1207
|
+
placeholder: Y ?? void 0,
|
|
1208
|
+
submitButton: Q ?? void 0,
|
|
1209
|
+
skipButton: J ?? void 0,
|
|
1169
1210
|
feedbackLabel: G ?? void 0,
|
|
1170
1211
|
confirmationTitle: S ?? void 0,
|
|
1171
1212
|
confirmationMessage: m ?? void 0,
|
|
1172
1213
|
confirmationClose: E ?? void 0,
|
|
1173
|
-
errorTitle:
|
|
1174
|
-
errorMessage:
|
|
1214
|
+
errorTitle: K ?? void 0,
|
|
1215
|
+
errorMessage: W ?? void 0,
|
|
1216
|
+
positiveLabel: et,
|
|
1217
|
+
negativeLabel: it,
|
|
1218
|
+
recordLabel: ot,
|
|
1219
|
+
dismissLabel: nt
|
|
1175
1220
|
} : void 0,
|
|
1176
|
-
positiveIcon:
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1221
|
+
positiveIcon: Nt ?? void 0,
|
|
1222
|
+
recordIcon: ee ?? void 0,
|
|
1223
|
+
negativeIcon: Ft ?? void 0,
|
|
1224
|
+
feedbackIcon: Vt ?? void 0,
|
|
1225
|
+
screenshotMethod: Jt ?? void 0,
|
|
1226
|
+
captureVideo: Xt === "true" ? !0 : void 0,
|
|
1227
|
+
hideThumbs: Yt === "true" ? !0 : void 0,
|
|
1228
|
+
hideDismiss: Qt === "true" ? !0 : void 0,
|
|
1229
|
+
videoOptions: _ || Z ? {
|
|
1230
|
+
maxDuration: _ ? parseInt(_, 10) : void 0,
|
|
1231
|
+
redaction: Z === "true" ? !0 : void 0
|
|
1186
1232
|
} : void 0,
|
|
1187
|
-
quests:
|
|
1188
|
-
base:
|
|
1189
|
-
up:
|
|
1190
|
-
down:
|
|
1191
|
-
video:
|
|
1192
|
-
apiKey:
|
|
1193
|
-
moduleUrl:
|
|
1233
|
+
quests: st ? {
|
|
1234
|
+
base: st,
|
|
1235
|
+
up: ie ?? void 0,
|
|
1236
|
+
down: oe ?? void 0,
|
|
1237
|
+
video: ne ?? void 0,
|
|
1238
|
+
apiKey: se ?? void 0,
|
|
1239
|
+
moduleUrl: ae ?? void 0
|
|
1194
1240
|
} : void 0
|
|
1195
1241
|
};
|
|
1196
1242
|
}
|
|
1197
|
-
function
|
|
1243
|
+
function ci() {
|
|
1198
1244
|
if (typeof document > "u") return;
|
|
1199
1245
|
const i = () => {
|
|
1200
|
-
const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), e =
|
|
1201
|
-
|
|
1246
|
+
const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), e = si() ?? (t ? di(t) : null);
|
|
1247
|
+
e?.endpoint && new ni(e);
|
|
1202
1248
|
};
|
|
1203
1249
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", i) : i();
|
|
1204
1250
|
}
|
|
1205
|
-
const
|
|
1206
|
-
function
|
|
1251
|
+
const li = 20, mt = 4096;
|
|
1252
|
+
function P(i) {
|
|
1207
1253
|
const t = typeof i == "string" ? i : JSON.stringify(i);
|
|
1208
|
-
return t.length >
|
|
1254
|
+
return t.length > mt ? t.slice(0, mt) + "…[truncated]" : t;
|
|
1209
1255
|
}
|
|
1210
|
-
function
|
|
1211
|
-
i.length >=
|
|
1256
|
+
function bt(i, t) {
|
|
1257
|
+
i.length >= li && i.shift(), i.push(t);
|
|
1212
1258
|
}
|
|
1213
|
-
async function
|
|
1259
|
+
async function hi(i) {
|
|
1214
1260
|
try {
|
|
1215
1261
|
const t = await i.clone().text();
|
|
1216
|
-
return
|
|
1262
|
+
return P(t);
|
|
1217
1263
|
} catch {
|
|
1218
1264
|
return;
|
|
1219
1265
|
}
|
|
1220
1266
|
}
|
|
1221
|
-
function
|
|
1267
|
+
function ui() {
|
|
1222
1268
|
const i = [], t = window.fetch;
|
|
1223
1269
|
window.fetch = async function(n, s) {
|
|
1224
1270
|
const a = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, c = s?.method ?? (typeof n == "object" && "method" in n ? n.method : "GET");
|
|
1225
1271
|
let l;
|
|
1226
|
-
s?.body && (l =
|
|
1272
|
+
s?.body && (l = P(s.body));
|
|
1227
1273
|
const d = await t.apply(window, [n, s]);
|
|
1228
1274
|
if (d.status >= 400) {
|
|
1229
|
-
const r = await
|
|
1230
|
-
|
|
1275
|
+
const r = await hi(d);
|
|
1276
|
+
bt(i, {
|
|
1231
1277
|
url: a,
|
|
1232
1278
|
method: c.toUpperCase(),
|
|
1233
1279
|
status: d.status,
|
|
@@ -1243,15 +1289,15 @@ function ei() {
|
|
|
1243
1289
|
return XMLHttpRequest.prototype.open = function(n, s, ...a) {
|
|
1244
1290
|
return this._qaid_method = n, this._qaid_url = typeof s == "string" ? s : s.toString(), e.apply(this, [n, s, ...a]);
|
|
1245
1291
|
}, XMLHttpRequest.prototype.send = function(n) {
|
|
1246
|
-
const s = this, a = n ?
|
|
1292
|
+
const s = this, a = n ? P(n) : void 0;
|
|
1247
1293
|
return s.addEventListener("load", function() {
|
|
1248
|
-
s.status >= 400 &&
|
|
1294
|
+
s.status >= 400 && bt(i, {
|
|
1249
1295
|
url: s._qaid_url,
|
|
1250
1296
|
method: s._qaid_method.toUpperCase(),
|
|
1251
1297
|
status: s.status,
|
|
1252
1298
|
statusText: s.statusText,
|
|
1253
1299
|
requestBody: a,
|
|
1254
|
-
responseBody:
|
|
1300
|
+
responseBody: P(s.responseText),
|
|
1255
1301
|
timestamp: Date.now()
|
|
1256
1302
|
});
|
|
1257
1303
|
}), o.apply(this, [n]);
|
|
@@ -1262,27 +1308,27 @@ function ei() {
|
|
|
1262
1308
|
}
|
|
1263
1309
|
};
|
|
1264
1310
|
}
|
|
1265
|
-
function
|
|
1311
|
+
function pi() {
|
|
1266
1312
|
const i = navigator.userAgent || "";
|
|
1267
1313
|
return /iP(hone|ad|od)/.test(i) || // iPadOS 13+ masquerades as "MacIntel" but is a multi-touch device.
|
|
1268
1314
|
navigator.platform === "MacIntel" && (navigator.maxTouchPoints || 0) > 1;
|
|
1269
1315
|
}
|
|
1270
|
-
function
|
|
1316
|
+
function fi(i, t, e, o, n) {
|
|
1271
1317
|
const s = i >= t, a = e >= o;
|
|
1272
1318
|
return s === a ? { width: i, height: t, rotate: 0 } : { width: t, height: i, rotate: n === 270 ? -90 : 90 };
|
|
1273
1319
|
}
|
|
1274
|
-
function
|
|
1320
|
+
function mi(i, t, e) {
|
|
1275
1321
|
if (e.rotate === 0) {
|
|
1276
1322
|
i.drawImage(t, 0, 0, e.width, e.height);
|
|
1277
1323
|
return;
|
|
1278
1324
|
}
|
|
1279
1325
|
i.save(), e.rotate === 90 ? (i.translate(e.width, 0), i.rotate(Math.PI / 2)) : (i.translate(0, e.height), i.rotate(-Math.PI / 2)), i.drawImage(t, 0, 0, e.height, e.width), i.restore();
|
|
1280
1326
|
}
|
|
1281
|
-
function
|
|
1327
|
+
function bi() {
|
|
1282
1328
|
const i = typeof screen < "u" ? screen.orientation : void 0;
|
|
1283
1329
|
return i && typeof i.angle == "number" ? i.angle : 0;
|
|
1284
1330
|
}
|
|
1285
|
-
function
|
|
1331
|
+
function Dt(i) {
|
|
1286
1332
|
return new Promise((t) => {
|
|
1287
1333
|
if (i.videoWidth > 0) {
|
|
1288
1334
|
t();
|
|
@@ -1291,30 +1337,30 @@ function St(i) {
|
|
|
1291
1337
|
i.addEventListener("loadedmetadata", () => t(), { once: !0 });
|
|
1292
1338
|
});
|
|
1293
1339
|
}
|
|
1294
|
-
async function
|
|
1340
|
+
async function Mt(i) {
|
|
1295
1341
|
try {
|
|
1296
1342
|
await i.play();
|
|
1297
1343
|
} catch {
|
|
1298
1344
|
}
|
|
1299
1345
|
}
|
|
1300
|
-
async function
|
|
1346
|
+
async function gi(i, t = 15) {
|
|
1301
1347
|
const e = document.createElement("canvas");
|
|
1302
1348
|
if (typeof e.captureStream != "function") return null;
|
|
1303
1349
|
const o = e.getContext("2d");
|
|
1304
1350
|
if (!o) return null;
|
|
1305
1351
|
const n = document.createElement("video");
|
|
1306
|
-
n.muted = !0, n.playsInline = !0, n.srcObject = i, await
|
|
1307
|
-
const s =
|
|
1352
|
+
n.muted = !0, n.playsInline = !0, n.srcObject = i, await Dt(n);
|
|
1353
|
+
const s = fi(
|
|
1308
1354
|
n.videoWidth,
|
|
1309
1355
|
n.videoHeight,
|
|
1310
1356
|
window.innerWidth,
|
|
1311
1357
|
window.innerHeight,
|
|
1312
|
-
|
|
1358
|
+
bi()
|
|
1313
1359
|
);
|
|
1314
|
-
e.width = s.width, e.height = s.height, await
|
|
1360
|
+
e.width = s.width, e.height = s.height, await Mt(n);
|
|
1315
1361
|
let a = 0;
|
|
1316
1362
|
const c = () => {
|
|
1317
|
-
|
|
1363
|
+
mi(o, n, s), a = requestAnimationFrame(c);
|
|
1318
1364
|
};
|
|
1319
1365
|
c();
|
|
1320
1366
|
const l = e.captureStream(t);
|
|
@@ -1325,15 +1371,15 @@ async function ai(i, t = 15) {
|
|
|
1325
1371
|
}
|
|
1326
1372
|
};
|
|
1327
1373
|
}
|
|
1328
|
-
function
|
|
1374
|
+
function vi(i, t, e, o, n) {
|
|
1329
1375
|
const s = Math.max(0, Math.min(o, i.left * t)), a = Math.max(0, Math.min(n, i.top * e)), c = Math.max(0, Math.min(o, (i.left + i.width) * t)), l = Math.max(0, Math.min(n, (i.top + i.height) * e)), d = c - s, r = l - a;
|
|
1330
1376
|
return d <= 0 || r <= 0 ? null : { x: s, y: a, w: d, h: r };
|
|
1331
1377
|
}
|
|
1332
|
-
function
|
|
1378
|
+
function yi(i, t, e, o, n, s, a) {
|
|
1333
1379
|
i.drawImage(t, 0, 0, o, n);
|
|
1334
1380
|
const c = o / Math.max(1, window.innerWidth), l = n / Math.max(1, window.innerHeight);
|
|
1335
1381
|
for (const d of e) {
|
|
1336
|
-
const r =
|
|
1382
|
+
const r = vi(
|
|
1337
1383
|
d.getBoundingClientRect(),
|
|
1338
1384
|
c,
|
|
1339
1385
|
l,
|
|
@@ -1343,16 +1389,16 @@ function di(i, t, e, o, n, s, a) {
|
|
|
1343
1389
|
r && (i.save(), a ? (i.filter = `blur(${s}px)`, i.drawImage(t, r.x, r.y, r.w, r.h, r.x, r.y, r.w, r.h)) : (i.fillStyle = "#0b0b0b", i.fillRect(r.x, r.y, r.w, r.h)), i.restore());
|
|
1344
1390
|
}
|
|
1345
1391
|
}
|
|
1346
|
-
async function
|
|
1392
|
+
async function wi(i, t, e = {}) {
|
|
1347
1393
|
const o = e.frameRate ?? 15, n = e.blurRadius ?? 12, s = document.createElement("canvas");
|
|
1348
1394
|
if (typeof s.captureStream != "function") return null;
|
|
1349
1395
|
const a = s.getContext("2d");
|
|
1350
1396
|
if (!a) return null;
|
|
1351
1397
|
const c = "filter" in a, l = document.createElement("video");
|
|
1352
|
-
l.muted = !0, l.playsInline = !0, l.srcObject = i, await
|
|
1398
|
+
l.muted = !0, l.playsInline = !0, l.srcObject = i, await Dt(l), s.width = l.videoWidth, s.height = l.videoHeight, await Mt(l);
|
|
1353
1399
|
let d = 0;
|
|
1354
1400
|
const r = () => {
|
|
1355
|
-
|
|
1401
|
+
yi(
|
|
1356
1402
|
a,
|
|
1357
1403
|
l,
|
|
1358
1404
|
t,
|
|
@@ -1371,11 +1417,11 @@ async function ci(i, t, e = {}) {
|
|
|
1371
1417
|
}
|
|
1372
1418
|
};
|
|
1373
1419
|
}
|
|
1374
|
-
const
|
|
1375
|
-
function
|
|
1420
|
+
const Rt = "This browser cannot blur the areas you picked, so the recording was not started.";
|
|
1421
|
+
function ki() {
|
|
1376
1422
|
return typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function" && typeof MediaRecorder < "u";
|
|
1377
1423
|
}
|
|
1378
|
-
function
|
|
1424
|
+
function Pt() {
|
|
1379
1425
|
if (typeof MediaRecorder > "u") return "";
|
|
1380
1426
|
const i = [
|
|
1381
1427
|
"video/webm;codecs=vp9",
|
|
@@ -1388,7 +1434,7 @@ function At() {
|
|
|
1388
1434
|
return t;
|
|
1389
1435
|
return "";
|
|
1390
1436
|
}
|
|
1391
|
-
function
|
|
1437
|
+
function xi(i = {}) {
|
|
1392
1438
|
const t = i.maxDuration ?? 15, e = i.videoBitsPerSecond ?? 8e5, o = i.redactionElements ?? [], n = i.redactionBlurRadius;
|
|
1393
1439
|
let s = null, a = null, c = null, l = null, d = [], r = null, h = null, f = null, b = 0, y = null, g = null, w = !1, x = null;
|
|
1394
1440
|
function u() {
|
|
@@ -1400,7 +1446,7 @@ function hi(i = {}) {
|
|
|
1400
1446
|
return {
|
|
1401
1447
|
async start() {
|
|
1402
1448
|
w = !1, d = [];
|
|
1403
|
-
const v =
|
|
1449
|
+
const v = Pt();
|
|
1404
1450
|
if (!v)
|
|
1405
1451
|
throw new Error("No supported video MIME type found");
|
|
1406
1452
|
s = await navigator.mediaDevices.getDisplayMedia({
|
|
@@ -1424,16 +1470,16 @@ function hi(i = {}) {
|
|
|
1424
1470
|
k();
|
|
1425
1471
|
});
|
|
1426
1472
|
let S = s;
|
|
1427
|
-
if (
|
|
1428
|
-
const m = await
|
|
1473
|
+
if (pi()) {
|
|
1474
|
+
const m = await gi(s);
|
|
1429
1475
|
m && (a = m, S = m.stream);
|
|
1430
1476
|
}
|
|
1431
1477
|
if (o.length > 0) {
|
|
1432
|
-
const m = await
|
|
1478
|
+
const m = await wi(S, o, {
|
|
1433
1479
|
blurRadius: n
|
|
1434
1480
|
});
|
|
1435
1481
|
if (!m)
|
|
1436
|
-
throw a && (a.stop(), a = null), s.getTracks().forEach((E) => E.stop()), s = null, new Error(
|
|
1482
|
+
throw a && (a.stop(), a = null), s.getTracks().forEach((E) => E.stop()), s = null, new Error(Rt);
|
|
1437
1483
|
c = m, S = m.stream;
|
|
1438
1484
|
}
|
|
1439
1485
|
l = new MediaRecorder(S, {
|
|
@@ -1469,46 +1515,46 @@ function hi(i = {}) {
|
|
|
1469
1515
|
}
|
|
1470
1516
|
};
|
|
1471
1517
|
}
|
|
1472
|
-
const
|
|
1518
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1473
1519
|
__proto__: null,
|
|
1474
|
-
REDACTION_UNAVAILABLE:
|
|
1475
|
-
createVideoRecorder:
|
|
1476
|
-
getSupportedMimeType:
|
|
1477
|
-
isVideoRecordingSupported:
|
|
1478
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1520
|
+
REDACTION_UNAVAILABLE: Rt,
|
|
1521
|
+
createVideoRecorder: xi,
|
|
1522
|
+
getSupportedMimeType: Pt,
|
|
1523
|
+
isVideoRecordingSupported: ki
|
|
1524
|
+
}, Symbol.toStringTag, { value: "Module" })), gt = "https://qaid.dev/lib/html2canvas.min.js", qi = 1e4, Ci = 50;
|
|
1479
1525
|
let L = null;
|
|
1480
|
-
function
|
|
1526
|
+
function Si() {
|
|
1481
1527
|
if (typeof document > "u" || typeof window > "u")
|
|
1482
1528
|
return !1;
|
|
1483
1529
|
const i = document.createElement("canvas");
|
|
1484
1530
|
return typeof i.getContext == "function" && !!i.getContext("2d");
|
|
1485
1531
|
}
|
|
1486
|
-
function
|
|
1532
|
+
function Ei() {
|
|
1487
1533
|
return window.html2canvas ? Promise.resolve(!0) : L || (L = new Promise((i) => {
|
|
1488
1534
|
if (!document.querySelector(
|
|
1489
|
-
`script[src="${
|
|
1535
|
+
`script[src="${gt}"]`
|
|
1490
1536
|
)) {
|
|
1491
1537
|
const n = document.createElement("script");
|
|
1492
|
-
n.src =
|
|
1538
|
+
n.src = gt, n.async = !0, document.head.appendChild(n);
|
|
1493
1539
|
}
|
|
1494
1540
|
const e = Date.now(), o = () => {
|
|
1495
1541
|
if (window.html2canvas) {
|
|
1496
1542
|
i(!0);
|
|
1497
1543
|
return;
|
|
1498
1544
|
}
|
|
1499
|
-
if (Date.now() - e >
|
|
1545
|
+
if (Date.now() - e > qi) {
|
|
1500
1546
|
L = null, i(!1);
|
|
1501
1547
|
return;
|
|
1502
1548
|
}
|
|
1503
|
-
setTimeout(o,
|
|
1549
|
+
setTimeout(o, Ci);
|
|
1504
1550
|
};
|
|
1505
1551
|
o();
|
|
1506
1552
|
}), L);
|
|
1507
1553
|
}
|
|
1508
|
-
async function
|
|
1554
|
+
async function Ti(i = {}) {
|
|
1509
1555
|
const { quality: t = 0.8, maxWidth: e = 1280, maxHeight: o = 800 } = i;
|
|
1510
1556
|
try {
|
|
1511
|
-
if (!await
|
|
1557
|
+
if (!await Ei() || !window.html2canvas)
|
|
1512
1558
|
return console.warn("html2canvas failed to load"), null;
|
|
1513
1559
|
const s = await window.html2canvas(document.body, {
|
|
1514
1560
|
useCORS: !0,
|
|
@@ -1533,11 +1579,11 @@ async function bi(i = {}) {
|
|
|
1533
1579
|
return console.warn("DOM screenshot capture failed:", n), null;
|
|
1534
1580
|
}
|
|
1535
1581
|
}
|
|
1536
|
-
const
|
|
1582
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1537
1583
|
__proto__: null,
|
|
1538
|
-
captureDomScreenshot:
|
|
1539
|
-
isDomScreenshotSupported:
|
|
1540
|
-
}, Symbol.toStringTag, { value: "Module" })), T = 12,
|
|
1584
|
+
captureDomScreenshot: Ti,
|
|
1585
|
+
isDomScreenshotSupported: Si
|
|
1586
|
+
}, Symbol.toStringTag, { value: "Module" })), T = 12, Ai = "#ef4444", Ii = ["#ef4444", "#f59e0b", "#22c55e", "#3b82f6", "#111827", "#ffffff"], Li = {
|
|
1541
1587
|
"#ef4444": "red",
|
|
1542
1588
|
"#f59e0b": "amber",
|
|
1543
1589
|
"#22c55e": "green",
|
|
@@ -1549,10 +1595,10 @@ const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1549
1595
|
"#6365f1": "indigo",
|
|
1550
1596
|
"#6366f1": "indigo"
|
|
1551
1597
|
};
|
|
1552
|
-
function
|
|
1553
|
-
return
|
|
1598
|
+
function yt(i) {
|
|
1599
|
+
return Li[i.toLowerCase()] ?? i;
|
|
1554
1600
|
}
|
|
1555
|
-
const
|
|
1601
|
+
const Di = 4, Mi = 0.8, Ri = {
|
|
1556
1602
|
title: "Annotate screenshot",
|
|
1557
1603
|
instructions: "Draw on the screenshot to highlight or hide details, then choose Done to attach it or Skip to send the original.",
|
|
1558
1604
|
rectangle: "Rectangle",
|
|
@@ -1564,7 +1610,7 @@ const wi = 4, ki = 0.8, xi = {
|
|
|
1564
1610
|
done: "Done",
|
|
1565
1611
|
colors: "Drawing colour"
|
|
1566
1612
|
};
|
|
1567
|
-
function
|
|
1613
|
+
function B(i, t) {
|
|
1568
1614
|
return {
|
|
1569
1615
|
x: Math.min(i.x, t.x),
|
|
1570
1616
|
y: Math.min(i.y, t.y),
|
|
@@ -1572,12 +1618,12 @@ function P(i, t) {
|
|
|
1572
1618
|
h: Math.abs(i.y - t.y)
|
|
1573
1619
|
};
|
|
1574
1620
|
}
|
|
1575
|
-
function
|
|
1621
|
+
function Pi(i) {
|
|
1576
1622
|
if (i.type === "pen") return i.points.length < 2;
|
|
1577
|
-
const t =
|
|
1623
|
+
const t = B(i.points[0], i.points[1]);
|
|
1578
1624
|
return t.w < 3 && t.h < 3;
|
|
1579
1625
|
}
|
|
1580
|
-
function
|
|
1626
|
+
function Bi(i, t, e, o) {
|
|
1581
1627
|
i.beginPath(), i.moveTo(t.x, t.y), i.lineTo(e.x, e.y), i.stroke();
|
|
1582
1628
|
const n = Math.atan2(e.y - t.y, e.x - t.x), s = Math.max(10, o * 3);
|
|
1583
1629
|
i.beginPath(), i.moveTo(e.x, e.y), i.lineTo(
|
|
@@ -1588,7 +1634,7 @@ function Ci(i, t, e, o) {
|
|
|
1588
1634
|
e.y - s * Math.sin(n + Math.PI / 6)
|
|
1589
1635
|
), i.stroke();
|
|
1590
1636
|
}
|
|
1591
|
-
function
|
|
1637
|
+
function Hi(i, t) {
|
|
1592
1638
|
if (t.length !== 0) {
|
|
1593
1639
|
i.beginPath(), i.moveTo(t[0].x, t[0].y);
|
|
1594
1640
|
for (let e = 1; e < t.length; e++)
|
|
@@ -1596,7 +1642,7 @@ function Si(i, t) {
|
|
|
1596
1642
|
i.stroke();
|
|
1597
1643
|
}
|
|
1598
1644
|
}
|
|
1599
|
-
function
|
|
1645
|
+
function Oi(i, t, e, o, n) {
|
|
1600
1646
|
i.fillStyle = "rgb(15, 23, 42)", i.fillRect(t, e, o, n), i.fillStyle = "rgb(37, 47, 63)";
|
|
1601
1647
|
for (let s = e; s < e + n; s += T)
|
|
1602
1648
|
for (let a = t; a < t + o; a += T)
|
|
@@ -1607,38 +1653,38 @@ function Ei(i, t, e, o, n) {
|
|
|
1607
1653
|
Math.min(T, e + n - s)
|
|
1608
1654
|
);
|
|
1609
1655
|
}
|
|
1610
|
-
function
|
|
1656
|
+
function H(i, t) {
|
|
1611
1657
|
switch (i.save(), i.strokeStyle = t.color, i.fillStyle = t.color, i.lineWidth = t.strokeWidth, i.lineJoin = "round", i.lineCap = "round", t.type) {
|
|
1612
1658
|
case "rect": {
|
|
1613
|
-
const e =
|
|
1659
|
+
const e = B(t.points[0], t.points[1]);
|
|
1614
1660
|
i.strokeRect(e.x, e.y, e.w, e.h);
|
|
1615
1661
|
break;
|
|
1616
1662
|
}
|
|
1617
1663
|
case "arrow":
|
|
1618
|
-
|
|
1664
|
+
Bi(i, t.points[0], t.points[1], t.strokeWidth);
|
|
1619
1665
|
break;
|
|
1620
1666
|
case "pen":
|
|
1621
|
-
|
|
1667
|
+
Hi(i, t.points);
|
|
1622
1668
|
break;
|
|
1623
1669
|
case "blur": {
|
|
1624
|
-
const e =
|
|
1625
|
-
|
|
1670
|
+
const e = B(t.points[0], t.points[1]);
|
|
1671
|
+
Oi(i, e.x, e.y, e.w, e.h);
|
|
1626
1672
|
break;
|
|
1627
1673
|
}
|
|
1628
1674
|
}
|
|
1629
1675
|
i.restore();
|
|
1630
1676
|
}
|
|
1631
|
-
function
|
|
1677
|
+
function Ht(i) {
|
|
1632
1678
|
return new Promise((t, e) => {
|
|
1633
1679
|
const o = new Image();
|
|
1634
1680
|
o.onload = () => t(o), o.onerror = () => e(new Error("Failed to load screenshot")), o.src = i;
|
|
1635
1681
|
});
|
|
1636
1682
|
}
|
|
1637
|
-
async function
|
|
1638
|
-
const o = e.quality ??
|
|
1683
|
+
async function Ot(i, t, e = {}) {
|
|
1684
|
+
const o = e.quality ?? Mi;
|
|
1639
1685
|
let n;
|
|
1640
1686
|
try {
|
|
1641
|
-
n = await
|
|
1687
|
+
n = await Ht(i);
|
|
1642
1688
|
} catch {
|
|
1643
1689
|
return i;
|
|
1644
1690
|
}
|
|
@@ -1648,11 +1694,11 @@ async function Dt(i, t, e = {}) {
|
|
|
1648
1694
|
if (!a) return i;
|
|
1649
1695
|
a.drawImage(n, 0, 0, s.width, s.height);
|
|
1650
1696
|
for (const c of t)
|
|
1651
|
-
|
|
1697
|
+
H(a, c);
|
|
1652
1698
|
return s.toDataURL("image/webp", o);
|
|
1653
1699
|
}
|
|
1654
|
-
let
|
|
1655
|
-
class
|
|
1700
|
+
let zi = 0;
|
|
1701
|
+
class zt {
|
|
1656
1702
|
shapes = [];
|
|
1657
1703
|
tool = "rect";
|
|
1658
1704
|
opts;
|
|
@@ -1660,7 +1706,7 @@ class Mt {
|
|
|
1660
1706
|
color;
|
|
1661
1707
|
palette;
|
|
1662
1708
|
strokeWidth;
|
|
1663
|
-
uid = `qaid-annotate-${++
|
|
1709
|
+
uid = `qaid-annotate-${++zi}`;
|
|
1664
1710
|
container;
|
|
1665
1711
|
canvas;
|
|
1666
1712
|
ctx = null;
|
|
@@ -1674,7 +1720,7 @@ class Mt {
|
|
|
1674
1720
|
// after the editor is mounted).
|
|
1675
1721
|
resolveResult;
|
|
1676
1722
|
constructor(t) {
|
|
1677
|
-
this.opts = t, this.labels = { ...
|
|
1723
|
+
this.opts = t, this.labels = { ...Ri, ...t.labels ?? {} }, this.color = t.color ?? Ai, this.palette = (t.palette && t.palette.length ? t.palette : Ii).slice(), this.palette.some((e) => e.toLowerCase() === this.color.toLowerCase()) || this.palette.unshift(this.color), this.strokeWidth = t.strokeWidth ?? Di;
|
|
1678
1724
|
}
|
|
1679
1725
|
/** Mount the editor and resolve when the user commits (Done) or skips. */
|
|
1680
1726
|
open() {
|
|
@@ -1696,7 +1742,7 @@ class Mt {
|
|
|
1696
1742
|
}
|
|
1697
1743
|
/** A round colour swatch button for the toolbar's colour group. */
|
|
1698
1744
|
swatchButton(t) {
|
|
1699
|
-
const e =
|
|
1745
|
+
const e = yt(t), o = q("button", {
|
|
1700
1746
|
type: "button",
|
|
1701
1747
|
class: "qaid-annotate-swatch",
|
|
1702
1748
|
"data-qaid-color": t,
|
|
@@ -1736,19 +1782,19 @@ class Mt {
|
|
|
1736
1782
|
"aria-label": this.labels.title
|
|
1737
1783
|
});
|
|
1738
1784
|
const a = q("div", { class: "qaid-annotate-tools" });
|
|
1739
|
-
a.appendChild(this.toolButton("rect",
|
|
1785
|
+
a.appendChild(this.toolButton("rect", de, this.labels.rectangle)), a.appendChild(this.toolButton("arrow", ce, this.labels.arrow)), a.appendChild(this.toolButton("pen", le, this.labels.pen)), a.appendChild(this.toolButton("blur", he, this.labels.blur));
|
|
1740
1786
|
const c = q("div", {
|
|
1741
1787
|
class: "qaid-annotate-colors",
|
|
1742
1788
|
role: "group",
|
|
1743
1789
|
"aria-label": this.labels.colors
|
|
1744
1790
|
});
|
|
1745
1791
|
for (const h of this.palette) c.appendChild(this.swatchButton(h));
|
|
1746
|
-
this.undoBtn = this.actionButton("undo",
|
|
1747
|
-
const l = this.actionButton("skip",
|
|
1792
|
+
this.undoBtn = this.actionButton("undo", ue, this.labels.undo, "qaid-annotate-undo"), this.undoBtn.disabled = !0;
|
|
1793
|
+
const l = this.actionButton("skip", fe, this.labels.skip, "qaid-annotate-skip"), d = this.actionButton("done", Et, this.labels.done, "qaid-annotate-done"), r = q("div", { class: "qaid-annotate-actions" });
|
|
1748
1794
|
r.appendChild(this.undoBtn), r.appendChild(l), r.appendChild(d), this.toolbar.appendChild(a), this.toolbar.appendChild(c), this.toolbar.appendChild(r), this.container.appendChild(o), this.container.appendChild(n), this.container.appendChild(s), this.container.appendChild(this.toolbar), this.opts.root.appendChild(this.container), this.toolbar.addEventListener("click", this.onToolbarClick), this.canvas.addEventListener("pointerdown", this.onPointerDown), this.container.addEventListener("pointermove", this.onPointerMove), this.container.addEventListener("pointerup", this.onPointerUp), this.container.addEventListener("keydown", this.onKeyDown), this.opts.openDialog?.(this.container, {
|
|
1749
1795
|
labelledbyId: t,
|
|
1750
1796
|
describedbyId: e
|
|
1751
|
-
}), this.opts.announce?.(this.labels.instructions),
|
|
1797
|
+
}), this.opts.announce?.(this.labels.instructions), Ht(this.opts.dataUrl).then((h) => {
|
|
1752
1798
|
this.img = h, this.canvas.width = h.naturalWidth || h.width || 1, this.canvas.height = h.naturalHeight || h.height || 1, this.redraw();
|
|
1753
1799
|
}).catch(() => {
|
|
1754
1800
|
this.img = null, this.redraw();
|
|
@@ -1768,8 +1814,8 @@ class Mt {
|
|
|
1768
1814
|
if (t) {
|
|
1769
1815
|
t.clearRect(0, 0, this.canvas.width, this.canvas.height), this.img && t.drawImage(this.img, 0, 0, this.canvas.width, this.canvas.height);
|
|
1770
1816
|
for (const e of this.shapes)
|
|
1771
|
-
|
|
1772
|
-
this.current &&
|
|
1817
|
+
H(t, e);
|
|
1818
|
+
this.current && H(t, this.current);
|
|
1773
1819
|
}
|
|
1774
1820
|
}
|
|
1775
1821
|
/** Select the active drawing tool and reflect it on the toolbar. */
|
|
@@ -1780,7 +1826,7 @@ class Mt {
|
|
|
1780
1826
|
n.getAttribute("data-qaid-tool") === t ? "true" : "false"
|
|
1781
1827
|
);
|
|
1782
1828
|
});
|
|
1783
|
-
const o = this.labels[
|
|
1829
|
+
const o = this.labels[$i[t]];
|
|
1784
1830
|
this.opts.announce?.(`${o} tool selected`);
|
|
1785
1831
|
}
|
|
1786
1832
|
/** Set the active drawing colour; subsequent shapes use it. */
|
|
@@ -1790,7 +1836,7 @@ class Mt {
|
|
|
1790
1836
|
"aria-pressed",
|
|
1791
1837
|
(o.getAttribute("data-qaid-color") ?? "").toLowerCase() === t.toLowerCase() ? "true" : "false"
|
|
1792
1838
|
);
|
|
1793
|
-
}), this.opts.announce?.(`${
|
|
1839
|
+
}), this.opts.announce?.(`${yt(t)} colour selected`);
|
|
1794
1840
|
}
|
|
1795
1841
|
onToolbarClick = (t) => {
|
|
1796
1842
|
const o = t.target?.closest(
|
|
@@ -1829,7 +1875,7 @@ class Mt {
|
|
|
1829
1875
|
if (!this.drawing || !this.current) return;
|
|
1830
1876
|
this.drawing = !1;
|
|
1831
1877
|
const t = this.current;
|
|
1832
|
-
if (this.current = null,
|
|
1878
|
+
if (this.current = null, Pi(t)) {
|
|
1833
1879
|
this.redraw();
|
|
1834
1880
|
return;
|
|
1835
1881
|
}
|
|
@@ -1858,7 +1904,7 @@ class Mt {
|
|
|
1858
1904
|
/** Composite the annotations and resolve with the new WebP data URL. */
|
|
1859
1905
|
async done() {
|
|
1860
1906
|
if (this.settled) return;
|
|
1861
|
-
const t = await
|
|
1907
|
+
const t = await Ot(this.opts.dataUrl, this.shapes, {
|
|
1862
1908
|
quality: this.opts.quality
|
|
1863
1909
|
});
|
|
1864
1910
|
this.opts.announce?.("Annotated screenshot attached"), this.settle(t);
|
|
@@ -1874,27 +1920,27 @@ class Mt {
|
|
|
1874
1920
|
this.toolbar.removeEventListener("click", this.onToolbarClick), this.canvas.removeEventListener("pointerdown", this.onPointerDown), this.container.removeEventListener("pointermove", this.onPointerMove), this.container.removeEventListener("pointerup", this.onPointerUp), this.container.removeEventListener("keydown", this.onKeyDown), this.opts.closeDialog?.(), this.container.remove();
|
|
1875
1921
|
}
|
|
1876
1922
|
}
|
|
1877
|
-
const
|
|
1923
|
+
const $i = {
|
|
1878
1924
|
rect: "rectangle",
|
|
1879
1925
|
arrow: "arrow",
|
|
1880
1926
|
pen: "pen",
|
|
1881
1927
|
blur: "blur"
|
|
1882
1928
|
};
|
|
1883
|
-
function
|
|
1884
|
-
return new
|
|
1929
|
+
function _i(i) {
|
|
1930
|
+
return new zt(i).open();
|
|
1885
1931
|
}
|
|
1886
|
-
const
|
|
1932
|
+
const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1887
1933
|
__proto__: null,
|
|
1888
|
-
AnnotationEditor:
|
|
1889
|
-
compositeAnnotations:
|
|
1890
|
-
drawShape:
|
|
1891
|
-
openAnnotationEditor:
|
|
1892
|
-
rectFromPoints:
|
|
1934
|
+
AnnotationEditor: zt,
|
|
1935
|
+
compositeAnnotations: Ot,
|
|
1936
|
+
drawShape: H,
|
|
1937
|
+
openAnnotationEditor: _i,
|
|
1938
|
+
rectFromPoints: B
|
|
1893
1939
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1940
|
+
ci();
|
|
1941
|
+
const Ni = document;
|
|
1896
1942
|
function p(i, t, ...e) {
|
|
1897
|
-
const o =
|
|
1943
|
+
const o = Ni.createElement(i);
|
|
1898
1944
|
if (t) {
|
|
1899
1945
|
if (t.class && (o.className = t.class), t.style && (o.style.cssText = t.style), t.html != null && (o.innerHTML = t.html), t.text != null && (o.textContent = t.text), t.attrs)
|
|
1900
1946
|
for (const n in t.attrs) o.setAttribute(n, t.attrs[n]);
|
|
@@ -1905,7 +1951,7 @@ function p(i, t, ...e) {
|
|
|
1905
1951
|
n != null && n !== !1 && o.append(n);
|
|
1906
1952
|
return o;
|
|
1907
1953
|
}
|
|
1908
|
-
class
|
|
1954
|
+
class Fi {
|
|
1909
1955
|
constructor(t) {
|
|
1910
1956
|
this.host = t;
|
|
1911
1957
|
}
|
|
@@ -1932,8 +1978,8 @@ class Di {
|
|
|
1932
1978
|
async startRecording(t = []) {
|
|
1933
1979
|
if (!(this.isRecording || this.host.state !== "IDLE"))
|
|
1934
1980
|
try {
|
|
1935
|
-
this.networkCapture =
|
|
1936
|
-
const { createVideoRecorder: e } = await Promise.resolve().then(() =>
|
|
1981
|
+
this.networkCapture = ui();
|
|
1982
|
+
const { createVideoRecorder: e } = await Promise.resolve().then(() => Bt);
|
|
1937
1983
|
this.videoRecorder = e({
|
|
1938
1984
|
maxDuration: this.host.config.videoOptions.maxDuration,
|
|
1939
1985
|
redactionElements: t
|
|
@@ -1999,7 +2045,7 @@ class Di {
|
|
|
1999
2045
|
}
|
|
2000
2046
|
handleRedactPickClick(t) {
|
|
2001
2047
|
const e = t.target instanceof Element ? t.target : null;
|
|
2002
|
-
if (!e ||
|
|
2048
|
+
if (!e || R(e) || this.redactPickerRoot?.contains(e)) return;
|
|
2003
2049
|
t.preventDefault(), t.stopPropagation();
|
|
2004
2050
|
const o = this.redactPicks.indexOf(e);
|
|
2005
2051
|
o >= 0 ? this.redactPicks.splice(o, 1) : this.redactPicks.push(e);
|
|
@@ -2160,11 +2206,11 @@ class Di {
|
|
|
2160
2206
|
this.isRecording = !1, this.removeRecordingIndicator(), this.videoRecorder && (this.videoRecorder.destroy(), this.videoRecorder = null), this.networkCapture && (this.networkCapture.restore(), this.networkCapture = null), this.recordedBlob && (this.recordedBlob = null), this.host.setButtonsDisabled(!1), this.host.overlayShadowHost && this.host.state === "IDLE" && (this.host.overlayShadowHost.style.pointerEvents = "none");
|
|
2161
2207
|
}
|
|
2162
2208
|
}
|
|
2163
|
-
const
|
|
2209
|
+
const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2164
2210
|
__proto__: null,
|
|
2165
|
-
RecordingController:
|
|
2211
|
+
RecordingController: Fi
|
|
2166
2212
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2167
|
-
async function
|
|
2213
|
+
async function Vi(i = {}) {
|
|
2168
2214
|
const { quality: t = 0.8, maxWidth: e = 1280, maxHeight: o = 800 } = i;
|
|
2169
2215
|
try {
|
|
2170
2216
|
if (!navigator.mediaDevices?.getDisplayMedia)
|
|
@@ -2193,11 +2239,11 @@ async function Mi(i = {}) {
|
|
|
2193
2239
|
return console.warn("Screenshot capture failed:", n), null;
|
|
2194
2240
|
}
|
|
2195
2241
|
}
|
|
2196
|
-
const
|
|
2242
|
+
const xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2197
2243
|
__proto__: null,
|
|
2198
|
-
captureScreenshot:
|
|
2244
|
+
captureScreenshot: Vi
|
|
2199
2245
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2200
|
-
class
|
|
2246
|
+
class Ui {
|
|
2201
2247
|
constructor(t) {
|
|
2202
2248
|
this.host = t;
|
|
2203
2249
|
}
|
|
@@ -2235,7 +2281,7 @@ class Ri {
|
|
|
2235
2281
|
), this.host.applyVars(e), t.appendChild(e), this.modalContainer = e, this.setupModalInteractions();
|
|
2236
2282
|
}
|
|
2237
2283
|
showPositionedModal() {
|
|
2238
|
-
const t = this.host.ensureOverlayHost(), { modal: e, arrow: o } =
|
|
2284
|
+
const t = this.host.ensureOverlayHost(), { modal: e, arrow: o } = je(
|
|
2239
2285
|
this.host.selectedBounds,
|
|
2240
2286
|
window.innerWidth,
|
|
2241
2287
|
window.innerHeight,
|
|
@@ -2262,9 +2308,9 @@ class Ri {
|
|
|
2262
2308
|
* markup, because they are documented as SVG/HTML strings.
|
|
2263
2309
|
*/
|
|
2264
2310
|
buildModalContent() {
|
|
2265
|
-
const { config: t, uid: e } = this.host, o = t.text, n = this.host.feedbackData.feedbackType, s = n === "up", a = t.positiveIcon || V, c = t.negativeIcon ||
|
|
2311
|
+
const { config: t, uid: e } = this.host, o = t.text, n = this.host.feedbackData.feedbackType, s = n === "up", a = t.positiveIcon || V, c = t.negativeIcon || U, l = t.buttonClass ? `qaid-type-toggle qaid-type-toggle-custom ${t.buttonClass} ${s ? "qaid-btn-up" : "qaid-btn-down"}` : `qaid-type-toggle ${s ? "qaid-type-up" : "qaid-type-down"}`, d = s ? "Feedback type: positive" : "Feedback type: negative", r = n === "neutral" ? p("span", {
|
|
2266
2312
|
class: "qaid-type-static",
|
|
2267
|
-
html: t.feedbackIcon ||
|
|
2313
|
+
html: t.feedbackIcon || St,
|
|
2268
2314
|
attrs: { "aria-hidden": "true" }
|
|
2269
2315
|
}) : p("button", {
|
|
2270
2316
|
class: l,
|
|
@@ -2327,7 +2373,7 @@ class Ri {
|
|
|
2327
2373
|
o && o.addEventListener("click", () => {
|
|
2328
2374
|
const n = this.host.feedbackData.feedbackType === "up" ? "down" : "up";
|
|
2329
2375
|
this.host.feedbackData.feedbackType = n, this.host.config.buttonClass ? (o.classList.toggle("qaid-btn-up", n === "up"), o.classList.toggle("qaid-btn-down", n === "down")) : (o.classList.toggle("qaid-type-up", n === "up"), o.classList.toggle("qaid-type-down", n === "down"));
|
|
2330
|
-
const s = this.host.config.positiveIcon || V, a = this.host.config.negativeIcon ||
|
|
2376
|
+
const s = this.host.config.positiveIcon || V, a = this.host.config.negativeIcon || U;
|
|
2331
2377
|
o.innerHTML = n === "up" ? s : a;
|
|
2332
2378
|
const c = n === "up" ? "Feedback type: positive" : "Feedback type: negative";
|
|
2333
2379
|
o.setAttribute("aria-pressed", String(n === "up")), o.setAttribute("aria-label", c), this.host.announceMsg(c), this.host.feedbackId && fetch(`${this.host.config.endpoint}/${this.host.feedbackId}`, {
|
|
@@ -2388,7 +2434,7 @@ class Ri {
|
|
|
2388
2434
|
{ class: t ? "qaid-confirm" : "qaid-confirm qaid-confirm-error" },
|
|
2389
2435
|
p("span", {
|
|
2390
2436
|
class: "qaid-confirm-icon",
|
|
2391
|
-
html: t ?
|
|
2437
|
+
html: t ? Et : pe,
|
|
2392
2438
|
attrs: { "aria-hidden": "true" }
|
|
2393
2439
|
}),
|
|
2394
2440
|
a,
|
|
@@ -2403,14 +2449,14 @@ class Ri {
|
|
|
2403
2449
|
), requestAnimationFrame(() => a.focus()), this.host.announceMsg(`${n} ${s}`, !0);
|
|
2404
2450
|
}
|
|
2405
2451
|
}
|
|
2406
|
-
const
|
|
2452
|
+
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2407
2453
|
__proto__: null,
|
|
2408
|
-
ModalController:
|
|
2409
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2410
|
-
function
|
|
2454
|
+
ModalController: Ui
|
|
2455
|
+
}, Symbol.toStringTag, { value: "Module" })), $t = ["data-comp", "data-qa", "data-testid", "data-id"];
|
|
2456
|
+
function _t(i, t = document.body) {
|
|
2411
2457
|
let e = i;
|
|
2412
2458
|
for (; e && e !== t; ) {
|
|
2413
|
-
for (const o of
|
|
2459
|
+
for (const o of $t) {
|
|
2414
2460
|
const n = e.getAttribute(o);
|
|
2415
2461
|
if (n)
|
|
2416
2462
|
return `${o}="${n}"`;
|
|
@@ -2419,37 +2465,37 @@ function Pt(i, t = document.body) {
|
|
|
2419
2465
|
}
|
|
2420
2466
|
return null;
|
|
2421
2467
|
}
|
|
2422
|
-
function
|
|
2468
|
+
function ji(i, t = 100) {
|
|
2423
2469
|
const e = i.textContent?.trim().slice(0, t) || "";
|
|
2424
2470
|
return e.length === t ? e + "..." : e;
|
|
2425
2471
|
}
|
|
2426
|
-
function
|
|
2472
|
+
function Ki(i) {
|
|
2427
2473
|
let t = 1, e = i.previousElementSibling;
|
|
2428
2474
|
for (; e; )
|
|
2429
2475
|
t++, e = e.previousElementSibling;
|
|
2430
2476
|
return t;
|
|
2431
2477
|
}
|
|
2432
|
-
function
|
|
2478
|
+
function Wi(i) {
|
|
2433
2479
|
const t = [];
|
|
2434
2480
|
let e = i;
|
|
2435
2481
|
for (; e && e !== document.body && e !== document.documentElement; ) {
|
|
2436
|
-
const o = e.tagName.toLowerCase(), n =
|
|
2482
|
+
const o = e.tagName.toLowerCase(), n = Ki(e);
|
|
2437
2483
|
t.unshift(`${o}:nth-child(${n})`), e = e.parentElement;
|
|
2438
2484
|
}
|
|
2439
2485
|
return t.length > 0 ? `body > ${t.join(" > ")}` : "body";
|
|
2440
2486
|
}
|
|
2441
|
-
function
|
|
2487
|
+
function Xi(i) {
|
|
2442
2488
|
return i.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
2443
2489
|
}
|
|
2444
|
-
function
|
|
2445
|
-
const t =
|
|
2446
|
-
return t ? `[${t}]` : i.id ? `#${
|
|
2490
|
+
function Yi(i) {
|
|
2491
|
+
const t = _t(i);
|
|
2492
|
+
return t ? `[${t}]` : i.id ? `#${Xi(i.id)}` : Wi(i);
|
|
2447
2493
|
}
|
|
2448
2494
|
function F(i) {
|
|
2449
|
-
const t =
|
|
2450
|
-
return { selector:
|
|
2495
|
+
const t = ji(i), e = _t(i);
|
|
2496
|
+
return { selector: Yi(i), text: t, dataAttr: e };
|
|
2451
2497
|
}
|
|
2452
|
-
const
|
|
2498
|
+
const Qi = [
|
|
2453
2499
|
"a[href]",
|
|
2454
2500
|
"button",
|
|
2455
2501
|
"input:not([type=hidden])",
|
|
@@ -2468,9 +2514,9 @@ const $i = [
|
|
|
2468
2514
|
"p",
|
|
2469
2515
|
"li",
|
|
2470
2516
|
"label",
|
|
2471
|
-
|
|
2472
|
-
].join(","),
|
|
2473
|
-
function
|
|
2517
|
+
...$t.map((i) => `[${i}]`)
|
|
2518
|
+
].join(","), Ji = /^(?:A|BUTTON|INPUT|SELECT|TEXTAREA|SUMMARY)$/;
|
|
2519
|
+
function Gi(i) {
|
|
2474
2520
|
if (i.hasAttribute("hidden") || i.getAttribute("aria-hidden") === "true") return !1;
|
|
2475
2521
|
const t = i.ownerDocument?.defaultView;
|
|
2476
2522
|
if (t && typeof t.getComputedStyle == "function") {
|
|
@@ -2479,14 +2525,14 @@ function Fi(i) {
|
|
|
2479
2525
|
}
|
|
2480
2526
|
return !0;
|
|
2481
2527
|
}
|
|
2482
|
-
function
|
|
2483
|
-
const t = i.root ?? document.body, e = i.selector ??
|
|
2528
|
+
function Zi(i = {}) {
|
|
2529
|
+
const t = i.root ?? document.body, e = i.selector ?? Qi, o = i.isExcluded ?? (() => !1), n = i.isVisible ?? Gi;
|
|
2484
2530
|
return Array.from(t.querySelectorAll(e)).filter(
|
|
2485
2531
|
(s) => !o(s) && n(s)
|
|
2486
2532
|
);
|
|
2487
2533
|
}
|
|
2488
|
-
function
|
|
2489
|
-
const t = i.candidates ??
|
|
2534
|
+
function to(i) {
|
|
2535
|
+
const t = i.candidates ?? Zi({
|
|
2490
2536
|
root: i.root,
|
|
2491
2537
|
selector: i.selector,
|
|
2492
2538
|
isExcluded: i.isExcluded,
|
|
@@ -2503,7 +2549,7 @@ function Ni(i) {
|
|
|
2503
2549
|
if (!e) return;
|
|
2504
2550
|
const k = u;
|
|
2505
2551
|
if (typeof k.focus == "function") {
|
|
2506
|
-
u.getAttribute("tabindex") === null && !
|
|
2552
|
+
u.getAttribute("tabindex") === null && !Ji.test(u.tagName) && (u.setAttribute("tabindex", "-1"), n.add(u));
|
|
2507
2553
|
try {
|
|
2508
2554
|
k.focus();
|
|
2509
2555
|
} catch {
|
|
@@ -2577,8 +2623,8 @@ function Ni(i) {
|
|
|
2577
2623
|
stop: y
|
|
2578
2624
|
};
|
|
2579
2625
|
}
|
|
2580
|
-
const
|
|
2581
|
-
class
|
|
2626
|
+
const eo = 12;
|
|
2627
|
+
class io {
|
|
2582
2628
|
constructor(t) {
|
|
2583
2629
|
this.host = t;
|
|
2584
2630
|
}
|
|
@@ -2607,8 +2653,8 @@ class ji {
|
|
|
2607
2653
|
* KeyboardTargetingController owns Tab/Arrow/Enter/Space/Escape.
|
|
2608
2654
|
*/
|
|
2609
2655
|
startKeyboard(t) {
|
|
2610
|
-
this.host.setState("TARGETING"), this.host.feedbackData.feedbackType = t, this.host.feedbackData.elementSelector = null, this.host.feedbackData.elementText = null, this.host.selectedBounds.visible = !1, document.body.style.setProperty("--qaid-positive", this.host.cssVars["--qaid-positive"]), document.body.style.setProperty("--qaid-negative", this.host.cssVars["--qaid-negative"]), this.createTargetingOverlay(), this.crosshairH && (this.crosshairH.style.display = "none"), this.crosshairV && (this.crosshairV.style.display = "none"), this.scope && (this.scope.style.display = "none"), this.keyboardController =
|
|
2611
|
-
isExcluded: (e) =>
|
|
2656
|
+
this.host.setState("TARGETING"), this.host.feedbackData.feedbackType = t, this.host.feedbackData.elementSelector = null, this.host.feedbackData.elementText = null, this.host.selectedBounds.visible = !1, document.body.style.setProperty("--qaid-positive", this.host.cssVars["--qaid-positive"]), document.body.style.setProperty("--qaid-negative", this.host.cssVars["--qaid-negative"]), this.createTargetingOverlay(), this.crosshairH && (this.crosshairH.style.display = "none"), this.crosshairV && (this.crosshairV.style.display = "none"), this.scope && (this.scope.style.display = "none"), this.keyboardController = to({
|
|
2657
|
+
isExcluded: (e) => R(e),
|
|
2612
2658
|
onHighlight: (e) => {
|
|
2613
2659
|
const o = e.getBoundingClientRect(), n = this.highlightBox;
|
|
2614
2660
|
n && (n.style.transform = `translate(${o.left}px, ${o.top}px)`, n.style.width = `${o.width}px`, n.style.height = `${o.height}px`, n.style.display = "block");
|
|
@@ -2620,7 +2666,7 @@ class ji {
|
|
|
2620
2666
|
});
|
|
2621
2667
|
}
|
|
2622
2668
|
selectKeyboardTarget(t) {
|
|
2623
|
-
const e =
|
|
2669
|
+
const e = lt(t, 8);
|
|
2624
2670
|
Object.assign(this.host.selectedBounds, e, {
|
|
2625
2671
|
clickX: e.x + e.width / 2,
|
|
2626
2672
|
clickY: e.y + e.height / 2,
|
|
@@ -2645,8 +2691,8 @@ class ji {
|
|
|
2645
2691
|
/** Move the crosshair/scope reticle and highlight the element under (x, y). */
|
|
2646
2692
|
updateReticleAt(t, e) {
|
|
2647
2693
|
if (this.mousePos.x = t, this.mousePos.y = e, this.crosshairH && (this.crosshairH.style.top = `${e}px`), this.crosshairV && (this.crosshairV.style.left = `${t}px`), this.scope && (this.scope.style.left = `${t}px`, this.scope.style.top = `${e}px`), this.captureLayer && this.host.shadowHost) {
|
|
2648
|
-
const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n =
|
|
2649
|
-
if (n && !
|
|
2694
|
+
const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = ct(t, e, o);
|
|
2695
|
+
if (n && !R(n)) {
|
|
2650
2696
|
if (this.highlightBox) {
|
|
2651
2697
|
const s = n.getBoundingClientRect();
|
|
2652
2698
|
this.highlightBox.style.transform = `translate(${s.left}px, ${s.top}px)`, this.highlightBox.style.width = `${s.width}px`, this.highlightBox.style.height = `${s.height}px`, this.highlightBox.style.display = "block";
|
|
@@ -2664,14 +2710,14 @@ class ji {
|
|
|
2664
2710
|
}
|
|
2665
2711
|
handleTouchEnd(t) {
|
|
2666
2712
|
const e = t.changedTouches[0], o = this.touchStartPos;
|
|
2667
|
-
this.touchStartPos = null, !(!e || !o || Math.hypot(e.clientX - o.x, e.clientY - o.y) >
|
|
2713
|
+
this.touchStartPos = null, !(!e || !o || Math.hypot(e.clientX - o.x, e.clientY - o.y) > eo) && (t.preventDefault(), this.selectAt(e.clientX, e.clientY));
|
|
2668
2714
|
}
|
|
2669
2715
|
/** Select the element under (x, y) and tear down targeting. */
|
|
2670
2716
|
selectAt(t, e) {
|
|
2671
|
-
const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n =
|
|
2672
|
-
if (!n ||
|
|
2717
|
+
const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = ct(t, e, o);
|
|
2718
|
+
if (!n || R(n))
|
|
2673
2719
|
return;
|
|
2674
|
-
const s =
|
|
2720
|
+
const s = lt(n, 8);
|
|
2675
2721
|
Object.assign(this.host.selectedBounds, s, { clickX: t, clickY: e, visible: !0 });
|
|
2676
2722
|
const { selector: a, text: c } = F(n);
|
|
2677
2723
|
this.host.feedbackData.elementSelector = a, this.host.feedbackData.elementText = c, this.stopTargetingListeners(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.host.setState("SELECTED"), this.host.clearActiveThumb(), this.showSelectedMarker(), this.host.submitFeedback();
|
|
@@ -2697,22 +2743,22 @@ class ji {
|
|
|
2697
2743
|
this.keyboardController?.stop(), this.keyboardController = null, this.stopTargetingListeners(), this.hideMarker();
|
|
2698
2744
|
}
|
|
2699
2745
|
}
|
|
2700
|
-
const
|
|
2746
|
+
const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2701
2747
|
__proto__: null,
|
|
2702
|
-
TargetingController:
|
|
2748
|
+
TargetingController: io
|
|
2703
2749
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2704
2750
|
export {
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2751
|
+
zt as AnnotationEditor,
|
|
2752
|
+
ni as QaidFeedback,
|
|
2753
|
+
Ti as captureDomScreenshot,
|
|
2754
|
+
ui as captureNetworkErrors,
|
|
2755
|
+
Ot as compositeAnnotations,
|
|
2756
|
+
xi as createVideoRecorder,
|
|
2757
|
+
H as drawShape,
|
|
2758
|
+
Pt as getSupportedMimeType,
|
|
2759
|
+
Si as isDomScreenshotSupported,
|
|
2760
|
+
ki as isVideoRecordingSupported,
|
|
2761
|
+
_i as openAnnotationEditor,
|
|
2762
|
+
B as rectFromPoints
|
|
2717
2763
|
};
|
|
2718
2764
|
//# sourceMappingURL=index.js.map
|