@inputbuffer/feedback 0.2.0 → 0.3.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.
@@ -1,4 +1,4 @@
1
- var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.category=t.category,this.field=t.field}};function G(e){let t=document.getElementById("ib-modal");if(!t)return;let{theme:i={}}=e;i.primary&&t.style.setProperty("--ib-primary",i.primary),i.background&&t.style.setProperty("--ib-background",i.background),i.surface&&t.style.setProperty("--ib-surface",i.surface),i.text&&t.style.setProperty("--ib-text",i.text),i.selected&&t.style.setProperty("--ib-selected",i.selected),i.selectedColor&&t.style.setProperty("--ib-selected-color",i.selectedColor)}var W="0.2.0",ne="https://inputbuffer.io/api/v0/inputs";async function _(e,t,i,d,u,m){var p,k,w,f;let c={description:t};if(d&&(c.title=d),i&&(c.contact_email=i),u!=null&&u.source&&(c.source=u.source),u!=null&&u.target){let h=u.target;c.targets=[{type:h.type,metadata:h.metadata}]}let n=new AbortController,y=setTimeout(()=>n.abort(),1e4),o;try{o=await fetch(m!=null?m:ne,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${W} (javascript)`},body:JSON.stringify(c),credentials:"omit",signal:n.signal})}finally{clearTimeout(y)}if(!o.ok){let h=await o.json().catch(()=>({}));throw new z({type:(p=h.type)!=null?p:"https://inputbuffer.io/problems/internal-error",title:(k=h.title)!=null?k:"Error",detail:(w=h.detail)!=null?w:"Submission failed. Please try again.",status:(f=h.status)!=null?f:o.status,category:h.category,field:h.field})}let{data:g}=await o.json();return{id:g.id}}var le="https://inputbuffer.io/api/v0/reactions";async function J(e,t,i,d,u){var g,p,k,w;let m=u?u.replace(/\/inputs$/,"/reactions"):le,c={reaction_value:t,target:{type:i.type,metadata:i.metadata}};d&&(c.user_id=d);let n=new AbortController,y=setTimeout(()=>n.abort(),1e4),o;try{o=await fetch(m,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${W} (javascript)`},body:JSON.stringify(c),credentials:"omit",signal:n.signal})}finally{clearTimeout(y)}if(!o.ok){let f=await o.json().catch(()=>({}));throw new z({type:(g=f.type)!=null?g:"https://inputbuffer.io/problems/internal-error",title:(p=f.title)!=null?p:"Error",detail:(k=f.detail)!=null?k:"Submission failed. Please try again.",status:(w=f.status)!=null?w:o.status,category:f.category,field:f.field})}}function Y(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),t.appendChild(i),t}var se="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",de="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z";function X(e){let t=null,i,d,u=null,m=null,c=null,n=null,y=null,o=null,g=null,p=null,k=null,w=[],f=[],h=[];function v(a){if(a.key==="Escape"){C();return}if(a.key==="Tab"&&t){let b=Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(b.length===0)return;let x=b[0],l=b[b.length-1];a.shiftKey?document.activeElement===x&&(a.preventDefault(),l.focus()):document.activeElement===l&&(a.preventDefault(),x.focus())}}async function P(){var b,x;if(!m||!y)return;let a=m.value.trim();if(a.length<10){o&&(o.textContent="Please enter at least 10 characters.",o.style.display="block");return}o&&(o.style.display="none"),y.disabled=!0,y.textContent="Sending\u2026";try{let l=(n==null?void 0:n.value.trim())||((b=i==null?void 0:i.prefill)==null?void 0:b.email)||null,E=(c==null?void 0:c.value.trim())||null,T=d!=null?d:i==null?void 0:i.sentiment,O=await _(e.apiKey,a,l||null,E,{...i,sentiment:T,source:(x=i==null?void 0:i.source)!=null?x:e.source},e.apiUrl);g&&(g.textContent="Thanks for your feedback!",g.style.display="block"),w.forEach(M=>M(O)),u=setTimeout(()=>C(),2e3)}catch(l){let E=l instanceof Error?l:new Error("Unknown error");if(o){let T=l instanceof z&&l.category==="user"?l.detail:"Something went wrong. Please try again.";o.textContent=T,o.style.display="block"}h.forEach(T=>T(E)),y.disabled=!1,y.textContent="Send feedback"}}function L(){let a=document.createElement("div");a.id="ib-overlay";let b=document.createElement("div");b.id="ib-modal",e.colorScheme==="dark"?b.classList.add("ib-theme-dark"):e.colorScheme==="light"&&b.classList.add("ib-theme-light"),b.setAttribute("role","dialog"),b.setAttribute("aria-modal","true");let x=document.createElement("div");if(x.id="ib-modal-header",k=x,e.title?(b.setAttribute("aria-labelledby","ib-title"),p=document.createElement("h2"),p.id="ib-title",p.className="ib-modal-title",p.textContent=e.title,x.appendChild(p)):b.setAttribute("aria-label","Feedback"),e.showSentiment){let A,H,j=document.createElement("div");j.className="ib-modal-sentiment",A=document.createElement("button"),A.type="button",A.className="ib-modal-thumb ib-modal-thumb--up",A.setAttribute("aria-label","Helpful"),A.appendChild(Y(se)),H=document.createElement("button"),H.type="button",H.className="ib-modal-thumb ib-modal-thumb--down",H.setAttribute("aria-label","Not helpful"),H.appendChild(Y(de)),A.addEventListener("click",()=>{A.classList.add("ib-modal-thumb--active"),H.classList.remove("ib-modal-thumb--active"),d="positive"}),H.addEventListener("click",()=>{H.classList.add("ib-modal-thumb--active"),A.classList.remove("ib-modal-thumb--active"),d="negative"}),j.appendChild(A),j.appendChild(H),x.appendChild(j)}let l=document.createElement("button");l.id="ib-close",l.className="ib-modal-close",l.textContent="\xD7",l.setAttribute("aria-label","Close feedback form"),l.addEventListener("click",C),x.appendChild(l);let E=document.createElement("div");E.id="ib-modal-body",m=document.createElement("textarea"),m.id="ib-textarea",m.className="ib-modal-textarea",m.placeholder=e.placeholder||"What's on your mind?",m.setAttribute("aria-label","Feedback"),y=document.createElement("button"),y.id="ib-submit",y.className="ib-modal-submit",y.textContent="Send feedback",y.addEventListener("click",P),g=document.createElement("p"),g.id="ib-success",g.className="ib-modal-success",o=document.createElement("p"),o.id="ib-error",o.className="ib-modal-error",e.showTitleField===!0&&(c=document.createElement("input"),c.id="ib-title-input",c.className="ib-modal-title-input",c.type="text",c.placeholder="Title (optional)",c.setAttribute("aria-label","Feedback title"),E.appendChild(c)),E.appendChild(m),e.showEmailField===!0&&(n=document.createElement("input"),n.id="ib-email",n.className="ib-modal-email",n.type="email",n.placeholder="Your email (optional)",n.setAttribute("aria-label","Email address"),E.appendChild(n)),E.appendChild(o),E.appendChild(g);let T=document.createElement("div");T.className="ib-modal-footer",T.appendChild(y);let O=document.createElement("div");O.className="ib-branding";let M=document.createElement("a");return M.href="https://inputbuffer.io",M.target="_blank",M.rel="noopener noreferrer",M.textContent="Powered by inputbuffer.io",O.appendChild(M),T.appendChild(O),E.appendChild(T),b.appendChild(x),b.appendChild(E),a.appendChild(b),a.addEventListener("click",A=>{A.target===a&&C()}),document.addEventListener("keydown",v),a}function B(a){var b,x;if(!t){if(i=a,t=L(),document.body.appendChild(t),G(e),a!=null&&a.title){if(p)p.textContent=a.title;else if(k){let l=t.querySelector("#ib-modal");l.removeAttribute("aria-label"),l.setAttribute("aria-labelledby","ib-title"),p=document.createElement("h2"),p.id="ib-title",p.className="ib-modal-title",p.textContent=a.title,k.prepend(p)}}if(a!=null&&a.sentiment){d=a.sentiment;let l=t.querySelector(".ib-modal-thumb--up"),E=t.querySelector(".ib-modal-thumb--down");a.sentiment==="positive"?l==null||l.classList.add("ib-modal-thumb--active"):a.sentiment==="negative"&&(E==null||E.classList.add("ib-modal-thumb--active"))}m&&((b=a==null?void 0:a.prefill)!=null&&b.description)&&(m.value=a.prefill.description),n&&((x=a==null?void 0:a.prefill)!=null&&x.email)&&(n.value=a.prefill.email),m==null||m.focus()}}function C(){t&&(u!==null&&(clearTimeout(u),u=null),document.removeEventListener("keydown",v),t.remove(),t=null,m=null,c=null,n=null,y=null,o=null,g=null,p=null,k=null,i=void 0,d=void 0,f.forEach(a=>a()))}function F(a,b){a==="submit"?w.push(b):a==="close"?f.push(b):a==="error"&&h.push(b)}function S(){C()}return{open:B,close:C,on:F,destroy:S}}function Q(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),t.appendChild(i),t}var be="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",ce="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z",ue=24*60*60*1e3;function U(e){var V,q;let t;function i(){let r=e.target;return r?`ib:reaction:${e.apiKey}:${r.type}:${JSON.stringify(r.metadata)}`:`ib:reaction:${e.apiKey}:${window.location.pathname}`}function d(){try{let r=localStorage.getItem(i());if(!r)return null;let{sentiment:N,ts:I}=JSON.parse(r);return Date.now()-I>ue?(localStorage.removeItem(i()),null):N}catch{return null}}function u(r){try{localStorage.setItem(i(),JSON.stringify({sentiment:r,ts:Date.now()}))}catch{}}let m={vote:[],open:[],submit:[],close:[],error:[]};function c(r,N){var I;(I=m[r])==null||I.forEach(R=>R(N))}let n=document.createElement("div"),y=e.colorScheme==="dark"?" ib-theme-dark":e.colorScheme==="light"?" ib-theme-light":"";n.className="ib-bar-wrapper"+(e.placement==="fixed"?" ib-bar-wrapper--fixed":"")+y;let{theme:o={}}=e;o.primary&&n.style.setProperty("--ib-primary",o.primary),o.background&&n.style.setProperty("--ib-background",o.background),o.surface&&n.style.setProperty("--ib-surface",o.surface),o.text&&n.style.setProperty("--ib-text",o.text),o.selected&&n.style.setProperty("--ib-selected",o.selected),o.selectedColor&&n.style.setProperty("--ib-selected-color",o.selectedColor);let g=document.createElement("div");g.className="ib-bar";let p=document.createElement("div");p.className="ib-bar-label-area";let k=document.createElement("span");k.className="ib-bar-label",k.textContent=(V=e.label)!=null?V:"Was this helpful?",p.appendChild(k);let w=document.createElement("div");w.className="ib-bar-actions"+(e.showLabel===!1?" ib-bar-actions--no-label":"");let f=document.createElement("button");f.type="button",f.className="ib-bar-btn ib-bar-btn--up",f.setAttribute("aria-label","Yes"),f.appendChild(Q(be));let h=document.createElement("button");h.type="button",h.className="ib-bar-btn ib-bar-btn--down",h.setAttribute("aria-label","No"),h.appendChild(Q(ce)),w.appendChild(f),w.appendChild(h),e.showLabel!==!1&&g.appendChild(p),g.appendChild(w);let v=document.createElement("div");v.className="ib-bar-popover",v.setAttribute("role","dialog"),v.setAttribute("aria-modal","false");let P=document.createElement("div");if(P.className="ib-bar-header",e.modalTitle){v.setAttribute("aria-labelledby","ib-bar-title");let r=document.createElement("p");r.id="ib-bar-title",r.className="ib-bar-title",r.textContent=e.modalTitle,P.appendChild(r)}else v.setAttribute("aria-label","Feedback");let L=document.createElement("div");L.className="ib-bar-body";let B=document.createElement("textarea");B.className="ib-bar-textarea",B.placeholder=(q=e.modalPlaceholder)!=null?q:"What's on your mind?",B.setAttribute("aria-label","Feedback");let C=document.createElement("p");C.className="ib-bar-error";let F=document.createElement("p");F.className="ib-bar-success";let S=document.createElement("button");if(S.type="button",S.className="ib-bar-submit",S.textContent="Send feedback",e.showTitleField===!0){let r=document.createElement("input");r.type="text",r.className="ib-bar-title-input",r.placeholder="Title (optional)",r.setAttribute("aria-label","Feedback title"),L.appendChild(r)}if(L.appendChild(B),e.showEmailField===!0){let r=document.createElement("input");r.type="email",r.className="ib-bar-email",r.placeholder="Your email (optional)",r.setAttribute("aria-label","Email address"),L.appendChild(r)}L.appendChild(C),L.appendChild(F);let a=document.createElement("div");a.className="ib-bar-footer",a.appendChild(S);let b=document.createElement("div");b.className="ib-branding";let x=document.createElement("a");x.href="https://inputbuffer.io",x.target="_blank",x.rel="noopener noreferrer",x.textContent="Powered by inputbuffer.io",b.appendChild(x),a.appendChild(b),L.appendChild(a),v.appendChild(P),v.appendChild(L),n.appendChild(v),n.appendChild(g);function l(){let r=g.getBoundingClientRect();v.style.top=`${r.top-v.offsetHeight-8}px`,v.style.left=`${r.right-320}px`}function E(r){t=r,v.classList.add("ib-bar-popover--visible"),requestAnimationFrame(l),C.textContent="",F.textContent="",B.focus(),setTimeout(()=>document.addEventListener("click",M),0),document.addEventListener("keydown",A),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),c("open",{sentiment:r})}function T(){v.classList.contains("ib-bar-popover--visible")&&(v.classList.remove("ib-bar-popover--visible"),document.removeEventListener("click",M),document.removeEventListener("keydown",A),window.removeEventListener("scroll",l),window.removeEventListener("resize",l),B.value="",c("close"))}function O(){f.classList.remove("ib-bar-btn--active"),h.classList.remove("ib-bar-btn--active"),t=void 0}function M(r){n.contains(r.target)||T()}function A(r){r.key==="Escape"&&T()}async function H(){let r=B.value.trim();if(r.length<10){C.textContent="Please enter at least 10 characters.";return}C.textContent="",S.disabled=!0,S.textContent="Sending\u2026";let N=v.querySelector(".ib-bar-title-input"),I=(N==null?void 0:N.value.trim())||null,R=v.querySelector(".ib-bar-email"),ae=(R==null?void 0:R.value.trim())||null;try{let D=await _(e.apiKey,r,ae,I,{sentiment:t,target:e.target,source:e.source},e.apiUrl);c("submit",D),F.textContent="Thanks for your feedback!",S.textContent="Send feedback",setTimeout(()=>{T(),O()},2e3)}catch(D){c("error",D instanceof Error?D:new Error("Something went wrong."));let oe=D instanceof z&&D.category==="user"?D.detail:"Something went wrong. Please try again.";C.textContent=oe,S.disabled=!1,S.textContent="Send feedback"}}function j(r){f.classList.remove("ib-bar-btn--active"),h.classList.remove("ib-bar-btn--active"),r.classList.add("ib-bar-btn--active")}let K=d();K&&(t=K,j(K==="positive"?f:h));function $(r,N){var I;u(r),j(N),E(r),c("vote",{sentiment:r}),e.target&&J(e.apiKey,r==="positive"?1:-1,e.target,(I=e.userId)!=null?I:null,e.apiUrl).catch(()=>{})}return f.addEventListener("click",()=>$("positive",f)),h.addEventListener("click",()=>$("negative",h)),S.addEventListener("click",H),{element:n,on(r,N){var I;(I=m[r])==null||I.push(N)},destroy(){T(),n.remove()}}}var Z=`/* InputBuffer Modal Styles
1
+ function X(e){let t=document.getElementById("ib-modal");if(!t)return;let{theme:r={}}=e;r.primary&&t.style.setProperty("--ib-primary",r.primary),r.background&&t.style.setProperty("--ib-background",r.background),r.surface&&t.style.setProperty("--ib-surface",r.surface),r.text&&t.style.setProperty("--ib-text",r.text),r.selected&&t.style.setProperty("--ib-selected",r.selected),r.selectedColor&&t.style.setProperty("--ib-selected-color",r.selectedColor)}var _=class extends Error{constructor(t){super(t.detail),this.name="ApiError",this.type=t.type,this.title=t.title,this.status=t.status,this.detail=t.detail,this.category=t.category,this.field=t.field}};var Y="Something went wrong. Please try again.";function j(e){return e instanceof _?e.category==="user"?e.detail:(e.category==="integration"&&M(`${e.title}: ${e.detail}`,e.type),Y):Y}function M(e,t){typeof console!="undefined"&&console.warn(`[inputbuffer] ${e}`,t!=null?t:"")}var U="0.3.1",pe="https://inputbuffer.io",me="/api/v0/feedback",fe="/api/v0/reactions",ge=1e4,he=5e3,ve=500,ye=300;function Q(e,t){return`${(e!=null?e:pe).replace(/\/+$/,"")}${t}`}async function Z(e,t,r){var d,s,c,p;let n=new AbortController,g=setTimeout(()=>n.abort(),ge),a;try{a=await fetch(e,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${U} (javascript)`},body:JSON.stringify(r),credentials:"omit",signal:n.signal})}finally{clearTimeout(g)}if(!a.ok){let b=await a.json().catch(()=>({}));throw new _({type:(d=b.type)!=null?d:"https://inputbuffer.io/docs/api/problems/internal-error",title:(s=b.title)!=null?s:"Error",detail:(c=b.detail)!=null?c:"Submission failed. Please try again.",status:(p=b.status)!=null?p:a.status,category:b.category,field:b.field})}return a}async function D(e,t,r,n,g){let a={description:t.slice(0,he)};if(r&&(a.title=r.slice(0,ve)),n!=null&&n.submittedBy&&(a.submitted_by=n.submittedBy.slice(0,ye)),n!=null&&n.target){let c=n.target;a.targets=[{type:c.type,metadata:c.metadata}]}let d=await Z(Q(g,me),e,a),{data:s}=await d.json();return{id:s.id}}async function ee(e,t,r,n,g){let a={reaction_value:t,target:{type:r.type,metadata:r.metadata}};n&&(a.user_id=n);let d;try{d=await Z(Q(g,fe),e,a)}catch(c){throw c instanceof _&&c.status===422&&c.field==="user_id"&&M("Reaction rejected: no user_id and no client IP. Set the `userId` option (or the `user-id` attribute)."),c}let{data:s}=await d.json();return s}function te(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}var xe="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",Ee="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z";function re(e){let t=null,r,n,g=null,a=null,d=null,s=null,c=null,p=null,b=null,B=null,z=[],H=[],E=[];function k(i){if(i.key==="Escape"){y();return}if(i.key==="Tab"&&t){let l=Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(l.length===0)return;let u=l[0],m=l[l.length-1];i.shiftKey?document.activeElement===u&&(i.preventDefault(),m.focus()):document.activeElement===m&&(i.preventDefault(),u.focus())}}async function h(){var l;if(!a||!s)return;let i=a.value.trim();if(i.length<10){c&&(c.textContent="Please enter at least 10 characters.",c.style.display="block");return}c&&(c.style.display="none"),s.disabled=!0,s.textContent="Sending\u2026";try{let u=(d==null?void 0:d.value.trim())||null,m=n!=null?n:r==null?void 0:r.sentiment,v=await D(e.apiKey,i,u,{...r,sentiment:m,submittedBy:(l=r==null?void 0:r.submittedBy)!=null?l:e.submittedBy},e.apiUrl);p&&(p.textContent="Thanks for your feedback!",p.style.display="block"),z.forEach(A=>A(v)),g=setTimeout(()=>y(),2e3)}catch(u){let m=u instanceof Error?u:new Error("Unknown error");c&&(c.textContent=j(u),c.style.display="block"),E.forEach(v=>v(m)),s.disabled=!1,s.textContent="Send feedback"}}function O(){let i=document.createElement("div");i.id="ib-overlay";let l=document.createElement("div");l.id="ib-modal",e.colorScheme==="dark"?l.classList.add("ib-theme-dark"):e.colorScheme==="light"&&l.classList.add("ib-theme-light"),l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true");let u=document.createElement("div");if(u.id="ib-modal-header",B=u,e.title?(l.setAttribute("aria-labelledby","ib-title"),b=document.createElement("h2"),b.id="ib-title",b.className="ib-modal-title",b.textContent=e.title,u.appendChild(b)):l.setAttribute("aria-label","Feedback"),e.showSentiment){let x,w,R=document.createElement("div");R.className="ib-modal-sentiment",x=document.createElement("button"),x.type="button",x.className="ib-modal-thumb ib-modal-thumb--up",x.setAttribute("aria-label","Helpful"),x.appendChild(te(xe)),w=document.createElement("button"),w.type="button",w.className="ib-modal-thumb ib-modal-thumb--down",w.setAttribute("aria-label","Not helpful"),w.appendChild(te(Ee)),x.addEventListener("click",()=>{x.classList.add("ib-modal-thumb--active"),w.classList.remove("ib-modal-thumb--active"),n="positive"}),w.addEventListener("click",()=>{w.classList.add("ib-modal-thumb--active"),x.classList.remove("ib-modal-thumb--active"),n="negative"}),R.appendChild(x),R.appendChild(w),u.appendChild(R)}let m=document.createElement("button");m.id="ib-close",m.className="ib-modal-close",m.textContent="\xD7",m.setAttribute("aria-label","Close feedback form"),m.addEventListener("click",y),u.appendChild(m);let v=document.createElement("div");v.id="ib-modal-body",a=document.createElement("textarea"),a.id="ib-textarea",a.className="ib-modal-textarea",a.placeholder=e.placeholder||"What's on your mind?",a.maxLength=5e3,a.setAttribute("aria-label","Feedback"),s=document.createElement("button"),s.id="ib-submit",s.className="ib-modal-submit",s.textContent="Send feedback",s.addEventListener("click",h),p=document.createElement("p"),p.id="ib-success",p.className="ib-modal-success",c=document.createElement("p"),c.id="ib-error",c.className="ib-modal-error",e.showTitleField===!0&&(d=document.createElement("input"),d.id="ib-title-input",d.className="ib-modal-title-input",d.type="text",d.placeholder="Title (optional)",d.maxLength=500,d.setAttribute("aria-label","Feedback title"),v.appendChild(d)),v.appendChild(a),v.appendChild(c),v.appendChild(p);let A=document.createElement("div");A.className="ib-modal-footer",A.appendChild(s);let I=document.createElement("div");I.className="ib-branding";let F=document.createElement("a");return F.href="https://inputbuffer.io",F.target="_blank",F.rel="noopener noreferrer",F.textContent="Powered by inputbuffer.io",I.appendChild(F),A.appendChild(I),v.appendChild(A),l.appendChild(u),l.appendChild(v),i.appendChild(l),i.addEventListener("click",x=>{x.target===i&&y()}),document.addEventListener("keydown",k),i}function S(i){var l;if(!t){if(r=i,t=O(),document.body.appendChild(t),X(e),i!=null&&i.title){if(b)b.textContent=i.title;else if(B){let u=t.querySelector("#ib-modal");u.removeAttribute("aria-label"),u.setAttribute("aria-labelledby","ib-title"),b=document.createElement("h2"),b.id="ib-title",b.className="ib-modal-title",b.textContent=i.title,B.prepend(b)}}if(i!=null&&i.sentiment){n=i.sentiment;let u=t.querySelector(".ib-modal-thumb--up"),m=t.querySelector(".ib-modal-thumb--down");i.sentiment==="positive"?u==null||u.classList.add("ib-modal-thumb--active"):i.sentiment==="negative"&&(m==null||m.classList.add("ib-modal-thumb--active"))}a&&((l=i==null?void 0:i.prefill)!=null&&l.description)&&(a.value=i.prefill.description),a==null||a.focus()}}function y(){t&&(g!==null&&(clearTimeout(g),g=null),document.removeEventListener("keydown",k),t.remove(),t=null,a=null,d=null,s=null,c=null,p=null,b=null,B=null,r=void 0,n=void 0,H.forEach(i=>i()))}function L(i,l){i==="submit"?z.push(l):i==="close"?H.push(l):i==="error"&&E.push(l)}function P(){y()}return{open:S,close:y,on:L,destroy:P}}function ie(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}var ke="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",we="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z",Ce=1440*60*1e3;function K(e){var G,J;let t;function r(){let o=e.target;return o?`ib:reaction:${e.apiKey}:${o.type}:${JSON.stringify(o.metadata)}`:`ib:reaction:${e.apiKey}:${window.location.pathname}`}function n(){try{let o=localStorage.getItem(r());if(!o)return null;let{sentiment:T,ts:C}=JSON.parse(o);return Date.now()-C>Ce?(localStorage.removeItem(r()),null):T}catch{return null}}function g(o){try{localStorage.setItem(r(),JSON.stringify({sentiment:o,ts:Date.now()}))}catch{}}let a={vote:[],open:[],submit:[],close:[],error:[]};function d(o,T){var C;(C=a[o])==null||C.forEach(N=>N(T))}let s=document.createElement("div"),c=e.colorScheme==="dark"?" ib-theme-dark":e.colorScheme==="light"?" ib-theme-light":"";s.className="ib-bar-wrapper"+(e.placement==="fixed"?" ib-bar-wrapper--fixed":"")+c;let{theme:p={}}=e;p.primary&&s.style.setProperty("--ib-primary",p.primary),p.background&&s.style.setProperty("--ib-background",p.background),p.surface&&s.style.setProperty("--ib-surface",p.surface),p.text&&s.style.setProperty("--ib-text",p.text),p.selected&&s.style.setProperty("--ib-selected",p.selected),p.selectedColor&&s.style.setProperty("--ib-selected-color",p.selectedColor);let b=document.createElement("div");b.className="ib-bar";let B=document.createElement("div");B.className="ib-bar-label-area";let z=document.createElement("span");z.className="ib-bar-label",z.textContent=(G=e.label)!=null?G:"Was this helpful?",B.appendChild(z);let H=document.createElement("div");H.className="ib-bar-actions"+(e.showLabel===!1?" ib-bar-actions--no-label":"");let E=document.createElement("button");E.type="button",E.className="ib-bar-btn ib-bar-btn--up",E.setAttribute("aria-label","Yes"),E.appendChild(ie(ke));let k=document.createElement("button");k.type="button",k.className="ib-bar-btn ib-bar-btn--down",k.setAttribute("aria-label","No"),k.appendChild(ie(we)),H.appendChild(E),H.appendChild(k),e.showLabel!==!1&&b.appendChild(B),b.appendChild(H);let h=document.createElement("div");h.className="ib-bar-popover",h.setAttribute("role","dialog"),h.setAttribute("aria-modal","false");let O=document.createElement("div");if(O.className="ib-bar-header",e.modalTitle){h.setAttribute("aria-labelledby","ib-bar-title");let o=document.createElement("p");o.id="ib-bar-title",o.className="ib-bar-title",o.textContent=e.modalTitle,O.appendChild(o)}else h.setAttribute("aria-label","Feedback");let S=document.createElement("div");S.className="ib-bar-body";let y=document.createElement("textarea");y.className="ib-bar-textarea",y.placeholder=(J=e.modalPlaceholder)!=null?J:"What's on your mind?",y.maxLength=5e3,y.setAttribute("aria-label","Feedback");let L=document.createElement("p");L.className="ib-bar-error";let P=document.createElement("p");P.className="ib-bar-success";let i=document.createElement("button");if(i.type="button",i.className="ib-bar-submit",i.textContent="Send feedback",e.showTitleField===!0){let o=document.createElement("input");o.type="text",o.className="ib-bar-title-input",o.placeholder="Title (optional)",o.maxLength=500,o.setAttribute("aria-label","Feedback title"),S.appendChild(o)}S.appendChild(y),S.appendChild(L),S.appendChild(P);let l=document.createElement("div");l.className="ib-bar-footer",l.appendChild(i);let u=document.createElement("div");u.className="ib-branding";let m=document.createElement("a");m.href="https://inputbuffer.io",m.target="_blank",m.rel="noopener noreferrer",m.textContent="Powered by inputbuffer.io",u.appendChild(m),l.appendChild(u),S.appendChild(l),h.appendChild(O),h.appendChild(S),s.appendChild(h),s.appendChild(b);function v(){let o=b.getBoundingClientRect();h.style.top=`${o.top-h.offsetHeight-8}px`,h.style.left=`${o.right-320}px`}function A(o){t=o,h.classList.add("ib-bar-popover--visible"),requestAnimationFrame(v),L.textContent="",P.textContent="",y.focus(),setTimeout(()=>document.addEventListener("click",x),0),document.addEventListener("keydown",w),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v,{passive:!0}),d("open",{sentiment:o})}function I(){h.classList.contains("ib-bar-popover--visible")&&(h.classList.remove("ib-bar-popover--visible"),document.removeEventListener("click",x),document.removeEventListener("keydown",w),window.removeEventListener("scroll",v),window.removeEventListener("resize",v),y.value="",d("close"))}function F(){E.classList.remove("ib-bar-btn--active"),k.classList.remove("ib-bar-btn--active"),t=void 0}function x(o){s.contains(o.target)||I()}function w(o){o.key==="Escape"&&I()}async function R(){let o=y.value.trim();if(o.length<10){L.textContent="Please enter at least 10 characters.";return}L.textContent="",i.disabled=!0,i.textContent="Sending\u2026";let T=h.querySelector(".ib-bar-title-input"),C=(T==null?void 0:T.value.trim())||null;try{let N=await D(e.apiKey,o,C,{sentiment:t,target:e.target,submittedBy:e.submittedBy},e.apiUrl);d("submit",N),P.textContent="Thanks for your feedback!",i.textContent="Send feedback",setTimeout(()=>{I(),F()},2e3)}catch(N){d("error",N instanceof Error?N:new Error("Something went wrong.")),L.textContent=j(N),i.disabled=!1,i.textContent="Send feedback"}}function q(o){E.classList.remove("ib-bar-btn--active"),k.classList.remove("ib-bar-btn--active"),o.classList.add("ib-bar-btn--active")}let W=n();W&&(t=W,q(W==="positive"?E:k));function V(o,T){var C;g(o),q(T),A(o),d("vote",{sentiment:o}),e.target&&ee(e.apiKey,o==="positive"?1:-1,e.target,(C=e.userId)!=null?C:null,e.apiUrl).catch(()=>{})}return E.addEventListener("click",()=>V("positive",E)),k.addEventListener("click",()=>V("negative",k)),i.addEventListener("click",R),{element:s,on(o,T){var C;(C=a[o])==null||C.push(T)},destroy(){I(),s.remove()}}}function f(e,t){var r;return(r=e.getAttribute(t))!=null?r:void 0}function ne(e,t){let r=e.getAttribute(t);return r===null?void 0:r==="true"}function Te(e){return{primary:f(e,"theme-primary"),background:f(e,"theme-background"),text:f(e,"theme-text"),selected:f(e,"theme-selected"),selectedColor:f(e,"theme-selected-color")}}function Se(e){var r;let t=e.getAttribute("target-type");if(t)switch(t){case"documentation":{let n=(r=f(e,"target-page-url"))!=null?r:typeof window!="undefined"?window.location.href:void 0;if(!n){M('target-type="documentation" needs target-page-url. Ignoring the target.');return}return{type:"documentation",metadata:{page_url:n,section_heading:f(e,"target-section-heading"),doc_version:f(e,"target-doc-version")}}}case"rest_endpoint":{let n=f(e,"target-method"),g=f(e,"target-path");if(!n||!g){M('target-type="rest_endpoint" needs target-method and target-path. Ignoring the target.');return}return{type:"rest_endpoint",metadata:{method:n,path:g,host:f(e,"target-host"),api_version:f(e,"target-api-version")}}}case"cli_command":{let n=f(e,"target-command");if(!n){M('target-type="cli_command" needs target-command. Ignoring the target.');return}let g=f(e,"target-args");return{type:"cli_command",metadata:{command:n,subcommand:f(e,"target-subcommand"),cli_version:f(e,"target-cli-version"),args:g?g.split(",").map(a=>a.trim()).filter(Boolean):void 0}}}default:M(`Unknown target-type "${t}". Expected documentation, rest_endpoint, or cli_command.`);return}}function oe(e,t){return{apiKey:t,apiUrl:f(e,"api-url"),label:f(e,"label"),showLabel:ne(e,"show-label"),placement:e.getAttribute("placement")==="fixed"?"fixed":"inline",colorScheme:f(e,"color-scheme"),modalTitle:f(e,"modal-title"),modalPlaceholder:f(e,"modal-placeholder"),showTitleField:ne(e,"show-title-field"),submittedBy:f(e,"submitted-by"),userId:f(e,"user-id"),target:Se(e),theme:Te(e)}}function ae(e){return e.getAttribute("inject-styles")!=="false"}function se(e,t){let r=e.dataset;return{apiKey:t,apiUrl:r.apiUrl,attachTo:r.attachTo,injectStyles:r.injectStyles===void 0?!0:r.injectStyles!=="false",colorScheme:r.colorScheme,title:r.title,placeholder:r.placeholder,showTitleField:r.showTitleField===void 0?void 0:r.showTitleField==="true",showSentiment:r.showSentiment===void 0?void 0:r.showSentiment==="true",submittedBy:r.submittedBy,theme:{primary:r.themePrimary,background:r.themeBackground,text:r.themeText,selected:r.themeSelected,selectedColor:r.themeSelectedColor}}}var le=`/* InputBuffer Modal Styles
2
2
  * All #ib-* IDs are stable public API \u2014 do not rename them.
3
3
  * Developers may target these IDs from their own stylesheets to customize the widget.
4
4
  */
@@ -99,9 +99,7 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
99
99
  }
100
100
 
101
101
  #ib-modal-body #ib-title-input,
102
- #ib-modal-body .ib-modal-title-input,
103
- #ib-modal-body #ib-email,
104
- #ib-modal-body .ib-modal-email {
102
+ #ib-modal-body .ib-modal-title-input {
105
103
  width: 100%;
106
104
  background: var(--ib-background);
107
105
  border: 1px solid var(--ib-border);
@@ -120,22 +118,13 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
120
118
  margin-bottom: 10px;
121
119
  }
122
120
 
123
- #ib-email,
124
- .ib-modal-email {
125
- margin-top: 10px;
126
- }
127
-
128
121
  #ib-modal-body #ib-title-input:hover,
129
- #ib-modal-body .ib-modal-title-input:hover,
130
- #ib-modal-body #ib-email:hover,
131
- #ib-modal-body .ib-modal-email:hover {
122
+ #ib-modal-body .ib-modal-title-input:hover {
132
123
  border-color: var(--ib-input-hover-border);
133
124
  }
134
125
 
135
126
  #ib-modal-body #ib-title-input:focus,
136
- #ib-modal-body .ib-modal-title-input:focus,
137
- #ib-modal-body #ib-email:focus,
138
- #ib-modal-body .ib-modal-email:focus {
127
+ #ib-modal-body .ib-modal-title-input:focus {
139
128
  border-color: var(--ib-focus-color);
140
129
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
141
130
  }
@@ -306,7 +295,7 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
306
295
  --ib-radius: 8px;
307
296
  --ib-radius-input: 4px;
308
297
  }
309
- `;var ee=`/* InputBuffer Feedback Bar Styles
298
+ `;var de=`/* InputBuffer Feedback Bar Styles
310
299
  * .ib-bar-* and .ib-bar-popover* classes are stable public API \u2014 do not rename them.
311
300
  * Developers may target these classes from their own stylesheets to customize the widget.
312
301
  */
@@ -414,8 +403,7 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
414
403
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
415
404
  }
416
405
 
417
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input,
418
- .ib-bar-wrapper .ib-bar-body .ib-bar-email {
406
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input {
419
407
  width: 100%;
420
408
  background: var(--ib-background);
421
409
  border: 1px solid var(--ib-border);
@@ -433,17 +421,11 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
433
421
  margin-bottom: 8px;
434
422
  }
435
423
 
436
- .ib-bar-email {
437
- margin-top: 8px;
438
- }
439
-
440
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:hover,
441
- .ib-bar-wrapper .ib-bar-body .ib-bar-email:hover {
424
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:hover {
442
425
  border-color: var(--ib-input-hover-border);
443
426
  }
444
427
 
445
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:focus,
446
- .ib-bar-wrapper .ib-bar-body .ib-bar-email:focus {
428
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:focus {
447
429
  border-color: var(--ib-focus-color);
448
430
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
449
431
  }
@@ -627,4 +609,4 @@ var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",th
627
609
  --ib-radius: 8px;
628
610
  --ib-radius-input: 4px;
629
611
  }
630
- `;var s=typeof document!="undefined"?document.currentScript:null;function fe(){if(typeof document=="undefined"||document.getElementById("ib-modal-styles"))return;let e=document.createElement("style");e.id="ib-modal-styles",e.textContent=Z,document.head.appendChild(e)}function te(){if(typeof document=="undefined"||document.getElementById("ib-bar-styles"))return;let e=document.createElement("style");e.id="ib-bar-styles",e.textContent=ee,document.head.appendChild(e)}function ie(e){e.injectStyles!==!1&&fe();let t=X(e),i=null,d=null;return e.attachTo&&(i=document.querySelector(e.attachTo),i&&(d=()=>t.open(),i.addEventListener("click",d))),{open:u=>t.open(u),close:()=>t.close(),on:(u,m)=>t.on(u,m),destroy:()=>{i&&d&&(i.removeEventListener("click",d),i=null,d=null),t.destroy()}}}function he(e){return e.injectStyles!==!1&&te(),U(e)}if(typeof HTMLElement!="undefined"){class e extends HTMLElement{constructor(){super(...arguments);this._bar=null}connectedCallback(){var g,p,k,w,f,h,v,P,L,B,C,F;let d=this.getAttribute("api-key");if(!d)return;let u=this.getAttribute("inject-styles");(u===null?!0:u!=="false")&&te();let c=this.getAttribute("placement"),n=this.getAttribute("show-label"),y=this.getAttribute("show-title-field"),o=this.getAttribute("show-email-field");this._bar=U({apiKey:d,apiUrl:(g=this.getAttribute("api-url"))!=null?g:void 0,label:(p=this.getAttribute("label"))!=null?p:void 0,placement:c==="fixed"?"fixed":"inline",colorScheme:(k=this.getAttribute("color-scheme"))!=null?k:void 0,showLabel:n===null?void 0:n==="true",modalTitle:(w=this.getAttribute("modal-title"))!=null?w:void 0,modalPlaceholder:(f=this.getAttribute("modal-placeholder"))!=null?f:void 0,showTitleField:y===null?void 0:y==="true",showEmailField:o===null?void 0:o==="true",source:(h=this.getAttribute("source"))!=null?h:void 0,userId:(v=this.getAttribute("user-id"))!=null?v:void 0,theme:{primary:(P=this.getAttribute("theme-primary"))!=null?P:void 0,background:(L=this.getAttribute("theme-background"))!=null?L:void 0,text:(B=this.getAttribute("theme-text"))!=null?B:void 0,selected:(C=this.getAttribute("theme-selected"))!=null?C:void 0,selectedColor:(F=this.getAttribute("theme-selected-color"))!=null?F:void 0}}),this.appendChild(this._bar.element)}disconnectedCallback(){var d;(d=this._bar)==null||d.destroy(),this._bar=null}}typeof customElements!="undefined"&&!customElements.get("inputbuffer-feedback")&&customElements.define("inputbuffer-feedback",e)}var re={createModal:ie,createBar:he,version:W};typeof window!="undefined"&&(window.InputBufferIO=re);(function(){if(typeof window=="undefined")return;let t=s==null?void 0:s.dataset.apiKey;if(!t)return;let i=s==null?void 0:s.dataset.injectStyles,d=s==null?void 0:s.dataset.colorScheme,u=ie({apiKey:t,apiUrl:s==null?void 0:s.dataset.apiUrl,attachTo:s==null?void 0:s.dataset.attachTo,injectStyles:i===void 0?!0:i!=="false",colorScheme:d,theme:{primary:s==null?void 0:s.dataset.themePrimary,background:s==null?void 0:s.dataset.themeBackground,text:s==null?void 0:s.dataset.themeText,selected:s==null?void 0:s.dataset.themeSelected,selectedColor:s==null?void 0:s.dataset.themeSelectedColor}});re._defaultInstance=u})();export{re as InputBufferIO};
612
+ `;var $=typeof document!="undefined"?document.currentScript:null;function Ae(){if(typeof document=="undefined"||document.getElementById("ib-modal-styles"))return;let e=document.createElement("style");e.id="ib-modal-styles",e.textContent=le,document.head.appendChild(e)}function ce(){if(typeof document=="undefined"||document.getElementById("ib-bar-styles"))return;let e=document.createElement("style");e.id="ib-bar-styles",e.textContent=de,document.head.appendChild(e)}function be(e){e.injectStyles!==!1&&Ae();let t=re(e),r=null,n=null;return e.attachTo&&(r=document.querySelector(e.attachTo),r&&(n=()=>t.open(),r.addEventListener("click",n))),{open:g=>t.open(g),close:()=>t.close(),on:(g,a)=>t.on(g,a),destroy:()=>{r&&n&&(r.removeEventListener("click",n),r=null,n=null),t.destroy()}}}function Ie(e){return e.injectStyles!==!1&&ce(),K(e)}if(typeof HTMLElement!="undefined"){class e extends HTMLElement{constructor(){super(...arguments);this._bar=null}connectedCallback(){let n=this.getAttribute("api-key");n&&(ae(this)&&ce(),this._bar=K(oe(this,n)),this.appendChild(this._bar.element))}disconnectedCallback(){var n;(n=this._bar)==null||n.destroy(),this._bar=null}}typeof customElements!="undefined"&&!customElements.get("inputbuffer-feedback")&&customElements.define("inputbuffer-feedback",e)}var ue={createModal:be,createBar:Ie,version:U};typeof window!="undefined"&&(window.InputBufferIO=ue);(function(){if(typeof window=="undefined"||!$)return;let t=$.dataset.apiKey;if(!t)return;let r=be(se($,t));ue._defaultInstance=r})();export{_ as ApiError,ue as InputBufferIO};
package/dist/widget.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var z=class extends Error{constructor(t){super(t.detail),this.name="ApiError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.category=t.category,this.field=t.field}};function G(e){let t=document.getElementById("ib-modal");if(!t)return;let{theme:i={}}=e;i.primary&&t.style.setProperty("--ib-primary",i.primary),i.background&&t.style.setProperty("--ib-background",i.background),i.surface&&t.style.setProperty("--ib-surface",i.surface),i.text&&t.style.setProperty("--ib-text",i.text),i.selected&&t.style.setProperty("--ib-selected",i.selected),i.selectedColor&&t.style.setProperty("--ib-selected-color",i.selectedColor)}var W="0.2.0",ne="https://inputbuffer.io/api/v0/inputs";async function _(e,t,i,d,u,m){var p,k,w,f;let c={description:t};if(d&&(c.title=d),i&&(c.contact_email=i),u!=null&&u.source&&(c.source=u.source),u!=null&&u.target){let h=u.target;c.targets=[{type:h.type,metadata:h.metadata}]}let n=new AbortController,y=setTimeout(()=>n.abort(),1e4),o;try{o=await fetch(m!=null?m:ne,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${W} (javascript)`},body:JSON.stringify(c),credentials:"omit",signal:n.signal})}finally{clearTimeout(y)}if(!o.ok){let h=await o.json().catch(()=>({}));throw new z({type:(p=h.type)!=null?p:"https://inputbuffer.io/problems/internal-error",title:(k=h.title)!=null?k:"Error",detail:(w=h.detail)!=null?w:"Submission failed. Please try again.",status:(f=h.status)!=null?f:o.status,category:h.category,field:h.field})}let{data:g}=await o.json();return{id:g.id}}var le="https://inputbuffer.io/api/v0/reactions";async function J(e,t,i,d,u){var g,p,k,w;let m=u?u.replace(/\/inputs$/,"/reactions"):le,c={reaction_value:t,target:{type:i.type,metadata:i.metadata}};d&&(c.user_id=d);let n=new AbortController,y=setTimeout(()=>n.abort(),1e4),o;try{o=await fetch(m,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${W} (javascript)`},body:JSON.stringify(c),credentials:"omit",signal:n.signal})}finally{clearTimeout(y)}if(!o.ok){let f=await o.json().catch(()=>({}));throw new z({type:(g=f.type)!=null?g:"https://inputbuffer.io/problems/internal-error",title:(p=f.title)!=null?p:"Error",detail:(k=f.detail)!=null?k:"Submission failed. Please try again.",status:(w=f.status)!=null?w:o.status,category:f.category,field:f.field})}}function Y(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),t.appendChild(i),t}var se="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",de="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z";function X(e){let t=null,i,d,u=null,m=null,c=null,n=null,y=null,o=null,g=null,p=null,k=null,w=[],f=[],h=[];function v(a){if(a.key==="Escape"){C();return}if(a.key==="Tab"&&t){let b=Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(b.length===0)return;let x=b[0],l=b[b.length-1];a.shiftKey?document.activeElement===x&&(a.preventDefault(),l.focus()):document.activeElement===l&&(a.preventDefault(),x.focus())}}async function P(){var b,x;if(!m||!y)return;let a=m.value.trim();if(a.length<10){o&&(o.textContent="Please enter at least 10 characters.",o.style.display="block");return}o&&(o.style.display="none"),y.disabled=!0,y.textContent="Sending\u2026";try{let l=(n==null?void 0:n.value.trim())||((b=i==null?void 0:i.prefill)==null?void 0:b.email)||null,E=(c==null?void 0:c.value.trim())||null,T=d!=null?d:i==null?void 0:i.sentiment,O=await _(e.apiKey,a,l||null,E,{...i,sentiment:T,source:(x=i==null?void 0:i.source)!=null?x:e.source},e.apiUrl);g&&(g.textContent="Thanks for your feedback!",g.style.display="block"),w.forEach(M=>M(O)),u=setTimeout(()=>C(),2e3)}catch(l){let E=l instanceof Error?l:new Error("Unknown error");if(o){let T=l instanceof z&&l.category==="user"?l.detail:"Something went wrong. Please try again.";o.textContent=T,o.style.display="block"}h.forEach(T=>T(E)),y.disabled=!1,y.textContent="Send feedback"}}function L(){let a=document.createElement("div");a.id="ib-overlay";let b=document.createElement("div");b.id="ib-modal",e.colorScheme==="dark"?b.classList.add("ib-theme-dark"):e.colorScheme==="light"&&b.classList.add("ib-theme-light"),b.setAttribute("role","dialog"),b.setAttribute("aria-modal","true");let x=document.createElement("div");if(x.id="ib-modal-header",k=x,e.title?(b.setAttribute("aria-labelledby","ib-title"),p=document.createElement("h2"),p.id="ib-title",p.className="ib-modal-title",p.textContent=e.title,x.appendChild(p)):b.setAttribute("aria-label","Feedback"),e.showSentiment){let A,H,j=document.createElement("div");j.className="ib-modal-sentiment",A=document.createElement("button"),A.type="button",A.className="ib-modal-thumb ib-modal-thumb--up",A.setAttribute("aria-label","Helpful"),A.appendChild(Y(se)),H=document.createElement("button"),H.type="button",H.className="ib-modal-thumb ib-modal-thumb--down",H.setAttribute("aria-label","Not helpful"),H.appendChild(Y(de)),A.addEventListener("click",()=>{A.classList.add("ib-modal-thumb--active"),H.classList.remove("ib-modal-thumb--active"),d="positive"}),H.addEventListener("click",()=>{H.classList.add("ib-modal-thumb--active"),A.classList.remove("ib-modal-thumb--active"),d="negative"}),j.appendChild(A),j.appendChild(H),x.appendChild(j)}let l=document.createElement("button");l.id="ib-close",l.className="ib-modal-close",l.textContent="\xD7",l.setAttribute("aria-label","Close feedback form"),l.addEventListener("click",C),x.appendChild(l);let E=document.createElement("div");E.id="ib-modal-body",m=document.createElement("textarea"),m.id="ib-textarea",m.className="ib-modal-textarea",m.placeholder=e.placeholder||"What's on your mind?",m.setAttribute("aria-label","Feedback"),y=document.createElement("button"),y.id="ib-submit",y.className="ib-modal-submit",y.textContent="Send feedback",y.addEventListener("click",P),g=document.createElement("p"),g.id="ib-success",g.className="ib-modal-success",o=document.createElement("p"),o.id="ib-error",o.className="ib-modal-error",e.showTitleField===!0&&(c=document.createElement("input"),c.id="ib-title-input",c.className="ib-modal-title-input",c.type="text",c.placeholder="Title (optional)",c.setAttribute("aria-label","Feedback title"),E.appendChild(c)),E.appendChild(m),e.showEmailField===!0&&(n=document.createElement("input"),n.id="ib-email",n.className="ib-modal-email",n.type="email",n.placeholder="Your email (optional)",n.setAttribute("aria-label","Email address"),E.appendChild(n)),E.appendChild(o),E.appendChild(g);let T=document.createElement("div");T.className="ib-modal-footer",T.appendChild(y);let O=document.createElement("div");O.className="ib-branding";let M=document.createElement("a");return M.href="https://inputbuffer.io",M.target="_blank",M.rel="noopener noreferrer",M.textContent="Powered by inputbuffer.io",O.appendChild(M),T.appendChild(O),E.appendChild(T),b.appendChild(x),b.appendChild(E),a.appendChild(b),a.addEventListener("click",A=>{A.target===a&&C()}),document.addEventListener("keydown",v),a}function B(a){var b,x;if(!t){if(i=a,t=L(),document.body.appendChild(t),G(e),a!=null&&a.title){if(p)p.textContent=a.title;else if(k){let l=t.querySelector("#ib-modal");l.removeAttribute("aria-label"),l.setAttribute("aria-labelledby","ib-title"),p=document.createElement("h2"),p.id="ib-title",p.className="ib-modal-title",p.textContent=a.title,k.prepend(p)}}if(a!=null&&a.sentiment){d=a.sentiment;let l=t.querySelector(".ib-modal-thumb--up"),E=t.querySelector(".ib-modal-thumb--down");a.sentiment==="positive"?l==null||l.classList.add("ib-modal-thumb--active"):a.sentiment==="negative"&&(E==null||E.classList.add("ib-modal-thumb--active"))}m&&((b=a==null?void 0:a.prefill)!=null&&b.description)&&(m.value=a.prefill.description),n&&((x=a==null?void 0:a.prefill)!=null&&x.email)&&(n.value=a.prefill.email),m==null||m.focus()}}function C(){t&&(u!==null&&(clearTimeout(u),u=null),document.removeEventListener("keydown",v),t.remove(),t=null,m=null,c=null,n=null,y=null,o=null,g=null,p=null,k=null,i=void 0,d=void 0,f.forEach(a=>a()))}function F(a,b){a==="submit"?w.push(b):a==="close"?f.push(b):a==="error"&&h.push(b)}function S(){C()}return{open:B,close:C,on:F,destroy:S}}function Q(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),t.appendChild(i),t}var be="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",ce="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z",ue=24*60*60*1e3;function U(e){var V,q;let t;function i(){let r=e.target;return r?`ib:reaction:${e.apiKey}:${r.type}:${JSON.stringify(r.metadata)}`:`ib:reaction:${e.apiKey}:${window.location.pathname}`}function d(){try{let r=localStorage.getItem(i());if(!r)return null;let{sentiment:N,ts:I}=JSON.parse(r);return Date.now()-I>ue?(localStorage.removeItem(i()),null):N}catch{return null}}function u(r){try{localStorage.setItem(i(),JSON.stringify({sentiment:r,ts:Date.now()}))}catch{}}let m={vote:[],open:[],submit:[],close:[],error:[]};function c(r,N){var I;(I=m[r])==null||I.forEach(R=>R(N))}let n=document.createElement("div"),y=e.colorScheme==="dark"?" ib-theme-dark":e.colorScheme==="light"?" ib-theme-light":"";n.className="ib-bar-wrapper"+(e.placement==="fixed"?" ib-bar-wrapper--fixed":"")+y;let{theme:o={}}=e;o.primary&&n.style.setProperty("--ib-primary",o.primary),o.background&&n.style.setProperty("--ib-background",o.background),o.surface&&n.style.setProperty("--ib-surface",o.surface),o.text&&n.style.setProperty("--ib-text",o.text),o.selected&&n.style.setProperty("--ib-selected",o.selected),o.selectedColor&&n.style.setProperty("--ib-selected-color",o.selectedColor);let g=document.createElement("div");g.className="ib-bar";let p=document.createElement("div");p.className="ib-bar-label-area";let k=document.createElement("span");k.className="ib-bar-label",k.textContent=(V=e.label)!=null?V:"Was this helpful?",p.appendChild(k);let w=document.createElement("div");w.className="ib-bar-actions"+(e.showLabel===!1?" ib-bar-actions--no-label":"");let f=document.createElement("button");f.type="button",f.className="ib-bar-btn ib-bar-btn--up",f.setAttribute("aria-label","Yes"),f.appendChild(Q(be));let h=document.createElement("button");h.type="button",h.className="ib-bar-btn ib-bar-btn--down",h.setAttribute("aria-label","No"),h.appendChild(Q(ce)),w.appendChild(f),w.appendChild(h),e.showLabel!==!1&&g.appendChild(p),g.appendChild(w);let v=document.createElement("div");v.className="ib-bar-popover",v.setAttribute("role","dialog"),v.setAttribute("aria-modal","false");let P=document.createElement("div");if(P.className="ib-bar-header",e.modalTitle){v.setAttribute("aria-labelledby","ib-bar-title");let r=document.createElement("p");r.id="ib-bar-title",r.className="ib-bar-title",r.textContent=e.modalTitle,P.appendChild(r)}else v.setAttribute("aria-label","Feedback");let L=document.createElement("div");L.className="ib-bar-body";let B=document.createElement("textarea");B.className="ib-bar-textarea",B.placeholder=(q=e.modalPlaceholder)!=null?q:"What's on your mind?",B.setAttribute("aria-label","Feedback");let C=document.createElement("p");C.className="ib-bar-error";let F=document.createElement("p");F.className="ib-bar-success";let S=document.createElement("button");if(S.type="button",S.className="ib-bar-submit",S.textContent="Send feedback",e.showTitleField===!0){let r=document.createElement("input");r.type="text",r.className="ib-bar-title-input",r.placeholder="Title (optional)",r.setAttribute("aria-label","Feedback title"),L.appendChild(r)}if(L.appendChild(B),e.showEmailField===!0){let r=document.createElement("input");r.type="email",r.className="ib-bar-email",r.placeholder="Your email (optional)",r.setAttribute("aria-label","Email address"),L.appendChild(r)}L.appendChild(C),L.appendChild(F);let a=document.createElement("div");a.className="ib-bar-footer",a.appendChild(S);let b=document.createElement("div");b.className="ib-branding";let x=document.createElement("a");x.href="https://inputbuffer.io",x.target="_blank",x.rel="noopener noreferrer",x.textContent="Powered by inputbuffer.io",b.appendChild(x),a.appendChild(b),L.appendChild(a),v.appendChild(P),v.appendChild(L),n.appendChild(v),n.appendChild(g);function l(){let r=g.getBoundingClientRect();v.style.top=`${r.top-v.offsetHeight-8}px`,v.style.left=`${r.right-320}px`}function E(r){t=r,v.classList.add("ib-bar-popover--visible"),requestAnimationFrame(l),C.textContent="",F.textContent="",B.focus(),setTimeout(()=>document.addEventListener("click",M),0),document.addEventListener("keydown",A),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),c("open",{sentiment:r})}function T(){v.classList.contains("ib-bar-popover--visible")&&(v.classList.remove("ib-bar-popover--visible"),document.removeEventListener("click",M),document.removeEventListener("keydown",A),window.removeEventListener("scroll",l),window.removeEventListener("resize",l),B.value="",c("close"))}function O(){f.classList.remove("ib-bar-btn--active"),h.classList.remove("ib-bar-btn--active"),t=void 0}function M(r){n.contains(r.target)||T()}function A(r){r.key==="Escape"&&T()}async function H(){let r=B.value.trim();if(r.length<10){C.textContent="Please enter at least 10 characters.";return}C.textContent="",S.disabled=!0,S.textContent="Sending\u2026";let N=v.querySelector(".ib-bar-title-input"),I=(N==null?void 0:N.value.trim())||null,R=v.querySelector(".ib-bar-email"),ae=(R==null?void 0:R.value.trim())||null;try{let D=await _(e.apiKey,r,ae,I,{sentiment:t,target:e.target,source:e.source},e.apiUrl);c("submit",D),F.textContent="Thanks for your feedback!",S.textContent="Send feedback",setTimeout(()=>{T(),O()},2e3)}catch(D){c("error",D instanceof Error?D:new Error("Something went wrong."));let oe=D instanceof z&&D.category==="user"?D.detail:"Something went wrong. Please try again.";C.textContent=oe,S.disabled=!1,S.textContent="Send feedback"}}function j(r){f.classList.remove("ib-bar-btn--active"),h.classList.remove("ib-bar-btn--active"),r.classList.add("ib-bar-btn--active")}let K=d();K&&(t=K,j(K==="positive"?f:h));function $(r,N){var I;u(r),j(N),E(r),c("vote",{sentiment:r}),e.target&&J(e.apiKey,r==="positive"?1:-1,e.target,(I=e.userId)!=null?I:null,e.apiUrl).catch(()=>{})}return f.addEventListener("click",()=>$("positive",f)),h.addEventListener("click",()=>$("negative",h)),S.addEventListener("click",H),{element:n,on(r,N){var I;(I=m[r])==null||I.push(N)},destroy(){T(),n.remove()}}}var Z=`/* InputBuffer Modal Styles
1
+ "use strict";(()=>{function X(e){let t=document.getElementById("ib-modal");if(!t)return;let{theme:r={}}=e;r.primary&&t.style.setProperty("--ib-primary",r.primary),r.background&&t.style.setProperty("--ib-background",r.background),r.surface&&t.style.setProperty("--ib-surface",r.surface),r.text&&t.style.setProperty("--ib-text",r.text),r.selected&&t.style.setProperty("--ib-selected",r.selected),r.selectedColor&&t.style.setProperty("--ib-selected-color",r.selectedColor)}var _=class extends Error{constructor(t){super(t.detail),this.name="ApiError",this.type=t.type,this.title=t.title,this.status=t.status,this.detail=t.detail,this.category=t.category,this.field=t.field}};var Y="Something went wrong. Please try again.";function j(e){return e instanceof _?e.category==="user"?e.detail:(e.category==="integration"&&M(`${e.title}: ${e.detail}`,e.type),Y):Y}function M(e,t){typeof console!="undefined"&&console.warn(`[inputbuffer] ${e}`,t!=null?t:"")}var U="0.3.1",pe="https://inputbuffer.io",me="/api/v0/feedback",fe="/api/v0/reactions",ge=1e4,he=5e3,ve=500,ye=300;function Q(e,t){return`${(e!=null?e:pe).replace(/\/+$/,"")}${t}`}async function Z(e,t,r){var d,s,c,p;let n=new AbortController,g=setTimeout(()=>n.abort(),ge),a;try{a=await fetch(e,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-IB-Client":`inputbuffer-widget/${U} (javascript)`},body:JSON.stringify(r),credentials:"omit",signal:n.signal})}finally{clearTimeout(g)}if(!a.ok){let b=await a.json().catch(()=>({}));throw new _({type:(d=b.type)!=null?d:"https://inputbuffer.io/docs/api/problems/internal-error",title:(s=b.title)!=null?s:"Error",detail:(c=b.detail)!=null?c:"Submission failed. Please try again.",status:(p=b.status)!=null?p:a.status,category:b.category,field:b.field})}return a}async function D(e,t,r,n,g){let a={description:t.slice(0,he)};if(r&&(a.title=r.slice(0,ve)),n!=null&&n.submittedBy&&(a.submitted_by=n.submittedBy.slice(0,ye)),n!=null&&n.target){let c=n.target;a.targets=[{type:c.type,metadata:c.metadata}]}let d=await Z(Q(g,me),e,a),{data:s}=await d.json();return{id:s.id}}async function ee(e,t,r,n,g){let a={reaction_value:t,target:{type:r.type,metadata:r.metadata}};n&&(a.user_id=n);let d;try{d=await Z(Q(g,fe),e,a)}catch(c){throw c instanceof _&&c.status===422&&c.field==="user_id"&&M("Reaction rejected: no user_id and no client IP. Set the `userId` option (or the `user-id` attribute)."),c}let{data:s}=await d.json();return s}function te(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}var xe="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",Ee="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z";function re(e){let t=null,r,n,g=null,a=null,d=null,s=null,c=null,p=null,b=null,B=null,z=[],H=[],E=[];function k(i){if(i.key==="Escape"){y();return}if(i.key==="Tab"&&t){let l=Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));if(l.length===0)return;let u=l[0],m=l[l.length-1];i.shiftKey?document.activeElement===u&&(i.preventDefault(),m.focus()):document.activeElement===m&&(i.preventDefault(),u.focus())}}async function h(){var l;if(!a||!s)return;let i=a.value.trim();if(i.length<10){c&&(c.textContent="Please enter at least 10 characters.",c.style.display="block");return}c&&(c.style.display="none"),s.disabled=!0,s.textContent="Sending\u2026";try{let u=(d==null?void 0:d.value.trim())||null,m=n!=null?n:r==null?void 0:r.sentiment,v=await D(e.apiKey,i,u,{...r,sentiment:m,submittedBy:(l=r==null?void 0:r.submittedBy)!=null?l:e.submittedBy},e.apiUrl);p&&(p.textContent="Thanks for your feedback!",p.style.display="block"),z.forEach(A=>A(v)),g=setTimeout(()=>y(),2e3)}catch(u){let m=u instanceof Error?u:new Error("Unknown error");c&&(c.textContent=j(u),c.style.display="block"),E.forEach(v=>v(m)),s.disabled=!1,s.textContent="Send feedback"}}function O(){let i=document.createElement("div");i.id="ib-overlay";let l=document.createElement("div");l.id="ib-modal",e.colorScheme==="dark"?l.classList.add("ib-theme-dark"):e.colorScheme==="light"&&l.classList.add("ib-theme-light"),l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true");let u=document.createElement("div");if(u.id="ib-modal-header",B=u,e.title?(l.setAttribute("aria-labelledby","ib-title"),b=document.createElement("h2"),b.id="ib-title",b.className="ib-modal-title",b.textContent=e.title,u.appendChild(b)):l.setAttribute("aria-label","Feedback"),e.showSentiment){let x,w,R=document.createElement("div");R.className="ib-modal-sentiment",x=document.createElement("button"),x.type="button",x.className="ib-modal-thumb ib-modal-thumb--up",x.setAttribute("aria-label","Helpful"),x.appendChild(te(xe)),w=document.createElement("button"),w.type="button",w.className="ib-modal-thumb ib-modal-thumb--down",w.setAttribute("aria-label","Not helpful"),w.appendChild(te(Ee)),x.addEventListener("click",()=>{x.classList.add("ib-modal-thumb--active"),w.classList.remove("ib-modal-thumb--active"),n="positive"}),w.addEventListener("click",()=>{w.classList.add("ib-modal-thumb--active"),x.classList.remove("ib-modal-thumb--active"),n="negative"}),R.appendChild(x),R.appendChild(w),u.appendChild(R)}let m=document.createElement("button");m.id="ib-close",m.className="ib-modal-close",m.textContent="\xD7",m.setAttribute("aria-label","Close feedback form"),m.addEventListener("click",y),u.appendChild(m);let v=document.createElement("div");v.id="ib-modal-body",a=document.createElement("textarea"),a.id="ib-textarea",a.className="ib-modal-textarea",a.placeholder=e.placeholder||"What's on your mind?",a.maxLength=5e3,a.setAttribute("aria-label","Feedback"),s=document.createElement("button"),s.id="ib-submit",s.className="ib-modal-submit",s.textContent="Send feedback",s.addEventListener("click",h),p=document.createElement("p"),p.id="ib-success",p.className="ib-modal-success",c=document.createElement("p"),c.id="ib-error",c.className="ib-modal-error",e.showTitleField===!0&&(d=document.createElement("input"),d.id="ib-title-input",d.className="ib-modal-title-input",d.type="text",d.placeholder="Title (optional)",d.maxLength=500,d.setAttribute("aria-label","Feedback title"),v.appendChild(d)),v.appendChild(a),v.appendChild(c),v.appendChild(p);let A=document.createElement("div");A.className="ib-modal-footer",A.appendChild(s);let I=document.createElement("div");I.className="ib-branding";let F=document.createElement("a");return F.href="https://inputbuffer.io",F.target="_blank",F.rel="noopener noreferrer",F.textContent="Powered by inputbuffer.io",I.appendChild(F),A.appendChild(I),v.appendChild(A),l.appendChild(u),l.appendChild(v),i.appendChild(l),i.addEventListener("click",x=>{x.target===i&&y()}),document.addEventListener("keydown",k),i}function S(i){var l;if(!t){if(r=i,t=O(),document.body.appendChild(t),X(e),i!=null&&i.title){if(b)b.textContent=i.title;else if(B){let u=t.querySelector("#ib-modal");u.removeAttribute("aria-label"),u.setAttribute("aria-labelledby","ib-title"),b=document.createElement("h2"),b.id="ib-title",b.className="ib-modal-title",b.textContent=i.title,B.prepend(b)}}if(i!=null&&i.sentiment){n=i.sentiment;let u=t.querySelector(".ib-modal-thumb--up"),m=t.querySelector(".ib-modal-thumb--down");i.sentiment==="positive"?u==null||u.classList.add("ib-modal-thumb--active"):i.sentiment==="negative"&&(m==null||m.classList.add("ib-modal-thumb--active"))}a&&((l=i==null?void 0:i.prefill)!=null&&l.description)&&(a.value=i.prefill.description),a==null||a.focus()}}function y(){t&&(g!==null&&(clearTimeout(g),g=null),document.removeEventListener("keydown",k),t.remove(),t=null,a=null,d=null,s=null,c=null,p=null,b=null,B=null,r=void 0,n=void 0,H.forEach(i=>i()))}function L(i,l){i==="submit"?z.push(l):i==="close"?H.push(l):i==="error"&&E.push(l)}function P(){y()}return{open:S,close:y,on:L,destroy:P}}function ie(e){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","currentColor"),t.setAttribute("aria-hidden","true"),t.style.display="block";let r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",e),t.appendChild(r),t}var ke="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h2v12H1z",we="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L10.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h2v12h-2z",Ce=1440*60*1e3;function K(e){var G,J;let t;function r(){let o=e.target;return o?`ib:reaction:${e.apiKey}:${o.type}:${JSON.stringify(o.metadata)}`:`ib:reaction:${e.apiKey}:${window.location.pathname}`}function n(){try{let o=localStorage.getItem(r());if(!o)return null;let{sentiment:T,ts:C}=JSON.parse(o);return Date.now()-C>Ce?(localStorage.removeItem(r()),null):T}catch{return null}}function g(o){try{localStorage.setItem(r(),JSON.stringify({sentiment:o,ts:Date.now()}))}catch{}}let a={vote:[],open:[],submit:[],close:[],error:[]};function d(o,T){var C;(C=a[o])==null||C.forEach(N=>N(T))}let s=document.createElement("div"),c=e.colorScheme==="dark"?" ib-theme-dark":e.colorScheme==="light"?" ib-theme-light":"";s.className="ib-bar-wrapper"+(e.placement==="fixed"?" ib-bar-wrapper--fixed":"")+c;let{theme:p={}}=e;p.primary&&s.style.setProperty("--ib-primary",p.primary),p.background&&s.style.setProperty("--ib-background",p.background),p.surface&&s.style.setProperty("--ib-surface",p.surface),p.text&&s.style.setProperty("--ib-text",p.text),p.selected&&s.style.setProperty("--ib-selected",p.selected),p.selectedColor&&s.style.setProperty("--ib-selected-color",p.selectedColor);let b=document.createElement("div");b.className="ib-bar";let B=document.createElement("div");B.className="ib-bar-label-area";let z=document.createElement("span");z.className="ib-bar-label",z.textContent=(G=e.label)!=null?G:"Was this helpful?",B.appendChild(z);let H=document.createElement("div");H.className="ib-bar-actions"+(e.showLabel===!1?" ib-bar-actions--no-label":"");let E=document.createElement("button");E.type="button",E.className="ib-bar-btn ib-bar-btn--up",E.setAttribute("aria-label","Yes"),E.appendChild(ie(ke));let k=document.createElement("button");k.type="button",k.className="ib-bar-btn ib-bar-btn--down",k.setAttribute("aria-label","No"),k.appendChild(ie(we)),H.appendChild(E),H.appendChild(k),e.showLabel!==!1&&b.appendChild(B),b.appendChild(H);let h=document.createElement("div");h.className="ib-bar-popover",h.setAttribute("role","dialog"),h.setAttribute("aria-modal","false");let O=document.createElement("div");if(O.className="ib-bar-header",e.modalTitle){h.setAttribute("aria-labelledby","ib-bar-title");let o=document.createElement("p");o.id="ib-bar-title",o.className="ib-bar-title",o.textContent=e.modalTitle,O.appendChild(o)}else h.setAttribute("aria-label","Feedback");let S=document.createElement("div");S.className="ib-bar-body";let y=document.createElement("textarea");y.className="ib-bar-textarea",y.placeholder=(J=e.modalPlaceholder)!=null?J:"What's on your mind?",y.maxLength=5e3,y.setAttribute("aria-label","Feedback");let L=document.createElement("p");L.className="ib-bar-error";let P=document.createElement("p");P.className="ib-bar-success";let i=document.createElement("button");if(i.type="button",i.className="ib-bar-submit",i.textContent="Send feedback",e.showTitleField===!0){let o=document.createElement("input");o.type="text",o.className="ib-bar-title-input",o.placeholder="Title (optional)",o.maxLength=500,o.setAttribute("aria-label","Feedback title"),S.appendChild(o)}S.appendChild(y),S.appendChild(L),S.appendChild(P);let l=document.createElement("div");l.className="ib-bar-footer",l.appendChild(i);let u=document.createElement("div");u.className="ib-branding";let m=document.createElement("a");m.href="https://inputbuffer.io",m.target="_blank",m.rel="noopener noreferrer",m.textContent="Powered by inputbuffer.io",u.appendChild(m),l.appendChild(u),S.appendChild(l),h.appendChild(O),h.appendChild(S),s.appendChild(h),s.appendChild(b);function v(){let o=b.getBoundingClientRect();h.style.top=`${o.top-h.offsetHeight-8}px`,h.style.left=`${o.right-320}px`}function A(o){t=o,h.classList.add("ib-bar-popover--visible"),requestAnimationFrame(v),L.textContent="",P.textContent="",y.focus(),setTimeout(()=>document.addEventListener("click",x),0),document.addEventListener("keydown",w),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v,{passive:!0}),d("open",{sentiment:o})}function I(){h.classList.contains("ib-bar-popover--visible")&&(h.classList.remove("ib-bar-popover--visible"),document.removeEventListener("click",x),document.removeEventListener("keydown",w),window.removeEventListener("scroll",v),window.removeEventListener("resize",v),y.value="",d("close"))}function F(){E.classList.remove("ib-bar-btn--active"),k.classList.remove("ib-bar-btn--active"),t=void 0}function x(o){s.contains(o.target)||I()}function w(o){o.key==="Escape"&&I()}async function R(){let o=y.value.trim();if(o.length<10){L.textContent="Please enter at least 10 characters.";return}L.textContent="",i.disabled=!0,i.textContent="Sending\u2026";let T=h.querySelector(".ib-bar-title-input"),C=(T==null?void 0:T.value.trim())||null;try{let N=await D(e.apiKey,o,C,{sentiment:t,target:e.target,submittedBy:e.submittedBy},e.apiUrl);d("submit",N),P.textContent="Thanks for your feedback!",i.textContent="Send feedback",setTimeout(()=>{I(),F()},2e3)}catch(N){d("error",N instanceof Error?N:new Error("Something went wrong.")),L.textContent=j(N),i.disabled=!1,i.textContent="Send feedback"}}function q(o){E.classList.remove("ib-bar-btn--active"),k.classList.remove("ib-bar-btn--active"),o.classList.add("ib-bar-btn--active")}let W=n();W&&(t=W,q(W==="positive"?E:k));function V(o,T){var C;g(o),q(T),A(o),d("vote",{sentiment:o}),e.target&&ee(e.apiKey,o==="positive"?1:-1,e.target,(C=e.userId)!=null?C:null,e.apiUrl).catch(()=>{})}return E.addEventListener("click",()=>V("positive",E)),k.addEventListener("click",()=>V("negative",k)),i.addEventListener("click",R),{element:s,on(o,T){var C;(C=a[o])==null||C.push(T)},destroy(){I(),s.remove()}}}function f(e,t){var r;return(r=e.getAttribute(t))!=null?r:void 0}function ne(e,t){let r=e.getAttribute(t);return r===null?void 0:r==="true"}function Te(e){return{primary:f(e,"theme-primary"),background:f(e,"theme-background"),text:f(e,"theme-text"),selected:f(e,"theme-selected"),selectedColor:f(e,"theme-selected-color")}}function Se(e){var r;let t=e.getAttribute("target-type");if(t)switch(t){case"documentation":{let n=(r=f(e,"target-page-url"))!=null?r:typeof window!="undefined"?window.location.href:void 0;if(!n){M('target-type="documentation" needs target-page-url. Ignoring the target.');return}return{type:"documentation",metadata:{page_url:n,section_heading:f(e,"target-section-heading"),doc_version:f(e,"target-doc-version")}}}case"rest_endpoint":{let n=f(e,"target-method"),g=f(e,"target-path");if(!n||!g){M('target-type="rest_endpoint" needs target-method and target-path. Ignoring the target.');return}return{type:"rest_endpoint",metadata:{method:n,path:g,host:f(e,"target-host"),api_version:f(e,"target-api-version")}}}case"cli_command":{let n=f(e,"target-command");if(!n){M('target-type="cli_command" needs target-command. Ignoring the target.');return}let g=f(e,"target-args");return{type:"cli_command",metadata:{command:n,subcommand:f(e,"target-subcommand"),cli_version:f(e,"target-cli-version"),args:g?g.split(",").map(a=>a.trim()).filter(Boolean):void 0}}}default:M(`Unknown target-type "${t}". Expected documentation, rest_endpoint, or cli_command.`);return}}function oe(e,t){return{apiKey:t,apiUrl:f(e,"api-url"),label:f(e,"label"),showLabel:ne(e,"show-label"),placement:e.getAttribute("placement")==="fixed"?"fixed":"inline",colorScheme:f(e,"color-scheme"),modalTitle:f(e,"modal-title"),modalPlaceholder:f(e,"modal-placeholder"),showTitleField:ne(e,"show-title-field"),submittedBy:f(e,"submitted-by"),userId:f(e,"user-id"),target:Se(e),theme:Te(e)}}function ae(e){return e.getAttribute("inject-styles")!=="false"}function se(e,t){let r=e.dataset;return{apiKey:t,apiUrl:r.apiUrl,attachTo:r.attachTo,injectStyles:r.injectStyles===void 0?!0:r.injectStyles!=="false",colorScheme:r.colorScheme,title:r.title,placeholder:r.placeholder,showTitleField:r.showTitleField===void 0?void 0:r.showTitleField==="true",showSentiment:r.showSentiment===void 0?void 0:r.showSentiment==="true",submittedBy:r.submittedBy,theme:{primary:r.themePrimary,background:r.themeBackground,text:r.themeText,selected:r.themeSelected,selectedColor:r.themeSelectedColor}}}var le=`/* InputBuffer Modal Styles
2
2
  * All #ib-* IDs are stable public API \u2014 do not rename them.
3
3
  * Developers may target these IDs from their own stylesheets to customize the widget.
4
4
  */
@@ -99,9 +99,7 @@
99
99
  }
100
100
 
101
101
  #ib-modal-body #ib-title-input,
102
- #ib-modal-body .ib-modal-title-input,
103
- #ib-modal-body #ib-email,
104
- #ib-modal-body .ib-modal-email {
102
+ #ib-modal-body .ib-modal-title-input {
105
103
  width: 100%;
106
104
  background: var(--ib-background);
107
105
  border: 1px solid var(--ib-border);
@@ -120,22 +118,13 @@
120
118
  margin-bottom: 10px;
121
119
  }
122
120
 
123
- #ib-email,
124
- .ib-modal-email {
125
- margin-top: 10px;
126
- }
127
-
128
121
  #ib-modal-body #ib-title-input:hover,
129
- #ib-modal-body .ib-modal-title-input:hover,
130
- #ib-modal-body #ib-email:hover,
131
- #ib-modal-body .ib-modal-email:hover {
122
+ #ib-modal-body .ib-modal-title-input:hover {
132
123
  border-color: var(--ib-input-hover-border);
133
124
  }
134
125
 
135
126
  #ib-modal-body #ib-title-input:focus,
136
- #ib-modal-body .ib-modal-title-input:focus,
137
- #ib-modal-body #ib-email:focus,
138
- #ib-modal-body .ib-modal-email:focus {
127
+ #ib-modal-body .ib-modal-title-input:focus {
139
128
  border-color: var(--ib-focus-color);
140
129
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
141
130
  }
@@ -306,7 +295,7 @@
306
295
  --ib-radius: 8px;
307
296
  --ib-radius-input: 4px;
308
297
  }
309
- `;var ee=`/* InputBuffer Feedback Bar Styles
298
+ `;var de=`/* InputBuffer Feedback Bar Styles
310
299
  * .ib-bar-* and .ib-bar-popover* classes are stable public API \u2014 do not rename them.
311
300
  * Developers may target these classes from their own stylesheets to customize the widget.
312
301
  */
@@ -414,8 +403,7 @@
414
403
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
415
404
  }
416
405
 
417
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input,
418
- .ib-bar-wrapper .ib-bar-body .ib-bar-email {
406
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input {
419
407
  width: 100%;
420
408
  background: var(--ib-background);
421
409
  border: 1px solid var(--ib-border);
@@ -433,17 +421,11 @@
433
421
  margin-bottom: 8px;
434
422
  }
435
423
 
436
- .ib-bar-email {
437
- margin-top: 8px;
438
- }
439
-
440
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:hover,
441
- .ib-bar-wrapper .ib-bar-body .ib-bar-email:hover {
424
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:hover {
442
425
  border-color: var(--ib-input-hover-border);
443
426
  }
444
427
 
445
- .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:focus,
446
- .ib-bar-wrapper .ib-bar-body .ib-bar-email:focus {
428
+ .ib-bar-wrapper .ib-bar-body .ib-bar-title-input:focus {
447
429
  border-color: var(--ib-focus-color);
448
430
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ib-focus-color) 15%, transparent);
449
431
  }
@@ -627,4 +609,4 @@
627
609
  --ib-radius: 8px;
628
610
  --ib-radius-input: 4px;
629
611
  }
630
- `;var s=typeof document!="undefined"?document.currentScript:null;function fe(){if(typeof document=="undefined"||document.getElementById("ib-modal-styles"))return;let e=document.createElement("style");e.id="ib-modal-styles",e.textContent=Z,document.head.appendChild(e)}function te(){if(typeof document=="undefined"||document.getElementById("ib-bar-styles"))return;let e=document.createElement("style");e.id="ib-bar-styles",e.textContent=ee,document.head.appendChild(e)}function ie(e){e.injectStyles!==!1&&fe();let t=X(e),i=null,d=null;return e.attachTo&&(i=document.querySelector(e.attachTo),i&&(d=()=>t.open(),i.addEventListener("click",d))),{open:u=>t.open(u),close:()=>t.close(),on:(u,m)=>t.on(u,m),destroy:()=>{i&&d&&(i.removeEventListener("click",d),i=null,d=null),t.destroy()}}}function he(e){return e.injectStyles!==!1&&te(),U(e)}if(typeof HTMLElement!="undefined"){class e extends HTMLElement{constructor(){super(...arguments);this._bar=null}connectedCallback(){var g,p,k,w,f,h,v,P,L,B,C,F;let d=this.getAttribute("api-key");if(!d)return;let u=this.getAttribute("inject-styles");(u===null?!0:u!=="false")&&te();let c=this.getAttribute("placement"),n=this.getAttribute("show-label"),y=this.getAttribute("show-title-field"),o=this.getAttribute("show-email-field");this._bar=U({apiKey:d,apiUrl:(g=this.getAttribute("api-url"))!=null?g:void 0,label:(p=this.getAttribute("label"))!=null?p:void 0,placement:c==="fixed"?"fixed":"inline",colorScheme:(k=this.getAttribute("color-scheme"))!=null?k:void 0,showLabel:n===null?void 0:n==="true",modalTitle:(w=this.getAttribute("modal-title"))!=null?w:void 0,modalPlaceholder:(f=this.getAttribute("modal-placeholder"))!=null?f:void 0,showTitleField:y===null?void 0:y==="true",showEmailField:o===null?void 0:o==="true",source:(h=this.getAttribute("source"))!=null?h:void 0,userId:(v=this.getAttribute("user-id"))!=null?v:void 0,theme:{primary:(P=this.getAttribute("theme-primary"))!=null?P:void 0,background:(L=this.getAttribute("theme-background"))!=null?L:void 0,text:(B=this.getAttribute("theme-text"))!=null?B:void 0,selected:(C=this.getAttribute("theme-selected"))!=null?C:void 0,selectedColor:(F=this.getAttribute("theme-selected-color"))!=null?F:void 0}}),this.appendChild(this._bar.element)}disconnectedCallback(){var d;(d=this._bar)==null||d.destroy(),this._bar=null}}typeof customElements!="undefined"&&!customElements.get("inputbuffer-feedback")&&customElements.define("inputbuffer-feedback",e)}var re={createModal:ie,createBar:he,version:W};typeof window!="undefined"&&(window.InputBufferIO=re);(function(){if(typeof window=="undefined")return;let t=s==null?void 0:s.dataset.apiKey;if(!t)return;let i=s==null?void 0:s.dataset.injectStyles,d=s==null?void 0:s.dataset.colorScheme,u=ie({apiKey:t,apiUrl:s==null?void 0:s.dataset.apiUrl,attachTo:s==null?void 0:s.dataset.attachTo,injectStyles:i===void 0?!0:i!=="false",colorScheme:d,theme:{primary:s==null?void 0:s.dataset.themePrimary,background:s==null?void 0:s.dataset.themeBackground,text:s==null?void 0:s.dataset.themeText,selected:s==null?void 0:s.dataset.themeSelected,selectedColor:s==null?void 0:s.dataset.themeSelectedColor}});re._defaultInstance=u})();})();
612
+ `;var $=typeof document!="undefined"?document.currentScript:null;function Ae(){if(typeof document=="undefined"||document.getElementById("ib-modal-styles"))return;let e=document.createElement("style");e.id="ib-modal-styles",e.textContent=le,document.head.appendChild(e)}function ce(){if(typeof document=="undefined"||document.getElementById("ib-bar-styles"))return;let e=document.createElement("style");e.id="ib-bar-styles",e.textContent=de,document.head.appendChild(e)}function be(e){e.injectStyles!==!1&&Ae();let t=re(e),r=null,n=null;return e.attachTo&&(r=document.querySelector(e.attachTo),r&&(n=()=>t.open(),r.addEventListener("click",n))),{open:g=>t.open(g),close:()=>t.close(),on:(g,a)=>t.on(g,a),destroy:()=>{r&&n&&(r.removeEventListener("click",n),r=null,n=null),t.destroy()}}}function Ie(e){return e.injectStyles!==!1&&ce(),K(e)}if(typeof HTMLElement!="undefined"){class e extends HTMLElement{constructor(){super(...arguments);this._bar=null}connectedCallback(){let n=this.getAttribute("api-key");n&&(ae(this)&&ce(),this._bar=K(oe(this,n)),this.appendChild(this._bar.element))}disconnectedCallback(){var n;(n=this._bar)==null||n.destroy(),this._bar=null}}typeof customElements!="undefined"&&!customElements.get("inputbuffer-feedback")&&customElements.define("inputbuffer-feedback",e)}var ue={createModal:be,createBar:Ie,version:U};typeof window!="undefined"&&(window.InputBufferIO=ue);(function(){if(typeof window=="undefined"||!$)return;let t=$.dataset.apiKey;if(!t)return;let r=be(se($,t));ue._defaultInstance=r})();})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inputbuffer/feedback",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Collect feedback from any website with a single script tag.",
5
5
  "type": "module",
6
6
  "main": "dist/widget.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@vitest/coverage-v8": "^4.1.4",
39
- "esbuild": "0.25.0",
39
+ "esbuild": "0.28.2",
40
40
  "jsdom": "^29.0.2",
41
41
  "typescript": "^5.8.2",
42
42
  "vitest": "^4.1.4"