gotcha-feedback 1.1.12 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,92 +1,54 @@
1
- import {createContext,useState,useMemo,useEffect,useCallback,useRef,useContext}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';var Co="https://gotcha.cx/api/v1";var Y={ANONYMOUS_ID:"gotcha_anonymous_id",OFFLINE_QUEUE:"gotcha_offline_queue",HIDDEN_UNTIL:"gotcha_hidden",VISIT_COUNT:"gotcha_visits"},Z={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Gotcha!"},$e={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function ee(e){if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function oe(e,r){if(!(typeof window>"u"))try{localStorage.setItem(e,r);}catch{}}function te(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let r=Math.random()*16|0;return (e==="x"?r:r&3|8).toString(16)})}function Ue(){let e=ee(Y.ANONYMOUS_ID);if(e)return e;let r=`anon_${te()}`;return oe(Y.ANONYMOUS_ID,r),r}var Oe=[],He=false;function Eo(e,r){let o={message:e.slice(0,200),source:r?.slice(0,200),timestamp:Date.now()};Oe.push(o),Oe.length>10&&Oe.shift();}function Ro(e){Eo(e.message,e.filename);}function Bo(e){let r=e.reason instanceof Error?e.reason.message:String(e.reason);Eo(r);}function Ao(){typeof window>"u"||He||(window.addEventListener("error",Ro),window.addEventListener("unhandledrejection",Bo),He=true);}function Io(){typeof window>"u"||!He||(window.removeEventListener("error",Ro),window.removeEventListener("unhandledrejection",Bo),He=false);}function Mo(){return [...Oe].reverse()}function Go(){return typeof window>"u"?{}:{url:window.location.origin+window.location.pathname,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenResolution:{width:screen.width,height:screen.height},recentErrors:Mo()}}var Rt=50,Bt=10080*60*1e3;function Ee(){let e=ee(Y.OFFLINE_QUEUE);if(!e)return [];try{let r=JSON.parse(e),o=Date.now();return r.filter(t=>o-t.queuedAt<Bt)}catch{return []}}function Je(e){oe(Y.OFFLINE_QUEUE,JSON.stringify(e));}function Ze(e,r="create"){let o=Ee();o.length>=Rt||(o.push({id:te(),payload:e,type:r,queuedAt:Date.now(),retries:0}),Je(o));}function Fo(e){let r=Ee().filter(o=>o.id!==e);Je(r);}function Do(){return Ee()}function zo(){return Ee().length}function Po(e){let r=Ee().map(o=>o.id===e?{...o,retries:o.retries+1}:o);Je(r.filter(o=>o.retries<=5));}var pe={maxRetries:$e.MAX_RETRIES,baseDelayMs:$e.BASE_DELAY_MS,maxDelayMs:$e.MAX_DELAY_MS};async function Re(e,r,o=pe,t=false){let n=null;for(let g=0;g<=o.maxRetries;g++){try{t&&g>0&&console.log(`[Gotcha] Retry attempt ${g}/${o.maxRetries}`);let l=await fetch(e,r);if(l.status>=400&&l.status<500&&l.status!==429||l.ok)return l;n=new Error(`HTTP ${l.status}`);}catch(l){n=l,t&&console.log(`[Gotcha] Network error: ${n.message}`);}if(g<o.maxRetries){let l=Math.min(o.baseDelayMs*Math.pow(2,g),o.maxDelayMs);await new Promise(u=>setTimeout(u,l));}}throw n}function Lo(e){let{apiKey:r,baseUrl:o=Co,debug:t=false}=e,n=false,g={"Content-Type":"application/json",Authorization:`Bearer ${r}`};async function l(u,p,s){let a=`${o}${p}`,h=te();t&&console.log(`[Gotcha] ${u} ${p}`,s);let d=await Re(a,{method:u,headers:{...g,"Idempotency-Key":h},body:s?JSON.stringify(s):void 0},pe,t),i;try{i=await d.json();}catch{throw {code:"PARSE_ERROR",message:"Invalid response from server",status:d.status}}if(!d.ok){let c=i.error;throw t&&console.error(`[Gotcha] Error: ${c.code} - ${c.message}`),c}return t&&console.log("[Gotcha] Response:",i),i}return {async submitResponse(u){let p=u.user||{};p.id||(p.id=Ue());let s={...u,user:p,context:Go(),...u.isBug?{isBug:true}:{}};if(typeof navigator<"u"&&!navigator.onLine)return Ze(s,"create"),{id:te(),status:"queued",createdAt:new Date().toISOString()};try{return await l("POST","/responses",s)}catch(a){if(a instanceof TypeError&&typeof navigator<"u"&&!navigator.onLine)return Ze(s,"create"),{id:te(),status:"queued",createdAt:new Date().toISOString()};throw a}},async checkExistingResponse(u,p){let s=`${o}/responses/check?elementId=${encodeURIComponent(u)}&userId=${encodeURIComponent(p)}`;t&&console.log("[Gotcha] GET /responses/check");let a=await Re(s,{method:"GET",headers:g},pe,t),h=await a.json();if(!a.ok){let d=h.error;throw t&&console.error(`[Gotcha] Error: ${d.code} - ${d.message}`),d}return h.exists?(t&&console.log("[Gotcha] Found existing response:",h.response),h.response):null},async updateResponse(u,p,s){let a=`${o}/responses/${u}${s?`?userId=${encodeURIComponent(s)}`:""}`;t&&console.log(`[Gotcha] PATCH /responses/${u}`,p);let h=await Re(a,{method:"PATCH",headers:g,body:JSON.stringify(p)},pe,t),d=await h.json();if(!h.ok){let i=d.error;throw t&&console.error(`[Gotcha] Error: ${i.code} - ${i.message}`),i}return t&&console.log("[Gotcha] Response updated:",d),d},async getScore(u){let p=`${o}/scores/${encodeURIComponent(u)}`;t&&console.log(`[Gotcha] GET /scores/${u}`);let s=await Re(p,{method:"GET",headers:g},pe,t),a=await s.json();if(!s.ok){let h=a.error;throw t&&console.error(`[Gotcha] Error: ${h.code} - ${h.message}`),h}return t&&console.log("[Gotcha] Score:",a),a},async flagAsBug(u){let p=`${o}/responses/${encodeURIComponent(u)}/bug`;t&&console.log(`[Gotcha] POST /responses/${u}/bug`);let s=await Re(p,{method:"POST",headers:g},pe,t),a=await s.json();if(!s.ok){let h=a.error;throw t&&console.error(`[Gotcha] Error: ${h.code} - ${h.message}`),h}return t&&console.log("[Gotcha] Bug flagged:",a),a},async flushQueue(){if(!n){n=true;try{let u=Do();for(let p of u)try{if(p.type==="update"&&p.payload.responseId){let{responseId:s,...a}=p.payload;await l("PATCH",`/responses/${s}`,a);}else await l("POST","/responses",p.payload);Fo(p.id);}catch{Po(p.id);}}finally{n=false;}}},getQueueLength:zo,getBaseUrl(){return o}}}var At=new Set(["__proto__","constructor","prototype"]);function ce(e,r){let o={...e};for(let t of Object.keys(r)){if(At.has(t))continue;let n=r[t];n!=null&&typeof n=="object"&&!Array.isArray(n)?o[t]=ce(e[t]??{},n):n!==void 0&&(o[t]=n);}return o}var $o=["#ef4444","#f05540","#f1663c","#f27738","#f38834","#f59e0b","#d4a30e","#b3a812","#79b841","#45c870","#10b981"],eo={colors:{primary:"#1e293b",primaryHover:"#334155",primaryText:"#ffffff",background:"#ffffff",backgroundGradient:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",surface:"#fafbfc",surfaceHover:"#ffffff",text:"#111827",textSecondary:"#374151",textDisabled:"#94a3b8",border:"#e2e8f0",borderFocus:"#1e293b",success:"#059669",successSurface:"rgba(5,150,105,0.08)",error:"#dc2626",errorSurface:"#fef2f2",errorBorder:"rgba(220,38,38,0.1)",warning:"#d97706",warningActive:"#b45309",warningSurface:"rgba(251,191,36,0.08)",warningBorder:"rgba(217,119,6,0.25)",starFilled:"#f59e0b",starEmpty:"#e2e8f0",voteUp:"#10b981",voteUpSurface:"rgba(16,185,129,0.06)",voteUpBorder:"rgba(16,185,129,0.25)",voteDown:"#ef4444",voteDownSurface:"rgba(239,68,68,0.06)",voteDownBorder:"rgba(239,68,68,0.25)",npsColors:$o,buttonBackground:"#1e293b",buttonBackgroundHover:"#334155",buttonBackgroundDisabled:"#e2e8f0",buttonColor:"#ffffff",buttonColorDisabled:"#94a3b8",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.4)",closeButton:"#9ca3af",closeButtonHover:"#6b7280",closeButtonBg:"rgba(0,0,0,0.04)",glassBackground:"linear-gradient(160deg, rgba(255,255,255,0.7) 0%, rgba(200,210,230,0.4) 40%, rgba(180,192,220,0.5) 100%)",glassBorder:"none",glassColor:"rgba(0,0,0,0.75)",glassShadow:"0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2)",glassHoverShadow:"0 6px 20px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.25)",inputBackground:"#fafbfc",inputBackgroundFocus:"#ffffff",inputBorder:"#e2e8f0",inputBorderFocus:"#1e293b",inputFocusRing:"rgba(30,41,59,0.15)",pollBorder:"#e2e8f0",pollSelectedBorder:"rgba(30,41,59,0.25)",pollBackground:"#fafbfc",pollSelectedBackground:"rgba(30,41,59,0.05)",pollColor:"#374151",pollSelectedColor:"#1e293b",pollCheckBorder:"#cbd5e1",pollCheckSelectedBorder:"#1e293b",pollCheckSelectedBg:"#1e293b"},typography:{fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSize:{xs:11,sm:13,md:14,lg:16},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:8,md:10,lg:14,full:"50%"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.04)",md:"0 4px 12px rgba(0,0,0,0.06)",lg:"0 12px 32px rgba(0,0,0,0.06)",modal:"0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.04)",button:"0 2px 8px rgba(0,0,0,0.06)"},animation:{duration:{fast:"0.15s",normal:"0.25s",slow:"0.4s"},easing:{default:"cubic-bezier(0.4, 0, 0.2, 1)",spring:"cubic-bezier(0.34, 1.56, 0.64, 1)"}}},oo={colors:{primary:"#e2e8f0",primaryHover:"#cbd5e1",primaryText:"#1e293b",background:"#1a1f2e",backgroundGradient:"linear-gradient(180deg, #1a1f2e 0%, #151925 100%)",surface:"rgba(55,65,81,0.5)",surfaceHover:"rgba(55,65,81,0.7)",text:"#f9fafb",textSecondary:"#d1d5db",textDisabled:"#6b7280",border:"rgba(255,255,255,0.08)",borderFocus:"rgba(255,255,255,0.2)",success:"#10b981",successSurface:"rgba(16,185,129,0.1)",error:"#fecaca",errorSurface:"rgba(127,29,29,0.3)",errorBorder:"rgba(254,202,202,0.1)",warning:"#fbbf24",warningActive:"#fbbf24",warningSurface:"rgba(245,158,11,0.08)",warningBorder:"rgba(245,158,11,0.3)",starFilled:"#f59e0b",starEmpty:"rgba(255,255,255,0.12)",voteUp:"#10b981",voteUpSurface:"rgba(16,185,129,0.08)",voteUpBorder:"rgba(16,185,129,0.3)",voteDown:"#ef4444",voteDownSurface:"rgba(239,68,68,0.08)",voteDownBorder:"rgba(239,68,68,0.3)",npsColors:$o,buttonBackground:"#e2e8f0",buttonBackgroundHover:"#cbd5e1",buttonBackgroundDisabled:"#374151",buttonColor:"#1e293b",buttonColorDisabled:"#6b7280",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.5)",closeButton:"#6b7280",closeButtonHover:"#9ca3af",closeButtonBg:"rgba(255,255,255,0.06)",glassBackground:"linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 60%, rgba(0,0,0,0.05) 100%)",glassBorder:"1px solid rgba(255,255,255,0.15)",glassColor:"rgba(255,255,255,0.88)",glassShadow:"0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.35)",glassHoverShadow:"0 8px 24px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.4)",inputBackground:"rgba(55,65,81,0.5)",inputBackgroundFocus:"rgba(55,65,81,0.7)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.2)",inputFocusRing:"rgba(255,255,255,0.06)",pollBorder:"rgba(255,255,255,0.08)",pollSelectedBorder:"rgba(226,232,240,0.25)",pollBackground:"rgba(55,65,81,0.5)",pollSelectedBackground:"rgba(226,232,240,0.08)",pollColor:"#d1d5db",pollSelectedColor:"#e2e8f0",pollCheckBorder:"rgba(255,255,255,0.2)",pollCheckSelectedBorder:"#e2e8f0",pollCheckSelectedBg:"#e2e8f0"},typography:{fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSize:{xs:11,sm:13,md:14,lg:16},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:8,md:10,lg:14,full:"50%"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.2)",md:"0 4px 12px rgba(0,0,0,0.3)",lg:"0 12px 32px rgba(0,0,0,0.2)",modal:"0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.2), 0 24px 48px rgba(0,0,0,0.15)",button:"0 2px 8px rgba(0,0,0,0.15)"},animation:{duration:{fast:"0.15s",normal:"0.25s",slow:"0.4s"},easing:{default:"cubic-bezier(0.4, 0, 0.2, 1)",spring:"cubic-bezier(0.34, 1.56, 0.64, 1)"}}};function It(e,r){return ce(e==="dark"?oo:eo,r)}function re(e,r,o){let n=(e==="auto"||e==="custom"?r:e)==="dark"?ce({},oo):ce({},eo);return o&&(n=ce(n,o)),n}var Uo="gotcha-styles",Oo="gotcha-dm-sans",Ho="gotcha-carter-one",Mt=`
1
+ import {createContext,useState,useMemo,useEffect,useCallback,useRef,useContext}from'react';import {jsx,jsxs}from'react/jsx-runtime';import {createPortal}from'react-dom';var Fo="https://gotcha.cx/api/v1";var j={ANONYMOUS_ID:"gotcha_anonymous_id",OFFLINE_QUEUE:"gotcha_offline_queue",HIDDEN_UNTIL:"gotcha_hidden",VISIT_COUNT:"gotcha_visits"},se={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Gotcha!"},Xe={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function ie(e){if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function ae(e,r){if(!(typeof window>"u"))try{localStorage.setItem(e,r);}catch{}}function le(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let r=Math.random()*16|0;return (e==="x"?r:r&3|8).toString(16)})}function Qe(){let e=ie(j.ANONYMOUS_ID);if(e)return e;let r=`anon_${le()}`;return ae(j.ANONYMOUS_ID,r),r}var Ke=[],Ve=false;function Ro(e,r){let o={message:e.slice(0,200),source:r?.slice(0,200),timestamp:Date.now()};Ke.push(o),Ke.length>10&&Ke.shift();}function Bo(e){Ro(e.message,e.filename);}function Mo(e){let r=e.reason instanceof Error?e.reason.message:String(e.reason);Ro(r);}function Go(){typeof window>"u"||Ve||(window.addEventListener("error",Bo),window.addEventListener("unhandledrejection",Mo),Ve=true);}function Lo(){typeof window>"u"||!Ve||(window.removeEventListener("error",Bo),window.removeEventListener("unhandledrejection",Mo),Ve=false);}function Do(){return [...Ke].reverse()}function Io(){return typeof window>"u"?{}:{url:window.location.origin+window.location.pathname,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenResolution:{width:screen.width,height:screen.height},recentErrors:Do()}}var Dt=50,It=10080*60*1e3;function Ie(){let e=ie(j.OFFLINE_QUEUE);if(!e)return [];try{let r=JSON.parse(e),o=Date.now();return r.filter(t=>o-t.queuedAt<It)}catch{return []}}function ro(e){ae(j.OFFLINE_QUEUE,JSON.stringify(e));}function no(e,r="create"){let o=Ie();o.length>=Dt||(o.push({id:le(),payload:e,type:r,queuedAt:Date.now(),retries:0}),ro(o));}function Po(e){let r=Ie().filter(o=>o.id!==e);ro(r);}function zo(){return Ie()}function Uo(){return Ie().length}function No(e){let r=Ie().map(o=>o.id===e?{...o,retries:o.retries+1}:o);ro(r.filter(o=>o.retries<=5));}var Ee={maxRetries:Xe.MAX_RETRIES,baseDelayMs:Xe.BASE_DELAY_MS,maxDelayMs:Xe.MAX_DELAY_MS};async function Pe(e,r,o=Ee,t=false){let n=null;for(let d=0;d<=o.maxRetries;d++){try{t&&d>0&&console.log(`[Gotcha] Retry attempt ${d}/${o.maxRetries}`);let i=await fetch(e,r);if(i.status>=400&&i.status<500&&i.status!==429||i.ok)return i;n=new Error(`HTTP ${i.status}`);}catch(i){n=i,t&&console.log(`[Gotcha] Network error: ${n.message}`);}if(d<o.maxRetries){let i=Math.min(o.baseDelayMs*Math.pow(2,d),o.maxDelayMs);await new Promise(c=>setTimeout(c,i));}}throw n}function Ho(e){let{apiKey:r,baseUrl:o=Fo,debug:t=false}=e,n=false,d={"Content-Type":"application/json",Authorization:`Bearer ${r}`};async function i(c,u,s){let l=`${o}${u}`,p=le();t&&console.log(`[Gotcha] ${c} ${u}`,s);let a=await Pe(l,{method:c,headers:{...d,"Idempotency-Key":p},body:s?JSON.stringify(s):void 0},Ee,t),g;try{g=await a.json();}catch{throw {code:"PARSE_ERROR",message:"Invalid response from server",status:a.status}}if(!a.ok){let y=g.error;throw t&&console.error(`[Gotcha] Error: ${y.code} - ${y.message}`),y}return t&&console.log("[Gotcha] Response:",g),g}return {async submitResponse(c){let u=c.user||{};u.id||(u.id=Qe());let s={...c,user:u,context:Io(),...c.isBug?{isBug:true}:{}};if(typeof navigator<"u"&&!navigator.onLine)return no(s,"create"),{id:le(),status:"queued",createdAt:new Date().toISOString()};try{return await i("POST","/responses",s)}catch(l){if(l instanceof TypeError&&typeof navigator<"u"&&!navigator.onLine)return no(s,"create"),{id:le(),status:"queued",createdAt:new Date().toISOString()};throw l}},async checkExistingResponse(c,u){let s=`${o}/responses/check?elementId=${encodeURIComponent(c)}&userId=${encodeURIComponent(u)}`;t&&console.log("[Gotcha] GET /responses/check");let l=await Pe(s,{method:"GET",headers:d},Ee,t),p=await l.json();if(!l.ok){let a=p.error;throw t&&console.error(`[Gotcha] Error: ${a.code} - ${a.message}`),a}return p.exists?(t&&console.log("[Gotcha] Found existing response:",p.response),p.response):null},async updateResponse(c,u,s){let l=`${o}/responses/${c}${s?`?userId=${encodeURIComponent(s)}`:""}`;t&&console.log(`[Gotcha] PATCH /responses/${c}`,u);let p=await Pe(l,{method:"PATCH",headers:d,body:JSON.stringify(u)},Ee,t),a=await p.json();if(!p.ok){let g=a.error;throw t&&console.error(`[Gotcha] Error: ${g.code} - ${g.message}`),g}return t&&console.log("[Gotcha] Response updated:",a),a},async getScore(c){let u=`${o}/scores/${encodeURIComponent(c)}`;t&&console.log(`[Gotcha] GET /scores/${c}`);let s=await Pe(u,{method:"GET",headers:d},Ee,t),l=await s.json();if(!s.ok){let p=l.error;throw t&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return t&&console.log("[Gotcha] Score:",l),l},async flagAsBug(c){let u=`${o}/responses/${encodeURIComponent(c)}/bug`;t&&console.log(`[Gotcha] POST /responses/${c}/bug`);let s=await Pe(u,{method:"POST",headers:d},Ee,t),l=await s.json();if(!s.ok){let p=l.error;throw t&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return t&&console.log("[Gotcha] Bug flagged:",l),l},async flushQueue(){if(!n){n=true;try{let c=zo();for(let u of c)try{if(u.type==="update"&&u.payload.responseId){let{responseId:s,...l}=u.payload;await i("PATCH",`/responses/${s}`,l);}else await i("POST","/responses",u.payload);Po(u.id);}catch{No(u.id);}}finally{n=false;}}},getQueueLength:Uo,getBaseUrl(){return o}}}var Pt=new Set(["__proto__","constructor","prototype"]);function he(e,r){let o={...e};for(let t of Object.keys(r)){if(Pt.has(t))continue;let n=r[t];n!=null&&typeof n=="object"&&!Array.isArray(n)?o[t]=he(e[t]??{},n):n!==void 0&&(o[t]=n);}return o}var zt=Array(11).fill("#1A1714"),Ut=Array(11).fill("#F2EEE6"),Oo="'Gotcha Fraunces', 'Fraunces 144', 'Fraunces', Georgia, 'Iowan Old Style', Charter, 'Source Serif Pro', serif",Wo="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",so={colors:{primary:"#1A1714",primaryHover:"#2A2622",primaryText:"#FAF8F4",background:"#FAF8F4",backgroundGradient:"#FAF8F4",surface:"#FAF8F4",surfaceHover:"#F2EEE6",text:"#1A1714",textSecondary:"#6B6660",textDisabled:"#A8A098",border:"#E8E3DA",borderFocus:"#1A1714",success:"#6B8E6B",successSurface:"rgba(107,142,107,0.08)",error:"#B85A3F",errorSurface:"rgba(184,90,63,0.06)",errorBorder:"rgba(184,90,63,0.18)",warning:"#D4532A",warningActive:"#B8451F",warningSurface:"rgba(212,83,42,0.06)",warningBorder:"rgba(212,83,42,0.22)",starFilled:"#1A1714",starEmpty:"#C9C2B6",voteUp:"#1A1714",voteUpSurface:"#FAF8F4",voteUpBorder:"#E8E3DA",voteDown:"#1A1714",voteDownSurface:"#FAF8F4",voteDownBorder:"#E8E3DA",npsColors:zt,buttonBackground:"#1A1714",buttonBackgroundHover:"#2A2622",buttonBackgroundDisabled:"#E8E3DA",buttonColor:"#FAF8F4",buttonColorDisabled:"#A8A098",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(26,23,20,0.32)",closeButton:"#6B6660",closeButtonHover:"#1A1714",closeButtonBg:"rgba(26,23,20,0.04)",glassBackground:"#FAF8F4",glassBorder:"1px solid #E8E3DA",glassColor:"#1A1714",glassShadow:"0 1px 2px rgba(26,23,20,0.04), 0 12px 32px -8px rgba(26,23,20,0.12)",glassHoverShadow:"0 2px 4px rgba(26,23,20,0.06), 0 16px 40px -8px rgba(26,23,20,0.16)",inputBackground:"transparent",inputBackgroundFocus:"transparent",inputBorder:"#E8E3DA",inputBorderFocus:"#1A1714",inputFocusRing:"transparent",pollBorder:"#E8E3DA",pollSelectedBorder:"#D4532A",pollBackground:"#FAF8F4",pollSelectedBackground:"#FAF8F4",pollColor:"#1A1714",pollSelectedColor:"#1A1714",pollCheckBorder:"#C9C2B6",pollCheckSelectedBorder:"#1A1714",pollCheckSelectedBg:"#1A1714"},typography:{fontFamily:Wo,fontFamilyDisplay:Oo,fontSize:{xs:11,sm:13,md:15,lg:17},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:6,md:10,lg:14,full:"999px"},width:1},shadows:{sm:"0 1px 2px rgba(26,23,20,0.04)",md:"0 2px 4px rgba(26,23,20,0.06), 0 8px 20px -6px rgba(26,23,20,0.08)",lg:"0 2px 4px rgba(26,23,20,0.06), 0 16px 40px -8px rgba(26,23,20,0.12)",modal:"0 2px 4px rgba(26,23,20,0.06), 0 24px 64px -12px rgba(26,23,20,0.18)",button:"0 1px 2px rgba(26,23,20,0.04), 0 12px 32px -8px rgba(26,23,20,0.12)"},animation:{duration:{fast:"0.18s",normal:"0.24s",slow:"0.32s"},easing:{default:"cubic-bezier(0.22, 0.61, 0.36, 1)",spring:"cubic-bezier(0.22, 0.61, 0.36, 1)"}}},io={colors:{primary:"#F2EEE6",primaryHover:"#FAF8F4",primaryText:"#141210",background:"#1A1714",backgroundGradient:"#1A1714",surface:"#1A1714",surfaceHover:"#221E1A",text:"#F2EEE6",textSecondary:"#9A928A",textDisabled:"#5A5449",border:"#2A2622",borderFocus:"#F2EEE6",success:"#8FAE8F",successSurface:"rgba(143,174,143,0.1)",error:"#D17560",errorSurface:"rgba(209,117,96,0.06)",errorBorder:"rgba(209,117,96,0.22)",warning:"#DC6340",warningActive:"#E8704A",warningSurface:"rgba(220,99,64,0.08)",warningBorder:"rgba(220,99,64,0.28)",starFilled:"#F2EEE6",starEmpty:"#4A433A",voteUp:"#F2EEE6",voteUpSurface:"#1A1714",voteUpBorder:"#2A2622",voteDown:"#F2EEE6",voteDownSurface:"#1A1714",voteDownBorder:"#2A2622",npsColors:Ut,buttonBackground:"#F2EEE6",buttonBackgroundHover:"#FAF8F4",buttonBackgroundDisabled:"#2A2622",buttonColor:"#141210",buttonColorDisabled:"#5A5449",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.52)",closeButton:"#9A928A",closeButtonHover:"#F2EEE6",closeButtonBg:"rgba(242,238,230,0.06)",glassBackground:"#1A1714",glassBorder:"1px solid #2A2622",glassColor:"#F2EEE6",glassShadow:"0 2px 4px rgba(0,0,0,0.4), 0 16px 40px -8px rgba(0,0,0,0.5)",glassHoverShadow:"0 4px 8px rgba(0,0,0,0.45), 0 20px 48px -8px rgba(0,0,0,0.55)",inputBackground:"transparent",inputBackgroundFocus:"transparent",inputBorder:"#2A2622",inputBorderFocus:"#F2EEE6",inputFocusRing:"transparent",pollBorder:"#2A2622",pollSelectedBorder:"#DC6340",pollBackground:"#1A1714",pollSelectedBackground:"#1A1714",pollColor:"#F2EEE6",pollSelectedColor:"#F2EEE6",pollCheckBorder:"#3A342E",pollCheckSelectedBorder:"#F2EEE6",pollCheckSelectedBg:"#F2EEE6"},typography:{fontFamily:Wo,fontFamilyDisplay:Oo,fontSize:{xs:11,sm:13,md:15,lg:17},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:6,md:10,lg:14,full:"999px"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 2px 4px rgba(0,0,0,0.35), 0 8px 20px -6px rgba(0,0,0,0.4)",lg:"0 2px 4px rgba(0,0,0,0.4), 0 16px 40px -8px rgba(0,0,0,0.5)",modal:"0 2px 4px rgba(0,0,0,0.4), 0 24px 64px -12px rgba(0,0,0,0.6)",button:"0 1px 2px rgba(0,0,0,0.3), 0 12px 32px -8px rgba(0,0,0,0.45)"},animation:{duration:{fast:"0.18s",normal:"0.24s",slow:"0.32s"},easing:{default:"cubic-bezier(0.22, 0.61, 0.36, 1)",spring:"cubic-bezier(0.22, 0.61, 0.36, 1)"}}};function Nt(e,r){return he(e==="dark"?io:so,r)}function ce(e,r,o){let n=(e==="auto"||e==="custom"?r:e)==="dark"?he({},io):he({},so);return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K825Sml+V1mGJ86e2IdeV7uBAvGFkbD70I1TuvhkjSntM7oTxnpsM08J1j4aZfdwmAa2/CG2FnN6OVF9o+7S4xojLF1I6g7Kf02RqPGGp96HQRLNLAu/2gH1dzpP2DtpaQVOTIvMRtnxsBB0LsSVDtAfnToKoU6RzTXI9FZXFtsU76fFFWvwjO+HAmMcM07ytc7XdOQJVCNCcDN96xn79bdPBbIVKq9PrpT8Y+oWYQdFObZPezdQ+4viho3eR2t4qrv4l7JVye5+4CEDObcj1HeNAQVen6HBGf5uDwkz2YHhG169qvqcqF5H1Fj6+4xNneU+/O7KMAnvs3ZC79Wyap52VbSwELRBmz1VZ0oOBtDUAYByAF0JgjV8IhXT8Qhg/Cxea8fD1QnO6oO+YBXo0UilRqk65PDlyVSLxwosViVbEWTzIkpuhSjGjxCsy1hgl8mVBMaVQxXmuLMo5WQ858tDcKpk4jGpVEW412MTLs8pQccpUqlOKO+cK3ZWntPJVeuex4DkaLzSc3OX4OHh4BPzFU9HyL0xPd8K2+UncGeksdK3OVMhTYr8jSZSTItlK2TJU4CWD59lEpRXVbO5DWNiUT4wtSyZ/NoQ82+nBBDcKfCXACwAAAA==",Yo=`
2
2
  @font-face {
3
- font-family: 'Carter One';
4
- font-style: normal;
3
+ font-family: '${Ht}';
5
4
  font-weight: 400;
5
+ font-style: normal;
6
6
  font-display: block;
7
- src: url(data:font/woff2;base64,d09GMgABAAAAAAK4AA4AAAAABOwAAAJlAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbXhwaBmAANBEICoFUgW8BNgIkAwgLBgAEIAWCUgcgGwoEUVQMHgC+OLCNaQVfBAoIrXGAIhjLIIM0CxavPfqMrzmLh6/9fufu20XEQyQzNNPOUEmimUZJpKLdIu3RKOU3O1hXc5D3YTdAbu+mRHU5AAIwC231R25qGGbpnwecyr34QQKM3gHMKMzOM4ogDSwQSreJE9bjISamQdCMwAAgeI0+S7qoy5j8TCDK8Ff4Fwm5+ecJhCwh9EgmsJiTo6S+/WkCPCU8DpCqr+hWKM/FBMRyfLPqV2LSlzBEIhqLxeGhIADg+rwoHxx58Oipm4301FUpgID4K8fAChoJFSYwAhNYKyDLAjudDimd9wA18hGDDvNkBE6AByBJiLpXVM2jgyht94hWK9yPQD+5lb948fAQKnfCK1PjBQWRayfW+hltCzAs9B8eX54Xd5g7vrzpiTswCeXB/VG5PNObmFr711KPrLKC6/mxys5avigCA+uFj8HGq+ErmaRDt/31k1XtfRtcI0pNluOCFEOOmVEOTg5eYn77Hq9Y0SJxu+bSBW5skqWS0VLXOvNJxgyRhVECycL7u2cb2pmOGdolPK+ORsLma1IHQCAY6I5NjWKsNzQVPeDnvzc7Pth+aTYMKHpqoEcCwSM4A6sVYPt/AIoeTckToLx4hELyieAj16Z4TKDbKYzIJOAW2JNhIptMhjyRlbXedjaymDv75i5jb1xkyVYiV4okyfIhmnG0EGNDIyMkVgmkUIJcmbJkQmLEi5Ehjz7iJF06pJeel1ETYiCBP/+OePouYuTKlyAX4iVTAl8JkhRIFyN3UpqAdTHa1nfVAy3Kk3LL2Ejf0Gch0McAqJNIAwAA) format('woff2');
8
- unicode-range: U+0047;
9
- }`.trim();function Gt(){if(typeof document>"u"||document.getElementById(Ho))return;let e=document.createElement("style");e.id=Ho,e.textContent=Mt,document.head.appendChild(e);}Gt();function ge(e){return e.replace(/[{}<>;@\\]/g,"")}function Ft(e){let r={default:ge(e.animation.easing.default),spring:ge(e.animation.easing.spring)},o={normal:ge(e.animation.duration.normal)},t=ge(e.typography.fontFamily),n=ge(e.colors.textDisabled),g=ge(e.colors.border);return `
10
- /* \u2500\u2500 Gotcha Keyframe Animations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
11
-
12
- @keyframes gotcha-modal-in {
13
- from { opacity: 0; transform: scale(0.92) translateY(-6px); }
14
- to { opacity: 1; transform: scale(1) translateY(0); }
15
- }
16
-
17
- @keyframes gotcha-modal-in-above {
18
- from { opacity: 0; transform: scale(0.92) translateY(6px); }
19
- to { opacity: 1; transform: scale(1) translateY(0); }
20
- }
21
-
22
- @keyframes gotcha-modal-in-center {
23
- from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
24
- to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
7
+ src: url(data:font/woff2;base64,${Ot}) format('woff2');
25
8
  }
9
+ `;var qo="gotcha-styles";function Te(e){return e.replace(/[{}<>;@\\]/g,"")}function Wt(e){let r=Te(e.animation.easing.default),o=Te(e.animation.duration.normal),t=Te(e.animation.duration.fast),n=Te(e.typography.fontFamily),d=Te(e.colors.textDisabled),i=Te(e.colors.borderFocus);return `
10
+ /* \u2500\u2500 Embedded Fraunces 144 SemiBold (OFL, subsetted to ASCII) \u2500\u2500 */
11
+ ${Yo}
12
+ /* \u2500\u2500 Gotcha keyframes (editorial) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
26
13
 
27
- @keyframes gotcha-success-pop {
28
- 0% { transform: scale(0); opacity: 0; }
29
- 50% { transform: scale(1.15); }
30
- 100% { transform: scale(1); opacity: 1; }
31
- }
32
-
33
- @keyframes gotcha-success-text {
34
- from { opacity: 0; transform: translateY(6px); }
14
+ @keyframes gotcha-fade-up {
15
+ from { opacity: 0; transform: translateY(8px); }
35
16
  to { opacity: 1; transform: translateY(0); }
36
17
  }
37
18
 
38
- @keyframes gotcha-check-draw {
39
- from { stroke-dashoffset: 24; }
40
- to { stroke-dashoffset: 0; }
41
- }
42
-
43
- @keyframes gotcha-glow-pulse {
44
- 0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
45
- 50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
19
+ @keyframes gotcha-modal-in {
20
+ from { opacity: 0; transform: translateY(8px); }
21
+ to { opacity: 1; transform: translateY(0); }
46
22
  }
47
23
 
48
- @keyframes gotcha-star-pulse {
49
- 0% { transform: scale(1); }
50
- 40% { transform: scale(1.3); }
51
- 100% { transform: scale(1); }
24
+ @keyframes gotcha-modal-in-above {
25
+ from { opacity: 0; transform: translateY(-8px); }
26
+ to { opacity: 1; transform: translateY(0); }
52
27
  }
53
28
 
54
- @keyframes gotcha-shimmer {
55
- 0% { background-position: -200% 0; }
56
- 100% { background-position: 200% 0; }
29
+ @keyframes gotcha-modal-in-center {
30
+ from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
31
+ to { opacity: 1; transform: translate(-50%, -50%); }
57
32
  }
58
33
 
59
- @keyframes gotcha-fade-up {
34
+ @keyframes gotcha-overlay-in {
60
35
  from { opacity: 0; }
61
36
  to { opacity: 1; }
62
37
  }
63
38
 
64
- @keyframes gotcha-overlay-in {
65
- from { opacity: 0; }
66
- to { opacity: 1; }
39
+ @keyframes gotcha-check-draw {
40
+ from { stroke-dashoffset: 30; }
41
+ to { stroke-dashoffset: 0; }
67
42
  }
68
43
 
69
44
  @keyframes gotcha-expand-in {
70
45
  from { opacity: 0; max-height: 0; margin-top: 0; }
71
- to { opacity: 1; max-height: 200px; margin-top: 12px; }
72
- }
73
-
74
- @keyframes gotcha-bubble-pop {
75
- 0% { transform: scale(0); opacity: 0; filter: blur(4px); }
76
- 40% { opacity: 1; filter: blur(0px); }
77
- 65% { transform: scale(1.08); }
78
- 82% { transform: scale(0.97); }
79
- 100% { transform: scale(1); opacity: 1; filter: blur(0px); }
80
- }
81
-
82
- @keyframes gotcha-letter-in {
83
- 0% { opacity: 0; transform: scale(0.6) translateY(2px); filter: blur(3px); }
84
- 100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); }
46
+ to { opacity: 1; max-height: 240px; margin-top: 14px; }
85
47
  }
86
48
 
87
- @keyframes gotcha-arrive-glow {
88
- 0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2); }
89
- 50% { box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.25); }
49
+ @keyframes gotcha-progress {
50
+ from { transform: scaleX(0); }
51
+ to { transform: scaleX(1); }
90
52
  }
91
53
 
92
54
  @keyframes gotcha-spin {
@@ -94,18 +56,14 @@ import {createContext,useState,useMemo,useEffect,useCallback,useRef,useContext}f
94
56
  to { transform: rotate(360deg); }
95
57
  }
96
58
 
97
- @keyframes gotcha-dash {
98
- 0% { stroke-dasharray: 1, 62; stroke-dashoffset: 0; }
99
- 50% { stroke-dasharray: 40, 62; stroke-dashoffset: -12; }
100
- 100% { stroke-dasharray: 1, 62; stroke-dashoffset: -62; }
101
- }
102
-
103
- /* \u2500\u2500 Base Styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
59
+ /* \u2500\u2500 Base styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
104
60
 
105
61
  [data-gotcha] {
106
- font-family: ${t};
62
+ font-family: ${n};
107
63
  -webkit-font-smoothing: antialiased;
108
64
  -moz-osx-font-smoothing: grayscale;
65
+ text-rendering: optimizeLegibility;
66
+ font-feature-settings: 'kern' 1, 'liga' 1;
109
67
  }
110
68
 
111
69
  [data-gotcha] *, [data-gotcha] *::before, [data-gotcha] *::after {
@@ -118,44 +76,61 @@ import {createContext,useState,useMemo,useEffect,useCallback,useRef,useContext}f
118
76
 
119
77
  [data-gotcha] button:focus-visible {
120
78
  outline: none;
121
- box-shadow: 0 0 0 2px ${g};
79
+ box-shadow: 0 0 0 2px ${i};
122
80
  }
123
81
 
124
82
  .gotcha-root textarea::placeholder {
125
- color: ${n};
83
+ color: ${d};
84
+ /* Upright, not italic \u2014 italic placeholders depress comprehension in
85
+ form inputs (Baymard). Italic is reserved for verb states like
86
+ "Sending\u2026" where it communicates motion/time. */
126
87
  }
127
88
 
128
- /* \u2500\u2500 Animation Utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
89
+ /* \u2500\u2500 Animation utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
129
90
 
130
91
  .gotcha-fade-up {
131
- animation: gotcha-fade-up ${o.normal} ${r.default} both;
92
+ animation: gotcha-fade-up ${o} ${r} both;
132
93
  }
133
94
 
134
95
  .gotcha-modal-enter {
135
- animation: gotcha-modal-in 0.3s ${r.spring} both;
96
+ animation: gotcha-modal-in ${o} ${r} both;
136
97
  }
137
98
 
138
99
  .gotcha-modal-enter-above {
139
- animation: gotcha-modal-in-above 0.3s ${r.spring} both;
100
+ animation: gotcha-modal-in-above ${o} ${r} both;
140
101
  }
141
102
 
142
103
  .gotcha-modal-enter-center {
143
- animation: gotcha-modal-in-center 0.3s ${r.spring} both;
104
+ animation: gotcha-modal-in-center ${o} ${r} both;
144
105
  }
145
106
 
146
107
  .gotcha-overlay-enter {
147
- animation: gotcha-overlay-in 0.2s ${r.default} both;
108
+ animation: gotcha-overlay-in ${t} ${r} both;
148
109
  }
149
110
 
150
- /* \u2500\u2500 Reduced Motion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
151
-
111
+ /* \u2500\u2500 Reduced motion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
112
+ Kill transforms and retime animations to near-instant. We carve out
113
+ the Spinner explicitly \u2014 it's the one widget surface where animation
114
+ communicates indeterminate status. Silencing it would leave reduced-
115
+ motion users staring at a static arc with no feedback that work is
116
+ in flight.
117
+ */
152
118
  @media (prefers-reduced-motion: reduce) {
153
- [data-gotcha] *, [data-gotcha] *::before, [data-gotcha] *::after {
119
+ [data-gotcha] *:not([role="img"]), [data-gotcha] *::before, [data-gotcha] *::after {
154
120
  animation-duration: 0.01ms !important;
155
121
  animation-iteration-count: 1 !important;
156
122
  transition-duration: 0.01ms !important;
123
+ transition-delay: 0ms !important;
124
+ transform: none !important;
125
+ }
126
+ [data-gotcha] .gotcha-fade-up,
127
+ [data-gotcha] .gotcha-modal-enter,
128
+ [data-gotcha] .gotcha-modal-enter-above,
129
+ [data-gotcha] .gotcha-modal-enter-center,
130
+ [data-gotcha] .gotcha-overlay-enter {
131
+ opacity: 1 !important;
157
132
  }
158
133
  }
159
- `.trim()}function _e(e){if(typeof document>"u")return;if(!document.getElementById(Oo)){let o=document.createElement("link");o.rel="preconnect",o.href="https://fonts.googleapis.com",document.head.appendChild(o);let t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",document.head.appendChild(t);let n=document.createElement("link");n.id=Oo,n.rel="stylesheet",n.href="https://fonts.googleapis.com/css2?family=Carter+One&family=DM+Sans:wght@400;500;600;700&display=swap",document.head.appendChild(n);}let r=document.getElementById(Uo);r||(r=document.createElement("style"),r.id=Uo,document.head.appendChild(r)),r.textContent=Ft(e);}var No=createContext(null),Lt={};function $t({apiKey:e,children:r,baseUrl:o,debug:t=false,disabled:n=false,defaultUser:g,themeConfig:l}){let[u,p]=useState(null);o&&!o.startsWith("https://")&&!o.startsWith("/")&&!o.includes("localhost")&&console.warn("[Gotcha] baseUrl should use HTTPS in production:",o);let s=useMemo(()=>Lo({apiKey:e,baseUrl:o,debug:t}),[e,o,t]),a=useMemo(()=>g??Lt,[JSON.stringify(g)]);useEffect(()=>{let c=re("light","light",l);_e(c);},[l]),useEffect(()=>(Ao(),()=>Io()),[]),useEffect(()=>{s.flushQueue();let c=()=>s.flushQueue();return window.addEventListener("online",c),()=>window.removeEventListener("online",c)},[s]);let h=useCallback(c=>{p(c);},[]),d=useCallback(()=>{p(null);},[]),i=useMemo(()=>({client:s,disabled:n,defaultUser:a,debug:t,activeModalId:u,openModal:h,closeModal:d,themeConfig:l}),[s,n,a,t,u,h,d,l]);return jsx(No.Provider,{value:i,children:r})}function D(){let e=useContext(No);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function _t(e,r){let o=new Date(e).getTime();if(isNaN(o))return true;let t=Date.now()-o,n=r*24*60*60*1e3;return t>=n}function Wo(e){let{client:r,defaultUser:o}=D(),[t,n]=useState(false),[g,l]=useState(false),[u,p]=useState(null),[s,a]=useState(null);return useEffect(()=>{process.env.NODE_ENV!=="production"&&e.cooldownDays&&!e.onePerUser&&console.warn("[Gotcha] cooldownDays has no effect without onePerUser=true");let d=e.user?.id||o?.id;if(!d||!e.onePerUser){a(null);return}let i=false;return (async()=>{l(true);try{let f=await r.checkExistingResponse(e.elementId,d);i||(f&&e.cooldownDays&&e.cooldownDays>0&&_t(f.createdAt,e.cooldownDays)?a(null):a(f));}catch{i||a(null);}finally{i||l(false);}})(),()=>{i=true;}},[r,e.elementId,e.user?.id,o?.id,e.onePerUser,e.cooldownDays]),{submit:useCallback(async d=>{n(true),p(null);try{let i=e.user?.id||o?.id,c;return e.onePerUser&&s&&i?c=await r.updateResponse(s.id,{content:d.content,title:d.title,rating:d.rating,vote:d.vote,pollSelected:d.pollSelected},i):c=await r.submitResponse({elementId:e.elementId,mode:e.mode,content:d.content,title:d.title,rating:d.rating,vote:d.vote,pollOptions:e.pollOptions,pollSelected:d.pollSelected,isBug:d.isBug,screenshot:d.screenshot,user:{...o,...e.user}}),e.onePerUser&&a({id:c.id,mode:e.mode,content:d.content??null,title:d.title??null,rating:d.rating??null,vote:d.vote??null,pollSelected:d.pollSelected??null,createdAt:c.createdAt}),e.onSuccess?.(c),c}catch(i){let c=i instanceof Error?i.message:"Something went wrong";throw p(c),e.onError?.(i instanceof Error?i:new Error(c)),i}finally{n(false);}},[r,o,e,s]),isLoading:t,isCheckingExisting:g,error:u,existingResponse:s,isEditing:!!s,clearError:()=>p(null)}}function Vo(e,r){return `${Y.HIDDEN_UNTIL}_${e}_${r}`}function Yo(e,r,o){if(!o||o<=0)return false;let t=Vo(e,r),n=ee(t);return n?new Date(n).getTime()>Date.now():false}function Ko(e){let{elementId:r,userId:o,hideAfterSubmitDays:t}=e,n=useMemo(()=>o||Ue(),[o]),[g,l]=useState(()=>Yo(r,n,t));useEffect(()=>{l(Yo(r,n,t));},[r,n,t]);let u=useCallback(()=>{if(!t||t<=0)return;let p=Vo(r,n),s=new Date(Date.now()+t*24*60*60*1e3);oe(p,s.toISOString()),l(true);},[r,n,t]);return {isHidden:g,markHidden:u}}function Kt(e){return `${Y.VISIT_COUNT}_${e}`}function jo(e){let{elementId:r,showAfterSeconds:o,showAfterScrollPercent:t,showAfterVisits:n}=e,g=o!=null||t!=null||n!=null,[l,u]=useState(!o),[p,s]=useState(!t),[a]=useState(()=>{if(!n)return true;let h=Kt(r),i=parseInt(ee(h)||"0",10)+1;return oe(h,String(i)),i>=n});return useEffect(()=>{if(!o||o<=0)return;let h=Date.now(),d=o*1e3,i=()=>{Date.now()-h>=d?u(true):c=setTimeout(i,Math.min(1e3,d-(Date.now()-h)));},c=setTimeout(i,Math.min(1e3,d));return ()=>clearTimeout(c)},[o]),useEffect(()=>{if(!t||t<=0)return;let h=()=>{let d=document.documentElement.scrollHeight,i=window.innerHeight;if(d<=i){s(true);return}(window.scrollY+i)/d*100>=t&&s(true);};if(h(),!p)return window.addEventListener("scroll",h,{passive:true}),()=>window.removeEventListener("scroll",h)},[t,p]),{conditionsMet:!g||l&&p&&a}}function We(...e){return e.filter(Boolean).join(" ")}var O=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,Xo=(e,r)=>{let o={sm:{desktop:24,mobile:28},md:{desktop:32,mobile:34},lg:{desktop:40,mobile:40}};return r?o[e].mobile:o[e].desktop};function jt(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qo({size:e,theme:r,customStyles:o,showOnHover:t,touchBehavior:n,onClick:g,isOpen:l,isParentHovered:u=false,animated:p=true,queuedCount:s=0}){let[a,h]=useState(false),[d,i]=useState(false),[c,f]=useState(jt),[S,v]=useState(false),[B,k]=useState(false),[A,z]=useState(false),{themeConfig:y}=D();useEffect(()=>{if(h(O()),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)"),H=V=>f(V.matches?"dark":"light");return U.addEventListener("change",H),()=>U.removeEventListener("change",H)},[]);let w=l?true:!a&&t?u:a&&n==="tap-to-reveal"?d:true;useEffect(()=>{if(w&&!A){let U=setTimeout(()=>z(true),600);return ()=>clearTimeout(U)}},[w,A]);let E=()=>{if(a&&n==="tap-to-reveal"&&!d){i(true);return}g();},C=Xo(e,a),x=useMemo(()=>re(r,c,y),[r,c,y]),F=()=>w?B?"scale(0.95)":S?"scale(1.08)":"scale(1)":"scale(0.6)",se={width:C,height:C,borderRadius:"50%",border:x.colors.glassBorder,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:x.colors.glassBackground,backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",color:x.colors.glassColor,boxShadow:S?x.colors.glassHoverShadow:x.colors.glassShadow,transition:A?`all 0.3s ${x.animation.easing.spring}`:"none",opacity:w?1:0,transform:F(),filter:B?"brightness(0.95)":"brightness(1)",pointerEvents:w?"auto":"none",...p&&w&&!A?{animation:"gotcha-bubble-pop 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) both, gotcha-arrive-glow 1200ms ease-in-out 600ms both"}:{},...o?.button};return jsxs("button",{type:"button",onClick:E,onMouseEnter:()=>v(true),onMouseLeave:()=>{v(false),k(false);},onMouseDown:()=>k(true),onMouseUp:()=>k(false),onTouchStart:()=>k(true),onTouchEnd:()=>k(false),style:se,className:We("gotcha-button",l&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":l,"aria-haspopup":"dialog",children:[jsx(Xt,{size:C*.65,animated:p}),s>0&&jsx("div",{"aria-label":`${s} queued`,style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:"50%",backgroundColor:x.colors.warning,border:"1.5px solid rgba(255,255,255,0.9)"}})]})}function Xt({size:e,animated:r=true}){let[o,t]=useState(false);return useEffect(()=>{t(true);},[]),jsx("span",{"aria-hidden":"true",style:{fontFamily:"'Carter One', cursive",fontSize:e,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",marginTop:e*.05,marginRight:e*.05,userSelect:"none",opacity:r?0:o?1:0,...r&&o?{animation:"gotcha-letter-in 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms both"}:{}},children:"G"})}function L({size:e=16,color:r="currentColor"}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:{animation:"gotcha-spin 0.8s linear infinite"},children:[jsx("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeOpacity:"0.12"}),jsx("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",style:{animation:"gotcha-dash 1.2s ease-in-out infinite"}})]})}function Zo({src:e,onRemove:r,resolvedTheme:o}){return jsxs("div",{style:{position:"relative",marginTop:10,borderRadius:o.borders.radius.md,overflow:"hidden",border:`1px solid ${o.colors.border}`},children:[jsx("img",{src:e,alt:"Screenshot",style:{display:"block",width:"100%",maxHeight:120,objectFit:"cover"}}),jsx("button",{type:"button",onClick:r,"aria-label":"Remove screenshot",style:{position:"absolute",top:4,right:4,width:22,height:22,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.6)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,lineHeight:1},children:jsx("svg",{width:10,height:10,viewBox:"0 0 14 14",fill:"none",children:jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]})}function et({resolvedTheme:e,placeholder:r,submitText:o,isLoading:t,onSubmit:n,customStyles:g,initialValues:l,isEditing:u=false,showText:p=true,showRating:s=true,enableBugFlag:a=false,bugFlagLabel:h,enableScreenshot:d=false}){let[i,c]=useState(l?.content||""),[f,S]=useState(l?.rating??null),[v,B]=useState(false),[k,A]=useState(false),[z,y]=useState(null),[w,E]=useState(false),[C,x]=useState(false);useEffect(()=>{A(O());},[]),useEffect(()=>{l?.content!==void 0&&c(l.content||""),l?.rating!==void 0&&S(l.rating??null);},[l?.content,l?.rating]);let F=p&&s?i.trim().length>0||f!==null:p?i.trim().length>0:s?f!==null:false,se=async()=>{E(true),x(false);try{let{captureScreenshot:b}=await import('./screenshot-KRQM47Z4.mjs'),ue=await b();ue?y(ue):(x(!0),setTimeout(()=>x(!1),3e3));}catch{x(true),setTimeout(()=>x(false),3e3);}finally{E(false);}},U=b=>{b.preventDefault(),F&&n({content:p&&i.trim()?i.trim():void 0,rating:s&&f!==null?f:void 0,isBug:v||void 0,screenshot:z||void 0});},H={width:"100%",padding:k?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:k?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:k?100:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,boxShadow:"inset 0 1px 2px rgba(0,0,0,0.04)",...g?.input},V={width:"100%",padding:k?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:e.colors.buttonBackground,color:e.colors.buttonColor,fontSize:k?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",...g?.submitButton};return jsxs("form",{onSubmit:U,children:[s&&jsx("div",{style:{marginBottom:p?k?16:12:0,...p?{}:{display:"flex",justifyContent:"center",padding:"8px 0"}},children:jsx(or,{value:f,onChange:S,theme:e,isTouch:k,large:!p})}),p&&jsx("textarea",{value:i,onChange:b=>c(b.target.value),placeholder:r||"Share your thoughts...",maxLength:5e3,style:H,disabled:t,"aria-label":"Your feedback",onFocus:b=>{b.currentTarget.style.borderColor=e.colors.inputBorderFocus,b.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,b.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:b=>{b.currentTarget.style.borderColor=e.colors.inputBorder,b.currentTarget.style.boxShadow="inset 0 1px 2px rgba(0,0,0,0.04)",b.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),a&&jsxs("button",{type:"button",role:"switch","aria-checked":v,onClick:()=>B(!v),style:{display:"flex",alignItems:"center",gap:7,width:"100%",marginTop:10,padding:"7px 10px",border:`1px solid ${v?e.colors.warningBorder:e.colors.border}`,borderRadius:7,backgroundColor:v?e.colors.warningSurface:"transparent",cursor:"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,fontFamily:e.typography.fontFamily,...g?.bugFlag},onMouseEnter:b=>{v||(b.currentTarget.style.backgroundColor=e.colors.surfaceHover===e.colors.inputBackgroundFocus?"rgba(0,0,0,0.02)":e.colors.surfaceHover);},onMouseLeave:b=>{v||(b.currentTarget.style.backgroundColor="transparent");},children:[jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:v?e.colors.warningActive:e.colors.textDisabled,strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transition:`stroke ${e.animation.duration.fast}`},children:jsx("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),jsx("span",{style:{fontSize:12,fontWeight:v?e.typography.fontWeight.medium:e.typography.fontWeight.normal,color:v?e.colors.warningActive:e.colors.textDisabled,transition:`color ${e.animation.duration.fast}`,letterSpacing:"0.01em"},children:v?"Issue reported":h||"Report an issue"}),jsx("div",{style:{marginLeft:"auto",width:28,height:16,borderRadius:8,backgroundColor:v?e.colors.warning:e.colors.border,position:"relative",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,flexShrink:0},children:jsx("div",{style:{position:"absolute",top:2,left:v?14:2,width:12,height:12,borderRadius:"50%",backgroundColor:v?"#ffffff":e.colors.textDisabled,transition:`left ${e.animation.duration.fast} ${e.animation.easing.default}, background-color ${e.animation.duration.fast}`,boxShadow:"0 1px 2px rgba(0,0,0,0.15)"}})})]}),a&&d&&v&&!z&&jsxs("button",{type:"button",onClick:se,disabled:w,style:{display:"flex",alignItems:"center",gap:6,width:"100%",marginTop:8,padding:"7px 10px",border:`1px solid ${e.colors.border}`,borderRadius:7,backgroundColor:"transparent",cursor:w?"not-allowed":"pointer",fontFamily:e.typography.fontFamily,fontSize:12,color:e.colors.textSecondary,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},onMouseEnter:b=>{b.currentTarget.style.backgroundColor=e.colors.surfaceHover;},onMouseLeave:b=>{b.currentTarget.style.backgroundColor="transparent";},children:[w?jsx(L,{size:14,color:e.colors.textSecondary}):jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),jsx("circle",{cx:"12",cy:"10",r:"3"}),jsx("path",{d:"M2 17l4-4 3 3 4-4 9 9"})]}),w?"Capturing...":"Capture screenshot"]}),C&&jsx("div",{style:{fontSize:11,color:e.colors.textSecondary,marginTop:4,padding:"4px 0",fontFamily:e.typography.fontFamily},children:"Screenshot capture unavailable"}),a&&d&&v&&z&&jsx(Zo,{src:z,onRemove:()=>y(null),resolvedTheme:e}),jsxs("button",{type:"submit",disabled:t||!F,style:{...V,marginTop:12,opacity:t?.8:1,backgroundColor:F?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:F?e.colors.buttonColor:e.colors.buttonColorDisabled,display:"flex",alignItems:"center",justifyContent:"center",gap:8,...t?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{}},onMouseEnter:b=>{b.currentTarget.disabled||(b.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,b.currentTarget.style.transform="translateY(-1px)",b.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:b=>{b.currentTarget.disabled||(b.currentTarget.style.backgroundColor=e.colors.buttonBackground,b.currentTarget.style.transform="translateY(0)",b.currentTarget.style.boxShadow="none");},children:[t&&jsx(L,{size:k?18:16,color:e.colors.buttonColor}),t?u?"Updating...":"Submitting...":u?"Update":o]})]})}function or({value:e,onChange:r,theme:o,isTouch:t,large:n=false}){let[g,l]=useState(null),[u,p]=useState(null),s=useRef(),a=n?t?36:28:t?28:18,h=n?t?8:5:t?8:3;useEffect(()=>()=>{clearTimeout(s.current);},[]);let d=i=>{p(i),r(i),clearTimeout(s.current),s.current=setTimeout(()=>p(null),300);};return jsx("div",{style:{display:"flex",gap:n?t?8:6:t?6:2},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(i=>{let c=(g??e??0)>=i;return jsx("button",{type:"button",onClick:()=>d(i),onMouseEnter:()=>l(i),onMouseLeave:()=>l(null),"aria-label":`Rate ${i} out of 5`,"aria-pressed":e===i,style:{background:"none",border:"none",cursor:"pointer",padding:h,color:c?o.colors.starFilled:o.colors.starEmpty,transition:`color 0.15s ${o.animation.easing.default}`,transform:u===i?"scale(1)":g!==null&&g>=i?"scale(1.1)":"scale(1)",animation:u===i?`gotcha-star-pulse 0.3s ${o.animation.easing.spring}`:"none",filter:c?`drop-shadow(0 0 3px ${o.colors.starFilled}40)`:"none",transitionDelay:`${(i-1)*30}ms`},children:jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"currentColor",children:jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})},i)})})}function ot({resolvedTheme:e,isLoading:r,onSubmit:o,initialVote:t,isEditing:n=false,labels:g}){let[l,u]=useState(false),[p,s]=useState(t||null),[a,h]=useState(t||null);useEffect(()=>{u(O());},[]),useEffect(()=>{t!==void 0&&(h(t),s(t));},[t]),useEffect(()=>{!r&&!n&&s(null);},[r,n]);let d=f=>{s(f),o({vote:f});},i=f=>{let S=a===f,v=f==="up"?e.colors.voteUp:e.colors.voteDown,B=f==="up"?e.colors.voteUpSurface:e.colors.voteDownSurface,k=f==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return {flex:1,minWidth:0,overflow:"hidden",padding:l?"14px 18px":"10px 14px",border:S?`2px solid ${k}`:`1px solid ${e.colors.border}`,borderRadius:e.borders.radius.lg-2,background:S?`linear-gradient(135deg, ${B}, ${B})`:e.colors.surface,color:S?v:e.colors.textSecondary,fontSize:l?28:24,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`all 0.2s ${e.animation.easing.default}`,display:"flex",alignItems:"center",justifyContent:"center",gap:l?10:8}},c=l?24:20;return jsxs("div",{style:{display:"flex",gap:l?12:10},role:"group","aria-label":"Vote",children:[jsx("button",{type:"button",onClick:()=>d("up"),disabled:r,style:i("up"),"aria-label":"Vote up - I like this","aria-pressed":a==="up",onMouseEnter:f=>{r||(f.currentTarget.style.transform="translateY(-2px) scale(1.02)",f.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:f=>{f.currentTarget.style.transform="translateY(0) scale(1)",f.currentTarget.style.boxShadow="none";},children:r&&p==="up"?jsxs(Fragment,{children:[jsx(L,{size:c,color:e.colors.text}),jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:n?"Updating...":"Sending..."})]}):jsxs(Fragment,{children:[jsx(tr,{size:c}),jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:g?.up||(a==="up"?"Liked":"Like")})]})}),jsx("button",{type:"button",onClick:()=>d("down"),disabled:r,style:i("down"),"aria-label":"Vote down - I don't like this","aria-pressed":a==="down",onMouseEnter:f=>{r||(f.currentTarget.style.transform="translateY(-2px) scale(1.02)",f.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:f=>{f.currentTarget.style.transform="translateY(0) scale(1)",f.currentTarget.style.boxShadow="none";},children:r&&p==="down"?jsxs(Fragment,{children:[jsx(L,{size:c,color:e.colors.text}),jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:n?"Updating...":"Sending..."})]}):jsxs(Fragment,{children:[jsx(rr,{size:c}),jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:g?.down||(a==="down"?"Disliked":"Dislike")})]})})]})}function tr({size:e=24}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function rr({size:e=24}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"})})}function nt({resolvedTheme:e,options:r,allowMultiple:o,isLoading:t,onSubmit:n,initialSelected:g,isEditing:l=false}){let[u,p]=useState(g||[]),[s,a]=useState(false);useEffect(()=>{a(O());},[]),useEffect(()=>{g&&p(g);},[g]);let h=c=>{p(o?f=>f.includes(c)?f.filter(S=>S!==c):[...f,c]:f=>f.includes(c)?[]:[c]);},d=()=>{u.length!==0&&n({pollSelected:u});},i=(c,f)=>{let S=u.includes(c);return {width:"100%",padding:s?"12px 14px":"9px 12px",border:`1px solid ${S?e.colors.pollSelectedBorder:e.colors.pollBorder}`,borderRadius:e.borders.radius.lg-2,backgroundColor:S?e.colors.pollSelectedBackground:e.colors.pollBackground,color:S?e.colors.pollSelectedColor:e.colors.pollColor,fontSize:s?15:e.typography.fontSize.sm,fontWeight:S?e.typography.fontWeight.semibold:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t?"not-allowed":"pointer",transition:`all 0.2s ${e.animation.easing.default}`,textAlign:"left",letterSpacing:"0.01em",display:"flex",alignItems:"center",gap:8,animation:`gotcha-fade-up ${e.animation.duration.normal} ${e.animation.easing.default} both`,animationDelay:`${f*.05}s`}};return jsxs("div",{children:[jsx("div",{style:{display:"flex",flexDirection:"column",gap:s?8:6},role:"group","aria-label":o?"Select one or more options":"Select an option",children:r.map((c,f)=>{let S=u.includes(c);return jsxs("button",{type:"button",onClick:()=>h(c),disabled:t,style:i(c,f),"aria-pressed":S,onMouseEnter:v=>{t||(v.currentTarget.style.transform="translateX(2px)");},onMouseLeave:v=>{v.currentTarget.style.transform="translateX(0)";},children:[jsx("span",{style:{width:16,height:16,borderRadius:o?4:"50%",border:`2px solid ${S?e.colors.pollCheckSelectedBorder:e.colors.pollCheckBorder}`,backgroundColor:S?e.colors.pollCheckSelectedBg:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast}`},children:S&&jsx("svg",{width:10,height:10,viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M2 6l3 3 5-5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),c]},c)})}),jsxs("button",{type:"button",onClick:d,disabled:t||u.length===0,style:{width:"100%",marginTop:12,padding:s?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:u.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,color:u.length===0?e.colors.buttonColorDisabled:e.colors.buttonColor,fontSize:s?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t||u.length===0?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:t?.8:1,...t?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{}},onMouseEnter:c=>{c.currentTarget.disabled||(c.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,c.currentTarget.style.transform="translateY(-1px)",c.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:c=>{c.currentTarget.disabled||(c.currentTarget.style.backgroundColor=u.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,c.currentTarget.style.transform="translateY(0)",c.currentTarget.style.boxShadow="none");},children:[t&&jsx(L,{size:s?18:16,color:e.colors.buttonColor}),t?l?"Updating...":"Submitting...":l?"Update":"Submit"]})]})}function at({resolvedTheme:e,submitText:r,isLoading:o,onSubmit:t,customStyles:n,showFollowUp:g=true,followUpPlaceholder:l,lowLabel:u="Not likely",highLabel:p="Very likely",initialValues:s,isEditing:a=false}){let[h,d]=useState(s?.rating??null),[i,c]=useState(s?.content||""),[f,S]=useState(false),[v,B]=useState(null);useEffect(()=>{S(O());},[]),useEffect(()=>{s?.rating!==void 0&&d(s.rating??null),s?.content!==void 0&&c(s.content||"");},[s?.rating,s?.content]);let k=h!==null,A=e.colors.npsColors;return jsxs("form",{onSubmit:y=>{y.preventDefault(),k&&t({rating:h??void 0,content:g&&i.trim()?i.trim():void 0});},children:[jsxs("div",{children:[jsx("div",{style:{display:"flex",gap:f?4:6,justifyContent:"center"},role:"group","aria-label":"NPS Score",children:Array.from({length:11},(y,w)=>{let E=h===w,C=v===w,x=A[w];return jsx("button",{type:"button",onClick:()=>d(w),onMouseEnter:()=>B(w),onMouseLeave:()=>B(null),"aria-label":`Score ${w} out of 10`,"aria-pressed":E,style:{flex:1,minWidth:0,height:f?34:32,borderRadius:e.borders.radius.sm,border:E?`2px solid ${x}`:`1.5px solid ${x}25`,backgroundColor:E?x:C?`${x}25`:`${x}0c`,color:E?"#fff":C?x:`${x}bb`,fontSize:12,fontWeight:E?e.typography.fontWeight.bold:e.typography.fontWeight.semibold,fontFamily:e.typography.fontFamily,fontVariantNumeric:"tabular-nums",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",transition:`all 0.2s ${e.animation.easing.spring}`,transform:E?"scale(1.08)":C?"scale(1.04)":"scale(1)",boxShadow:E?`0 0 12px ${x}40`:"none",...n?.npsButton,...E?n?.npsButtonSelected:{}},children:w},w)})}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:6,padding:"0 2px",...n?.npsLabels},children:[jsx("span",{style:{fontSize:e.typography.fontSize.xs,color:e.colors.textDisabled,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.02em"},children:u}),jsx("span",{style:{fontSize:e.typography.fontSize.xs,color:e.colors.textDisabled,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.02em"},children:p})]})]}),g&&h!==null&&jsx("textarea",{value:i,onChange:y=>c(y.target.value),placeholder:l||"What's the main reason for your score?",maxLength:5e3,style:{width:"100%",padding:f?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:f?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"vertical",minHeight:f?80:60,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,animation:`gotcha-expand-in 0.3s ${e.animation.easing.default} both`,overflow:"hidden",...n?.input},disabled:o,"aria-label":"Follow-up feedback",onFocus:y=>{y.currentTarget.style.borderColor=e.colors.inputBorderFocus,y.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,y.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:y=>{y.currentTarget.style.borderColor=e.colors.inputBorder,y.currentTarget.style.boxShadow="none",y.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),jsxs("button",{type:"submit",disabled:o||!k,style:{width:"100%",padding:f?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:k?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:k?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:f?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:o?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",opacity:o?.8:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginTop:12,...o?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{},...n?.submitButton},onMouseEnter:y=>{y.currentTarget.disabled||(y.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,y.currentTarget.style.transform="translateY(-1px)",y.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:y=>{y.currentTarget.disabled||(y.currentTarget.style.backgroundColor=k?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,y.currentTarget.style.transform="translateY(0)",y.currentTarget.style.boxShadow="none");},children:[o&&jsx(L,{size:f?18:16,color:e.colors.buttonColor}),o?a?"Updating...":"Submitting...":a?"Update":r]})]})}function ct({resolvedTheme:e,promptText:r,placeholder:o,isLoading:t,onSubmit:n}){let[g,l]=useState(""),[u,p]=useState(false);return useEffect(()=>{p(O());},[]),jsxs("form",{onSubmit:a=>{a.preventDefault(),g.trim()&&n(g.trim());},children:[jsx("p",{style:{margin:"0 0 12px 0",fontSize:e.typography.fontSize.sm,color:e.colors.textSecondary,lineHeight:1.4,fontFamily:e.typography.fontFamily},children:r}),jsx("textarea",{value:g,onChange:a=>l(a.target.value),placeholder:o||"Tell us more...",maxLength:5e3,disabled:t,"aria-label":"Follow-up feedback",style:{width:"100%",padding:u?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:u?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:u?100:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,boxShadow:"inset 0 1px 2px rgba(0,0,0,0.04)"},onFocus:a=>{a.currentTarget.style.borderColor=e.colors.inputBorderFocus,a.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,a.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:a=>{a.currentTarget.style.borderColor=e.colors.inputBorder,a.currentTarget.style.boxShadow="inset 0 1px 2px rgba(0,0,0,0.04)",a.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),jsxs("button",{type:"submit",disabled:t||!g.trim(),style:{width:"100%",marginTop:12,padding:u?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:g.trim()?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:g.trim()?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:u?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:t?.8:1},onMouseEnter:a=>{a.currentTarget.disabled||(a.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,a.currentTarget.style.transform="translateY(-1px)",a.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:a=>{a.currentTarget.disabled||(a.currentTarget.style.backgroundColor=e.colors.buttonBackground,a.currentTarget.style.transform="translateY(0)",a.currentTarget.style.boxShadow="none");},children:[t&&jsx(L,{size:u?18:16,color:e.colors.buttonColor}),t?"Sending...":"Submit"]})]})}function mo({mode:e,theme:r,customStyles:o,promptText:t,placeholder:n,submitText:g,thankYouMessage:l,isLoading:u,isCheckingExisting:p=false,isSubmitted:s,phase:a="form",followUpConfig:h,followUpLoading:d=false,onFollowUpSubmit:i,error:c,existingResponse:f,isEditing:S=false,showText:v=true,showRating:B=true,voteLabels:k,options:A,allowMultiple:z=false,npsQuestion:y,npsFollowUp:w=true,npsFollowUpPlaceholder:E,npsLowLabel:C,npsHighLabel:x,enableBugFlag:F=false,bugFlagLabel:se,enableScreenshot:U=false,onSubmit:H,onClose:V,anchorRect:b,useFixedPosition:ue=false}){let De=useRef(null),ze=useRef(null),me=useRef(V);me.current=V;let[P,Xe]=useState(false),[Pe,Le]=useState("light"),{themeConfig:he}=D();useEffect(()=>{Xe(window.innerWidth<640);let I=window.matchMedia("(prefers-color-scheme: dark)");Le(I.matches?"dark":"light");let _=N=>Le(N.matches?"dark":"light");return I.addEventListener("change",_),()=>I.removeEventListener("change",_)},[]);let m=useMemo(()=>re(r,Pe,he),[r,Pe,he]);useEffect(()=>{_e(m);},[m]);let be=typeof window>"u"||!b?false:window.innerHeight-b.bottom<300;useEffect(()=>{let I=De.current;if(!I)return;ze.current?.focus();let _=N=>{if(N.key==="Escape"){me.current();return}if(N.key==="Tab"){let q=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),xe=q[0],ve=q[q.length-1];N.shiftKey&&document.activeElement===xe?(N.preventDefault(),ve?.focus()):!N.shiftKey&&document.activeElement===ve&&(N.preventDefault(),xe?.focus());}};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[]);let ae=e==="vote"?"What do you think?":e==="poll"?"Cast your vote":e==="nps"?y||"How likely are you to recommend us?":"What do you think of this feature?",ye=P?24:20,ie=e==="nps"?420:340,qe=P?"gotcha-modal-enter-center":be?"gotcha-modal-enter-above":"gotcha-modal-enter",Se=typeof window<"u"?window.innerHeight:0,K=P?{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:ie,padding:ye,borderRadius:m.borders.radius.lg+2,background:m.colors.backgroundGradient,color:m.colors.text,boxShadow:m.shadows.modal,border:`${m.borders.width}px solid ${m.colors.border}`,zIndex:9999,fontFamily:m.typography.fontFamily,...o?.modal,textAlign:"left"}:ue&&b&&Se?(()=>{let I=window.innerWidth,_=24,q=b.left+b.width/2-ie/2;return {position:"fixed",left:Math.max(_,Math.min(q,I-ie-_)),width:ie,padding:ye,borderRadius:m.borders.radius.lg,background:m.colors.backgroundGradient,color:m.colors.text,boxShadow:m.shadows.modal,border:`${m.borders.width}px solid ${m.colors.border}`,zIndex:99999,fontFamily:m.typography.fontFamily,...be?{bottom:Se-b.top+8}:{top:b.bottom+8},...o?.modal,textAlign:"left"}})():{position:"absolute",left:"50%",width:ie,padding:ye,borderRadius:m.borders.radius.lg,background:m.colors.backgroundGradient,color:m.colors.text,boxShadow:m.shadows.modal,border:`${m.borders.width}px solid ${m.colors.border}`,zIndex:9999,fontFamily:m.typography.fontFamily,...be?{bottom:"100%",marginBottom:8,transform:"translateX(-50%)"}:{top:"100%",marginTop:8,transform:"translateX(-50%)"},...o?.modal,textAlign:"left"},Q=I=>P?{}:{animation:`gotcha-fade-up ${m.animation.duration.normal} ${m.animation.easing.default} both`,animationDelay:`${I*.05}s`},le=l==="Gotcha!"||l==="Thanks for your feedback!";return jsxs("div",{ref:De,role:"dialog","aria-modal":"true","aria-label":s?"Feedback submitted":void 0,"aria-labelledby":s?void 0:"gotcha-modal-title","data-gotcha":true,style:K,className:We("gotcha-modal",qe),children:[jsx("button",{ref:ze,type:"button",onClick:V,"aria-label":"Close feedback form",style:{position:"absolute",top:P?10:6,right:P?10:6,width:P?40:36,height:P?40:36,border:"none",background:"transparent",outline:"none",cursor:"pointer",zIndex:10,color:m.colors.closeButton,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:m.borders.radius.sm,transition:`all ${m.animation.duration.fast} ${m.animation.easing.default}`,...o?.closeButton},onMouseEnter:I=>{I.currentTarget.style.backgroundColor=m.colors.closeButtonBg,I.currentTarget.style.color=m.colors.closeButtonHover;},onMouseLeave:I=>{I.currentTarget.style.backgroundColor="transparent",I.currentTarget.style.color=m.colors.closeButton;},children:jsx("svg",{width:P?16:14,height:P?16:14,viewBox:"0 0 14 14",fill:"none",children:jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),!s&&jsx("h2",{id:"gotcha-modal-title",style:{margin:"0 0 16px 0",fontSize:P?m.typography.fontSize.lg:m.typography.fontSize.md,fontWeight:m.typography.fontWeight.semibold,paddingRight:P?44:38,letterSpacing:"-0.02em",lineHeight:1.4,textAlign:"left",fontFamily:m.typography.fontFamily,...Q(0),...o?.title},children:t||ae}),s&&jsxs("div",{style:{textAlign:"center",padding:"28px 0 20px"},children:[jsx("div",{style:{width:52,height:52,borderRadius:"50%",backgroundColor:m.colors.successSurface,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",animation:`gotcha-success-pop 0.4s ${m.animation.easing.spring} both, gotcha-glow-pulse 0.8s ease 0.4s`,...o?.successIcon},children:jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20 6L9 17L4 12",stroke:m.colors.success,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:24,strokeDashoffset:0,animation:"gotcha-check-draw 0.4s ease 0.2s both"}})})}),jsx("p",{style:{margin:0,fontSize:le?22:m.typography.fontSize.md,fontWeight:le?m.typography.fontWeight.bold:m.typography.fontWeight.medium,color:m.colors.text,fontFamily:le?"'Carter One', cursive":m.typography.fontFamily,animation:"gotcha-success-text 0.3s ease 0.3s both",...o?.successMessage},children:le?"Gotcha!":l}),le&&jsx("p",{style:{margin:"6px 0 0",fontSize:m.typography.fontSize.sm,fontWeight:m.typography.fontWeight.normal,color:m.colors.textSecondary,animation:"gotcha-success-text 0.3s ease 0.45s both"},children:"Thanks for your feedback!"})]}),c&&!s&&jsxs("div",{style:{padding:"8px 10px",marginBottom:12,borderRadius:m.borders.radius.sm,backgroundColor:m.colors.errorSurface,border:`1px solid ${m.colors.errorBorder}`,color:m.colors.error,fontSize:m.typography.fontSize.sm,lineHeight:1.4,display:"flex",alignItems:"center",gap:8,...Q(1),...o?.errorMessage},children:[jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:jsx("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),c]}),a==="followUp"&&h&&i&&jsx("div",{style:Q(1),children:jsx(ct,{resolvedTheme:m,promptText:h.promptText,placeholder:h.placeholder,isLoading:d,onSubmit:i})}),a==="form"&&p&&jsx("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0",...Q(1)},children:jsx(L,{size:24,color:m.colors.textSecondary})}),a==="form"&&!p&&jsxs("div",{style:Q(1),children:[e==="feedback"&&jsx(et,{resolvedTheme:m,placeholder:n,submitText:g,isLoading:u,onSubmit:H,customStyles:o,initialValues:f?{content:f.content,rating:f.rating}:void 0,isEditing:S,showText:v,showRating:B,enableBugFlag:F,bugFlagLabel:se,enableScreenshot:U}),e==="vote"&&jsx(ot,{resolvedTheme:m,isLoading:u,onSubmit:H,initialVote:f?.vote||void 0,isEditing:S,labels:k}),e==="nps"&&jsx(at,{resolvedTheme:m,submitText:g,isLoading:u,onSubmit:H,showFollowUp:w,followUpPlaceholder:E,lowLabel:C,highLabel:x,customStyles:o,initialValues:f?{rating:f.rating,content:f.content}:void 0,isEditing:S}),e==="poll"&&A&&A.length>0&&jsx(nt,{resolvedTheme:m,options:A,allowMultiple:z,isLoading:u,onSubmit:H,initialSelected:f?.pollSelected||void 0,isEditing:S})]}),jsxs("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:[s&&"Thank you! Your feedback has been submitted.",c&&`Error: ${c}`]})]})}function ar({elementId:e,user:r,mode:o="feedback",showText:t=true,showRating:n=true,voteLabels:g,options:l,allowMultiple:u=false,npsQuestion:p,npsFollowUp:s=true,npsFollowUpPlaceholder:a,npsLowLabel:h,npsHighLabel:d,enableBugFlag:i=false,bugFlagLabel:c,enableScreenshot:f=false,onePerUser:S=false,cooldownDays:v,hideAfterSubmitDays:B,showAfterSeconds:k,showAfterScrollPercent:A,showAfterVisits:z,followUp:y,animated:w=true,position:E=Z.POSITION,size:C=Z.SIZE,theme:x=Z.THEME,customStyles:F,visible:se=true,showOnHover:U=Z.SHOW_ON_HOVER,touchBehavior:H=Z.TOUCH_BEHAVIOR,promptText:V,placeholder:b,submitText:ue=Z.SUBMIT_TEXT,thankYouMessage:De=Z.THANK_YOU_MESSAGE,onSubmit:ze,onOpen:me,onClose:P,onError:Xe}){let{disabled:Pe,activeModalId:Le,openModal:he,closeModal:m,defaultUser:be,client:ae}=D(),{conditionsMet:ye}=jo({elementId:e,showAfterSeconds:k,showAfterScrollPercent:A,showAfterVisits:z}),{isHidden:ie,markHidden:qe}=Ko({elementId:e,userId:r?.id||be?.id,hideAfterSubmitDays:B}),[Se,K]=useState("form"),[Q,le]=useState(null),[I,_]=useState(false),[N,q]=useState(0),[xe,ve]=useState(false),[ft,mt]=useState(null),[we,ht]=useState(false),[yo,bt]=useState(false),ke=useRef(null),Te=useRef(),Ce=useRef(null);useEffect(()=>(bt(true),ht(window.innerWidth<640),()=>{clearTimeout(Te.current);}),[]),useEffect(()=>{q(ae.getQueueLength());let T=()=>{setTimeout(()=>q(ae.getQueueLength()),2e3);};return window.addEventListener("online",T),()=>window.removeEventListener("online",T)},[ae]);let J=Le===e;useEffect(()=>{J||(K("form"),clearTimeout(Te.current));},[J]),useEffect(()=>{if(!J||!we)return;let T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=T;}},[J,we]),useEffect(()=>{if(!U)return;let T=ke.current;if(!T)return;let W=T.parentElement;if(!W)return;let ko=()=>ve(true),To=()=>ve(false);return W.addEventListener("mouseenter",ko),W.addEventListener("mouseleave",To),()=>{W.removeEventListener("mouseenter",ko),W.removeEventListener("mouseleave",To);}},[U]);let{submit:So,isLoading:yt,isCheckingExisting:St,error:xt,existingResponse:vt,isEditing:xo}=Wo({elementId:e,mode:o,pollOptions:l,user:r,onePerUser:S,cooldownDays:v,onSuccess:T=>{le(T.id),B&&qe(),ze?.(T),y&&Ce.current&&(y.ratingThreshold!=null&&Ce.current.rating!=null&&Ce.current.rating<=y.ratingThreshold||y.onNegativeVote&&Ce.current.vote==="down")&&o!=="poll"?K("followUp"):(K("success"),Te.current=setTimeout(()=>{m(),K("form");},3e3));},onError:T=>{console.warn("[Gotcha] Submission failed:",T instanceof Error?T.message:T),Xe?.(T);}}),wt=useCallback(()=>{if(ke.current){let T=ke.current.querySelector("button");mt((T??ke.current).getBoundingClientRect());}he(e),me?.();},[e,he,me]),vo=useCallback(()=>{clearTimeout(Te.current),m(),K("form"),P?.();},[m,P]),kt=useCallback(T=>{Ce.current={rating:T.rating,vote:T.vote},So(T);},[So]),Tt=useCallback(async T=>{if(Q){_(true);try{await ae.updateResponse(Q,{content:T});}catch(W){console.warn("[Gotcha] Follow-up submission failed:",W instanceof Error?W.message:W);}finally{_(false),K("success"),Te.current=setTimeout(()=>{m(),K("form");},3e3);}}},[Q,m,ae]),Ct=S&&xo?"Update":ue;if(Pe||!se||ie||!ye)return null;let Et={"top-right":{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)"},"top-left":{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)"},"bottom-right":{position:"absolute",bottom:0,right:0,transform:"translate(50%, 50%)"},"bottom-left":{position:"absolute",bottom:0,left:0,transform:"translate(-50%, 50%)"},inline:{position:"relative",display:"inline-flex"}},wo={mode:o,theme:x,customStyles:F,promptText:V,placeholder:b,submitText:Ct,thankYouMessage:De,isLoading:yt,isCheckingExisting:S&&St,isSubmitted:Se==="success",phase:Se,followUpConfig:y,followUpLoading:I,onFollowUpSubmit:Tt,error:xt,existingResponse:S?vt:null,isEditing:S&&xo,showText:t,showRating:n,voteLabels:g,options:l,allowMultiple:u,npsQuestion:p,npsFollowUp:s,npsFollowUpPlaceholder:a,npsLowLabel:h,npsHighLabel:d,enableBugFlag:i,bugFlagLabel:c,enableScreenshot:f,onSubmit:kt,onClose:vo,anchorRect:ft||void 0,useFixedPosition:!we};return jsxs("div",{ref:ke,style:{...Et[E],zIndex:J?1e4:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsx(qo,{size:C,theme:x,customStyles:F,showOnHover:U,touchBehavior:H,onClick:wt,isOpen:J,isParentHovered:xe,animated:w,queuedCount:N}),J&&!we&&yo&&createPortal(jsx(mo,{...wo}),document.body),J&&we&&yo&&createPortal(jsx("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:"rgba(0,0,0,0.4)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},className:"gotcha-overlay-enter",onClick:vo,children:jsx("div",{onClick:T=>T.stopPropagation(),children:jsx(mo,{...wo})})}),document.body)]})}function pt({elementId:e,refreshInterval:r}){let{client:o}=D(),[t,n]=useState(null),[g,l]=useState(true),[u,p]=useState(null);return useEffect(()=>{let s=false,a=async()=>{try{let d=await o.getScore(e);s||(n(d),p(null));}catch(d){s||p(d instanceof Error?d.message:"Failed to load score");}finally{s||l(false);}};a();let h;return r&&r>0&&(h=setInterval(a,r)),()=>{s=true,h&&clearInterval(h);}},[o,e,r]),{score:t,isLoading:g,error:u}}var pr={sm:{fontSize:11,ratingFontSize:13,starSize:13,gap:5,pillPx:8,pillPy:4,barHeight:3,iconSize:12},md:{fontSize:12.5,ratingFontSize:15,starSize:15,gap:6,pillPx:10,pillPy:5,barHeight:4,iconSize:14},lg:{fontSize:14,ratingFontSize:18,starSize:18,gap:8,pillPx:12,pillPy:6,barHeight:5,iconSize:16}};function gr({rating:e,size:r,filledColor:o,emptyColor:t}){let n=`gotcha-star-clip-${Math.random().toString(36).slice(2,8)}`,g=[];for(let l=1;l<=5;l++){let u=Math.min(1,Math.max(0,e-(l-1))),p=`${n}-${l}`;g.push(jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",style:{display:"block"},children:[jsx("defs",{children:jsx("clipPath",{id:p,children:jsx("rect",{x:"0",y:"0",width:24*u,height:"24"})})}),jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:t}),jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:o,clipPath:`url(#${p})`})]},l));}return jsx("span",{style:{display:"inline-flex",gap:Math.max(1,r*.08),alignItems:"center"},children:g})}function fr({rate:e,height:r,filledColor:o,trackColor:t}){return jsx("span",{style:{display:"inline-block",width:48,height:r,borderRadius:r,backgroundColor:t,overflow:"hidden",verticalAlign:"middle"},children:jsx("span",{style:{display:"block",width:`${e}%`,height:"100%",borderRadius:r,background:o,transition:"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)"}})})}function mr({size:e,color:r}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:r,style:{display:"block"},children:jsx("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66a4.8 4.8 0 00-.88-1.12L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})})}function hr({elementId:e,variant:r="stars",showCount:o=true,size:t="md",theme:n="auto",refreshInterval:g,style:l}){let{score:u,isLoading:p}=pt({elementId:e,refreshInterval:g}),[s,a]=useState("light");useEffect(()=>{if(typeof window>"u")return;let C=window.matchMedia("(prefers-color-scheme: dark)");a(C.matches?"dark":"light");let x=F=>a(F.matches?"dark":"light");return C.addEventListener("change",x),()=>C.removeEventListener("change",x)},[]);let{themeConfig:h}=D(),d=useMemo(()=>re(n,s,h),[n,s,h]);if(p||!u)return null;let i=pr[t],c=d.colors.text,f=d.colors.textDisabled,S=d.colors.starFilled,v=d.colors.starEmpty,B=d.colors.voteUp,k=d.colors.starEmpty,A={display:"inline-flex",alignItems:"center",gap:i.gap,fontFamily:d.typography.fontFamily,lineHeight:1,letterSpacing:"-0.01em",WebkitFontSmoothing:"antialiased",...l},z=(C,x)=>{let F=C===1?x:`${x}s`;return `${C.toLocaleString()} ${F}`};if(r==="votes"){let{voteCount:C,positiveRate:x}=u,F=C.up+C.down;return F===0?null:jsxs("span",{style:A,children:[jsx(mr,{size:i.iconSize,color:B}),jsxs("span",{style:{fontSize:i.ratingFontSize,fontWeight:600,color:B,fontVariantNumeric:"tabular-nums"},children:[x,"%"]}),jsx(fr,{rate:x??0,height:i.barHeight,filledColor:B,trackColor:k}),o&&jsx("span",{style:{fontSize:i.fontSize,color:f,fontWeight:400},children:z(F,"vote")})]})}let{averageRating:y,totalResponses:w}=u;if(y===null||w===0)return null;let E=y.toFixed(1);return r==="compact"?jsxs("span",{style:A,children:[jsx("svg",{width:i.starSize,height:i.starSize,viewBox:"0 0 24 24",style:{display:"block",flexShrink:0},children:jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:S})}),jsx("span",{style:{fontSize:i.ratingFontSize,fontWeight:700,color:c,fontVariantNumeric:"tabular-nums"},children:E}),o&&jsxs("span",{style:{fontSize:i.fontSize,color:f,fontWeight:400},children:["(",w.toLocaleString(),")"]})]}):r==="number"?jsxs("span",{style:A,children:[jsx("span",{style:{fontSize:i.ratingFontSize,fontWeight:700,color:c,fontVariantNumeric:"tabular-nums"},children:E}),jsx("span",{style:{fontSize:i.fontSize,color:f,fontWeight:400},children:"/ 5"}),o&&jsxs("span",{style:{fontSize:i.fontSize,color:f,fontWeight:400,marginLeft:2},children:["(",z(w,"response"),")"]})]}):jsxs("span",{style:A,children:[jsx(gr,{rating:y,size:i.starSize,filledColor:S,emptyColor:v}),jsx("span",{style:{fontSize:i.ratingFontSize,fontWeight:700,color:c,fontVariantNumeric:"tabular-nums"},children:E}),o&&jsxs("span",{style:{fontSize:i.fontSize,color:f,fontWeight:400},children:["(",z(w,"response"),")"]})]})}function br(){let{client:e,disabled:r,defaultUser:o,debug:t,openModal:n,closeModal:g,activeModalId:l}=D();return {client:e,disabled:r,defaultUser:o,debug:t,submitFeedback:e.submitResponse.bind(e),openModal:n,closeModal:g,activeModalId:l}}function yr(e){let{activeModalId:r,openModal:o,closeModal:t}=D(),n=useCallback(()=>o(e),[o,e]),g=useCallback(()=>t(),[t]);return {open:n,close:g,isOpen:r===e}}
160
- export{ar as Gotcha,$t as GotchaProvider,hr as GotchaScore,It as createTheme,br as useGotcha,yr as useGotchaTrigger};//# sourceMappingURL=index.mjs.map
134
+ `.trim()}function Ze(e){if(typeof document>"u")return;let r=document.getElementById(qo);r||(r=document.createElement("style"),r.id=qo,document.head.appendChild(r)),r.textContent=Wt(e);}var Qo=createContext(null),Qt={};function Kt({apiKey:e,children:r,baseUrl:o,debug:t=false,disabled:n=false,defaultUser:d,defaultUserEmail:i,themeConfig:c}){let[u,s]=useState(null);o&&!o.startsWith("https://")&&!o.startsWith("/")&&!o.includes("localhost")&&console.warn("[Gotcha] baseUrl should use HTTPS in production:",o);let l=useMemo(()=>Ho({apiKey:e,baseUrl:o,debug:t}),[e,o,t]),p=useMemo(()=>d??Qt,[JSON.stringify(d)]);useEffect(()=>{let v=ce("light","light",c);Ze(v);},[c]),useEffect(()=>(Go(),()=>Lo()),[]),useEffect(()=>{l.flushQueue();let v=()=>l.flushQueue();return window.addEventListener("online",v),()=>window.removeEventListener("online",v)},[l]);let a=useCallback(v=>{s(v);},[]),g=useCallback(()=>{s(null);},[]),y=useMemo(()=>({client:l,disabled:n,defaultUser:p,defaultUserEmail:i,debug:t,activeModalId:u,openModal:a,closeModal:g,themeConfig:c}),[l,n,p,i,t,u,a,g,c]);return jsx(Qo.Provider,{value:y,children:r})}function P(){let e=useContext(Qo);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function Jt(e,r){let o=new Date(e).getTime();if(isNaN(o))return true;let t=Date.now()-o,n=r*24*60*60*1e3;return t>=n}function Ko(e){let{client:r,defaultUser:o}=P(),[t,n]=useState(false),[d,i]=useState(false),[c,u]=useState(null),[s,l]=useState(null);return useEffect(()=>{process.env.NODE_ENV!=="production"&&e.cooldownDays&&!e.onePerUser&&console.warn("[Gotcha] cooldownDays has no effect without onePerUser=true");let a=e.user?.id||o?.id;if(!a||!e.onePerUser){l(null);return}let g=false;return (async()=>{i(true);try{let v=await r.checkExistingResponse(e.elementId,a);g||(v&&e.cooldownDays&&e.cooldownDays>0&&Jt(v.createdAt,e.cooldownDays)?l(null):l(v));}catch{g||l(null);}finally{g||i(false);}})(),()=>{g=true;}},[r,e.elementId,e.user?.id,o?.id,e.onePerUser,e.cooldownDays]),{submit:useCallback(async a=>{n(true),u(null);try{let g=e.user?.id||o?.id,y;return e.onePerUser&&s&&g?y=await r.updateResponse(s.id,{content:a.content,title:a.title,rating:a.rating,vote:a.vote,pollSelected:a.pollSelected},g):y=await r.submitResponse({elementId:e.elementId,mode:e.mode,content:a.content,title:a.title,rating:a.rating,vote:a.vote,pollOptions:e.pollOptions,pollSelected:a.pollSelected,isBug:a.isBug,screenshot:a.screenshot,user:{...o,...e.user},userEmail:e.userEmail}),e.onePerUser&&l({id:y.id,mode:e.mode,content:a.content??null,title:a.title??null,rating:a.rating??null,vote:a.vote??null,pollSelected:a.pollSelected??null,createdAt:y.createdAt}),e.onSuccess?.(y),y}catch(g){let y=g instanceof Error?g.message:"Something went wrong";throw u(y),e.onError?.(g instanceof Error?g:new Error(y)),g}finally{n(false);}},[r,o,e,s]),isLoading:t,isCheckingExisting:d,error:c,existingResponse:s,isEditing:!!s,clearError:()=>u(null)}}function Zo(e,r){return `${j.HIDDEN_UNTIL}_${e}_${r}`}function Vo(e,r,o){if(!o||o<=0)return false;let t=Zo(e,r),n=ie(t);return n?new Date(n).getTime()>Date.now():false}function jo(e){let{elementId:r,userId:o,hideAfterSubmitDays:t}=e,n=useMemo(()=>o||Qe(),[o]),[d,i]=useState(()=>Vo(r,n,t));useEffect(()=>{i(Vo(r,n,t));},[r,n,t]);let c=useCallback(()=>{if(!t||t<=0)return;let u=Zo(r,n),s=new Date(Date.now()+t*24*60*60*1e3);ae(u,s.toISOString()),i(true);},[r,n,t]);return {isHidden:d,markHidden:c}}function tr(e){return `${j.VISIT_COUNT}_${e}`}function $o(e){let{elementId:r,showAfterSeconds:o,showAfterScrollPercent:t,showAfterVisits:n}=e,d=o!=null||t!=null||n!=null,[i,c]=useState(!o),[u,s]=useState(!t),[l]=useState(()=>{if(!n)return true;let p=tr(r),g=parseInt(ie(p)||"0",10)+1;return ae(p,String(g)),g>=n});return useEffect(()=>{if(!o||o<=0)return;let p=Date.now(),a=o*1e3,g=()=>{Date.now()-p>=a?c(true):y=setTimeout(g,Math.min(1e3,a-(Date.now()-p)));},y=setTimeout(g,Math.min(1e3,a));return ()=>clearTimeout(y)},[o]),useEffect(()=>{if(!t||t<=0)return;let p=()=>{let a=document.documentElement.scrollHeight,g=window.innerHeight;if(a<=g){s(true);return}(window.scrollY+g)/a*100>=t&&s(true);};if(p(),!u)return window.addEventListener("scroll",p,{passive:true}),()=>window.removeEventListener("scroll",p)},[t,u]),{conditionsMet:!d||i&&u&&l}}function Je(...e){return e.filter(Boolean).join(" ")}var W=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,_o=(e,r)=>{let o={sm:{desktop:24,mobile:28},md:{desktop:32,mobile:34},lg:{desktop:40,mobile:40}};return r?o[e].mobile:o[e].desktop};function nr(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function et({size:e,theme:r,customStyles:o,showOnHover:t,touchBehavior:n,onClick:d,isOpen:i,isParentHovered:c=false,animated:u=true,queuedCount:s=0}){let[l,p]=useState(false),[a,g]=useState(false),[y,v]=useState(nr),[m,f]=useState(false),[E,S]=useState(false),[C,x]=useState(false),{themeConfig:k}=P();useEffect(()=>{if(p(W()),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)"),pe=Se=>v(Se.matches?"dark":"light");return K.addEventListener("change",pe),()=>K.removeEventListener("change",pe)},[]);let T=i?true:!l&&t?c:l&&n==="tap-to-reveal"?a:true;useEffect(()=>{if(T&&!C){let K=setTimeout(()=>x(true),320);return ()=>clearTimeout(K)}},[T,C]);let U=()=>{if(l&&n==="tap-to-reveal"&&!a){g(true);return}d();},N=_o(e,l),A=useMemo(()=>ce(r,y,k),[r,y,k]),F=i?A.colors.warning:A.colors.border,M=i?A.colors.warning:A.colors.glassColor,H=()=>T?E?"scale(0.97)":"scale(1)":"scale(0.96)",q=E?"80ms":"160ms",w=A.animation.easing.default,O=m&&!i?A.colors.surfaceHover:A.colors.glassBackground,Fe={position:"relative",width:N,height:N,borderRadius:A.borders.radius.full,border:`1px solid ${F}`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:O,color:M,boxShadow:m?A.colors.glassHoverShadow:A.colors.glassShadow,transition:C?`transform ${q} ${w}, background-color 180ms ${w}, box-shadow 180ms ${w}, border-color 240ms ${w}, color 240ms ${w}`:`opacity 320ms ${w}, transform 320ms ${w}`,opacity:T?1:0,transform:H(),pointerEvents:T?"auto":"none",...o?.button};return jsxs("button",{type:"button",onClick:U,onMouseEnter:()=>f(true),onMouseLeave:()=>{f(false),S(false);},onMouseDown:()=>S(true),onMouseUp:()=>S(false),onTouchStart:()=>S(true),onTouchEnd:()=>S(false),style:Fe,className:Je("gotcha-button",i&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":i,"aria-haspopup":"dialog",children:[jsx(sr,{size:N*.62,color:M,fontFamilyDisplay:A.typography.fontFamilyDisplay,animated:u&&!C}),s>0&&jsx("span",{"aria-label":`${s} queued`,style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:"50%",backgroundColor:A.colors.warning,border:`1.5px solid ${A.colors.background}`}})]})}function sr({size:e,color:r,fontFamilyDisplay:o,animated:t}){let[n,d]=useState(false);return useEffect(()=>{d(true);},[]),jsx("span",{"aria-hidden":"true",style:{fontFamily:o,fontWeight:400,fontSize:e,fontStyle:"normal",lineHeight:1,color:r,transform:"translateY(1px) translateZ(0)",willChange:"transform",letterSpacing:"normal",userSelect:"none",display:"inline-block",opacity:t?n?1:0:1,transition:t?"opacity 240ms cubic-bezier(0.22, 0.61, 0.36, 1) 120ms":"none"},children:"G"})}function tt({src:e,onRemove:r,resolvedTheme:o}){let[t,n]=useState(false),[d,i]=useState(false);useEffect(()=>{n(W());},[]);let c=(()=>{if(!e.startsWith("data:"))return null;let u=e.indexOf(",");if(u<0)return null;let s=e.slice(u+1);return Math.round(s.length*3/4/1024)})();return jsxs("div",{style:{marginTop:12},children:[jsxs("div",{style:{position:"relative",borderRadius:o.borders.radius.sm,overflow:"hidden",border:`1px solid ${o.colors.border}`,padding:4,background:o.colors.background},children:[jsx("img",{src:e,alt:"Screenshot attached to the feedback",style:{display:"block",width:"100%",maxHeight:140,objectFit:"cover",borderRadius:Math.max(0,o.borders.radius.sm-2)}}),jsx("button",{type:"button",onClick:r,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),"aria-label":"Remove screenshot",style:{position:"absolute",top:8,right:8,width:t?32:24,height:t?32:24,borderRadius:"50%",border:`1px solid ${d?o.colors.error:o.colors.border}`,backgroundColor:d?o.colors.error:o.colors.background,color:d?o.colors.primaryText:o.colors.textSecondary,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:`all ${o.animation.duration.fast} ${o.animation.easing.default}`},children:jsx("svg",{width:10,height:10,viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxs("p",{style:{margin:"6px 0 0",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:o.colors.textSecondary},children:["screenshot.png",c!=null?` \xB7 ${c} KB`:""]})]})}function nt({resolvedTheme:e,placeholder:r,submitText:o,isLoading:t,onSubmit:n,customStyles:d,initialValues:i,isEditing:c=false,showText:u=true,showRating:s=true,enableBugFlag:l=false,bugFlagLabel:p,enableScreenshot:a=false}){let[g,y]=useState(i?.content||""),[v,m]=useState(i?.rating??null),[f,E]=useState(false),[S,C]=useState(false),[x,k]=useState(null),[T,U]=useState(false),[N,A]=useState(false);useEffect(()=>{C(W());},[]),useEffect(()=>{i?.content!==void 0&&y(i.content||""),i?.rating!==void 0&&m(i.rating??null);},[i?.content,i?.rating]);let F=u&&s?g.trim().length>0||v!==null:u?g.trim().length>0:s?v!==null:false,M=async()=>{U(true),A(false);try{let{captureScreenshot:w}=await import('./screenshot-KDHUL63V.mjs'),O=await w();O?k(O):A(!0);}catch{A(true);}finally{U(false);}},H=w=>{w.preventDefault(),!(!F||t)&&n({content:u&&g.trim()?g.trim():void 0,rating:s&&v!==null?v:void 0,isBug:f||void 0,screenshot:x||void 0});},q={width:"100%",padding:S?"12px 0":"10px 0",border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:S?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:S?96:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55,...d?.input};return jsxs("form",{onSubmit:H,children:[s&&jsx("div",{style:{marginBottom:u?S?18:16:0,...u?{}:{display:"flex",justifyContent:"center",padding:"6px 0"}},children:jsx(lr,{value:v,onChange:m,theme:e,isTouch:S,large:!u})}),u&&jsx("textarea",{value:g,onChange:w=>y(w.target.value),placeholder:r||"Share your thoughts\u2026",maxLength:5e3,style:q,disabled:t,"aria-label":"Your feedback",onFocus:w=>{w.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:w=>{w.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),l&&jsxs("button",{type:"button",role:"switch","aria-checked":f,onClick:()=>E(!f),style:{display:"flex",alignItems:"center",gap:10,width:"100%",marginTop:16,padding:S?"12px 12px":"10px 12px",border:`1px solid ${f?e.colors.warningBorder:e.colors.border}`,borderRadius:e.borders.radius.sm,backgroundColor:f?e.colors.warningSurface:"transparent",cursor:"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,fontFamily:e.typography.fontFamily,...d?.bugFlag},children:[jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:3,border:`1px solid ${f?e.colors.warningActive:e.colors.border}`,backgroundColor:f?e.colors.warning:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},children:f&&jsx("svg",{width:8,height:8,viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:jsx("path",{d:"M2 5L4 7L8 3",stroke:e.colors.primaryText,strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsx("span",{style:{fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.normal,color:f?e.colors.text:e.colors.textSecondary,letterSpacing:"0",textAlign:"left",flex:1},children:f?"Reported as an issue":p||"Report an issue"})]}),l&&a&&f&&!x&&jsxs("button",{type:"button",onClick:M,disabled:T,style:{display:"flex",alignItems:"center",gap:8,width:"100%",marginTop:8,padding:"9px 12px",border:`1px solid ${e.colors.border}`,borderRadius:e.borders.radius.sm,backgroundColor:"transparent",cursor:T?"progress":"pointer",fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize.xs,letterSpacing:"0.06em",textTransform:"uppercase",color:e.colors.textSecondary,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},onMouseEnter:w=>{w.currentTarget.style.borderColor=e.colors.inputBorderFocus,w.currentTarget.style.color=e.colors.text;},onMouseLeave:w=>{w.currentTarget.style.borderColor=e.colors.border,w.currentTarget.style.color=e.colors.textSecondary;},children:[jsxs("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),jsx("circle",{cx:"12",cy:"10",r:"3"}),jsx("path",{d:"M2 17l4-4 3 3 4-4 9 9"})]}),T?"Capturing\u2026":"Attach screenshot"]}),N&&jsxs("div",{role:"alert",style:{marginTop:8,padding:"6px 0 6px 10px",borderLeft:`2px solid ${e.colors.error}`,fontSize:e.typography.fontSize.xs,color:e.colors.text,fontFamily:e.typography.fontFamily,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[jsx("span",{children:"Screenshot capture unavailable."}),jsx("button",{type:"button",onClick:M,style:{background:"none",border:"none",padding:0,color:e.colors.text,fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize.xs,textDecoration:"underline",textDecorationColor:e.colors.border,textUnderlineOffset:3,cursor:"pointer"},children:"Try again"})]}),l&&a&&f&&x&&jsx(tt,{src:x,onRemove:()=>k(null),resolvedTheme:e}),jsx("button",{type:"submit",disabled:t||!F,style:{width:"100%",padding:S?"14px 16px":"11px 16px",marginTop:18,border:"none",borderRadius:e.borders.radius.sm,backgroundColor:F?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:F?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t||!F?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:t?"italic":"normal",...d?.submitButton},onMouseEnter:w=>{w.currentTarget.disabled||(w.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:w=>{w.currentTarget.disabled||(w.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:t?c?"Updating\u2026":"Sending\u2026":c?"Update":o})]})}function lr({value:e,onChange:r,theme:o,isTouch:t,large:n=false}){let[d,i]=useState(null),c=n?t?34:28:t?26:20,u=n?8:6,s=n?t?6:4:t?6:2,l=p=>d!==null&&d>=p?`${(p-1)*30}ms`:"0ms";return jsx("div",{style:{display:"flex",gap:u},role:"group","aria-label":"Rating",onMouseLeave:()=>i(null),children:[1,2,3,4,5].map(p=>{let a=(d??e??0)>=p;return jsx("button",{type:"button",onClick:()=>r(p),onMouseEnter:()=>i(p),"aria-label":`Rate ${p} out of 5`,"aria-pressed":e===p,style:{background:"none",border:"none",cursor:"pointer",padding:s,color:a?o.colors.starFilled:o.colors.starEmpty,transition:`color 180ms ${o.animation.easing.default}`,transitionDelay:l(p),outline:"none",WebkitTapHighlightColor:"transparent"},children:jsx("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:a?"currentColor":"none",stroke:"currentColor",strokeWidth:a?0:1.5,strokeLinejoin:"round",children:jsx("path",{d:"M12 3.5L14.472 8.506L20 9.308L16 13.205L16.944 18.706L12 16.107L7.056 18.706L8 13.205L4 9.308L9.528 8.506L12 3.5Z"})})},p)})})}function st({resolvedTheme:e,isLoading:r,onSubmit:o,initialVote:t,isEditing:n=false,labels:d}){let[i,c]=useState(false),[u,s]=useState(t||null),[l,p]=useState(t||null);useEffect(()=>{c(W());},[]),useEffect(()=>{t!==void 0&&(p(t),s(t));},[t]),useEffect(()=>{!r&&!n&&s(null);},[r,n]);let a=m=>{s(m),o({vote:m});},g=i?24:20,y=m=>{let f=l===m,E=m==="up"?e.colors.voteUp:e.colors.voteDown,S=m==="up"?e.colors.voteUpSurface:e.colors.voteDownSurface,C=m==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return {flex:1,minWidth:0,padding:i?"14px 18px":"11px 16px",border:`1px solid ${f?E:C}`,borderRadius:e.borders.radius.full,background:f?E:S,color:f?e.colors.primaryText:e.colors.text,fontSize:i?15:13,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}, border-color ${e.animation.duration.fast} ${e.animation.easing.default}, color ${e.animation.duration.fast} ${e.animation.easing.default}`,display:"flex",alignItems:"center",justifyContent:"center",gap:i?10:8,outline:"none"}},v=(m,f)=>d?.[m]?d[m]:m==="up"?f?"Liked":"Like":f?"Disliked":"Dislike";return jsx("div",{style:{display:"flex",gap:i?12:10},role:"group","aria-label":"Vote",children:["up","down"].map(m=>{let f=l===m,E=r&&u===m,S=v(m,f),C=E?`${S}, submitting`:S,x=m==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return jsxs("button",{type:"button",onClick:()=>a(m),disabled:r,style:y(m),"aria-label":C,"aria-pressed":f,onMouseEnter:k=>{r||f||(k.currentTarget.style.borderColor=e.colors.inputBorderFocus);},onMouseLeave:k=>{f||(k.currentTarget.style.borderColor=x);},children:[m==="up"?jsx(cr,{size:g}):jsx(dr,{size:g}),jsx("span",{style:{fontStyle:E?"italic":"normal"},children:E?n?"Updating\u2026":"Sending\u2026":S})]},m)})})}function cr({size:e=20}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function dr({size:e=20}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"})})}function at({resolvedTheme:e,options:r,allowMultiple:o,isLoading:t,onSubmit:n,initialSelected:d,isEditing:i=false}){let[c,u]=useState(d||[]),[s,l]=useState(false),[p,a]=useState(null);useEffect(()=>{l(W());},[]),useEffect(()=>{d&&u(d);},[d]);let g=m=>{t||u(o?f=>f.includes(m)?f.filter(E=>E!==m):[...f,m]:f=>f.includes(m)?[]:[m]);},y=()=>{c.length===0||t||n({pollSelected:c});},v=s?"14px 14px":"12px 14px";return jsxs("div",{children:[jsx("ul",{role:"group","aria-label":o?"Select one or more options":"Select an option",style:{listStyle:"none",margin:0,padding:0,borderTop:`1px solid ${e.colors.border}`},children:r.map((m,f)=>{let E=c.includes(m),S=p===f;return jsxs("li",{style:{borderBottom:`1px solid ${e.colors.border}`,position:"relative",animation:`gotcha-fade-up ${e.animation.duration.normal} ${e.animation.easing.default} both`,animationDelay:`${f*.04}s`},children:[E&&jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:8,bottom:8,width:2,backgroundColor:e.colors.pollSelectedBorder}}),jsxs("button",{type:"button",onClick:()=>g(m),onMouseEnter:()=>a(f),onMouseLeave:()=>a(null),disabled:t,"aria-pressed":E,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:v,paddingLeft:E?16:14,border:"none",background:S&&!E?e.colors.surfaceHover:"transparent",color:e.colors.text,fontSize:s?15:e.typography.fontSize.md,fontWeight:E?e.typography.fontWeight.medium:e.typography.fontWeight.normal,fontFamily:e.typography.fontFamily,cursor:t?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,textAlign:"left",letterSpacing:"0",outline:"none"},children:[jsx("span",{style:{flex:1},children:m}),jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:o?3:"50%",border:`1px solid ${E?e.colors.pollCheckSelectedBorder:e.colors.pollCheckBorder}`,backgroundColor:E?e.colors.pollCheckSelectedBg:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},children:E&&jsx("svg",{width:8,height:8,viewBox:"0 0 10 10",fill:"none",children:jsx("path",{d:"M2 5L4 7L8 3",stroke:e.colors.primaryText,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},m)})}),jsx("button",{type:"button",onClick:y,disabled:t||c.length===0,style:{width:"100%",marginTop:18,padding:s?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:c.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,color:c.length===0?e.colors.buttonColorDisabled:e.colors.buttonColor,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t||c.length===0?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:t?"italic":"normal"},onMouseEnter:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:t?i?"Updating\u2026":"Sending\u2026":i?"Update":"Submit"})]})}function ct({size:e=16,color:r="currentColor"}){let t=2*Math.PI*9,n=t*.25;return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading",style:{animation:"gotcha-spin 1.1s linear infinite",transformOrigin:"center"},children:[jsx("circle",{cx:"12",cy:"12",r:9,stroke:r,strokeOpacity:"0.18",strokeWidth:"1.25",fill:"none"}),jsx("circle",{cx:"12",cy:"12",r:9,stroke:r,strokeWidth:"1.25",strokeLinecap:"round",fill:"none",strokeDasharray:`${n} ${t}`,strokeDashoffset:"0"})]})}function ut({resolvedTheme:e,submitText:r,isLoading:o,onSubmit:t,customStyles:n,showFollowUp:d=true,followUpPlaceholder:i,lowLabel:c="Not likely",highLabel:u="Very likely",initialValues:s,isEditing:l=false}){let[p,a]=useState(s?.rating??null),[g,y]=useState(s?.content||""),[v,m]=useState(false),[f,E]=useState(null);useEffect(()=>{m(W());},[]),useEffect(()=>{s?.rating!==void 0&&a(s.rating??null),s?.content!==void 0&&y(s.content||"");},[s?.rating,s?.content]);let S=p!==null;return jsxs("form",{onSubmit:x=>{x.preventDefault(),!(!S||o)&&t({rating:p??void 0,content:d&&g.trim()?g.trim():void 0});},children:[jsx("div",{style:{position:"relative",display:"flex",gap:v?4:5,justifyContent:"center"},role:"group","aria-label":"NPS Score",onMouseLeave:()=>E(null),children:Array.from({length:11},(x,k)=>{let T=p===k,U=f===k;return jsx("button",{type:"button",onClick:()=>a(k),onMouseEnter:()=>E(k),"aria-label":`Score ${k} out of 10`,"aria-pressed":T,style:{flex:1,minWidth:0,aspectRatio:"1",borderRadius:e.borders.radius.sm,border:`1px solid ${T?e.colors.buttonBackground:U?e.colors.inputBorderFocus:e.colors.border}`,backgroundColor:T?e.colors.buttonBackground:"transparent",color:T?e.colors.buttonColor:e.colors.text,fontSize:15,fontWeight:T?e.typography.fontWeight.medium:e.typography.fontWeight.normal,fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontVariantNumeric:"tabular-nums",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}, border-color ${e.animation.duration.fast} ${e.animation.easing.default}, color ${e.animation.duration.fast} ${e.animation.easing.default}`,outline:"none",...n?.npsButton,...T?n?.npsButtonSelected:{}},children:k},k)})}),jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,padding:"0 2px",...n?.npsLabels},children:[c,u].map(x=>jsx("span",{style:{fontFamily:e.typography.fontFamily,fontSize:11,color:e.colors.text,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.14em",textTransform:"uppercase"},children:x},x))}),d&&p!==null&&jsx("textarea",{value:g,onChange:x=>y(x.target.value),placeholder:i||"What's the main reason for your score?",maxLength:5e3,style:{width:"100%",padding:v?"12px 0":"10px 0",marginTop:18,border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:v?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:v?72:56,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55,animation:`gotcha-expand-in ${e.animation.duration.normal} ${e.animation.easing.default} both`,overflow:"hidden",...n?.input},disabled:o,"aria-label":"Follow-up feedback",onFocus:x=>{x.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:x=>{x.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),jsx("button",{type:"submit",disabled:o||!S,style:{width:"100%",marginTop:18,padding:v?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:S?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:S?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:o||!S?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:o?"italic":"normal",...n?.submitButton},onMouseEnter:x=>{x.currentTarget.disabled||(x.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:x=>{x.currentTarget.disabled||(x.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:o?l?"Updating\u2026":"Sending\u2026":l?"Update":r})]})}function gt({resolvedTheme:e,promptText:r,placeholder:o,isLoading:t,onSubmit:n}){let[d,i]=useState(""),[c,u]=useState(false);return useEffect(()=>{u(W());},[]),jsxs("form",{onSubmit:l=>{l.preventDefault(),!(!d.trim()||t)&&n(d.trim());},children:[jsx("p",{style:{margin:"0 0 14px 0",fontFamily:e.typography.fontFamilyDisplay,fontSize:c?17:16,fontStyle:"italic",color:e.colors.text,lineHeight:1.45,letterSpacing:"-0.01em"},children:r}),jsx("textarea",{value:d,onChange:l=>i(l.target.value),placeholder:o||"Tell us more\u2026",maxLength:5e3,disabled:t,"aria-label":"Follow-up feedback",style:{width:"100%",padding:c?"12px 0":"10px 0",border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:c?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:c?96:72,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55},onFocus:l=>{l.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:l=>{l.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),jsx("button",{type:"submit",disabled:t||!d.trim(),style:{width:"100%",marginTop:16,padding:c?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:d.trim()?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:d.trim()?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t||!d.trim()?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:t?"italic":"normal"},onMouseEnter:l=>{l.currentTarget.disabled||(l.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:l=>{l.currentTarget.disabled||(l.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:t?"Sending\u2026":"Submit"})]})}var br={feedback:"Feedback",vote:"Vote",poll:"Poll",nps:"Rate"};function yr(e,r){switch(e){case "vote":return "What do you think?";case "poll":return "Cast your vote.";case "nps":return r||"How likely are you to recommend us?";default:return "What do you think of this feature?"}}var vr=4e3;function ft({mode:e,theme:r,customStyles:o,promptText:t,placeholder:n,submitText:d,thankYouMessage:i,isLoading:c,isCheckingExisting:u=false,isSubmitted:s,phase:l="form",followUpConfig:p,followUpLoading:a=false,onFollowUpSubmit:g,error:y,existingResponse:v,isEditing:m=false,showText:f=true,showRating:E=true,voteLabels:S,options:C,allowMultiple:x=false,npsQuestion:k,npsFollowUp:T=true,npsFollowUpPlaceholder:U,npsLowLabel:N,npsHighLabel:A,enableBugFlag:F=false,bugFlagLabel:M,enableScreenshot:H=false,onSubmit:q,onClose:w,anchorRect:O,useFixedPosition:Fe=false,isMobile:K}){let pe=useRef(null),Se=useRef(null),Re=useRef(w);Re.current=w;let[Ue,oo]=useState(false),z=K??Ue,[Ne,He]=useState("light"),{themeConfig:J}=P();useEffect(()=>{if(typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)"),V=I=>He(I.matches?"dark":"light");V(L);let Y=I=>V(I);L.addEventListener("change",Y);let Z=[()=>L.removeEventListener("change",Y)];if(K===void 0){let I=window.matchMedia("(max-width: 1023px)"),te=()=>oo(I.matches);te(),I.addEventListener("change",te),Z.push(()=>I.removeEventListener("change",te));}return ()=>{for(let I of Z)I();}},[K]);let h=useMemo(()=>ce(r,Ne,J),[r,Ne,J]);useEffect(()=>{Ze(h);},[h]);let Be=typeof window>"u"||!O?false:window.innerHeight-O.bottom<340;useEffect(()=>{let L=pe.current;if(!L)return;Se.current?.focus();let V=Y=>{if(Y.key==="Escape"){Re.current();return}if(Y.key==="Tab"){let Z=L.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),I=Z[0],te=Z[Z.length-1];Y.shiftKey&&document.activeElement===I?(Y.preventDefault(),te?.focus()):!Y.shiftKey&&document.activeElement===te&&(Y.preventDefault(),I?.focus());}};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[]);let ge=t||yr(e,k),Oe=br[e],me=e==="nps"?420:e==="poll"?400:360,We=z?"gotcha-modal-enter-center":Be?"gotcha-modal-enter-above":"gotcha-modal-enter",Me=typeof window<"u"?window.innerHeight:0,Q={padding:0,borderRadius:h.borders.radius.lg,background:h.colors.background,color:h.colors.text,boxShadow:h.shadows.modal,border:`${h.borders.width}px solid ${h.colors.border}`,fontFamily:h.typography.fontFamily,textAlign:"left",overflow:"hidden"},Ge=z?{...Q,position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:me,zIndex:9999,...o?.modal}:Fe&&O&&Me?(()=>{let L=window.innerWidth,V=24,Z=O.left+O.width/2-me/2,I=Math.max(V,Math.min(Z,L-me-V));return {...Q,position:"fixed",left:I,width:me,zIndex:99999,...Be?{bottom:Me-O.top+10}:{top:O.bottom+10},...o?.modal}})():{...Q,position:"absolute",left:"50%",width:me,zIndex:9999,...Be?{bottom:"100%",marginBottom:10,transform:"translateX(-50%)"}:{top:"100%",marginTop:10,transform:"translateX(-50%)"},...o?.modal},oe=L=>z?{}:{animation:`gotcha-fade-up ${h.animation.duration.normal} ${h.animation.easing.default} both`,animationDelay:`${L*.04}s`},to=z?"20px 24px 24px":"20px 28px 24px";return jsxs("div",{ref:pe,role:"dialog","aria-modal":"true","aria-label":s?"Feedback submitted":void 0,"aria-labelledby":s?void 0:"gotcha-modal-title","data-gotcha":true,style:Ge,className:Je("gotcha-modal","gotcha-root",We),children:[!s&&jsxs("header",{style:{padding:z?"20px 24px 16px":"22px 28px 16px",borderBottom:`${h.borders.width}px solid ${h.colors.border}`,position:"relative"},children:[jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10,...oe(0)},children:[jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16,height:1,backgroundColor:h.colors.warning}}),jsx("span",{style:{fontFamily:h.typography.fontFamily,fontSize:10,fontWeight:h.typography.fontWeight.medium,letterSpacing:"0.16em",textTransform:"uppercase",color:h.colors.textSecondary},children:Oe})]}),jsx("h2",{id:"gotcha-modal-title",style:{margin:0,paddingRight:z?52:44,fontFamily:h.typography.fontFamilyDisplay,fontSize:z?22:20,fontWeight:h.typography.fontWeight.normal,letterSpacing:"-0.01em",lineHeight:1.25,color:h.colors.text,...oe(1),...o?.title},children:ge}),jsx("button",{ref:Se,type:"button",onClick:w,"aria-label":"Close feedback form",style:{position:"absolute",top:z?14:16,right:z?14:18,width:z?44:32,height:z?44:32,border:"none",background:"transparent",outline:"none",cursor:"pointer",color:h.colors.closeButton,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:h.borders.radius.sm,transition:`color ${h.animation.duration.fast} ${h.animation.easing.default}`,...o?.closeButton},onMouseEnter:L=>{L.currentTarget.style.color=h.colors.closeButtonHover;},onMouseLeave:L=>{L.currentTarget.style.color=h.colors.closeButton;},children:jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M1 1L11 11M1 11L11 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxs("div",{style:{padding:s?0:to,position:"relative"},children:[y&&!s&&jsxs("div",{role:"alert",style:{padding:"2px 0 2px 14px",marginBottom:16,borderLeft:`2px solid ${h.colors.error}`,color:h.colors.text,fontSize:h.typography.fontSize.sm,lineHeight:1.55,...oe(2),...o?.errorMessage},children:[y,jsx("span",{style:{color:h.colors.textSecondary},children:" \u2014 try again?"})]}),s&&jsxs("div",{style:{padding:z?"32px 24px 28px":"36px 28px 28px",textAlign:"center",position:"relative"},children:[jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",style:{display:"block",margin:"0 auto 14px",...o?.successIcon},children:jsx("path",{d:"M10 20.5L17 27.5L31 13.5",stroke:h.colors.success,strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:30,strokeDashoffset:30,animation:`gotcha-check-draw 320ms ${h.animation.easing.default} forwards`}})}),jsx("p",{style:{margin:0,fontFamily:h.typography.fontFamilyDisplay,fontSize:22,fontWeight:h.typography.fontWeight.normal,letterSpacing:"-0.01em",color:h.colors.text,...o?.successMessage},children:i}),jsx("p",{style:{margin:"8px 0 0",fontFamily:h.typography.fontFamily,fontSize:h.typography.fontSize.sm,color:h.colors.textSecondary,fontStyle:"italic"},children:"We\u2019ll close this in a moment."}),jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:1,right:1,bottom:1,height:1,backgroundColor:h.colors.success,transformOrigin:"left center",animation:`gotcha-progress ${vr}ms linear forwards`}})]}),l==="followUp"&&p&&g&&!s&&jsx("div",{style:oe(2),children:jsx(gt,{resolvedTheme:h,promptText:p.promptText,placeholder:p.placeholder,isLoading:a,onSubmit:g})}),l==="form"&&u&&jsx("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0",...oe(2)},children:jsx(ct,{size:20,color:h.colors.textSecondary})}),l==="form"&&!u&&!s&&jsxs("div",{style:oe(2),children:[e==="feedback"&&jsx(nt,{resolvedTheme:h,placeholder:n,submitText:d,isLoading:c,onSubmit:q,customStyles:o,initialValues:v?{content:v.content,rating:v.rating}:void 0,isEditing:m,showText:f,showRating:E,enableBugFlag:F,bugFlagLabel:M,enableScreenshot:H}),e==="vote"&&jsx(st,{resolvedTheme:h,isLoading:c,onSubmit:q,initialVote:v?.vote||void 0,isEditing:m,labels:S}),e==="nps"&&jsx(ut,{resolvedTheme:h,submitText:d,isLoading:c,onSubmit:q,showFollowUp:T,followUpPlaceholder:U,lowLabel:N,highLabel:A,customStyles:o,initialValues:v?{rating:v.rating,content:v.content}:void 0,isEditing:m}),e==="poll"&&C&&C.length>0&&jsx(at,{resolvedTheme:h,options:C,allowMultiple:x,isLoading:c,onSubmit:q,initialSelected:v?.pollSelected||void 0,isEditing:m})]})]}),jsx("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:s?"Thank you. Your feedback has been submitted.":y?`Error: ${y}`:""})]})}function Sr({elementId:e,user:r,userEmail:o,mode:t="feedback",showText:n=true,showRating:d=true,voteLabels:i,options:c,allowMultiple:u=false,npsQuestion:s,npsFollowUp:l=true,npsFollowUpPlaceholder:p,npsLowLabel:a,npsHighLabel:g,enableBugFlag:y=false,bugFlagLabel:v,enableScreenshot:m=false,onePerUser:f=false,cooldownDays:E,hideAfterSubmitDays:S,showAfterSeconds:C,showAfterScrollPercent:x,showAfterVisits:k,followUp:T,animated:U=true,position:N=se.POSITION,size:A=se.SIZE,theme:F=se.THEME,customStyles:M,visible:H=true,showOnHover:q=se.SHOW_ON_HOVER,touchBehavior:w=se.TOUCH_BEHAVIOR,promptText:O,placeholder:Fe,submitText:K=se.SUBMIT_TEXT,thankYouMessage:pe=se.THANK_YOU_MESSAGE,onSubmit:Se,onOpen:Re,onClose:Ue,onError:oo}){let{disabled:z,activeModalId:Ne,openModal:He,closeModal:J,defaultUser:h,defaultUserEmail:Be,client:ge,debug:Oe}=P(),{conditionsMet:Eo}=$o({elementId:e,showAfterSeconds:C,showAfterScrollPercent:x,showAfterVisits:k}),{isHidden:me,markHidden:We}=jo({elementId:e,userId:r?.id||h?.id,hideAfterSubmitDays:S}),[Me,Q]=useState("form"),[Ge,oe]=useState(null),[to,L]=useState(false),[V,Y]=useState(0),[Z,I]=useState(false),[te,To]=useState(null),[X,vt]=useState(false),[ko,St]=useState(false),xe=useRef(null),Le=useRef(),xt=useRef(null),De=useRef(null),[fe,Ye]=useState(null);useEffect(()=>{if(St(true),typeof window>"u")return;let b=window.matchMedia("(max-width: 1023px)"),G=()=>vt(b.matches);return G(),b.addEventListener("change",G),()=>{b.removeEventListener("change",G),clearTimeout(Le.current);}},[]),useEffect(()=>{Y(ge.getQueueLength());let b=()=>{setTimeout(()=>Y(ge.getQueueLength()),2e3);};return window.addEventListener("online",b),()=>window.removeEventListener("online",b)},[ge]);let re=Ne===e;useEffect(()=>{if(!re||X)return;let b=0,G=()=>{b||(b=requestAnimationFrame(()=>{b=0;let ne=xe.current;if(!ne)return;let we=ne.querySelector("button");To((we??ne).getBoundingClientRect());}));};return window.addEventListener("resize",G),window.addEventListener("scroll",G,{passive:true}),()=>{b&&cancelAnimationFrame(b),window.removeEventListener("resize",G),window.removeEventListener("scroll",G);}},[re,X]),useEffect(()=>{re||(Q("form"),clearTimeout(Le.current));},[re]),useEffect(()=>{if(!re||!X)return;let b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b;}},[re,X]),useEffect(()=>{if(!q)return;let b=xe.current;if(!b)return;let G=b.parentElement;if(!G)return;let ne=()=>I(true),we=()=>I(false);return G.addEventListener("mouseenter",ne),G.addEventListener("mouseleave",we),()=>{G.removeEventListener("mouseenter",ne),G.removeEventListener("mouseleave",we);}},[q]);let{submit:qe,isLoading:wt,isCheckingExisting:Et,error:Tt,existingResponse:kt,isEditing:Ao}=Ko({elementId:e,mode:t,pollOptions:c,user:r,userEmail:o??Be,onePerUser:f,cooldownDays:E,onSuccess:b=>{oe(b.id),Se?.(b),Ye(null),De.current=null;},onError:b=>{console.warn("[Gotcha] Submission failed:",b instanceof Error?b.message:b),oo?.(b),De.current&&Ye({message:b instanceof Error?b.message:"Something went wrong",retrying:false});}}),At=useCallback(()=>{if(xe.current){let b=xe.current.querySelector("button");To((b??xe.current).getBoundingClientRect());}He(e),Re?.();},[e,He,Re]),Co=useCallback(()=>{clearTimeout(Le.current),J(),Q("form"),Ue?.();},[J,Ue]),Ct=useCallback(b=>{xt.current={rating:b.rating,vote:b.vote},De.current=b,T&&(T.ratingThreshold!=null&&b.rating!=null&&b.rating<=T.ratingThreshold||T.onNegativeVote&&b.vote==="down")&&t!=="poll"?Q("followUp"):(Q("success"),Le.current=setTimeout(()=>{J(),Q("form");},4e3)),S&&We();let ne=typeof performance<"u"?performance.now():Date.now();qe(b).catch(()=>{}).finally(()=>{if(Oe){let we=(typeof performance<"u"?performance.now():Date.now())-ne;console.log(`[Gotcha] Server ack in ${we.toFixed(0)}ms`);}});},[qe,T,t,S,We,J,Oe]),Ft=useCallback(()=>{let b=De.current;!b||!fe||fe.retrying||(Ye({...fe,retrying:true}),qe(b).catch(()=>{}));},[fe,qe]),Rt=useCallback(()=>{Ye(null),De.current=null;},[]),Bt=useCallback(async b=>{if(Ge){L(true);try{await ge.updateResponse(Ge,{content:b});}catch(G){console.warn("[Gotcha] Follow-up submission failed:",G instanceof Error?G.message:G);}finally{L(false),Q("success"),Le.current=setTimeout(()=>{J(),Q("form");},4e3);}}},[Ge,J,ge]),Mt=f&&Ao?"Update":K;if(z||!H||me||!Eo)return null;let Gt={"top-right":{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)"},"top-left":{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)"},"bottom-right":{position:"absolute",bottom:0,right:0,transform:"translate(50%, 50%)"},"bottom-left":{position:"absolute",bottom:0,left:0,transform:"translate(-50%, 50%)"},inline:{position:"relative",display:"inline-flex"}},Lt={mode:t,theme:F,customStyles:M,promptText:O,placeholder:Fe,submitText:Mt,thankYouMessage:pe,isLoading:wt,isCheckingExisting:f&&Et,isSubmitted:Me==="success",phase:Me,followUpConfig:T,followUpLoading:to,onFollowUpSubmit:Bt,error:Tt,existingResponse:f?kt:null,isEditing:f&&Ao,showText:n,showRating:d,voteLabels:i,options:c,allowMultiple:u,npsQuestion:s,npsFollowUp:l,npsFollowUpPlaceholder:p,npsLowLabel:a,npsHighLabel:g,enableBugFlag:y,bugFlagLabel:v,enableScreenshot:m,onSubmit:Ct,onClose:Co,anchorRect:te||void 0,useFixedPosition:!X,isMobile:X};return jsxs("div",{ref:xe,style:{...Gt[N],zIndex:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsx(et,{size:A,theme:F,customStyles:M,showOnHover:q,touchBehavior:w,onClick:At,isOpen:re,isParentHovered:Z,animated:U,queuedCount:V}),fe&&ko&&createPortal(jsx(xr,{message:fe.message,retrying:fe.retrying,onRetry:Ft,onDismiss:Rt}),document.body),re&&ko&&createPortal(jsx("div",{role:"presentation",onClick:X?Co:void 0,style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:X?"rgba(26,23,20,0.32)":"transparent",backdropFilter:X?"blur(8px)":"none",WebkitBackdropFilter:X?"blur(8px)":"none",pointerEvents:X?"auto":"none",transition:"background-color 180ms cubic-bezier(0.22, 0.61, 0.36, 1)"},children:jsx("div",{onClick:X?b=>b.stopPropagation():void 0,style:{pointerEvents:"auto"},children:jsx(ft,{...Lt})})}),document.body)]})}function xr({message:e,retrying:r,onRetry:o,onDismiss:t}){return jsxs("div",{role:"status","aria-live":"polite",className:"editorial",style:{position:"fixed",bottom:16,right:16,zIndex:99998,maxWidth:360,borderRadius:6,border:"1px solid rgba(155, 58, 46, 0.35)",backgroundColor:"#FAF8F4",boxShadow:"0 4px 16px rgba(26, 23, 20, 0.12)",padding:"14px 16px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",color:"#1A1714",animation:"gotcha-fade-up 240ms cubic-bezier(0.22, 0.61, 0.36, 1)"},children:[jsx("div",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, 'Courier New', monospace",fontSize:10,textTransform:"uppercase",letterSpacing:"0.18em",color:"#9B3A2E",marginBottom:6},children:"Couldn\u2019t save"}),jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,color:"#1A1714"},children:e||"Your feedback didn\u2019t reach us. Retry?"}),jsxs("div",{style:{marginTop:12,display:"flex",gap:8},children:[jsx("button",{type:"button",onClick:o,disabled:r,style:{backgroundColor:"#1A1714",color:"#FAF8F4",border:"none",borderRadius:4,padding:"6px 14px",fontSize:12,fontWeight:500,cursor:r?"default":"pointer",opacity:r?.6:1,transition:"opacity 180ms"},children:r?"Retrying\u2026":"Retry"}),jsx("button",{type:"button",onClick:t,style:{backgroundColor:"transparent",color:"#6B655D",border:"1px solid #E8E2D9",borderRadius:4,padding:"6px 14px",fontSize:12,cursor:"pointer",transition:"color 180ms"},children:"Dismiss"})]})]})}function bt({elementId:e,refreshInterval:r}){let{client:o}=P(),[t,n]=useState(null),[d,i]=useState(true),[c,u]=useState(null);return useEffect(()=>{let s=false,l=async()=>{try{let a=await o.getScore(e);s||(n(a),u(null));}catch(a){s||u(a instanceof Error?a.message:"Failed to load score");}finally{s||i(false);}};l();let p;return r&&r>0&&(p=setInterval(l,r)),()=>{s=true,p&&clearInterval(p);}},[o,e,r]),{score:t,isLoading:d,error:c}}var Ar={sm:{fontSize:11,ratingFontSize:13,starSize:13,gap:5,pillPx:8,pillPy:4,barHeight:3,iconSize:12},md:{fontSize:12.5,ratingFontSize:15,starSize:15,gap:6,pillPx:10,pillPy:5,barHeight:4,iconSize:14},lg:{fontSize:14,ratingFontSize:18,starSize:18,gap:8,pillPx:12,pillPy:6,barHeight:5,iconSize:16}};function Cr({rating:e,size:r,filledColor:o,emptyColor:t}){let n=`gotcha-star-clip-${Math.random().toString(36).slice(2,8)}`,d=[];for(let i=1;i<=5;i++){let c=Math.min(1,Math.max(0,e-(i-1))),u=`${n}-${i}`;d.push(jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",style:{display:"block"},children:[jsx("defs",{children:jsx("clipPath",{id:u,children:jsx("rect",{x:"0",y:"0",width:24*c,height:"24"})})}),jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:t}),jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:o,clipPath:`url(#${u})`})]},i));}return jsx("span",{style:{display:"inline-flex",gap:Math.max(1,r*.08),alignItems:"center"},children:d})}function Fr({rate:e,height:r,filledColor:o,trackColor:t}){return jsx("span",{style:{display:"inline-block",width:48,height:r,borderRadius:r,backgroundColor:t,overflow:"hidden",verticalAlign:"middle"},children:jsx("span",{style:{display:"block",width:`${e}%`,height:"100%",borderRadius:r,background:o,transition:"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)"}})})}function Rr({size:e,color:r}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function Br({elementId:e,variant:r="stars",showCount:o=true,size:t="md",theme:n="auto",refreshInterval:d,style:i}){let{score:c,isLoading:u}=bt({elementId:e,refreshInterval:d}),[s,l]=useState("light");useEffect(()=>{if(typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");l(F.matches?"dark":"light");let M=H=>l(H.matches?"dark":"light");return F.addEventListener("change",M),()=>F.removeEventListener("change",M)},[]);let{themeConfig:p}=P(),a=useMemo(()=>ce(n,s,p),[n,s,p]);if(u||!c)return null;let g=Ar[t],y=a.colors.text,v=a.colors.textDisabled,m=a.colors.starFilled,f=a.colors.starEmpty,E=a.colors.voteUp,S=a.colors.starEmpty,C={display:"inline-flex",alignItems:"center",gap:g.gap,fontFamily:a.typography.fontFamily,lineHeight:1,WebkitFontSmoothing:"antialiased",...i},x={fontFamily:a.typography.fontFamily,fontSize:g.ratingFontSize,fontWeight:700,color:y,fontVariantNumeric:"tabular-nums",letterSpacing:"-0.01em",lineHeight:1},k={fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:Math.max(9,g.fontSize-1),color:v,fontWeight:400,letterSpacing:"0.1em",textTransform:"uppercase"},T=(F,M)=>{let H=F===1?M:`${M}s`;return `${F.toLocaleString()} ${H}`};if(r==="votes"){let{voteCount:F,positiveRate:M}=c,H=F.up+F.down;return H===0?null:jsxs("span",{style:C,children:[jsx(Rr,{size:g.iconSize,color:E}),jsxs("span",{style:{...x,color:E},children:[M,"%"]}),jsx(Fr,{rate:M??0,height:g.barHeight,filledColor:E,trackColor:S}),o&&jsx("span",{style:k,children:T(H,"vote")})]})}let{averageRating:U,totalResponses:N}=c;if(U===null||N===0)return null;let A=U.toFixed(1);return r==="compact"?jsxs("span",{style:C,children:[jsx("svg",{width:g.starSize,height:g.starSize,viewBox:"0 0 24 24",style:{display:"block",flexShrink:0},children:jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:m})}),jsx("span",{style:x,children:A}),o&&jsxs("span",{style:k,children:["(",N.toLocaleString(),")"]})]}):r==="number"?jsxs("span",{style:C,children:[jsx("span",{style:x,children:A}),jsx("span",{style:{...k,marginLeft:2},children:"/ 5"}),o&&jsxs("span",{style:{...k,marginLeft:2},children:["(",T(N,"response"),")"]})]}):jsxs("span",{style:C,children:[jsx(Cr,{rating:U,size:g.starSize,filledColor:m,emptyColor:f}),jsx("span",{style:x,children:A}),o&&jsxs("span",{style:k,children:["(",T(N,"response"),")"]})]})}function Mr(){let{client:e,disabled:r,defaultUser:o,debug:t,openModal:n,closeModal:d,activeModalId:i}=P();return {client:e,disabled:r,defaultUser:o,debug:t,submitFeedback:e.submitResponse.bind(e),openModal:n,closeModal:d,activeModalId:i}}function Gr(e){let{activeModalId:r,openModal:o,closeModal:t}=P(),n=useCallback(()=>o(e),[o,e]),d=useCallback(()=>t(),[t]);return {open:n,close:d,isOpen:r===e}}
135
+ export{Sr as Gotcha,Kt as GotchaProvider,Br as GotchaScore,Nt as createTheme,Mr as useGotcha,Gr as useGotchaTrigger};//# sourceMappingURL=index.mjs.map
161
136
  //# sourceMappingURL=index.mjs.map