@qaiddev/thumbs-embed 1.10.1 → 1.11.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/dist/annotate.d.ts +2 -0
- package/dist/chunks/annotate-5zJWs-aB.js +357 -0
- package/dist/chunks/annotate-5zJWs-aB.js.map +1 -0
- package/dist/chunks/{core-2nGsCcZq.js → core-CL1dwdaN.js} +425 -402
- package/dist/chunks/core-CL1dwdaN.js.map +1 -0
- package/dist/chunks/modal-DccueVYZ.js +222 -0
- package/dist/chunks/modal-DccueVYZ.js.map +1 -0
- package/dist/chunks/recording-CPzxRL7f.js +323 -0
- package/dist/chunks/recording-CPzxRL7f.js.map +1 -0
- package/dist/chunks/{targeting-DaBmGVk5.js → targeting-mahtuPpo.js} +107 -105
- package/dist/chunks/targeting-mahtuPpo.js.map +1 -0
- package/dist/embed.d.ts +9 -3
- package/dist/index.js +320 -292
- package/dist/index.js.map +1 -1
- package/dist/loader.js +2 -2
- package/dist/modal.d.ts +2 -0
- package/dist/qaid.umd.cjs +10 -10
- package/dist/qaid.umd.cjs.map +1 -1
- package/dist/recording.d.ts +2 -0
- package/dist/targeting.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/annotate-BTLeFQa0.js +0 -355
- package/dist/chunks/annotate-BTLeFQa0.js.map +0 -1
- package/dist/chunks/core-2nGsCcZq.js.map +0 -1
- package/dist/chunks/modal-zwBhxWO0.js +0 -219
- package/dist/chunks/modal-zwBhxWO0.js.map +0 -1
- package/dist/chunks/recording-DNngIGr2.js +0 -321
- package/dist/chunks/recording-DNngIGr2.js.map +0 -1
- package/dist/chunks/targeting-DaBmGVk5.js.map +0 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Mt = `<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>`, Lt = `<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>`, Ht = `<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>`, Bt = `<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>`, Te = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
10
|
-
<rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
|
|
11
9
|
</svg>`, Ee = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
12
|
-
<
|
|
10
|
+
<rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
|
|
13
11
|
</svg>`, Ie = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
14
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="
|
|
12
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 19L19 5m0 0h-8m8 0v8"/>
|
|
15
13
|
</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">
|
|
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>`, Me = `<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>`, Le = `<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>`, He = `<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>`, Be = `<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>`, Oe = `<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>`, Ht = "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;pointer-events:auto;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}}", Bt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
|
|
25
|
+
</svg>`, Ot = "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}button.qaid-btn-record:hover{background:#dc2626;color:#fff}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-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}@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{outline:2px solid CanvasText;outline-offset:2px}}", Rt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
|
|
26
26
|
let b = 0;
|
|
27
|
-
const
|
|
27
|
+
const Pt = "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)}", zt = {
|
|
28
28
|
small: 36,
|
|
29
29
|
medium: 48,
|
|
30
30
|
large: 64
|
|
31
|
-
},
|
|
31
|
+
}, Ft = {
|
|
32
32
|
small: 18,
|
|
33
33
|
medium: 24,
|
|
34
34
|
large: 32
|
|
35
35
|
};
|
|
36
|
-
function Nt(e, t,
|
|
37
|
-
const [
|
|
38
|
-
return 0.2126 *
|
|
36
|
+
function Nt(e, t, o) {
|
|
37
|
+
const [i, s, n] = [e, t, o].map((a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4)));
|
|
38
|
+
return 0.2126 * i + 0.7152 * s + 0.0722 * n;
|
|
39
39
|
}
|
|
40
40
|
function Ut(e) {
|
|
41
41
|
if (e.startsWith("#")) {
|
|
42
|
-
const
|
|
42
|
+
const o = e.slice(1), i = o.length === 3 ? o.split("").map((n) => n + n).join("") : o, s = parseInt(i, 16);
|
|
43
43
|
return {
|
|
44
|
-
r:
|
|
45
|
-
g:
|
|
46
|
-
b:
|
|
44
|
+
r: s >> 16 & 255,
|
|
45
|
+
g: s >> 8 & 255,
|
|
46
|
+
b: s & 255
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
const t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
@@ -53,50 +53,50 @@ function Ut(e) {
|
|
|
53
53
|
b: parseInt(t[3])
|
|
54
54
|
} : null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function _t(e) {
|
|
57
57
|
const t = Ut(e);
|
|
58
58
|
return t && Nt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Vt(e = {}) {
|
|
61
61
|
const {
|
|
62
62
|
positiveColor: t = "rgb(0, 200, 83)",
|
|
63
|
-
negativeColor:
|
|
64
|
-
markerColor:
|
|
65
|
-
buttonSize:
|
|
63
|
+
negativeColor: o = "rgb(255, 0, 0)",
|
|
64
|
+
markerColor: i = "#6365f1",
|
|
65
|
+
buttonSize: s = "medium",
|
|
66
66
|
modalWidth: n = 400,
|
|
67
|
-
backdropOpacity:
|
|
67
|
+
backdropOpacity: a = 0.3,
|
|
68
68
|
fontFamily: l = "system-ui, -apple-system, sans-serif",
|
|
69
69
|
fontSize: c = 16
|
|
70
|
-
} = e, d =
|
|
70
|
+
} = e, d = zt[s], r = Ft[s], u = _t(i);
|
|
71
71
|
return {
|
|
72
72
|
"--qaid-positive": t,
|
|
73
|
-
"--qaid-negative":
|
|
74
|
-
"--qaid-marker":
|
|
73
|
+
"--qaid-negative": o,
|
|
74
|
+
"--qaid-marker": i,
|
|
75
75
|
"--qaid-marker-text": u,
|
|
76
76
|
"--qaid-btn-size": `${d}px`,
|
|
77
|
-
"--qaid-icon-size": `${
|
|
77
|
+
"--qaid-icon-size": `${r}px`,
|
|
78
78
|
"--qaid-modal-width": `${n}px`,
|
|
79
|
-
"--qaid-backdrop-opacity": String(
|
|
79
|
+
"--qaid-backdrop-opacity": String(a),
|
|
80
80
|
"--qaid-font-family": l,
|
|
81
81
|
"--qaid-font-size": `${c}px`
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
for (const [
|
|
86
|
-
e.style.setProperty(
|
|
84
|
+
function $t(e, t) {
|
|
85
|
+
for (const [o, i] of Object.entries(t))
|
|
86
|
+
e.style.setProperty(o, i);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function X() {
|
|
89
|
+
return Ot + Pt;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Kt() {
|
|
92
92
|
if (b++, b > 1) return;
|
|
93
93
|
const e = document.createElement("style");
|
|
94
|
-
e.id = "qaid-styles", e.textContent =
|
|
94
|
+
e.id = "qaid-styles", e.textContent = Rt, document.head.appendChild(e);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Qt() {
|
|
97
97
|
b <= 0 || (b--, b === 0 && document.getElementById("qaid-styles")?.remove());
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const Y = "data-qaid-a11y-live", jt = "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;", Wt = [
|
|
100
100
|
"a[href]",
|
|
101
101
|
"button",
|
|
102
102
|
"input",
|
|
@@ -104,30 +104,30 @@ const X = "data-qaid-a11y-live", Kt = "position:absolute;width:1px;height:1px;ma
|
|
|
104
104
|
"select",
|
|
105
105
|
"[tabindex]"
|
|
106
106
|
].join(",");
|
|
107
|
-
function
|
|
107
|
+
function Xt(e) {
|
|
108
108
|
return e.ownerDocument || document;
|
|
109
109
|
}
|
|
110
110
|
function Yt(e, t) {
|
|
111
|
-
const
|
|
112
|
-
`[${
|
|
111
|
+
const o = t ? "assertive" : "polite", i = e.querySelector(
|
|
112
|
+
`[${Y}="${o}"]`
|
|
113
113
|
);
|
|
114
|
-
if (
|
|
115
|
-
const n =
|
|
116
|
-
return n.setAttribute(
|
|
114
|
+
if (i) return i;
|
|
115
|
+
const n = Xt(e).createElement("div");
|
|
116
|
+
return n.setAttribute(Y, o), n.setAttribute("role", t ? "alert" : "status"), n.setAttribute("aria-live", t ? "assertive" : "polite"), n.setAttribute("aria-atomic", "true"), n.style.cssText = jt, e.appendChild(n), n;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
function Jt(e, t, o = {}) {
|
|
119
|
+
const i = Yt(e, !!o.assertive);
|
|
120
|
+
i.textContent = "", i.textContent = t;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Gt(e) {
|
|
123
123
|
return e.hasAttribute("disabled") ? !0 : e.disabled === !0;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Zt(e) {
|
|
126
126
|
let t = e;
|
|
127
127
|
for (; t; ) {
|
|
128
128
|
if (t.hasAttribute("hidden")) return !0;
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
129
|
+
const o = t.style;
|
|
130
|
+
if (o && (o.display === "none" || o.visibility === "hidden" || o.visibility === "collapse"))
|
|
131
131
|
return !0;
|
|
132
132
|
t = t.parentElement;
|
|
133
133
|
}
|
|
@@ -135,8 +135,8 @@ function Gt(e) {
|
|
|
135
135
|
}
|
|
136
136
|
function J(e) {
|
|
137
137
|
return Array.from(
|
|
138
|
-
e.querySelectorAll(
|
|
139
|
-
).filter((
|
|
138
|
+
e.querySelectorAll(Wt)
|
|
139
|
+
).filter((o) => !(o.getAttribute("tabindex") === "-1" || o instanceof HTMLInputElement && o.type === "hidden" || o instanceof HTMLAnchorElement && !o.getAttribute("href") || Gt(o) || Zt(o)));
|
|
140
140
|
}
|
|
141
141
|
function it(e) {
|
|
142
142
|
let t = e.activeElement;
|
|
@@ -144,31 +144,31 @@ function it(e) {
|
|
|
144
144
|
t = t.shadowRoot.activeElement;
|
|
145
145
|
return t instanceof HTMLElement ? t : null;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function te(e) {
|
|
148
148
|
const t = e.ownerDocument || document;
|
|
149
|
-
let
|
|
150
|
-
const
|
|
149
|
+
let o = !1;
|
|
150
|
+
const i = (n) => {
|
|
151
151
|
if (n.key !== "Tab") return;
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
152
|
+
const a = J(e);
|
|
153
|
+
if (a.length === 0) {
|
|
154
154
|
n.preventDefault(), e.focus();
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
const l =
|
|
158
|
-
n.shiftKey ? (!
|
|
157
|
+
const l = a[0], c = a[a.length - 1], d = it(t), r = d ? a.indexOf(d) !== -1 : !1;
|
|
158
|
+
n.shiftKey ? (!r || d === l) && (n.preventDefault(), c.focus()) : (!r || d === c) && (n.preventDefault(), l.focus());
|
|
159
159
|
};
|
|
160
|
-
e.addEventListener("keydown",
|
|
161
|
-
const
|
|
162
|
-
return
|
|
160
|
+
e.addEventListener("keydown", i);
|
|
161
|
+
const s = J(e);
|
|
162
|
+
return s.length > 0 ? s[0].focus() : (e.hasAttribute("tabindex") || (e.setAttribute("tabindex", "-1"), o = !0), e.focus()), {
|
|
163
163
|
release() {
|
|
164
|
-
e.removeEventListener("keydown",
|
|
164
|
+
e.removeEventListener("keydown", i), o && (e.removeAttribute("tabindex"), o = !1);
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ee() {
|
|
169
169
|
return it(document);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function oe(e) {
|
|
172
172
|
if (!(!e || typeof e.focus != "function"))
|
|
173
173
|
try {
|
|
174
174
|
e.focus();
|
|
@@ -178,159 +178,159 @@ function ee(e) {
|
|
|
178
178
|
function ie(e, t = {}) {
|
|
179
179
|
e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), t.labelledbyId && e.setAttribute("aria-labelledby", t.labelledbyId), t.describedbyId && e.setAttribute("aria-describedby", t.describedbyId), t.label && e.setAttribute("aria-label", t.label);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
let
|
|
183
|
-
for (;
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
186
|
-
if (
|
|
187
|
-
|
|
181
|
+
function ne(e, t) {
|
|
182
|
+
let o = e;
|
|
183
|
+
for (; o && o !== t; ) {
|
|
184
|
+
const i = o.parentNode;
|
|
185
|
+
if (i === t) return o;
|
|
186
|
+
if (i && i.host) {
|
|
187
|
+
o = i.host;
|
|
188
188
|
continue;
|
|
189
189
|
}
|
|
190
|
-
if (!
|
|
191
|
-
|
|
190
|
+
if (!i) return null;
|
|
191
|
+
o = i;
|
|
192
192
|
}
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
195
|
+
function se(e) {
|
|
196
|
+
const o = (e.ownerDocument || document).body;
|
|
197
|
+
if (!o) return () => {
|
|
198
198
|
};
|
|
199
|
-
const
|
|
200
|
-
return Array.from(
|
|
201
|
-
if (!(n instanceof HTMLElement) ||
|
|
202
|
-
const
|
|
203
|
-
|
|
199
|
+
const i = ne(e, o), s = [];
|
|
200
|
+
return Array.from(o.children).forEach((n) => {
|
|
201
|
+
if (!(n instanceof HTMLElement) || i && n === i) return;
|
|
202
|
+
const a = n.inert === !0, l = n.getAttribute("aria-hidden");
|
|
203
|
+
a && l === "true" || (n.inert = !0, n.setAttribute("aria-hidden", "true"), s.push({ el: n, prevInert: a, prevAriaHidden: l }));
|
|
204
204
|
}), function() {
|
|
205
|
-
for (;
|
|
206
|
-
const
|
|
207
|
-
|
|
205
|
+
for (; s.length; ) {
|
|
206
|
+
const a = s.pop();
|
|
207
|
+
a.el.inert = a.prevInert, a.prevAriaHidden === null ? a.el.removeAttribute("aria-hidden") : a.el.setAttribute("aria-hidden", a.prevAriaHidden);
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
const
|
|
211
|
+
const nt = {
|
|
212
212
|
width: 400,
|
|
213
213
|
height: 280,
|
|
214
214
|
arrowHeight: 12,
|
|
215
215
|
gap: 8,
|
|
216
216
|
viewportPadding: 16
|
|
217
217
|
};
|
|
218
|
-
function ae(e, t,
|
|
219
|
-
const n = e.y,
|
|
220
|
-
if (
|
|
218
|
+
function ae(e, t, o, i, s) {
|
|
219
|
+
const n = e.y, a = t - (e.y + e.height);
|
|
220
|
+
if (a >= o + i)
|
|
221
221
|
return {
|
|
222
|
-
top: e.y + e.height +
|
|
222
|
+
top: e.y + e.height + i,
|
|
223
223
|
position: "below"
|
|
224
224
|
};
|
|
225
|
-
if (n >=
|
|
225
|
+
if (n >= o + i)
|
|
226
226
|
return {
|
|
227
|
-
top: e.y -
|
|
227
|
+
top: e.y - o - i,
|
|
228
228
|
position: "above"
|
|
229
229
|
};
|
|
230
|
-
const l =
|
|
230
|
+
const l = a > n ? "below" : "above";
|
|
231
231
|
let c;
|
|
232
232
|
return l === "below" ? c = Math.min(
|
|
233
|
-
e.y + e.height +
|
|
234
|
-
t -
|
|
235
|
-
) : c = Math.max(
|
|
233
|
+
e.y + e.height + i,
|
|
234
|
+
t - o - s
|
|
235
|
+
) : c = Math.max(s, e.y - o - i), { top: c, position: l };
|
|
236
236
|
}
|
|
237
|
-
function re(e, t,
|
|
238
|
-
let n = e.x + e.width / 2 -
|
|
239
|
-
return n = Math.max(
|
|
237
|
+
function re(e, t, o, i) {
|
|
238
|
+
let n = e.x + e.width / 2 - o / 2;
|
|
239
|
+
return n = Math.max(i, Math.min(n, t - o - i)), n;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
return Math.max(
|
|
241
|
+
function de(e, t, o, i = 24, s = 24) {
|
|
242
|
+
const a = e.clickX - t - s / 2;
|
|
243
|
+
return Math.max(i, Math.min(a, o - i - s / 2));
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
const
|
|
245
|
+
function le(e, t, o, i = nt) {
|
|
246
|
+
const s = i.height + i.arrowHeight, n = ae(
|
|
247
247
|
e,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
),
|
|
248
|
+
o,
|
|
249
|
+
s,
|
|
250
|
+
i.gap,
|
|
251
|
+
i.viewportPadding
|
|
252
|
+
), a = re(
|
|
253
253
|
e,
|
|
254
254
|
t,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
i.width,
|
|
256
|
+
i.viewportPadding
|
|
257
257
|
);
|
|
258
258
|
return {
|
|
259
259
|
top: n.top,
|
|
260
|
-
left:
|
|
260
|
+
left: a,
|
|
261
261
|
position: n.position
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
const
|
|
266
|
-
let n = e.bottom +
|
|
267
|
-
n + t.height >
|
|
268
|
-
let
|
|
269
|
-
return
|
|
264
|
+
function ce(e, t, o, i = {}) {
|
|
265
|
+
const s = i.gap ?? 8;
|
|
266
|
+
let n = e.bottom + s;
|
|
267
|
+
n + t.height > o.height - s && (n = e.top - t.height - s);
|
|
268
|
+
let a = e.left;
|
|
269
|
+
return a < s ? a = s : a + t.width > o.width - s && (a = o.width - t.width - s), n < s ? n = s : n + t.height > o.height - s && (n = o.height - t.height - s), { top: n, left: a };
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
const
|
|
271
|
+
function Re(e, t, o, i = nt) {
|
|
272
|
+
const s = le(e, t, o, i), n = de(
|
|
273
273
|
e,
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
s.left,
|
|
275
|
+
i.width
|
|
276
276
|
);
|
|
277
277
|
return {
|
|
278
|
-
modal:
|
|
278
|
+
modal: s,
|
|
279
279
|
arrow: { left: n }
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
function
|
|
284
|
-
const t = [],
|
|
282
|
+
const ue = 20;
|
|
283
|
+
function he(e) {
|
|
284
|
+
const t = [], o = console.error, i = console.warn, s = console.log, n = (a, l) => {
|
|
285
285
|
const c = {
|
|
286
286
|
message: l.map((d) => String(d)).join(" "),
|
|
287
287
|
timestamp: Date.now(),
|
|
288
|
-
level:
|
|
288
|
+
level: a
|
|
289
289
|
};
|
|
290
|
-
t.length >=
|
|
290
|
+
t.length >= ue && t.shift(), t.push(c), e && e(c);
|
|
291
291
|
};
|
|
292
|
-
return console.error = function(...
|
|
293
|
-
n("error",
|
|
294
|
-
}, console.warn = function(...
|
|
295
|
-
n("warn",
|
|
296
|
-
}, console.log = function(...
|
|
297
|
-
n("log",
|
|
292
|
+
return console.error = function(...a) {
|
|
293
|
+
n("error", a), o.apply(console, a);
|
|
294
|
+
}, console.warn = function(...a) {
|
|
295
|
+
n("warn", a), i.apply(console, a);
|
|
296
|
+
}, console.log = function(...a) {
|
|
297
|
+
n("log", a), s.apply(console, a);
|
|
298
298
|
}, {
|
|
299
299
|
errors: t,
|
|
300
300
|
restore: () => {
|
|
301
|
-
console.error =
|
|
301
|
+
console.error = o, console.warn = i, console.log = s;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const
|
|
305
|
+
function Pe(e, t, o) {
|
|
306
|
+
const i = document.createElement(e);
|
|
307
307
|
if (t)
|
|
308
|
-
for (const [
|
|
309
|
-
|
|
310
|
-
return
|
|
308
|
+
for (const [s, n] of Object.entries(t))
|
|
309
|
+
s === "className" ? i.className = n : i.setAttribute(s, n);
|
|
310
|
+
return i;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function fe(e = 640) {
|
|
313
313
|
return typeof window < "u" && window.innerWidth < e;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
return
|
|
315
|
+
function ze(e, t, o) {
|
|
316
|
+
const i = o.map((n) => n.style.visibility);
|
|
317
|
+
o.forEach((n) => n.style.visibility = "hidden");
|
|
318
|
+
const s = document.elementFromPoint(e, t);
|
|
319
|
+
return o.forEach((n, a) => n.style.visibility = i[a]), s;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Fe(e) {
|
|
322
322
|
return e ? e.hasAttribute("data-qaid-embed") || e.hasAttribute("data-qaid-embed-overlay") ? !0 : !!e.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
|
|
323
323
|
}
|
|
324
324
|
function Ne(e, t = 0) {
|
|
325
|
-
const
|
|
325
|
+
const o = e.getBoundingClientRect();
|
|
326
326
|
return {
|
|
327
|
-
x:
|
|
328
|
-
y:
|
|
329
|
-
width:
|
|
330
|
-
height:
|
|
327
|
+
x: o.left - t,
|
|
328
|
+
y: o.top - t,
|
|
329
|
+
width: o.width + t * 2,
|
|
330
|
+
height: o.height + t * 2
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const pe = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", be = (e) => (
|
|
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,50 +338,50 @@ const fe = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", pe =
|
|
|
338
338
|
e
|
|
339
339
|
)
|
|
340
340
|
);
|
|
341
|
-
let
|
|
342
|
-
const
|
|
343
|
-
function
|
|
341
|
+
let me = be, p = null, x = null;
|
|
342
|
+
const S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
343
|
+
function st(e, t) {
|
|
344
344
|
return `${e.replace(/\/+$/, "")}/${encodeURIComponent(t)}/definition`;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
if (
|
|
346
|
+
function ge(e) {
|
|
347
|
+
if (S.has(e)) return Promise.resolve();
|
|
348
348
|
const t = C.get(e);
|
|
349
349
|
if (t) return t;
|
|
350
|
-
const
|
|
351
|
-
|
|
350
|
+
const o = fetch(e, { headers: { Accept: "application/json" } }).then((i) => i.ok ? i.json() : null).then((i) => {
|
|
351
|
+
i && S.set(e, i);
|
|
352
352
|
}).catch(() => {
|
|
353
353
|
}).finally(() => {
|
|
354
354
|
C.delete(e);
|
|
355
355
|
});
|
|
356
|
-
return C.set(e,
|
|
356
|
+
return C.set(e, o), o;
|
|
357
357
|
}
|
|
358
358
|
function at(e) {
|
|
359
|
-
return p &&
|
|
360
|
-
const
|
|
361
|
-
if (!
|
|
359
|
+
return p && x === e || (x = e, p = Promise.resolve(me(e)).then((t) => {
|
|
360
|
+
const o = t;
|
|
361
|
+
if (!o || typeof o.QaidQuests != "function")
|
|
362
362
|
throw new Error("quests module has no QaidQuests export");
|
|
363
|
-
return
|
|
363
|
+
return o;
|
|
364
364
|
}).catch((t) => {
|
|
365
|
-
throw p = null,
|
|
365
|
+
throw p = null, x = null, t;
|
|
366
366
|
})), p;
|
|
367
367
|
}
|
|
368
|
-
async function
|
|
369
|
-
const t = await at(e.moduleUrl),
|
|
368
|
+
async function ve(e) {
|
|
369
|
+
const t = await at(e.moduleUrl), o = e.base.replace(/\/+$/, ""), i = st(o, e.questId), s = (l) => l != null ? { feedbackId: l } : void 0;
|
|
370
370
|
let n;
|
|
371
|
-
const
|
|
372
|
-
return
|
|
373
|
-
}) :
|
|
374
|
-
endpoint: `${
|
|
375
|
-
configUrl:
|
|
371
|
+
const a = e.feedbackId;
|
|
372
|
+
return a instanceof Promise ? n = t.QaidQuests.supports?.asyncMetadata ? a.then(s, () => {
|
|
373
|
+
}) : s(await a.catch(() => null)) : n = s(a ?? null), new t.QaidQuests({
|
|
374
|
+
endpoint: `${o}/responses`,
|
|
375
|
+
configUrl: i,
|
|
376
376
|
// Only a definition already in hand. One still loading is left to the
|
|
377
377
|
// widget, which shows its own loading state instead of nothing.
|
|
378
|
-
questionnaire:
|
|
378
|
+
questionnaire: S.get(i),
|
|
379
379
|
apiKey: e.apiKey || void 0,
|
|
380
380
|
metadata: n,
|
|
381
381
|
onClose: e.onClose
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
const G = "qaid_visitor_id", Z = "qaid_hide_feedback",
|
|
384
|
+
const G = "qaid_visitor_id", Z = "qaid_hide_feedback", ye = [
|
|
385
385
|
"#ef4444",
|
|
386
386
|
"#f59e0b",
|
|
387
387
|
"#22c55e",
|
|
@@ -389,22 +389,22 @@ const G = "qaid_visitor_id", Z = "qaid_hide_feedback", ve = [
|
|
|
389
389
|
"#111827",
|
|
390
390
|
"#ffffff"
|
|
391
391
|
];
|
|
392
|
-
function
|
|
392
|
+
function we() {
|
|
393
393
|
return typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function A(e) {
|
|
396
396
|
return e ? `${Z}_${e}` : Z;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function ke(e) {
|
|
399
399
|
try {
|
|
400
|
-
return localStorage.getItem(
|
|
400
|
+
return localStorage.getItem(A(e)) === "1";
|
|
401
401
|
} catch {
|
|
402
402
|
return !1;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
function tt(e, t = !0) {
|
|
406
406
|
try {
|
|
407
|
-
t ? localStorage.setItem(
|
|
407
|
+
t ? localStorage.setItem(A(e), "1") : localStorage.removeItem(A(e));
|
|
408
408
|
} catch {
|
|
409
409
|
}
|
|
410
410
|
}
|
|
@@ -415,10 +415,10 @@ function et() {
|
|
|
415
415
|
if (e && typeof e.getRandomValues == "function")
|
|
416
416
|
e.getRandomValues(t);
|
|
417
417
|
else
|
|
418
|
-
for (let
|
|
418
|
+
for (let i = 0; i < t.length; i++) t[i] = Math.floor(Math.random() * 256);
|
|
419
419
|
t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128;
|
|
420
|
-
const
|
|
421
|
-
return `${
|
|
420
|
+
const o = Array.from(t, (i) => i.toString(16).padStart(2, "0")).join("");
|
|
421
|
+
return `${o.slice(0, 8)}-${o.slice(8, 12)}-${o.slice(12, 16)}-${o.slice(16, 20)}-${o.slice(20)}`;
|
|
422
422
|
}
|
|
423
423
|
function qe() {
|
|
424
424
|
try {
|
|
@@ -428,6 +428,12 @@ function qe() {
|
|
|
428
428
|
return et();
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
+
function ot(e, t) {
|
|
432
|
+
const o = document.createElement("style");
|
|
433
|
+
o.setAttribute("data-qaid-feature", ""), o.textContent = t;
|
|
434
|
+
const i = e.querySelectorAll("style[data-qaid-base], style[data-qaid-feature]"), s = i[i.length - 1];
|
|
435
|
+
e.insertBefore(o, s ? s.nextSibling : e.firstChild);
|
|
436
|
+
}
|
|
431
437
|
class xe {
|
|
432
438
|
config;
|
|
433
439
|
state = "IDLE";
|
|
@@ -552,7 +558,7 @@ class xe {
|
|
|
552
558
|
captureScreenshot: t.captureScreenshot ?? !1,
|
|
553
559
|
annotate: t.annotate ?? !0,
|
|
554
560
|
annotationColor: t.annotationColor ?? t.colors?.marker ?? "#6365f1",
|
|
555
|
-
annotationPalette: t.annotationPalette ??
|
|
561
|
+
annotationPalette: t.annotationPalette ?? ye,
|
|
556
562
|
screenshotMethod: t.screenshotMethod ?? "permission",
|
|
557
563
|
screenshotOptions: {
|
|
558
564
|
quality: t.screenshotOptions?.quality ?? 0.8,
|
|
@@ -579,12 +585,12 @@ class xe {
|
|
|
579
585
|
video: t.quests?.video ?? "",
|
|
580
586
|
// Quest service reuses the feedback API key unless overridden.
|
|
581
587
|
apiKey: t.quests?.apiKey ?? t.apiKey ?? "",
|
|
582
|
-
moduleUrl: t.quests?.moduleUrl ??
|
|
588
|
+
moduleUrl: t.quests?.moduleUrl ?? pe
|
|
583
589
|
}
|
|
584
590
|
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = qe(), this.init();
|
|
585
591
|
}
|
|
586
592
|
applyVars(t) {
|
|
587
|
-
|
|
593
|
+
$t(t, this.cssVars);
|
|
588
594
|
}
|
|
589
595
|
/**
|
|
590
596
|
* Announce a message via the shared visually-hidden live regions.
|
|
@@ -592,26 +598,26 @@ class xe {
|
|
|
592
598
|
* is never inerted by its own dialogs) so announcements are not suppressed
|
|
593
599
|
* while a dialog aria-hides the main button host.
|
|
594
600
|
*/
|
|
595
|
-
announceMsg(t,
|
|
596
|
-
const
|
|
597
|
-
|
|
601
|
+
announceMsg(t, o = !1) {
|
|
602
|
+
const i = this.overlayShadowRoot ?? this.shadowRoot;
|
|
603
|
+
i && Jt(i, t, { assertive: o });
|
|
598
604
|
}
|
|
599
605
|
/**
|
|
600
606
|
* Turn a transient surface into an accessible modal dialog: save the
|
|
601
607
|
* invoking control, apply dialog semantics, trap focus, and inert the
|
|
602
608
|
* background. Paired with closeDialogA11y() on every close path.
|
|
603
609
|
*/
|
|
604
|
-
openDialogA11y(t,
|
|
605
|
-
this.dialogTrigger =
|
|
610
|
+
openDialogA11y(t, o) {
|
|
611
|
+
this.dialogTrigger = ee(), ie(t, o), this.dialogTrap = te(t), this.dialogRestoreInert = se(t);
|
|
606
612
|
}
|
|
607
613
|
closeDialogA11y() {
|
|
608
|
-
this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null),
|
|
614
|
+
this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), oe(this.dialogTrigger), this.dialogTrigger = null;
|
|
609
615
|
}
|
|
610
616
|
clearActiveThumb() {
|
|
611
617
|
this.activeThumbBtn && (this.activeThumbBtn.setAttribute("aria-pressed", "false"), this.activeThumbBtn = null);
|
|
612
618
|
}
|
|
613
619
|
init() {
|
|
614
|
-
|
|
620
|
+
Kt(), this.cssVars = Vt({
|
|
615
621
|
positiveColor: this.config.colors.positive,
|
|
616
622
|
negativeColor: this.config.colors.negative,
|
|
617
623
|
markerColor: this.config.colors.marker,
|
|
@@ -620,7 +626,7 @@ class xe {
|
|
|
620
626
|
backdropOpacity: this.config.backdropOpacity,
|
|
621
627
|
fontFamily: this.config.fontFamily,
|
|
622
628
|
fontSize: this.config.fontSize
|
|
623
|
-
}), !this.config.hideDismiss &&
|
|
629
|
+
}), !this.config.hideDismiss && ke(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = he((t) => {
|
|
624
630
|
this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
|
|
625
631
|
}), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot || this.linkedQuestIds().length > 0) && this.schedulePrewarm(() => {
|
|
626
632
|
this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot(), this.prewarmQuests();
|
|
@@ -633,19 +639,19 @@ class xe {
|
|
|
633
639
|
* swallowed — a failed preload just falls back to an on-demand load.
|
|
634
640
|
*/
|
|
635
641
|
prewarmVideo() {
|
|
636
|
-
this.videoPrewarmed || (this.videoPrewarmed = !0, import("./recording-
|
|
642
|
+
this.videoPrewarmed || (this.videoPrewarmed = !0, import("./recording-CPzxRL7f.js").catch(() => {
|
|
637
643
|
}), import("./video-Bd_29-rK.js").catch(() => {
|
|
638
644
|
}));
|
|
639
645
|
}
|
|
640
646
|
prewarmScreenshot() {
|
|
641
647
|
this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? import("./screenshot-dom-CME7tYRE.js") : import("./screenshot-DYOKg2bS.js")).catch(() => {
|
|
642
|
-
}), this.config.annotate && import("./annotate-
|
|
648
|
+
}), this.config.annotate && import("./annotate-5zJWs-aB.js").catch(() => {
|
|
643
649
|
}));
|
|
644
650
|
}
|
|
645
651
|
/** Quest ids linked to any button, when quest launching is on. */
|
|
646
652
|
linkedQuestIds() {
|
|
647
653
|
const t = this.config.quests;
|
|
648
|
-
return t.base ? [t.up, t.down, t.video].filter((
|
|
654
|
+
return t.base ? [t.up, t.down, t.video].filter((o) => o) : [];
|
|
649
655
|
}
|
|
650
656
|
/**
|
|
651
657
|
* Load the quests module and fetch every linked quest's definition, so a
|
|
@@ -658,16 +664,16 @@ class xe {
|
|
|
658
664
|
if (t.length !== 0) {
|
|
659
665
|
this.questsPrewarmed = !0, at(this.config.quests.moduleUrl).catch(() => {
|
|
660
666
|
});
|
|
661
|
-
for (const
|
|
662
|
-
|
|
667
|
+
for (const o of t)
|
|
668
|
+
ge(st(this.config.quests.base, o));
|
|
663
669
|
}
|
|
664
670
|
}
|
|
665
671
|
/** Run fn when the main thread is idle; cancelled by destroy(). */
|
|
666
672
|
schedulePrewarm(t) {
|
|
667
|
-
const
|
|
673
|
+
const o = window, i = () => {
|
|
668
674
|
this.destroyed || t();
|
|
669
675
|
};
|
|
670
|
-
typeof
|
|
676
|
+
typeof o.requestIdleCallback == "function" ? (this.prewarmIsTimeout = !1, this.prewarmHandle = o.requestIdleCallback(i, { timeout: 2e3 })) : (this.prewarmIsTimeout = !0, this.prewarmHandle = window.setTimeout(i, 1200));
|
|
671
677
|
}
|
|
672
678
|
/**
|
|
673
679
|
* Watch for the shadow hosts being removed from the DOM by framework
|
|
@@ -681,14 +687,14 @@ class xe {
|
|
|
681
687
|
*/
|
|
682
688
|
observeDom() {
|
|
683
689
|
this.boundBeforeSwap = (t) => {
|
|
684
|
-
const
|
|
685
|
-
!
|
|
690
|
+
const o = t.newDocument;
|
|
691
|
+
!o || this.destroyed || (this.shadowHost && o.body.appendChild(this.shadowHost), this.overlayShadowHost && o.body.appendChild(this.overlayShadowHost));
|
|
686
692
|
}, document.addEventListener("astro:before-swap", this.boundBeforeSwap), this.domObserver = new MutationObserver(() => {
|
|
687
693
|
this.destroyed || (this.shadowHost && !this.shadowHost.isConnected && document.body.appendChild(this.shadowHost), this.overlayShadowHost && !this.overlayShadowHost.isConnected && document.body.appendChild(this.overlayShadowHost));
|
|
688
694
|
}), this.domObserver.observe(document.body, { childList: !0 });
|
|
689
695
|
}
|
|
690
696
|
checkMobile() {
|
|
691
|
-
this.isMobile =
|
|
697
|
+
this.isMobile = fe();
|
|
692
698
|
}
|
|
693
699
|
handleResize() {
|
|
694
700
|
this.checkMobile();
|
|
@@ -697,18 +703,18 @@ class xe {
|
|
|
697
703
|
this.shadowHost = document.createElement("div"), this.shadowHost.setAttribute("data-qaid-embed", ""), this.shadowHost.style.position = "static", this.shadowHost.style.display = "contents";
|
|
698
704
|
let t = null;
|
|
699
705
|
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" });
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
706
|
+
const o = document.createElement("style");
|
|
707
|
+
if (o.setAttribute("data-qaid-base", ""), o.textContent = X(), this.shadowRoot.appendChild(o), this.config.css) {
|
|
702
708
|
const d = document.createElement("style");
|
|
703
709
|
d.textContent = this.config.css, this.shadowRoot.appendChild(d);
|
|
704
710
|
}
|
|
705
|
-
const
|
|
711
|
+
const i = this.config.direction === "vertical" ? "qaid-vertical" : "";
|
|
706
712
|
if (this.isUserProvidedContainer)
|
|
707
|
-
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-${this.config.position} ${
|
|
713
|
+
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-${this.config.position} ${i}`.trim(), this.config.incognito && this.buttonsContainer.classList.add("qaid-incognito");
|
|
708
714
|
else {
|
|
709
|
-
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-auto-container qaid-${this.config.position} ${
|
|
710
|
-
const { x: d, y:
|
|
711
|
-
this.config.position.includes("right") ? this.buttonsContainer.style.right = `${d}px` : this.buttonsContainer.style.left = `${d}px`, this.config.position.includes("bottom") ? this.buttonsContainer.style.bottom = `${
|
|
715
|
+
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-auto-container qaid-${this.config.position} ${i}${this.config.incognito ? " qaid-incognito" : ""}`.trim(), this.buttonsContainer.style.pointerEvents = "auto";
|
|
716
|
+
const { x: d, y: r } = this.config.offset;
|
|
717
|
+
this.config.position.includes("right") ? this.buttonsContainer.style.right = `${d}px` : this.buttonsContainer.style.left = `${d}px`, this.config.position.includes("bottom") ? this.buttonsContainer.style.bottom = `${r}px` : this.buttonsContainer.style.top = `${r}px`;
|
|
712
718
|
}
|
|
713
719
|
this.applyVars(this.buttonsContainer), this.shadowRoot.appendChild(this.buttonsContainer), this.buttonsContainer.addEventListener("keydown", (d) => {
|
|
714
720
|
(d.key === "Enter" || d.key === " " || d.key === "Spacebar") && (this.keyboardActivation = !0);
|
|
@@ -717,41 +723,41 @@ class xe {
|
|
|
717
723
|
}), this.buttonsContainer.addEventListener("pointerdown", () => {
|
|
718
724
|
this.keyboardActivation = !1;
|
|
719
725
|
});
|
|
720
|
-
const
|
|
726
|
+
const s = !!this.config.buttonClass, n = s ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", c = document.createElement("div");
|
|
721
727
|
if (c.className = "qaid-tooltip-text", c.textContent = l, this.applyVars(c), this.shadowRoot.appendChild(c), this.tooltipElement = c, this.config.singleButton) {
|
|
722
728
|
const d = document.createElement("div");
|
|
723
729
|
d.className = "qaid-tooltip-wrapper";
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
this.prewarmTargeting(), this.showTooltip(
|
|
727
|
-
}),
|
|
730
|
+
const r = document.createElement("button");
|
|
731
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon || Bt, r.addEventListener("click", (u) => this.handleThumbClick("neutral", u.currentTarget, u)), r.addEventListener("mouseenter", () => {
|
|
732
|
+
this.prewarmTargeting(), this.showTooltip(r);
|
|
733
|
+
}), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
|
|
728
734
|
} else if (!this.config.hideThumbs) {
|
|
729
735
|
const d = document.createElement("div");
|
|
730
736
|
d.className = "qaid-tooltip-wrapper";
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(
|
|
734
|
-
}),
|
|
737
|
+
const r = document.createElement("button");
|
|
738
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-up` : "qaid-btn qaid-btn-up", r.setAttribute("aria-label", this.config.text.positiveLabel), r.innerHTML = this.config.positiveIcon || Mt, r.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget, f)), r.addEventListener("mouseenter", () => {
|
|
739
|
+
this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(r);
|
|
740
|
+
}), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r);
|
|
735
741
|
const u = document.createElement("div");
|
|
736
742
|
u.className = "qaid-tooltip-wrapper";
|
|
737
743
|
const h = document.createElement("button");
|
|
738
|
-
h.type = "button", h.className =
|
|
744
|
+
h.type = "button", h.className = s ? `${n} qaid-btn-down` : "qaid-btn qaid-btn-down", h.setAttribute("aria-label", this.config.text.negativeLabel), h.innerHTML = this.config.negativeIcon || Lt, h.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget, f)), h.addEventListener("mouseenter", () => {
|
|
739
745
|
this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(h);
|
|
740
746
|
}), h.addEventListener("mouseleave", () => this.hideTooltip()), u.appendChild(h), this.buttonsContainer.appendChild(d), this.buttonsContainer.appendChild(u);
|
|
741
747
|
}
|
|
742
748
|
if (this.config.captureVideo && this.videoSupported()) {
|
|
743
749
|
const d = document.createElement("div");
|
|
744
750
|
d.className = "qaid-tooltip-wrapper";
|
|
745
|
-
const
|
|
746
|
-
|
|
751
|
+
const r = document.createElement("button");
|
|
752
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon || Ht, r.addEventListener("click", () => {
|
|
747
753
|
this.ensureRecording().then(
|
|
748
754
|
(h) => this.config.videoOptions.redaction ? h.startPicking() : h.startRecording()
|
|
749
755
|
);
|
|
750
756
|
});
|
|
751
757
|
const u = () => this.prewarmVideo();
|
|
752
|
-
|
|
753
|
-
u(), this.showTooltip(
|
|
754
|
-
}),
|
|
758
|
+
r.addEventListener("mouseenter", () => {
|
|
759
|
+
u(), this.showTooltip(r);
|
|
760
|
+
}), r.addEventListener("focus", u), r.addEventListener("touchstart", u, { passive: !0 }), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
|
|
755
761
|
}
|
|
756
762
|
this.config.hideDismiss || (this.dismissBtn = document.createElement("button"), this.dismissBtn.type = "button", this.dismissBtn.className = "qaid-dismiss-btn", this.dismissBtn.setAttribute("aria-label", this.config.text.dismissLabel), this.dismissBtn.title = this.config.text.dismissLabel, this.dismissBtn.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 2l8 8M10 2l-8 8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>', this.dismissBtn.addEventListener("click", (d) => {
|
|
757
763
|
d.stopPropagation(), this.handleDismiss();
|
|
@@ -767,22 +773,39 @@ class xe {
|
|
|
767
773
|
if (this.overlayShadowRoot) return this.overlayShadowRoot;
|
|
768
774
|
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" });
|
|
769
775
|
const t = document.createElement("style");
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
776
|
+
t.setAttribute("data-qaid-base", ""), t.textContent = X(), this.overlayShadowRoot.appendChild(t);
|
|
777
|
+
for (const o of this.featureStyles) ot(this.overlayShadowRoot, o);
|
|
778
|
+
if (this.config.css) {
|
|
779
|
+
const o = document.createElement("style");
|
|
780
|
+
o.textContent = this.config.css, this.overlayShadowRoot.appendChild(o);
|
|
773
781
|
}
|
|
774
782
|
return this.overlayShadowRoot;
|
|
775
783
|
}
|
|
784
|
+
/** The styles of every feature chunk loaded so far, in load order. */
|
|
785
|
+
featureStyles = [];
|
|
786
|
+
/**
|
|
787
|
+
* Add a feature chunk's styles to both shadow roots. The core stylesheet
|
|
788
|
+
* styles only the buttons; the message box, targeting, video and markup
|
|
789
|
+
* editor bring their own CSS with their chunk, so a page that never opens
|
|
790
|
+
* them never downloads it.
|
|
791
|
+
*/
|
|
792
|
+
addFeatureStyles(t) {
|
|
793
|
+
if (!this.featureStyles.includes(t)) {
|
|
794
|
+
this.featureStyles.push(t);
|
|
795
|
+
for (const o of [this.shadowRoot, this.overlayShadowRoot])
|
|
796
|
+
o && ot(o, t);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
776
799
|
tooltipElement = null;
|
|
777
800
|
showTooltip(t) {
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
|
|
801
|
+
const o = this.tooltipElement;
|
|
802
|
+
o.style.visibility = "hidden", o.classList.add("qaid-tooltip-visible");
|
|
803
|
+
const i = t.getBoundingClientRect(), s = o.getBoundingClientRect(), { top: n, left: a } = ce(
|
|
804
|
+
i,
|
|
805
|
+
s,
|
|
783
806
|
{ width: window.innerWidth, height: window.innerHeight }
|
|
784
807
|
);
|
|
785
|
-
|
|
808
|
+
o.style.top = `${n}px`, o.style.left = `${a}px`, o.style.visibility = "visible";
|
|
786
809
|
}
|
|
787
810
|
hideTooltip() {
|
|
788
811
|
this.tooltipElement.classList.remove("qaid-tooltip-visible");
|
|
@@ -790,27 +813,27 @@ class xe {
|
|
|
790
813
|
handleDismiss() {
|
|
791
814
|
this.buttonsContainer.classList.add("qaid-dismissed"), tt(this.config.apiKey, !0);
|
|
792
815
|
}
|
|
793
|
-
handleThumbClick(t,
|
|
816
|
+
handleThumbClick(t, o, i) {
|
|
794
817
|
if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), tt(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
|
|
795
|
-
this.submitDirectFeedback(t,
|
|
818
|
+
this.submitDirectFeedback(t, o);
|
|
796
819
|
else {
|
|
797
|
-
this.activeThumbBtn =
|
|
798
|
-
const
|
|
820
|
+
this.activeThumbBtn = o, o.setAttribute("aria-pressed", "true");
|
|
821
|
+
const s = this.keyboardActivation;
|
|
799
822
|
this.keyboardActivation = !1, this.ensureTargeting().then((n) => {
|
|
800
|
-
this.destroyed || (
|
|
823
|
+
this.destroyed || (s ? n.startKeyboard(t) : n.startPointer(t, i));
|
|
801
824
|
});
|
|
802
825
|
}
|
|
803
826
|
}
|
|
804
|
-
submitDirectFeedback(t,
|
|
827
|
+
submitDirectFeedback(t, o) {
|
|
805
828
|
this.feedbackData.feedbackType = t, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null;
|
|
806
|
-
const
|
|
829
|
+
const i = o.getBoundingClientRect();
|
|
807
830
|
this.selectedBounds = {
|
|
808
|
-
x:
|
|
809
|
-
y:
|
|
810
|
-
width:
|
|
811
|
-
height:
|
|
812
|
-
clickX:
|
|
813
|
-
clickY:
|
|
831
|
+
x: i.left,
|
|
832
|
+
y: i.top,
|
|
833
|
+
width: i.width,
|
|
834
|
+
height: i.height,
|
|
835
|
+
clickX: i.left + i.width / 2,
|
|
836
|
+
clickY: i.top + i.height / 2,
|
|
814
837
|
visible: !1
|
|
815
838
|
}, this.submitFeedback();
|
|
816
839
|
}
|
|
@@ -824,7 +847,7 @@ class xe {
|
|
|
824
847
|
* instead of the permission-based Screen Capture API. Explicit "dom" wins;
|
|
825
848
|
* otherwise DOM is used on touch devices to avoid the getDisplayMedia prompt. */
|
|
826
849
|
shouldCaptureViaDom() {
|
|
827
|
-
return this.config.screenshotMethod === "dom" ||
|
|
850
|
+
return this.config.screenshotMethod === "dom" || we();
|
|
828
851
|
}
|
|
829
852
|
/**
|
|
830
853
|
* Open the full-screen annotation editor over the captured screenshot,
|
|
@@ -834,25 +857,25 @@ class xe {
|
|
|
834
857
|
* enabled while the editor is open and restored on close.
|
|
835
858
|
*/
|
|
836
859
|
async openAnnotationEditor(t) {
|
|
837
|
-
const
|
|
838
|
-
|
|
860
|
+
const o = this.ensureOverlayHost(), i = this.overlayShadowHost, s = i.style.pointerEvents;
|
|
861
|
+
i.style.pointerEvents = "auto";
|
|
839
862
|
try {
|
|
840
|
-
const { openAnnotationEditor: n } = await import("./annotate-
|
|
841
|
-
return await n({
|
|
863
|
+
const { openAnnotationEditor: n, styles: a } = await import("./annotate-5zJWs-aB.js");
|
|
864
|
+
return this.addFeatureStyles(a), await n({
|
|
842
865
|
dataUrl: t,
|
|
843
|
-
root:
|
|
866
|
+
root: o,
|
|
844
867
|
quality: this.config.screenshotOptions.quality,
|
|
845
868
|
color: this.config.annotationColor,
|
|
846
869
|
palette: this.config.annotationPalette,
|
|
847
|
-
applyVars: (
|
|
848
|
-
announce: (
|
|
849
|
-
openDialog: (
|
|
870
|
+
applyVars: (l) => this.applyVars(l),
|
|
871
|
+
announce: (l, c) => this.announceMsg(l, c),
|
|
872
|
+
openDialog: (l, c) => this.openDialogA11y(l, c),
|
|
850
873
|
closeDialog: () => this.closeDialogA11y()
|
|
851
874
|
});
|
|
852
875
|
} catch (n) {
|
|
853
876
|
return console.error("Annotation editor failed to open:", n), null;
|
|
854
877
|
} finally {
|
|
855
|
-
|
|
878
|
+
i.style.pointerEvents = s;
|
|
856
879
|
}
|
|
857
880
|
}
|
|
858
881
|
async submitFeedback() {
|
|
@@ -860,23 +883,23 @@ class xe {
|
|
|
860
883
|
if (this.config.captureScreenshot || this.config.feedbackMode === "annotate")
|
|
861
884
|
try {
|
|
862
885
|
if (this.shouldCaptureViaDom()) {
|
|
863
|
-
const { captureDomScreenshot:
|
|
864
|
-
t = await
|
|
886
|
+
const { captureDomScreenshot: a } = await import("./screenshot-dom-CME7tYRE.js");
|
|
887
|
+
t = await a(this.config.screenshotOptions);
|
|
865
888
|
} else {
|
|
866
|
-
const { captureScreenshot:
|
|
867
|
-
t = await
|
|
889
|
+
const { captureScreenshot: a } = await import("./screenshot-DYOKg2bS.js");
|
|
890
|
+
t = await a(this.config.screenshotOptions);
|
|
868
891
|
}
|
|
869
892
|
t && this.announceMsg("Screenshot captured");
|
|
870
|
-
} catch (
|
|
871
|
-
console.error("Screenshot capture failed:",
|
|
893
|
+
} catch (a) {
|
|
894
|
+
console.error("Screenshot capture failed:", a), t = null;
|
|
872
895
|
}
|
|
873
896
|
t && this.config.annotate && (t = await this.openAnnotationEditor(t) ?? t);
|
|
874
|
-
const
|
|
897
|
+
const i = this.feedbackData.elementSelector ? {
|
|
875
898
|
x: this.selectedBounds.x,
|
|
876
899
|
y: this.selectedBounds.y,
|
|
877
900
|
width: this.selectedBounds.width,
|
|
878
901
|
height: this.selectedBounds.height
|
|
879
|
-
} : null,
|
|
902
|
+
} : null, s = {
|
|
880
903
|
feedbackType: this.feedbackData.feedbackType,
|
|
881
904
|
pageUrl: window.location.href,
|
|
882
905
|
apiKey: this.config.apiKey || void 0,
|
|
@@ -892,10 +915,10 @@ class xe {
|
|
|
892
915
|
screenshot: t,
|
|
893
916
|
visitorId: this.visitorId,
|
|
894
917
|
// Include element bounds and user agent for server-side screenshot fallback
|
|
895
|
-
elementBounds:
|
|
918
|
+
elementBounds: i,
|
|
896
919
|
userAgent: navigator.userAgent
|
|
897
920
|
};
|
|
898
|
-
this.feedbackIdPromise = this.postFeedback(
|
|
921
|
+
this.feedbackIdPromise = this.postFeedback(s);
|
|
899
922
|
const n = this.feedbackData.feedbackType;
|
|
900
923
|
if (n && n !== "neutral" && await this.tryLaunchQuest(n, this.feedbackIdPromise)) {
|
|
901
924
|
this.resetFeedbackUi();
|
|
@@ -903,27 +926,27 @@ class xe {
|
|
|
903
926
|
}
|
|
904
927
|
this.state = "MODAL_OPEN";
|
|
905
928
|
try {
|
|
906
|
-
const
|
|
929
|
+
const a = await this.ensureModal();
|
|
907
930
|
if (this.destroyed) return;
|
|
908
|
-
|
|
909
|
-
} catch (
|
|
910
|
-
console.error("Failed to open the feedback modal:",
|
|
931
|
+
a.open(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto");
|
|
932
|
+
} catch (a) {
|
|
933
|
+
console.error("Failed to open the feedback modal:", a), this.announceMsg("Thank you for your feedback!", !0), this.resetFeedbackUi();
|
|
911
934
|
}
|
|
912
935
|
}
|
|
913
936
|
/** POST the feedback. Resolves to the new record's id, or null if it failed. */
|
|
914
937
|
async postFeedback(t) {
|
|
915
938
|
try {
|
|
916
|
-
const
|
|
939
|
+
const o = await fetch(this.config.endpoint, {
|
|
917
940
|
method: "POST",
|
|
918
941
|
headers: { "Content-Type": "application/json" },
|
|
919
942
|
body: JSON.stringify(t)
|
|
920
943
|
});
|
|
921
|
-
if (
|
|
922
|
-
const
|
|
923
|
-
return this.announceMsg("Feedback sent"),
|
|
944
|
+
if (o.ok) {
|
|
945
|
+
const i = await o.json();
|
|
946
|
+
return this.announceMsg("Feedback sent"), i.id;
|
|
924
947
|
}
|
|
925
|
-
} catch (
|
|
926
|
-
console.error("Failed to submit feedback:",
|
|
948
|
+
} catch (o) {
|
|
949
|
+
console.error("Failed to submit feedback:", o), this.announceMsg("Failed to send feedback", !0);
|
|
927
950
|
}
|
|
928
951
|
return null;
|
|
929
952
|
}
|
|
@@ -932,8 +955,8 @@ class xe {
|
|
|
932
955
|
* (no `base`) or this button has no quest configured.
|
|
933
956
|
*/
|
|
934
957
|
questIdFor(t) {
|
|
935
|
-
const
|
|
936
|
-
return
|
|
958
|
+
const o = this.config.quests;
|
|
959
|
+
return o.base && o[t] || "";
|
|
937
960
|
}
|
|
938
961
|
/**
|
|
939
962
|
* Launch the quest linked to `type`, if any. Resolves `true` when a quest
|
|
@@ -942,22 +965,22 @@ class xe {
|
|
|
942
965
|
* normal UI). The created feedback record id is passed through so the
|
|
943
966
|
* quest response can be joined back to it server-side.
|
|
944
967
|
*/
|
|
945
|
-
async tryLaunchQuest(t,
|
|
946
|
-
const
|
|
947
|
-
if (!
|
|
968
|
+
async tryLaunchQuest(t, o) {
|
|
969
|
+
const i = this.questIdFor(t);
|
|
970
|
+
if (!i) return !1;
|
|
948
971
|
try {
|
|
949
|
-
return this.activeQuest?.destroy(), this.activeQuest = await
|
|
950
|
-
questId:
|
|
972
|
+
return this.activeQuest?.destroy(), this.activeQuest = await ve({
|
|
973
|
+
questId: i,
|
|
951
974
|
base: this.config.quests.base,
|
|
952
975
|
apiKey: this.config.quests.apiKey || void 0,
|
|
953
976
|
moduleUrl: this.config.quests.moduleUrl,
|
|
954
|
-
feedbackId:
|
|
977
|
+
feedbackId: o,
|
|
955
978
|
onClose: () => {
|
|
956
979
|
this.activeQuest = null;
|
|
957
980
|
}
|
|
958
981
|
}), !0;
|
|
959
|
-
} catch (
|
|
960
|
-
return console.error("Failed to launch quest:",
|
|
982
|
+
} catch (s) {
|
|
983
|
+
return console.error("Failed to launch quest:", s), this.activeQuest = null, !1;
|
|
961
984
|
}
|
|
962
985
|
}
|
|
963
986
|
/**
|
|
@@ -975,8 +998,8 @@ class xe {
|
|
|
975
998
|
*/
|
|
976
999
|
async ensureModal() {
|
|
977
1000
|
if (!this.modal) {
|
|
978
|
-
const { ModalController: t } = await import("./modal-
|
|
979
|
-
this.modal = new t(this.makeModalHost());
|
|
1001
|
+
const { ModalController: t, styles: o } = await import("./modal-DccueVYZ.js");
|
|
1002
|
+
this.addFeatureStyles(o), this.modal = new t(this.makeModalHost());
|
|
980
1003
|
}
|
|
981
1004
|
return this.modal;
|
|
982
1005
|
}
|
|
@@ -1007,16 +1030,16 @@ class xe {
|
|
|
1007
1030
|
},
|
|
1008
1031
|
whenFeedbackId: () => t.feedbackIdPromise,
|
|
1009
1032
|
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1010
|
-
applyVars: (
|
|
1011
|
-
announceMsg: (
|
|
1012
|
-
openDialogA11y: (
|
|
1033
|
+
applyVars: (o) => t.applyVars(o),
|
|
1034
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1035
|
+
openDialogA11y: (o, i) => t.openDialogA11y(o, i),
|
|
1013
1036
|
closeDialogA11y: () => t.closeDialogA11y(),
|
|
1014
1037
|
resetFeedbackUi: () => t.resetFeedbackUi()
|
|
1015
1038
|
};
|
|
1016
1039
|
}
|
|
1017
1040
|
/** Warm the modal chunk while the user is targeting, so it opens instantly. */
|
|
1018
1041
|
prewarmModal() {
|
|
1019
|
-
this.modalPrewarmed || (this.modalPrewarmed = !0, import("./modal-
|
|
1042
|
+
this.modalPrewarmed || (this.modalPrewarmed = !0, import("./modal-DccueVYZ.js").catch(() => {
|
|
1020
1043
|
}));
|
|
1021
1044
|
}
|
|
1022
1045
|
/**
|
|
@@ -1026,8 +1049,8 @@ class xe {
|
|
|
1026
1049
|
*/
|
|
1027
1050
|
async ensureTargeting() {
|
|
1028
1051
|
if (!this.targeting) {
|
|
1029
|
-
const { TargetingController: t } = await import("./targeting-
|
|
1030
|
-
this.targeting = new t(this.makeTargetingHost());
|
|
1052
|
+
const { TargetingController: t, styles: o } = await import("./targeting-mahtuPpo.js");
|
|
1053
|
+
this.addFeatureStyles(o), this.targeting = new t(this.makeTargetingHost());
|
|
1031
1054
|
}
|
|
1032
1055
|
return this.targeting;
|
|
1033
1056
|
}
|
|
@@ -1059,19 +1082,19 @@ class xe {
|
|
|
1059
1082
|
get selectedBounds() {
|
|
1060
1083
|
return t.selectedBounds;
|
|
1061
1084
|
},
|
|
1062
|
-
setState: (
|
|
1063
|
-
t.state =
|
|
1085
|
+
setState: (o) => {
|
|
1086
|
+
t.state = o;
|
|
1064
1087
|
},
|
|
1065
1088
|
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1066
|
-
applyVars: (
|
|
1067
|
-
announceMsg: (
|
|
1089
|
+
applyVars: (o) => t.applyVars(o),
|
|
1090
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1068
1091
|
clearActiveThumb: () => t.clearActiveThumb(),
|
|
1069
1092
|
submitFeedback: () => t.submitFeedback()
|
|
1070
1093
|
};
|
|
1071
1094
|
}
|
|
1072
1095
|
/** Warm the targeting chunk on thumb-button hover, before the click. */
|
|
1073
1096
|
prewarmTargeting() {
|
|
1074
|
-
this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, import("./targeting-
|
|
1097
|
+
this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, import("./targeting-mahtuPpo.js").catch(() => {
|
|
1075
1098
|
}));
|
|
1076
1099
|
}
|
|
1077
1100
|
// ==================== Video Recording ====================
|
|
@@ -1090,8 +1113,8 @@ class xe {
|
|
|
1090
1113
|
*/
|
|
1091
1114
|
async ensureRecording() {
|
|
1092
1115
|
if (!this.recording) {
|
|
1093
|
-
const { RecordingController: t } = await import("./recording-
|
|
1094
|
-
this.recording = new t(this.makeRecordingHost());
|
|
1116
|
+
const { RecordingController: t, styles: o } = await import("./recording-CPzxRL7f.js");
|
|
1117
|
+
this.addFeatureStyles(o), this.recording = new t(this.makeRecordingHost());
|
|
1095
1118
|
}
|
|
1096
1119
|
return this.recording;
|
|
1097
1120
|
}
|
|
@@ -1120,22 +1143,22 @@ class xe {
|
|
|
1120
1143
|
get state() {
|
|
1121
1144
|
return t.state;
|
|
1122
1145
|
},
|
|
1123
|
-
setState: (
|
|
1124
|
-
t.state =
|
|
1146
|
+
setState: (o) => {
|
|
1147
|
+
t.state = o;
|
|
1125
1148
|
},
|
|
1126
1149
|
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1127
|
-
applyVars: (
|
|
1128
|
-
announceMsg: (
|
|
1129
|
-
openDialogA11y: (
|
|
1150
|
+
applyVars: (o) => t.applyVars(o),
|
|
1151
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1152
|
+
openDialogA11y: (o, i) => t.openDialogA11y(o, i),
|
|
1130
1153
|
closeDialogA11y: () => t.closeDialogA11y(),
|
|
1131
|
-
setButtonsDisabled: (
|
|
1132
|
-
tryLaunchQuest: (
|
|
1154
|
+
setButtonsDisabled: (o) => t.setButtonsDisabled(o),
|
|
1155
|
+
tryLaunchQuest: (o, i) => t.tryLaunchQuest(o, i)
|
|
1133
1156
|
};
|
|
1134
1157
|
}
|
|
1135
1158
|
setButtonsDisabled(t) {
|
|
1136
1159
|
if (!this.buttonsContainer) return;
|
|
1137
|
-
this.buttonsContainer.querySelectorAll("button.qaid-btn, button.qaid-btn-structural").forEach((
|
|
1138
|
-
t ?
|
|
1160
|
+
this.buttonsContainer.querySelectorAll("button.qaid-btn, button.qaid-btn-structural").forEach((i) => {
|
|
1161
|
+
t ? i.classList.contains("qaid-btn-record") || (i.disabled = !0, i.style.opacity = "0.5") : (i.disabled = !1, i.style.opacity = "");
|
|
1139
1162
|
});
|
|
1140
1163
|
}
|
|
1141
1164
|
/**
|
|
@@ -1146,13 +1169,13 @@ class xe {
|
|
|
1146
1169
|
const t = window;
|
|
1147
1170
|
this.prewarmIsTimeout ? clearTimeout(this.prewarmHandle) : t.cancelIdleCallback?.(this.prewarmHandle), this.prewarmHandle = null;
|
|
1148
1171
|
}
|
|
1149
|
-
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,
|
|
1172
|
+
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, Qt();
|
|
1150
1173
|
}
|
|
1151
1174
|
}
|
|
1152
1175
|
function rt(e) {
|
|
1153
1176
|
return document.querySelector(e)?.textContent?.trim() ?? "";
|
|
1154
1177
|
}
|
|
1155
|
-
function
|
|
1178
|
+
function Ce() {
|
|
1156
1179
|
const e = document.querySelector(
|
|
1157
1180
|
'script[type="application/json"][data-feedback-config]'
|
|
1158
1181
|
);
|
|
@@ -1160,160 +1183,160 @@ function ke() {
|
|
|
1160
1183
|
const t = e.textContent?.trim();
|
|
1161
1184
|
if (!t) return null;
|
|
1162
1185
|
try {
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1186
|
+
const o = JSON.parse(t);
|
|
1187
|
+
return o.cssSelector && !o.css && (o.css = rt(o.cssSelector), delete o.cssSelector), o;
|
|
1165
1188
|
} catch {
|
|
1166
1189
|
return null;
|
|
1167
1190
|
}
|
|
1168
1191
|
}
|
|
1169
|
-
function
|
|
1170
|
-
console.warn(`[thumbs-embed] Ignoring ${e}="${t}": expected ${
|
|
1192
|
+
function dt(e, t, o) {
|
|
1193
|
+
console.warn(`[thumbs-embed] Ignoring ${e}="${t}": expected ${o}.`);
|
|
1171
1194
|
}
|
|
1172
|
-
function
|
|
1195
|
+
function Se(e) {
|
|
1173
1196
|
const t = [];
|
|
1174
|
-
let
|
|
1175
|
-
for (const
|
|
1176
|
-
|
|
1177
|
-
return t.push(
|
|
1197
|
+
let o = 0, i = "";
|
|
1198
|
+
for (const s of e)
|
|
1199
|
+
s === "(" && o++, s === ")" && (o = Math.max(0, o - 1)), s === "," && o === 0 ? (t.push(i.trim()), i = "") : i += s;
|
|
1200
|
+
return t.push(i.trim()), t;
|
|
1178
1201
|
}
|
|
1179
1202
|
function Ae(e, t) {
|
|
1180
1203
|
if (t === null) return;
|
|
1181
|
-
const
|
|
1182
|
-
let
|
|
1183
|
-
if (
|
|
1204
|
+
const o = t.trim();
|
|
1205
|
+
let i = null;
|
|
1206
|
+
if (o.startsWith("[") || o.startsWith("{"))
|
|
1184
1207
|
try {
|
|
1185
|
-
|
|
1208
|
+
i = JSON.parse(o);
|
|
1186
1209
|
} catch {
|
|
1187
|
-
|
|
1210
|
+
i = null;
|
|
1188
1211
|
}
|
|
1189
1212
|
else
|
|
1190
|
-
|
|
1191
|
-
if (Array.isArray(
|
|
1192
|
-
return
|
|
1193
|
-
|
|
1213
|
+
i = Se(o);
|
|
1214
|
+
if (Array.isArray(i) && i.length > 0 && i.every((s) => typeof s == "string" && s.trim() !== ""))
|
|
1215
|
+
return i.map((s) => s.trim());
|
|
1216
|
+
dt(e, t, "a JSON array of colours or a comma-separated list");
|
|
1194
1217
|
}
|
|
1195
1218
|
function m(e, t) {
|
|
1196
1219
|
if (t !== null) {
|
|
1197
1220
|
if (t.trim() === "") {
|
|
1198
|
-
|
|
1221
|
+
dt(e, t, "a non-empty label");
|
|
1199
1222
|
return;
|
|
1200
1223
|
}
|
|
1201
1224
|
return t;
|
|
1202
1225
|
}
|
|
1203
1226
|
}
|
|
1204
|
-
function
|
|
1227
|
+
function Te(e) {
|
|
1205
1228
|
const t = e.getAttribute("data-endpoint");
|
|
1206
1229
|
if (!t) return null;
|
|
1207
|
-
const
|
|
1230
|
+
const o = e.getAttribute("data-position"), i = e.getAttribute("data-zindex"), s = e.getAttribute("data-positive-color"), n = e.getAttribute("data-negative-color"), a = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), c = e.getAttribute("data-button-class"), d = e.getAttribute("data-skip-targeting"), r = e.getAttribute("data-hide-confirmation"), u = e.getAttribute("data-single-button"), h = e.getAttribute("data-feedback-mode"), f = e.getAttribute("data-incognito"), lt = e.getAttribute("data-button-size"), g = e.getAttribute("data-offset-x"), v = e.getAttribute("data-offset-y"), T = e.getAttribute("data-modal-width"), E = e.getAttribute("data-backdrop-opacity"), ct = e.getAttribute("data-font-family"), I = e.getAttribute("data-font-size"), D = e.getAttribute("data-tooltip"), M = e.getAttribute("data-modal-title"), L = e.getAttribute("data-confirmation-title"), H = e.getAttribute("data-confirmation-message"), B = e.getAttribute("data-confirmation-close"), O = e.getAttribute("data-error-title"), R = e.getAttribute("data-error-message"), P = e.getAttribute("data-modal-subtitle"), z = e.getAttribute("data-placeholder"), F = e.getAttribute("data-submit-button"), N = e.getAttribute("data-skip-button"), ut = e.getAttribute("data-positive-icon"), ht = e.getAttribute("data-negative-icon"), ft = e.getAttribute("data-feedback-icon"), U = e.getAttribute("data-feedback-label"), pt = e.getAttribute("data-api-key"), bt = e.getAttribute("data-capture-screenshot"), mt = e.getAttribute("data-annotate"), gt = e.getAttribute("data-annotation-color"), y = e.getAttribute("data-screenshot-quality"), w = e.getAttribute("data-screenshot-max-width"), k = e.getAttribute("data-screenshot-max-height"), vt = e.getAttribute("data-capture-video"), _ = e.getAttribute("data-video-redaction"), yt = e.getAttribute("data-hide-thumbs"), wt = e.getAttribute("data-hide-dismiss"), q = e.getAttribute("data-video-max-duration"), kt = e.getAttribute("data-screenshot-method"), qt = e.getAttribute("data-direction"), V = e.getAttribute("data-css-selector"), xt = e.getAttribute("data-css"), $ = m("data-positive-label", e.getAttribute("data-positive-label")), K = m("data-negative-label", e.getAttribute("data-negative-label")), Q = m("data-record-label", e.getAttribute("data-record-label")), j = m("data-dismiss-label", e.getAttribute("data-dismiss-label")), Ct = Ae(
|
|
1208
1231
|
"data-annotation-palette",
|
|
1209
1232
|
e.getAttribute("data-annotation-palette")
|
|
1210
|
-
),
|
|
1233
|
+
), St = e.getAttribute("data-record-icon"), W = e.getAttribute("data-quest-base"), At = e.getAttribute("data-quest-up"), Tt = e.getAttribute("data-quest-down"), Et = e.getAttribute("data-quest-video"), It = e.getAttribute("data-quest-api-key"), Dt = e.getAttribute("data-quest-module-url");
|
|
1211
1234
|
return {
|
|
1212
1235
|
endpoint: t,
|
|
1213
1236
|
// Inline CSS wins over a selector, as `css` wins over `cssSelector` in
|
|
1214
1237
|
// the JSON block.
|
|
1215
1238
|
css: xt || (V ? rt(V) : void 0),
|
|
1216
|
-
apiKey:
|
|
1217
|
-
captureScreenshot:
|
|
1239
|
+
apiKey: pt ?? void 0,
|
|
1240
|
+
captureScreenshot: bt === "true" ? !0 : void 0,
|
|
1218
1241
|
// Annotation is on by default; only an explicit "false" disables it.
|
|
1219
|
-
annotate:
|
|
1220
|
-
annotationColor:
|
|
1221
|
-
annotationPalette:
|
|
1222
|
-
screenshotOptions: y || w ||
|
|
1242
|
+
annotate: mt === "false" ? !1 : void 0,
|
|
1243
|
+
annotationColor: gt ?? void 0,
|
|
1244
|
+
annotationPalette: Ct,
|
|
1245
|
+
screenshotOptions: y || w || k ? {
|
|
1223
1246
|
quality: y ? parseFloat(y) : void 0,
|
|
1224
1247
|
maxWidth: w ? parseInt(w, 10) : void 0,
|
|
1225
|
-
maxHeight:
|
|
1248
|
+
maxHeight: k ? parseInt(k, 10) : void 0
|
|
1226
1249
|
} : void 0,
|
|
1227
1250
|
container: l ?? void 0,
|
|
1228
1251
|
buttonClass: c ?? void 0,
|
|
1229
1252
|
direction: qt ?? void 0,
|
|
1230
|
-
position:
|
|
1231
|
-
zIndex:
|
|
1253
|
+
position: o ?? void 0,
|
|
1254
|
+
zIndex: i ? parseInt(i, 10) : void 0,
|
|
1232
1255
|
skipTargeting: d === "true" ? !0 : void 0,
|
|
1233
|
-
hideConfirmation:
|
|
1256
|
+
hideConfirmation: r === "true" ? !0 : void 0,
|
|
1234
1257
|
singleButton: u === "true" ? !0 : void 0,
|
|
1235
1258
|
feedbackMode: h ?? void 0,
|
|
1236
1259
|
incognito: f === "true" ? !0 : void 0,
|
|
1237
|
-
buttonSize:
|
|
1260
|
+
buttonSize: lt ?? void 0,
|
|
1238
1261
|
offset: g || v ? {
|
|
1239
1262
|
x: g ? parseInt(g, 10) : void 0,
|
|
1240
1263
|
y: v ? parseInt(v, 10) : void 0
|
|
1241
1264
|
} : void 0,
|
|
1242
1265
|
modalWidth: T ? parseInt(T, 10) : void 0,
|
|
1243
1266
|
backdropOpacity: E ? parseFloat(E) : void 0,
|
|
1244
|
-
fontFamily:
|
|
1267
|
+
fontFamily: ct ?? void 0,
|
|
1245
1268
|
fontSize: I ? parseInt(I, 10) : void 0,
|
|
1246
1269
|
colors: {
|
|
1247
|
-
positive:
|
|
1270
|
+
positive: s ?? void 0,
|
|
1248
1271
|
negative: n ?? void 0,
|
|
1249
|
-
marker:
|
|
1272
|
+
marker: a ?? void 0
|
|
1250
1273
|
},
|
|
1251
|
-
text: D ||
|
|
1274
|
+
text: D || M || P || z || F || N || U || L || H || B || O || R || $ || K || Q || j ? {
|
|
1252
1275
|
tooltip: D ?? void 0,
|
|
1253
|
-
modalTitle:
|
|
1276
|
+
modalTitle: M ?? void 0,
|
|
1254
1277
|
modalSubtitle: P ?? void 0,
|
|
1255
|
-
placeholder:
|
|
1256
|
-
submitButton:
|
|
1257
|
-
skipButton:
|
|
1258
|
-
feedbackLabel:
|
|
1259
|
-
confirmationTitle:
|
|
1260
|
-
confirmationMessage:
|
|
1261
|
-
confirmationClose:
|
|
1262
|
-
errorTitle:
|
|
1263
|
-
errorMessage:
|
|
1264
|
-
positiveLabel:
|
|
1265
|
-
negativeLabel:
|
|
1266
|
-
recordLabel:
|
|
1267
|
-
dismissLabel:
|
|
1278
|
+
placeholder: z ?? void 0,
|
|
1279
|
+
submitButton: F ?? void 0,
|
|
1280
|
+
skipButton: N ?? void 0,
|
|
1281
|
+
feedbackLabel: U ?? void 0,
|
|
1282
|
+
confirmationTitle: L ?? void 0,
|
|
1283
|
+
confirmationMessage: H ?? void 0,
|
|
1284
|
+
confirmationClose: B ?? void 0,
|
|
1285
|
+
errorTitle: O ?? void 0,
|
|
1286
|
+
errorMessage: R ?? void 0,
|
|
1287
|
+
positiveLabel: $,
|
|
1288
|
+
negativeLabel: K,
|
|
1289
|
+
recordLabel: Q,
|
|
1290
|
+
dismissLabel: j
|
|
1268
1291
|
} : void 0,
|
|
1269
|
-
positiveIcon:
|
|
1270
|
-
recordIcon:
|
|
1271
|
-
negativeIcon:
|
|
1272
|
-
feedbackIcon:
|
|
1273
|
-
screenshotMethod:
|
|
1274
|
-
captureVideo:
|
|
1275
|
-
hideThumbs:
|
|
1276
|
-
hideDismiss:
|
|
1277
|
-
videoOptions:
|
|
1278
|
-
maxDuration:
|
|
1292
|
+
positiveIcon: ut ?? void 0,
|
|
1293
|
+
recordIcon: St ?? void 0,
|
|
1294
|
+
negativeIcon: ht ?? void 0,
|
|
1295
|
+
feedbackIcon: ft ?? void 0,
|
|
1296
|
+
screenshotMethod: kt ?? void 0,
|
|
1297
|
+
captureVideo: vt === "true" ? !0 : void 0,
|
|
1298
|
+
hideThumbs: yt === "true" ? !0 : void 0,
|
|
1299
|
+
hideDismiss: wt === "true" ? !0 : void 0,
|
|
1300
|
+
videoOptions: q || _ ? {
|
|
1301
|
+
maxDuration: q ? parseInt(q, 10) : void 0,
|
|
1279
1302
|
redaction: _ === "true" ? !0 : void 0
|
|
1280
1303
|
} : void 0,
|
|
1281
1304
|
quests: W ? {
|
|
1282
1305
|
base: W,
|
|
1283
1306
|
up: At ?? void 0,
|
|
1284
|
-
down:
|
|
1285
|
-
video:
|
|
1286
|
-
apiKey:
|
|
1287
|
-
moduleUrl:
|
|
1307
|
+
down: Tt ?? void 0,
|
|
1308
|
+
video: Et ?? void 0,
|
|
1309
|
+
apiKey: It ?? void 0,
|
|
1310
|
+
moduleUrl: Dt ?? void 0
|
|
1288
1311
|
} : void 0
|
|
1289
1312
|
};
|
|
1290
1313
|
}
|
|
1291
1314
|
function Ue() {
|
|
1292
1315
|
if (typeof document > "u") return;
|
|
1293
1316
|
const e = () => {
|
|
1294
|
-
const t = document.currentScript ?? document.querySelector("script[data-endpoint]"),
|
|
1295
|
-
|
|
1317
|
+
const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), o = Ce() ?? (t ? Te(t) : null);
|
|
1318
|
+
o?.endpoint && new xe(o);
|
|
1296
1319
|
};
|
|
1297
1320
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
|
|
1298
1321
|
}
|
|
1299
1322
|
export {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1323
|
+
Ie as A,
|
|
1324
|
+
Me as B,
|
|
1325
|
+
He as D,
|
|
1326
|
+
Be as E,
|
|
1327
|
+
Bt as F,
|
|
1328
|
+
De as P,
|
|
1306
1329
|
xe as Q,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1330
|
+
Ee as R,
|
|
1331
|
+
Oe as S,
|
|
1332
|
+
Mt as T,
|
|
1333
|
+
Le as U,
|
|
1311
1334
|
Ue as a,
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1335
|
+
Re as b,
|
|
1336
|
+
Pe as c,
|
|
1337
|
+
Lt as d,
|
|
1338
|
+
ze as e,
|
|
1316
1339
|
Ne as g,
|
|
1317
|
-
|
|
1340
|
+
Fe as i
|
|
1318
1341
|
};
|
|
1319
|
-
//# sourceMappingURL=core-
|
|
1342
|
+
//# sourceMappingURL=core-CL1dwdaN.js.map
|